Sdl class

The main SDL class.

Constructors

Sdl({String? libName})
Create an object.

Properties

audioDriver AudioDriver
Get the current audio driver.
no setter
audioDrivers List<AudioDriver>
Get the audio drivers on the system.
no setter
basePath String
Get the base path.
no setter
compiledVersion int
Get the compiled version.
no setter
currentWindow Window
Get the current window.
no setter
displayModePointer Pointer<SDL_DisplayMode>
The display pointer.
final
events Stream<Event>
Stream all events.
no setter
floatPointer Pointer<Float>
The Float pointer.
final
gameControllerEventsEnabled bool
Get the state of game controller events.
getter/setter pair
hapticDirectionPointer Pointer<SDL_HapticDirection>
The haptic direction pointer.
final
hashCode int
The hash code for this object.
no setterinherited
hasScreenKeyboardSupport bool
Check whether the platform has screen keyboard support.
no setter
inputAudioDevices List<AudioDevice>
Get all audio devices suitable for input.
no setter
isTextInputActive bool
Check whether or not Unicode text input events are enabled.
no setter
keyboardState List<PressedState>
Get a snapshot of the current state of the keyboard.
no setter
modState Set<KeyMod>
Get the current key modifier state for the keyboard.
getter/setter pair
mouseIsHaptic bool
Query whether or not the current mouse has haptic capabilities.
no setter
numHaptics int
Count the number of haptic devices attached to the system.
no setter
numJoysticks int
Get the number of joysticks on the system.
no setter
numSensors int
Count the number of sensors attached to the system right now.
no setter
numVideoDisplays int
Get the number of video displays.
no setter
numVideoDrivers int
Get the number of video drivers compiled into SDL.
no setter
outputAudioDevices List<AudioDevice>
Get all audio devices suitable for output.
no setter
rectPointer Pointer<SDL_Rect>
The rectangle pointer.
final
relativeMouseMode bool
Query whether relative mouse mode is enabled.
getter/setter pair
revision String
Get the SDL revision.
no setter
revisionNumber int
Get revision number.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
screenSaverEnabled bool
Return whether or not the screen saver is currently enabled.
getter/setter pair
sdl ↔ DartSdl
The SDL bindings to use.
latefinal
showCursor bool
Returns true if the cursor is shown, false otherwise.
getter/setter pair
ticks int
Get the number of ticks.
no setter
version → SdlVersion
Get SDL version.
no setter
x2Pointer Pointer<Int>
An extra Int32 pointer.
final
xPointer Pointer<Int>
The x Int32 pointer.
final
y2Pointer Pointer<Int>
Another Int32 pointer.
final
yPointer Pointer<Int>
The y Int32 pointer.
final

Methods

boolToValue(bool value) int
Convert a boolean to one of the members of SDL_bool.
captureMouse(bool enabled) → void
Capture the mouse and to track input outside an SDL window.
checkReturnValue(int value) int
Throw an error if return value is non-null.
clearError() → void
Clear the last error message.
clearHints() → void
Clear all hints.
createDisplay(int index) Display
Create a display.
createFirstDisplay() Display
Create a display with index 0.
createWindow(String title, {int x = SDL_WINDOWPOS_CENTERED, int y = SDL_WINDOWPOS_CENTERED, int width = 1024, int height = 648, int flags = 0}) Window
Create a window.
delay(int ms) → void
Wait a specified number of milliseconds before returning.
destroyWindow(Window window) → void
Destroy a window.
getAudioDevices(bool isCapture) List<AudioDevice>
Get all the audio devices on this system.
getBool(int value) bool
Get a Dart boolean from an SDL one.
getClipboardText() String?
Get clipboard text.
getError() String
Get the most recent SDL error for this thread.
getEvents({Duration duration = Duration.zero}) Stream<Event>
Get a stream of all SDL events.
getGameControllerName(int index) String
Get the implementation dependent name for the game controller.
getHapticName(int index) String
Get the implementation dependent name of a haptic device.
getJoystickDeviceGuid(int index) → SDL_JoystickGUID
Get the implementation-dependent GUID for the joystick at a given device index.
getJoystickInstanceId(int index) int
Get the instance ID of the joystick at index index.
getJoystickName(int index) String
Get the implementation dependent name of a joystick.
getKeyboardFocus() Window?
Query the window which currently has keyboard focus.
getKeyFromName(String name) KeyCode
Get a key code from a human-readable name.
getKeyFromScanCode(ScanCode scanCode) KeyCode
Get the key code corresponding to the given scancode according to the current keyboard layout.
getKeyName(KeyCode keyCode) String
Get a human-readable name for a key.
getLogPriority(LogCategory category) LogPriority
Get log priority.
getMouseFocus() Window
Get the window which currently has mouse focus.
getPrefPath(String org, String app) String
Get the preferences path for your org and app.
getScanCodeFromKey(KeyCode key) ScanCode
Get the scancode corresponding to the given key code according to the current keyboard layout.
getScanCodeFromName(String name) ScanCode
Get a scancode from a human-readable name.
getScanCodeName(ScanCode scanCode) String
Get a human-readable name for a scancode.
getVideoDriver(int index) String
Get the name of a video driver.
hapticOpened(int index) bool
Check if the haptic device at the designated index has been opened.
hasClipboardText() bool
Returns true if the clipboard contains text.
init({int flags = SDL_INIT_EVERYTHING}) → void
Initialise SDL.
isGameController(int index) bool
Returns true if the joystick at index is a game controller.
loadHapticDirection(HapticDirection direction) → void
Load direction onto hapticDirectionPointer.
log(String message) → void
Log a message.
logCritical(LogCategory category, String message) → void
Log a critical message.
logDebug(LogCategory category, String message) → void
Log a debug message.
logError(LogCategory category, String message) → void
Log an error message.
logInfo(LogCategory category, String message) → void
Log an informational message.
logMessage(LogCategory category, LogPriority priority, String message) → void
Log a message.
logVerbose(LogCategory category, String message) → void
Log a verbose message.
logWarn(LogCategory category, String message) → void
Log a warning message.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
openAudioDevice({AudioDevice? device, bool? isCapture, AudioSpec? settings}) OpenAudioDevice
Open an audio device.
openGameController(int index) GameController
Open a game controller.
openHaptic(int index) Haptic
Open a haptic device for use.
openHapticFromMouse() Haptic
Try to open a haptic device from the current mouse.
openJoystick(int index) Joystick
Open a joystick with the given index for use.
pollEvent() Event?
Poll events.
pumpEvents() → void
Pump events.
quit() → void
Shutdown SDL.
registerEvents(int n) int
Register user-defined event types.
resetLogPriorities() → void
Reset log priorities.
setAllLogPriorities(LogPriority priority) → void
Set the priority of all log categories.
setClipboardText(String value) → void
Set clipboard text.
setError(String message) → void
Set the error message.
setHint(String hint, String value) bool
Set a hint at normal priority.
setHintPriority(String hint, String value, HintPriority priority) bool
Set hint with priority.
setLogPriority(LogCategory category, LogPriority priority) → void
Set log priority.
setMainReady() → void
Set main ready.
showMessageBox(String title, String message, List<MessageBoxButton> buttons, {Window? window, List<MessageBoxFlags>? flags}) int
Show a message box.
showSimpleMessageBox(List<MessageBoxFlags> types, String title, String message, {Window? window}) → void
Show a simple message box.
startTextInput() → void
Start accepting Unicode text input events.
stopTextInput() → void
Stop receiving any text input events.
throwInvalidEvent(EventType type) → Never
Throw an error to show that an event was unhandled.
toString() String
A string representation of this object.
inherited
warpMouse(int x, int y) → void
Move the mouse to the given position in global screen space.
wasInit({int flags = 0}) int
Get the systems which are currently initialised.

Operators

operator ==(Object other) bool
The equality operator.
inherited