Platform

Root object for SDL2 functionality. It's passed around to other SDL wapper objects to ensure library loading.

Constructors

this
this(SharedLibVersion sld2_version)

Load SDL2 library. Param1: You can specify a minimum version of SDL2 for your application.

Destructor

~this
~this()

Releases all resourceas and the SDL library.

Members

Aliases

audioDrivers
alias audioDrivers = drivers!(SDL_GetNumAudioDrivers, SDL_GetAudioDriver)

Returns available SDL audio drivers.

videoDrivers
alias videoDrivers = drivers!(SDL_GetNumVideoDrivers, SDL_GetVideoDriver)

Returns available SDL video drivers.

Functions

audioDevices
const(char)[][] audioDevices()

Returns available audio device names.

clipboard
string clipboard(string s)

Sets clipboard content. Throws PlatformException on error.

clipboard
const(char)[] clipboard()

Returns clipboard content. Throws PlatformException on error.

cpuCount
int cpuCount()

Returns number of CPUs

displays
SDL2VideoDisplay[] displays()

Returns available display information. Throws PlatformException on error.

errorString
const(char)[] errorString()

Returns last SDL error and clears it.

firstDisplayResolution
SDL_Point firstDisplayResolution()

Returns resolution of the first display. Throws PlatformException on error.

l1LineSize
int l1LineSize()

Returns L1 cacheline size in bytes.

platformName
const(char)[] platformName()

Returns platform name.

pollEvent
bool pollEvent(SDL_Event* event)

Get next SDL2 event. Input state gets updated and window callbacks are called too. Returns true if an event is returned.

prefPath
const(char)[] prefPath(string org_name, string application_name)

Returns a path suitable for writing configuration files. Throws PlatformException on error.

processEvents
void processEvents()

Process all pending SDL2 events. Input state gets updated.

secondDisplayResolution
SDL_Point secondDisplayResolution()

Returns resolution of the second display. Throws PlatformException on error.

shouldQuit
bool shouldQuit()

Returns true if application should quit.

startTextInput
void startTextInput()

Start text input.

stopTextInput
void stopTextInput()

Stops text input.

subSystemInit
void subSystemInit(int flag)

Initialize a subsystem.

subSystemInitialized
bool subSystemInitialized(int sub_system)

Returns true if a subsystem is initiated.

throwPlatformException
void throwPlatformException(string call_name)
Undocumented in source. Be warned that the author may not have intended to support it.
waitEvent
void waitEvent(SDL_Event* event)

Wait for next SDL2 event. Input state gets updated and window callbacks are called too. Throws PlatformException on error.

waitEventTimeout
bool waitEventTimeout(SDL_Event* event, int timeout_ms)

Wait for next SDL2 event, with a timeout. Input state gets updated and window callbacks are called too. Returns true if an event is returned. Throws PlatformException on error.

Meta