A custom game engine built with bgfx, SDL3, and ImGui.
Console/
├── vendor/ # Third-party libraries
│ ├── bgfx/ # bgfx rendering library (with bx and bimg)
│ ├── sdl/ # SDL3 for windowing and input
│ └── imgui/ # Dear ImGui for debug UI
├── src/
│ ├── engine/ # Core engine library
│ │ ├── core/ # Application, Window, Logger, Timer
│ │ ├── graphics/ # Renderer (bgfx wrapper)
│ │ ├── input/ # Input management
│ │ └── audio/ # Audio system (TODO)
│ ├── framework/ # Game framework
│ │ ├── Scene.h/cpp # Scene management
│ │ ├── Entity.h/cpp # Entity with components
│ │ ├── Component.h/cpp# Component base class
│ │ └── GameLoop.h/cpp # Scene stack management
│ ├── game/ # Example game
│ │ ├── main.cpp # Entry point
│ │ └── Game.cpp # Game implementation
│ └── Engine.h # Main include header
├── assets/ # Game assets (textures, shaders, etc.)
├── build/ # Build output
└── CMakeLists.txt # CMake build configuration
- CMake 3.20 or higher
- Visual Studio 2022 (Windows) or GCC/Clang (Linux/macOS)
- Git (for cloning dependencies)
# Configure
cmake -B build -S .
# Build
cmake --build build --config Release
# Run
./build/bin/Release/Game.exe # Windows
./build/bin/Game # Linux/macOS- Application: Main application loop with initialization and shutdown
- Window: SDL3-based window management
- Renderer: bgfx-based rendering (supports DirectX, OpenGL, Vulkan, Metal)
- Input: Keyboard and mouse input handling
- Logger: Console and file logging with colored output
- Timer: Delta time and FPS tracking
- Scene: Container for entities with lifecycle callbacks
- Entity: Game object with transform and components
- Component: Attachable behavior/data for entities
- GameLoop: Scene stack management
- bgfx: Cross-platform rendering library
- SDL3: Window creation, input, and platform abstraction
- ImGui: Immediate mode GUI for debug tools
#include "Engine.h"
class MyGame : public Engine::Application {
public:
MyGame() : Application({"My Game", 1920, 1080}) {}
protected:
void OnInit() override {
// Initialize your game
}
void OnUpdate(float deltaTime) override {
// Update game logic
}
void OnRender() override {
// Render your game
}
void OnImGui() override {
// Debug UI
ImGui::Begin("Debug");
ImGui::Text("Hello, World!");
ImGui::End();
}
};
int main() {
MyGame game;
game.Run();
return 0;
}This project is for educational purposes.