1 Portable game and multimedia framework for Nit
3 _gamnit_ is a modular framework to create portable 2D or 3D apps in Nit.
4 It is based on the portability framework _app.nit_ and the OpenGL ES 2.0 standard.
8 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.
9 On Debian 8.2, this command should install everything needed:
12 apt-get install libgles2-mesa-dev libsdl2-dev libsdl2-image-dev libsdl2-mixer-dev inkscape
15 On Windows 64 bits, using msys2, you can install the required packages with:
18 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
21 While macOS isn't supported, it can create iOS apps.
22 You need to install and setup Xcode, and you may install the GLSL shader validation tool via `brew`:
28 # Services by submodules
30 _gamnit_ is modular, different services of the framework are available through different submodules:
32 * The main entrypoint `gamnit` provides low-level abstractions over some services of OpenGL ES 2.0, like textures, shaders and programs.
33 It defines the basic methods to implement in order to obtain a working game:
34 `App::frame_core` to update the screen and `App::accept_event` to receive user inputs.
36 * `flat` provides an easy to use API for 2D games based on sprites.
37 Clients of this API redefine `App::update` to update the game logic and fill lists of sprites with objects to draw.
39 `App::sprites` lists the sprites of the game world, they are drawn form the point of view of the `world_camera`.
40 This camera can be moved around in the world by updating the x and y of its `position`,
41 and the zoom can easily be set using `reset_depth(desired_world_units_on_y)` or the `z` of its `position`
43 `App::ui_sprites` lists the UI sprites drawn from the point of view of `ui_camera`.
44 By default, this camera is pixel-perfect with the origin in the top left corner of the window.
45 However to support screens with different DPI, it is recommended to standardize
46 the display size using `reset_depth(height_of_reference_display)`.
48 * `depth` defines an API for 3D games based on instances of `Actor`.
50 This framework is build upon `flat`, see the doc of this submodule first (just above).
51 As such, clients should still implement `update` with the game logic, and fill `ui_sprites` for UI elements.
53 At each frame, elements in the list `actors` are drawn to screen.
54 Each `Actor` is composed of a `Model` and other information specific to this instance:
55 position in the world, rotation and scaling.
57 * `limit_fps` refines existing services of _gamnit_ to limit the framerate to a customizable value.
59 * `keys` provides `app.pressed_keys` keeping track of the currently pressed keys.
61 * `model_parsers` provides services to read and parse models from the asset folder.
63 * `network` provides a simple communication framework for multiplayer client/server games.