Building VEngine #1 — The First Layer of Abstraction

*Building a C++ game engine on top of Raylib to learn engine architecture.

When I started VEngine, I thought the first milestone would be seeing a window appear on the screen.

It wasn't.

The first real milestone was understanding that a game engine is not an application.

An application does everything itself.

InitWindow(...);

while (!WindowShouldClose())
{
    BeginDrawing();
    EndDrawing();
}

CloseWindow();

An engine is different.

The application shouldn't know how a window is created or how a frame is rendered. It should only describe what it wants to happen.

After spending time learning modern CMake, targets, libraries, and dependencies, VEngine now has a simple architecture.

Sandbox
    │
    ▼
VEngine
    │
    ▼
Raylib

The sandbox doesn't know anything about Raylib.

Instead, it talks to VEngine.

VEngine::Init();

while (VEngine::Running())
{
    VEngine::BeginFrame();

    // Game code

    VEngine::EndFrame();
}

VEngine::Shutdown();

All the Raylib functions live inside the engine.

That separation may look small, but it completely changed how I think about software.

A few days ago I was asking questions like:

Today those ideas finally connected.

Sandbox depends on VEngine.

VEngine depends on Raylib.

The application doesn't need to know what graphics library is being used. That detail belongs inside the engine.

This milestone wasn't about graphics.

It was about architecture.

The window opening on the screen is simply proof that the architecture works.

There is still a long road ahead.

Rendering.

Math.

Scenes.

Editor.

Physics.

AI.

But I'm glad the project started here instead of chasing graphics first.


What I Learned


This is only the beginning.

One milestone at a time.

Project

GitHub: VEngine

The project is still in its early stages, but every milestone will be documented as I learn.

go back to tech