mnit

package mnit
Multiplatform game framework for Nit

Concerns

  • mnit: Multiplatform game framework for Nit
    • input: Defines abstract classes for user and general inputs to the application.
    • display: Defines abstract display classes
    • mnit_app: General Mnit application structure
    • opengles1: OpenGL ES1 general support (most of it)
    • tileset: Manage images that are tileset or glyphset (for bitmap fonts)
    • assets: Manages all assets usable by an Mnit app
    • mnit_fps: Frame-rate control for applications
    • mnit_injected_input: Injection of input events that are read frm a file.
    • image_set: Utility module used by the svg_to_png_and_nit tool. It is imported
    • mnit_null: Dummy mnit platform for headless executions
    • numbers: Helper services to draw numbers on screen
    • mnit: Multiplatform game framework for Nit

mnit::input

module input

Defines abstract classes for user and general inputs to the application.

Implemented independantly for each platforms and technologies.

Introduces
  • InputEvent: Input to the App, propagated through App::input.
  • MotionEvent: A motion event on screen composed of many PointerEvent
  • PointerEvent: Mouse and touch input events
  • KeyEvent: Keyboard or other keys event
  • SensorEvent: Sensor events like accelerometer, gyroscope etc for mobile apps
  • QuitEvent: Quit event, used for window close button
  • TouchEvent: Specific touch event
  • MobileKeyEvent: Mobile hardware (or pseudo hardware) event

mnit::mnit_injected_input

Injection of input events that are read frm a file.

This cloud be used to replay an execution of a mnit application to debug or to benchmark it.

The input file is given through the environment variable MNIT_READ_INPUT

In order to reproduce executions, the behavior of the application must be deterministic for a given sequence of inputs. The main source of differences in executions is caused by the rand function, Set the environment variable NIT_SRAND to a value to force srand to be initialized with this value.

The input event file is made of event descriptions, one event by line.

10 click 10.0 20.0
20 quit

The first field, an integer, is the delay (in frame count) since the previous event 0 means the event is launched in the same frame that the previous one.

The second field, a string, is the kind of the event. Currently only click for PointerEvent and quit for QuitEvent are recognized.

The following fields are the arguments that specific for each kind of event.

  • quit does not have arguments
  • click has 2 float arguments: PointerEvent::x and PointerEvent::y
Redefines
  • App: App subclasses are cross-platform applications

mnit::mnit_null

module mnit_null

Dummy mnit platform for headless executions

Extends mnit_injected_input so that the whole application is simulated. This permits more debugging and benchmarking, even without screen (thinks regression tests).

Assets loading and display operations are executed with an empty body, Except on frames that have some injected input events, in theses the description of all blit operations are printed to screen.

Introduces
Redefines
  • App: App subclasses are cross-platform applications