Display

A display that handles collecting events and drawing to the activity and handling window stuff Will handle the main loop and send events to where they need to be handled

Constructors

this
this(int w, int h, SDL_WindowFlags flags = SDL_WINDOW_SHOWN, uint rendererFlags = 0, string title = "", string iconPath = null)

Constructs a display given a width, height, window flags, renderer flags, a title, and a path for an image icon (or null) Disregarding width and height, constructor asks for flags first because once set, those cannot be changed

Members

Functions

run
void run()

Actually runs the display and handles event collection and framerate and most other things

Properties

framerate
int framerate [@property setter]

Sets the window's framerate

framerate
int framerate [@property getter]

Gets the window's framerate

frames
ulong frames [@property getter]

Gets how many frames have passed since the window started

keyboard
Keyboard keyboard [@property getter]

Gets the keyboard of the display

mouse
Mouse mouse [@property getter]

Gets the mouse of the display

renderer
Renderer renderer [@property getter]

Gets the contained window's renderer

window
Window window [@property getter]

Gets the window of the display

Variables

activity
Activity activity;

The activity that the display is displaying right now

eventHandlers
EventHandler[] eventHandlers;

All event handlers of the display; define specific behaviours for events; events pass to handlers from first to last

frameSleep
int frameSleep;

How long to wait between frames in milliseconds; will be ignored in case of VSync

isRunning
bool isRunning;

Whether the display is running; will stop running if set to false

Meta