From 3498f5a7808c8302015be3f6aada6bedfb7460c8 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Alexis=20Laferri=C3=A8re?= Date: Fri, 1 Jan 2016 18:08:04 -0500 Subject: [PATCH] lib/gamnit: improve the gamnit README and fix the typo in its name MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Alexis Laferrière --- lib/gamnit/README.md | 50 ++++++++++++++++++++++++++++++++++++++++++++ lib/gamnit/REAME.md | 21 ------------------- lib/gamnit/depth/README.md | 2 +- 3 files changed, 51 insertions(+), 22 deletions(-) create mode 100644 lib/gamnit/README.md delete mode 100644 lib/gamnit/REAME.md diff --git a/lib/gamnit/README.md b/lib/gamnit/README.md new file mode 100644 index 0000000..a9882df --- /dev/null +++ b/lib/gamnit/README.md @@ -0,0 +1,50 @@ +Portable game and multimedia framework for Nit + +_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. + +# System configuration + +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. +Under Debian 8.2, this command should install everything needed: + +~~~ +apt-get install libgles2-mesa-dev libsdl1.2-dev libsdl-image1.2-dev libsdl-ttf2.0-dev inkscape mpg123 +~~~ + +# Services by submodules + +_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 `world_camera`. + This camera can be moved around in the world by updating the x and y of its `position`, + and the zoom can easily be set using `reset_depth(desired_world_units_on_y)` or the `z` of its `position` + + `App::ui_sprites` lists the UI sprites drawn from the point of view of `ui_camera`. + 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 `reset_depth(height_of_reference_display)`. + +* `depth` defines an API for 3D games based on instances of `Actor`. + + This framework is build upon `flat`, see the doc of this submodule first (just above). + As such, clients should still implement `update` with the game logic, and fill `ui_sprites` for UI elements. + + At each frame, elements in the list `actors` are drawn to screen. + Each `Actor` is composed of a `Model` and other information specific to this instance: + position in the world, rotation and scaling. + +* `limit_fps` refines existing services of _gamnit_ to limit the framerate to a customizable value. + +* `keys` provides `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. diff --git a/lib/gamnit/REAME.md b/lib/gamnit/REAME.md deleted file mode 100644 index 33c2501..0000000 --- a/lib/gamnit/REAME.md +++ /dev/null @@ -1,21 +0,0 @@ -Portable game and multimedia framework for Nit - -This framework is based on the portability framework _app.nit_ and the OpenGL ES 2.0 standard. - -It is modular, different parts of the framework are available through different entry points: - -* `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 must redefine `App::update` to update the game logic and fill `App::sprites` with objects to draw. - -* `depth` defines an API for 3D games. - It is based on a list of `actors`, with `Model` composed of `Mesh` and `Material`. - -* `cameras` provides cameras classes to produce MVP matrices which can be fed to shaders. - -* `limit_fps` redefines existing services of gamnit to limit the framerate to a client-defined value. - -* `network` provides a simple communication framework for multiplayer client/server games. diff --git a/lib/gamnit/depth/README.md b/lib/gamnit/depth/README.md index 61e9c40..6350c2f 100644 --- a/lib/gamnit/depth/README.md +++ b/lib/gamnit/depth/README.md @@ -1,6 +1,6 @@ gamnit depth, a framework to create portable 3D games in Nit. -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. +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. # Assets -- 1.7.9.5