A LithTech-style modular renderer technical demo.
This project explores a LithTech-style inspired renderer architecture, where the game
code depends on a renderer-agnostic interface (IRenderer.h) and concrete rendering
backends are implemented as interchangeable modules.
This modular system requires normalized drawing operations, which refer to a small, renderer-agnostic set of high-level drawing commands (e.g. sprites, quads, batches) implemented by each backend.
This is not intended to be a full engine, but a technical exploration of modular renderer design and backend interchangeability.
.
├── README.md # This file
├── CMakeLists.txt # root CMake file
├── engine
│ ├── CMakeLists.txt
│ ├── include
│ │ └── IRenderer.h
│ └── src
│ └── Engine.cpp
├── game
│ ├── CMakeLists.txt
│ ├── include
│ │ └── DemoScene.h
│ └── src
│ ├── DemoScene.cpp
│ └── main.cpp
└── renderers
└── OGL4REN
├── CMakeLists.txt
├── gl.c
├── include
│ ├── glad
│ │ └── gl.h
│ └── KHR
│ └── khrplatform.h
├── RendererOGL4.cpp
├── RendererOGL4.h
└── shaders
├── sprite.frag
└── sprite.vert
12 directories, 17 filesLinux, Makefile generator:
mkdir build && cd build && cmake ..
make && cd game
./gameWindows, MSVC solution generator:
mkdir build && cd build && cmake ..
msbuild Modular2DEngine.sln /p:Configuration=Release /p:Platform=x64
cd game
game.exeWindows, MSVC solution generator with manual SDL2-dev package files path:
cmake .. -DSDL2_DIR=C:\SDL2-2.32.10\cmake
msbuild Modular2DEngine.sln /p:Configuration=Release /p:Platform=x64 /p:AdditionalIncludeDirectories="C:\SDL2-2.32.10\include"
cd game
game.exeSDL2 Runtime dependency:
You must have a SDL2.dll copy located in the same directory as the executable. For both legal and practical reasons, using the dynamic library (.dll) is preferred over static linking.
Official SDL2 MSVC development package layout:
The official SDL2 dev package for MSVC use a header layout that may not match the expected include path style <SDL2/...>. If you extract SDL2 to a PATH, eg. "C:\SDL2-2.32.10/", apply the following changes:
cd "C:\SDL2-2.32.10"
move include SDL2
mkdir include
move SDL2 includeAfter this adjustment, the compiler will correctly resolve headers using #include <SDL2/...>.
- Code cleanup and general refactoring.
- Add more "normalized drawing operations".
- Reimplement LearnOpenGL tutorials using these "normalized drawing operations" as a testing framework.
- Implement simple 2D games to demonstrate functionality.
- Refactor these 2D games to use Lua scripting instead of hardcoded game logic.
- Add
Legacy OpenGL,VulkanandDirectX 11support throughIRenderer.hinterface. - Decouple SDL2 dependency through an
IPlatform.hinterface as a modular platform layer. - If implemented, add
GLFWsupport throughIPlatform.hinterface. - If implemented, decouple the embedded Lua scripting system through an
IScriptingVM.hinterface.
