Gumichan01/lunatix


A free SDL2-based library

http://gumichan01.github.io/lunatix/

License: Zlib

Language: C++

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


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).

Features

  • 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...

Examples

#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;

    if(!LX_Init())
    {
        LX_Log::log("Cannot load the library: %s",LX_GetError());
        return -1;
    }

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

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

    while(go)
    {
        while(ev.pollEvent())
        {
            switch(ev.getType())
            {
            case LX_QUIT:
                go = false;
                break;
            default:
                break;
            }
        }

        w.clearWindow();
        sprite.draw(&position);
        w.update();
        LX_Timer::delay(33);
    }

    LX_Quit();
    return 0;
}

Contribute

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).

Prerequisites

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

Build

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

Documentation

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
Created
Last updated
Last pushed

Top Contributors See all

Luxon JEAN-PIERRE

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