Cross-platform 2D Game Library for C++
A lightweight library for easy 2D game development using C++ 20 and newer.
cerlib focuses on a simple design and at the same time offers you the possibility to design your game architecture your way.
Example
#include <cerlib.hpp>
#include <cerlib/Main.hpp>
struct MyGame : cer::Game {
MyGame() {
window = cer::Window("My Game Window");
}
void load_content() override {
image = cer::load_image("MyImage.png");
}
bool update(const cer::GameTime& time) override {
// Update game logic. Use the time parameter as a reference point for
// how much time has passed since the last update:
// ...
return true;
}
void draw(const cer::Window& window) override {
// Draw game content into 'window':
// ...
cer::draw_sprite(image, {100, 200}, cer::white);
}
cer::Window window;
cer::Image image;
};
int main() {
// Create & run our game.
return cer::run_game<MyGame>();
}