SDL2

Owns both the loader, logging, keyboard state... This object is passed around to other SDL wrapper objects to ensure library loading.

Constructors

this
this(Logger logger, SharedLibVersion sdl2Version)

Load SDL2 library, redirect logging to our logger. You can pass a null logger if you don't want logging. You can specify a minimum version of SDL2 you wish your project to support. Creating this object doesn't initialize any SDL subsystem!

Destructor

~this
~this()

Releases the SDL library and all resources. All resources should have been released at this point, since you won't be able to call any SDL function afterwards.

Members

Aliases

getAudioDrivers
alias getAudioDrivers = getDrivers!(SDL_GetNumAudioDrivers, SDL_GetAudioDriver)
getVideoDrivers
alias getVideoDrivers = getDrivers!(SDL_GetNumVideoDrivers, SDL_GetVideoDriver)

Functions

firstDisplaySize
SDL_Point firstDisplaySize()
getAudioDevices
const(char)[][] getAudioDevices(int type)
getCPUCount
int getCPUCount()
getClipboard
const(char)[] getClipboard()
getDisplays
SDL2VideoDisplay[] getDisplays()
getErrorString
const(char)[] getErrorString()
Undocumented in source. Be warned that the author may not have intended to support it.
getL1LineSize
int getL1LineSize()
getPlatform
const(char)[] getPlatform()
getPrefPath
const(char)[] getPrefPath(string orgName, string applicationName)
getRenderersInfo
SDL2RendererInfo[] getRenderersInfo()
keyboard
SDL2Keyboard keyboard()
mouse
SDL2Mouse mouse()
pollEvent
bool pollEvent(SDL_Event* event)

Get next SDL event. Input state gets updated and window callbacks are called too.

processEvents
void processEvents()

Process all pending SDL events. Input state gets updated. You would typically look at event instead of calling this function.

setClipboard
string setClipboard(string s)

Sets clipboard content.

startTextInput
void startTextInput()

Start text input.

stopTextInput
void stopTextInput()

Stops text input.

subSystemInit
void subSystemInit(int flag)

Initialize a subsystem. By default, all SDL subsystems are uninitialized.

subSystemInitialized
bool subSystemInitialized(int subSystem)
throwSDL2Exception
void throwSDL2Exception(string callThatFailed)
Undocumented in source. Be warned that the author may not have intended to support it.
waitEvent
void waitEvent(SDL_Event* event)

Wait for next SDL event. Input state gets updated and window callbacks are called too.

waitEventTimeout
bool waitEventTimeout(SDL_Event* event, int timeoutMs)

Wait for next SDL event, with a timeout. Input state gets updated and window callbacks are called too.

wasQuitRequested
bool wasQuitRequested()

Variables

_logger
Logger _logger;
Undocumented in source.

Meta