Welcome

cerlib logo

Welcome to the cerlib documentation! πŸ‘‹

cerlib is a lightweight 2D game framework for modern C++.

It focuses on a simple design and allows you to design your game architecture your way.

Minimal example
#include <cerlib.hpp>
#include <cerlib/Main.hpp>

using namespace cer;

int main(int argc, char* argv[]) {
    // Create the game instance.
    auto game   = Game("My Game");
    auto window = game.window();

    // Load an image.
    auto img = Image("MyImage.png");

    while (game.tick()) {
        // Update game logic. Use 'time' as a reference point for
        // how much time has passed since the last tick.
        const auto time = game.time();

        // Draw an animated image.
        auto imgPos = (window.sizePx() - img.size()) / 2;

        imgPos.x += sin(float(time.totalTime) * 2) * 100;

        drawSprite(img, imgPos, white);
    }

    return 0;
}
Get Started

Set up your game in just a few minutes!


What it does not provide

  • A full-fledged 2D game engine
  • A level editor
  • An entity-component-system or any kind of scene representation
  • 3D rendering

In short, cerlib lets you define your game architecture however you desire it. It doesn’t impose a strict model on the game’s code. It provides every audiovisual aspect necessary to comfortably make a 2D game.

Platform Support

OS Architecture
Windows x64, ARM64
Linux x64, ARM64
Android All ABIs
macOS Intel, Apple Silicon
iOS, iPadOS, visionOS ARM64 - In Development

Supported Compilers

cerlib has been tested and is confirmed to work with the following compilers:

Compiler Version
MSVC 2022
Clang β‰₯ 16.0.6
GCC β‰₯ 11.4
Apple Clang β‰₯ 15