A free SDL2-based library

License: Zlib

Language: C++

Keywords: game, game-dev, game-development, gamedev, graphics-library, graphics-rendering, lunatix


LunatiX Logo

LunatiX is a free SDL2-based library. It can be used for open-source or commercial games thanks to the zlib/libpng license.

It contains these following modules:

  • Graphics: 2D module for rendering (sprite, text, ...) and window management
  • Audio: Audio module for mixing (music, channels, effect, ...)
  • Physics: Physics Module (collision detection, movement, ...)
  • And some others ...

The library works on Windows and Linux (maybe on Mac OS X).


  • 2D hardware acceleration
  • 2D basic animation
  • Support for OpenGL 3.0+
  • Support for multiple windows
  • Basic particle system
  • Multithreading
  • Text input
  • Gamepad support
  • many other things...


#include <LunatiX/LX_LunatiX.hpp>

using namespace LX_Event;

int main(int argc, char** argv)
    LX_AABB position = {0,0,256,256};
    LX_EventHandler ev;
    bool go = true;

        LX_Log::log("Cannot load the library: %s",LX_GetError());
        return -1;

    // Information about how to build the window
    LX_Win::LX_WindowInfo info;
    info.w = 256;
    info.h = 256;

    LX_Win::LX_Window w(info);
    LX_Graphics::LX_Sprite sprite("data/bullet.png",w);

            case LX_QUIT:
                go = false;


    return 0;


You may take a look on the library or get the development version on Github. The library reference is also available online (version 0.10).


You must install git-lfs in your computer in order to retrieve the repository.


On Windows

First of all, download the stable development and runtime libraries (v0.9.0). It includes the library files and all necessary materials (SDL2 libraries) to develop any project.

The source code is compilable using MinGW. It should work with Visual C++ (if you are lucky).

You can build it using the CodeBlocks project provided in the directory (lunatix-win32.cbp).

On Linux

The Makefile uses Clang in order to get the library being compiled. So you must ensure that Clang (version 3.4 at least) is installed to compile the code. If not, you can compile the source code using g++ (4.7.1+), but you will have to modify the Makefile to do it.

In order to build the library, you need to get these following libraries installed.

Library Minimal version
SDL2 2.0.3+
SDL2_image 2.0.0+
SDL2_TTF 2.0.12+
SDL2_Mixer 2.0.2+
OpenGL 3.0+

If you want to generate the library libraries you just need to execute the following command:

$ make

These two library files are generated into the lib/linux/ directory.

To test the library, execute the following command:

$ make test


The documentation of the library can be build with Doxygen, using the dox configuration file.

Project Statistics

Sourcerank 5
Repository Size 86.4 MB
Stars 3
Forks 0
Watchers 1
Open issues 0
Dependencies 0
Contributors 1
Tags 19
Last updated
Last pushed

Top Contributors See all


Recent Tags See all

LX-v0.11.0 July 29, 2017
LX-1.0-RC1 January 01, 2017
LX-v0.10.0 December 04, 2016
LX-v0.9.1 November 15, 2016
LX-v0.9.0 November 06, 2016
LX-v0.8.0 July 10, 2016
LX-v0.7.2 February 02, 2016
LX-v0.7.1 December 04, 2015
LX-v0.7 November 21, 2015
TX-v0.7-rc1 November 16, 2015
LX-v0.6.1 July 12, 2015
LX-v0.6 July 07, 2015
LX-v0.5.2 June 17, 2015
LX-v0.5.1 June 08, 2015
LX-v0.5 June 01, 2015

Something wrong with this page? Make a suggestion

Last synced: 2017-02-21 14:40:59 UTC

Login to resync this repository