gamnit is a modular framework to create portable 2D or 3D apps in Nit. It is based on the portability framework app.nit and the OpenGL ES 2.0 standard.
To compile the gamnit apps packaged with the Nit repository on GNU/Linux you need to install the dev version of a few libraries and some tools. On Debian 8.2, this command should install everything needed:
apt-get install libgles2-mesa-dev libsdl2-dev libsdl2-image-dev libsdl2-mixer-dev inkscape
On Windows 64 bits, using msys2, you can install the required packages with:
pacman -S mingw-w64-x86_64-angleproject-git mingw-w64-x86_64-SDL2 mingw-w64-x86_64-SDL2_image mingw-w64-x86_64-SDL2_mixer
While macOS isn't supported, it can create iOS apps.
You need to install and setup Xcode, and you may install the GLSL shader validation tool via
brew install glslang
gamnit is modular, different services of the framework are available through different submodules:
The main entrypoint
gamnit provides low-level abstractions over some services of OpenGL ES 2.0, like textures, shaders and programs.
It defines the basic methods to implement in order to obtain a working game:
App::frame_core to update the screen and
App::accept_event to receive user inputs.
flat provides an easy to use API for 2D games based on sprites.
Clients of this API redefine
App::update to update the game logic and fill lists of sprites with objects to draw.
App::sprites lists the sprites of the game world, they are drawn form the point of view of the
This camera can be moved around in the world by updating the x and y of its
and the zoom can easily be set using
reset_depth(desired_world_units_on_y) or the
z of its
App::ui_sprites lists the UI sprites drawn from the point of view of
By default, this camera is pixel-perfect with the origin in the top left corner of the window.
However to support screens with different DPI, it is recommended to standardize
the display size using
limit_fps refines existing services of gamnit to limit the framerate to a customizable value.
app.pressed_keys keeping track of the currently pressed keys.
model_parsers provides services to read and parse models from the asset folder.
network provides a simple communication framework for multiplayer client/server games.