Skip to main content

Module platform

Module platform 

Source
Expand description

Platform: what a backend gives the engine (ADR-0008 §2, ADR-0024), and the plain data that crosses it: the time (Millis), the display (DisplayInfo), a Frame to show and the system’s events (SystemEvent).

Structs§

DisplayInfo
What a backend’s display is (ADR-0008 §2). One screen for now; a device with more (the DS) reports them here once ticket 3023 adds surfaces.
Frame
One frame for the backend to show (Platform::present).
Look
What a game’s frame is painted with: the font atlas and the pictures in the game’s data. A backend makes its textures from them the first time it sees them. Build it with Look::new (ADR-0039); a game that runs on a one-bit display adds Look::with_one_bit (ADR-0062).
Millis
A moment on the backend’s clock, in whole milliseconds. Where the clock counts from (the program’s start, the device’s, 1970) doesn’t matter: App only takes differences. A clock that goes backwards counts as no time passing.
OneBitLook
A game’s look on a one-bit display (ADR-0062): what render_with needs beside the frame. The game’s load makes it from its pack, once.

Enums§

Color
How many colours a display shows.
Show
What a frame shows.
SystemEvent
Something the system tells the game, between frames.

Traits§

Platform
What a backend gives the engine: a display to present frames on, the player’s input, the system’s events, storage, a sound device, the facts of where the game runs and, if the device has one, its own keyboard for text and, in debug builds, a clock to measure frames with.