Framework

btm-framework

The shared foundation powering BeforeTheMesh tutorials and TheMeshProject.

btm-framework BeforeTheMesh TheMeshProject
Ecosystem overview

Philosophy

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.

Modules

  • core — application layer, logging, utilities, time management.
  • math — vectors, matrices, transforms, geometry helpers.
  • window — window creation, input handling, platform abstraction.
  • render — rendering abstractions, GPU resource management, basic pipeline setup.
  • tutorials — small, focused demos for each concept.

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

On one side you find friendly beginner tutorials. On the other, massive engines with millions of lines of code. Between them, there is almost nothing that shows how real systems are built, step by step.

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.