Framework
btm-framework
The shared foundation powering BeforeTheMesh tutorials and TheMeshProject.
Overview of the Ecosystem approach
ecosystem
Ecosystem overview diagram

The ecosystem approach emphasizes modularity, reusability, and clear separation of concerns. Each component of the ecosystem interacts seamlessly with others, providing a cohesive and efficient development experience.

This approach ensures that developers can focus on building features without worrying about the underlying infrastructure, promoting a more efficient and maintainable workflow.

By adopting the ecosystem approach, teams can achieve better collaboration, faster development cycles, and a more robust and scalable software architecture.

The base framework provides the essential building blocks and abstractions that enable developers to efficiently create and manage complex applications within the ecosystem.

BeforeTheMesh serves as the learning basis for understanding and effectively utilizing the ecosystem approach. It provides practical examples and guidance to help developers grasp the core principles and effectively apply them in real-world projects.

TheMeshProject is the final application layer of the framework. It utilizes the base framework and the principles of the ecosystem approach to deliver a complete and functional CAE application framework.

Overview of the Framework approach
framework
Framework overview diagram

The framework splits the work in two branches: The first branch is BeforeTheMesh, which represents the core framework, providing the essential knowledge path to master the building blocks and abstractions, and the application layer, TheMeshProject, which utilizes the core framework to implement CAE functionality.

This division allows developers to focus on mastering the core framework before moving on to building applications with TheMeshProject.

As you can see, the framework approach emphasizes a structured learning path, guiding developers from understanding the core framework to effectively utilizing the application layer. In summary, the framework approach provides a clear separation between the core knowledge and the application layer, ensuring that developers build a strong foundation before tackling complex application development.

Philosophy

In the heart of the framework lies the btm-framework. It serves as the foundation for all other modules, providing essential building blocks and abstractions that ensure consistency and ease of use throughout the framework.

btm-framework is designed to be modular, clear, and educational. It uses modern C++ and modern CMake to provide a minimal but realistic base for engine architecture and visualization tools.

On top of it sit the two branches: BeforeTheMesh which is the educational branch, and TheMeshProject which is the application and more technical branch.

Modules

The core framework is organized into several key modules, each responsible for a specific aspect of the system. Understanding these modules helps in navigating and utilizing the framework effectively.

  • core — application layer, logging, utilities, time management.
  • math — vectors, matrices, transforms, geometry helpers.
  • geometry — lines, planes, triangles, and other geometric primitives.
  • mesh — mesh representation, manipulation, and processing.
  • render — rendering abstractions, GPU resource management, basic pipeline setup.
  • platform — platform-specific abstractions and utilities.

These modules collectively form the backbone of the framework, providing a structured and modular approach to application development.

The core framework contains more modules and utilities that support advanced features and optimizations, which are not listed here but are documented in the subsequent sections.These modules grow in functionality and complexity as the framework evolves.

Minimal example

Here’s a minimal example of a Windows application using the btm_framework. It creates a window and renders a simple colored background. We will go through this code in detail in the next few tutorials, but for now, just take a look at how concise and clear it is compared to typical boilerplate-heavy graphics code.

#include "application.h"
#include "glew.h"

// This is a minimal example of a Windows application using the btm_framework. 
// It creates a window and renders a simple colored background.
class win_minimal_example : public btm_framework::winApplication
{
public:
    win_minimal_example() : winApplication() {}
    virtual ~win_minimal_example() {}

    // Override the render method to perform our custom rendering
    void render() override {
        // This function can be used to render the current state of the simulation
        // For example, you could clear the screen, draw objects, etc.
        btm_framework::begin_render();

        // Set the clear color to black and clear the color and depth buffers
        glClearColor(0.2f, 0.4f, 0.6f, 1.f);

        // clear screen and depth buffer
        glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);

        // we finish the rendering by calling end_render(), which swaps the buffers to display the rendered frame
        // and performs any necessary cleanup after rendering
        btm_framework::end_render();
    }
};

// Windows application entry point
// The WinMain function is the entry point for a Windows application. It initializes the application and starts the main loop.
int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE, LPTSTR, int nCmdShow)
{
    // create an instance of our application class, which will be used throughout the program
    win_minimal_example app;
    // initialization of the framework: btm_framework::init_framework();
    // is done inside the init_and_run() method of the application class, which is called below. 
    // This method will set up the application window and start the main loop.
    app.init_and_run();
    return 0;
}
Why BeforeTheMesh Exists

BeforeTheMesh is a platform dedicated in teaching developers how real systems are built, step by step. Based on real-world practices, it bridges the gap between beginner tutorials and large-scale engines.

The problem

Many developers know how to write C++ but still feel they don’t know how to build things. Tutorials hide complexity behind magic functions; engines hide it behind scale and abstraction.

The approach

BeforeTheMesh focuses on the “missing middle”: project structure, CMake, rendering pipelines, and modular design. You build a real foundation, piece by piece, instead of copying a finished engine.

The ecosystem

The tutorials connect directly to btm‑framework and TheMeshProject. Articles provide conceptual depth; examples provide concrete reference. Together they form a coherent learning and development path.

The goal

The goal is simple: help you move from “I can code” to “I can engineer”. BeforeTheMesh exists to make that transition explicit, structured, and achievable.