This is a simple game framework library I'm creating for use in my own games. SDLGL currently provides support for
- A simple and extensible Entity + Scene organization
- A simple 'Update and Render' game loop
- Audio mixing for sound effects and music built on miniaudio
- Easily configurable (JSON-defined) resources supporting:
- Animated sprites
- Static textures
- Sound effects
- Music tracks
- Collision detection system for rotatable rectangles
- Font renderer
- Debugging UI elements
- Access to the SDL3 rendering context
- Multiple example programs demonstrating each engine feature
In addition to the example programs, I have some other projects that are built with SDLGL.
To install SDLGL, you will have to build from source. Before building, there are 3 dependencies required for static linking:
- SDL3
- SDL3_image
- SDL3_ttf
You can build SDL3, SDL3_image, and SDL3_ttf from source. See the official SDL3 documentation for instructions.
You can use homebrew to install the libraries.
brew install sdl3 sdl3_image sdl3_ttf
Currently, no binaries are published for SDLGL. A CMake configuration is provided to enable easy building across platforms. SDL3 ships with CMake config files, so no custom Find modules are needed.
The recommended way to use SDLGL is via CMake add_subdirectory. In your project's CMakeLists.txt:
add_subdirectory(path/to/sdlgl ${CMAKE_BINARY_DIR}/sdlgl)
target_link_libraries(YourProject PRIVATE sdlgl)This automatically brings in SDL3, SDL3_image, and SDL3_ttf as transitive dependencies.
Alternatively, you can build and install the library system-wide:
cmake -S . -B build
cmake --build build
cmake --install build --prefix ~/.localIn addition to the build requirements, additional tools are required for development. You can install them with the following commands:
sudo apt install clang-formatbrew install clang-formatThis project is auto-formatted to the Google style (modified to an indent of 4 spaces) using the clang-format tool.
To run the auto-formatter on all files, use the following command:
bash clang_format_project.shSDLGL is licensed under the MIT License.
This library uses the JSON C++ library by Niels Lohmann which is licensed under the MIT License.


