Window

Encapsulates state-based OpenGL and SDL2 into something much more friendly.

Constructors

this
this(string title, int x, int y, int width, int height)

Destructor

~this
~this()
Undocumented in source.

Members

Functions

aspectRatio
float aspectRatio()
framesPerSecond
uint framesPerSecond()
height
int height()
keyboard
Keyboard keyboard()
load
void load()

Override to specify loading behaviour.

processEvent
void processEvent(SDL_Event event)

Override to specify unique actions on SDL events.

quit
void quit()

Halt running.

render
void render()

Override to specify Render behaviour. Called once for each frame per second.

resize
void resize()

Override to specify resizing behaviour.

run
void run(ubyte fps, ubyte ups)
run
void run(ubyte fps)
run
void run()
runUpdate
void runUpdate()
Undocumented in source. Be warned that the author may not have intended to support it.
setSize
void setSize(int width, int height)
Undocumented in source. Be warned that the author may not have intended to support it.
update
void update()

Override to specify update behaviour. + Called by the Worker-thread to run non-visual updates.

updatesPerSecond
uint updatesPerSecond()
width
int width()

Variables

_context
SDL_GLContext _context;
_height
int _height;
Undocumented in source.
_keyboard
Keyboard _keyboard;
Undocumented in source.
_mspf
uint _mspf;
_mspu
uint _mspu;
Undocumented in source.
_running
bool _running;
Undocumented in source.
_updateThread
Thread _updateThread;
Undocumented in source.
_width
int _width;
Undocumented in source.
_window
SDL_Window* _window;
Undocumented in source.
_wndwEvnt
SDL_Event _wndwEvnt;
Undocumented in source.
onLoad
void delegate() onLoad;
onRender
void delegate() onRender;
onResize
void delegate() onResize;
onUpdate
void delegate() onUpdate;

Meta