Skip to content

A light and fast 2D game framework made with C++ and SDL2.

License

Notifications You must be signed in to change notification settings

derriche-massinissa/zenith

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

A light and fast cross-platform 2D game framework written in C++ using SDL2.

Features | Sample Code | Plans | Dependencies

platforms license
issues size starts

Zenith is a lightweight cross-platform 2D game framework, for making games and other multimedia applications targeted at desktop computers. Its interface and overall structure is heavily inspired by Phaser 3.

Features

  • Lightweight and extra fast
  • Support for Linux and Windows (I don't have MacOS to test but it might work there too)
  • 3D audio using OpenAL (3D sound in a 2D framework, crazy amaright?)
  • Easy to use interface
  • Entity Component System (ECS) using ENTT
  • OpenGL / Shaders / Render Pipeline System

Sample Code

#include "zenith.hpp"

class TestScene : public Zen::Scene {
public:
	Zen::Entity ball;

	TestScene () : Scene("test")
	{}

	void preload ()
	{
		load.image("ball", "assets/ball.png");
	}

	void create ()
	{
		ball = add.image(400, 300, "ball");
	}

	void update (Uint32 time, Uint32 delta)
	{
		Zen::SetX(ball, Zen::GetX(ball) + 1);
	}

};

int main ()
{
	Zen::GameConfig config;

	config.setBackgroundColor(0xffff00)
		.setWidth(800)
		.setHeight(600)
		.addScenes<TestScene>();

	Zen::Game game (config);
}

Plans

  • Animation system
  • Add 2D physics with Box2D
  • Asynchronous resource loader
  • Write a documentation

Dependencies

  • SDL2 : Cross-platform multimedia library
  • OpenGL : Cross-platform API for rendering 2D and 3D vector graphics
  • GLM : header only C++ mathematics library for graphics software based on the GLSL specifications
  • OpenAL Soft : 3D Audio API
  • entt : A fast and reliable entity component system (ECS)
  • JSON for Modern C++ : A C++ library for JSON support
  • FreeType 2 : A freely available software library to render fonts
  • Earcut : Fast, header-only polygon triangulation