Skip to content

Commit 413c227

Browse files
committed
Merge: Small improvements to the gamnit README
Pull-Request: #1926 Reviewed-by: Jean Privat <jean@pryen.org>
2 parents 8763619 + 3498f5a commit 413c227

File tree

3 files changed

+51
-22
lines changed

3 files changed

+51
-22
lines changed

lib/gamnit/README.md

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
Portable game and multimedia framework for Nit
2+
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.
5+
6+
# System configuration
7+
8+
To compile the _gamnit_ apps packaged with the Nit repositoy on GNU/Linux you need to install the dev version of a few libraries and some tools.
9+
Under Debian 8.2, this command should install everything needed:
10+
11+
~~~
12+
apt-get install libgles2-mesa-dev libsdl1.2-dev libsdl-image1.2-dev libsdl-ttf2.0-dev inkscape mpg123
13+
~~~
14+
15+
# Services by submodules
16+
17+
_gamnit_ is modular, different services of the framework are available through different submodules:
18+
19+
* The main entrypoint `gamnit` provides low-level abstractions over some services of OpenGL ES 2.0, like textures, shaders and programs.
20+
It defines the basic methods to implement in order to obtain a working game:
21+
`App::frame_core` to update the screen and `App::accept_event` to receive user inputs.
22+
23+
* `flat` provides an easy to use API for 2D games based on sprites.
24+
Clients of this API redefine `App::update` to update the game logic and fill lists of sprites with objects to draw.
25+
26+
`App::sprites` lists the sprites of the game world, they are drawn form the point of view of the `world_camera`.
27+
This camera can be moved around in the world by updating the x and y of its `position`,
28+
and the zoom can easily be set using `reset_depth(desired_world_units_on_y)` or the `z` of its `position`
29+
30+
`App::ui_sprites` lists the UI sprites drawn from the point of view of `ui_camera`.
31+
By default, this camera is pixel-perfect with the origin in the top left corner of the window.
32+
However to support screens with different DPI, it is recommended to standardize
33+
the display size using `reset_depth(height_of_reference_display)`.
34+
35+
* `depth` defines an API for 3D games based on instances of `Actor`.
36+
37+
This framework is build upon `flat`, see the doc of this submodule first (just above).
38+
As such, clients should still implement `update` with the game logic, and fill `ui_sprites` for UI elements.
39+
40+
At each frame, elements in the list `actors` are drawn to screen.
41+
Each `Actor` is composed of a `Model` and other information specific to this instance:
42+
position in the world, rotation and scaling.
43+
44+
* `limit_fps` refines existing services of _gamnit_ to limit the framerate to a customizable value.
45+
46+
* `keys` provides `app.pressed_keys` keeping track of the currently pressed keys.
47+
48+
* `model_parsers` provides services to read and parse models from the asset folder.
49+
50+
* `network` provides a simple communication framework for multiplayer client/server games.

lib/gamnit/REAME.md

Lines changed: 0 additions & 21 deletions
This file was deleted.

lib/gamnit/depth/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
gamnit depth, a framework to create portable 3D games in Nit.
22

3-
This framework is based on a list of `Actor`, in `app::actors`, which are drawn to the screen at each frame. Each actor is composed of a model and other information specific to this instance: position in the world, rotation and scaling. Each `Model` is either a composite of models or it is composed of a `Mesh` defining its geometry and a `Material` defining how to draw the model. `Material` can be subclassed to use custom shaders.
3+
This framework is based on a list of `Actor`, in `app::actors`, which are drawn to the screen at each frame. Each actor is composed of a `Model` and other information specific to this instance: position in the world, rotation and scaling. Each `Model` is either a composite of models or it is composed of a `Mesh` defining its geometry and a `Material` defining how to draw the model. `Material` can be subclassed to use custom shaders.
44

55
# Assets
66

0 commit comments

Comments
 (0)