platform.platform

Platform abstraction.

class PlatformException: object.Exception;

Exception thrown at platform related errors.

abstract class Platform;

Handles platform specific functionality like input/output.

Signal:
public mixin Signal!(KeyState, Key, dchar) key
Emitted when a key is pressed. Passes the key, its state and unicode value.

Signal:
public mixin Signal!(KeyState, MouseKey, Vector2u) mouseKey
Emitted when a mouse button is pressed. Passes the key, its state and mouse position.

Signal:
public mixin Signal!(Vector2u, Vector2i) mouseMotion
Emitted when mouse is moved. Passes mouse position and position change.

protected bool[Key.max] keysPressed_;

Array of bools for each key specifying if the key is currently pressed.

this();

Construct Platform.

Throws:
PlatformException on failure.
bool run();

Collect input and determine if the game should continue to run.

final pure void quit();

Quit the platform, i.e. the game.

@property void windowCaption(const string str);

Set window caption string to str.

void hideCursor();

Hide the mouse cursor.

void showCursor();

Show the mouse cursor.

final const pure nothrow bool isKeyPressed(const Key key);

Determine if specified key is pressed.