dart_sdl library Null safety

Dart bindings for sdl.

Start by creating an Sdl instance:

final sdl = Sdl(DynamicLibrary.open('sdl2.dll'));

Next, you need to initialise the library:

sdl.init();

For more information, see the SDL API docs.

Classes

AppDidEnterBackgroundEvent
The application entered background.
AppDidEnterForegroundEvent
The application entered foreground.
AppLowMemoryEvent
The OS is low on memory.
AppTerminatingEvent
The OS is terminating the application.
AppWillEnterBackgroundEvent
The application is entering background.
AppWillEnterForegroundEvent
The application is entering foreground.
AudioDevice
An audio device on the system.
AudioDeviceAddedEvent
A device was added.
AudioDeviceEvent
An audio device event.
AudioDeviceRemovedEvent
A device was removed.
AudioDriver
An audio driver on the system.
AudioSpec
Audio specification.
BordersSize
A class to represent the size of a window's borders.
ClipboardChangedEvent
The clipboard changed.
ConditionEffect
A 3-part number for use with HapticCondition members.
ControllerAxisEvent
A controller axis moved.
ControllerButtonEvent
A controller button was pressed or released.
ControllerDeviceEvent
A device was added, removed, or remapped.
ControllerSensorEvent
A controller sensor event.
ControllerTouchpadEvent
A controller touch device event.
Display
The display class.
DisplayChangedEvent
SDL_WINDOWEVENT_DISPLAY_CHANGED.
DisplayEvent
A generic display event.
DisplayMode
A display mode.
DollarGestureEvent
A gesture event.
DropEvent
A drag and drop event.
Event
The base event class.
GameController
A game controller.
GameControllerEvent
The base for all game controller events.
Haptic
A haptic device.
HapticCondition
A conditional haptic effect.
HapticConstant
A constant haptic effect.
HapticDirection
A structure that contains a haptic direction.
HapticEffect
A haptic effect.
HapticLeftRight
A left/right effect.
HapticPeriodic
A periodic haptic effect.
HapticRamp
A ramp effect.
IccprofChangedEvent
SDL_WINDOWEVENT_ICCPROF_CHANGED.
JoyAxisEvent
An axis on a joystick was moved.
JoyBallEvent
A trackball was moved.
JoyButtonEvent
A button was pressed or released.
JoyDeviceEvent
A joystick device was connected or disconnected.
JoyHatEvent
A hat on a joystick has moved.
Joystick
A joystick device.
JoystickEvent
The base class for all joystick events.
KeyboardEvent
A keyboard event.
KeyboardKey
A keyboard key.
KeymapChangedEvent
The keymap changed due to a system event such as an input language or keyboard layout change (>= SDL 2.0.4).
LocaleChangedEvent
Locale changed.
MessageBoxButton
A button for use in an SDL message box.
MouseButtonEvent
A mouse button has been pressed or released.
MouseEvent
The base class for all mouse events.
MouseMotionEvent
A mouse has moved in the window.
MouseWheelEvent
A mouse wheel event.
MultiGestureEvent
A multifinger gesture was made.
OpenAudioDevice
An open device.
PollSentinelEvent
SDL_POLLSENTINEL.
QuitEvent
User requested quit.
RenderDeviceReset
The device has been reset and all textures need to be recreated.
RenderTargetsResetEvent
The render targets have been reset and their contents need to be updated.
Sdl
The main SDL class.
SensorEvent
A sensor update event.
SysWmEvent
A system specific event.
TextEditingEvent
Keyboard text editing (composition).
TextInputEvent
Keyboard text input.
TouchFingerEvent
A touch event.
UserEvent
A user event.
WaveFile
A class representing a wave file.
Window
An SDL Window.
WindowClosedEvent
The window manager requests that the window be closed.
WindowEnterEvent
A window has gained focus.
WindowEvent
A window state change.
WindowExposedEvent
A window has been exposed and should be redrawn.
WindowFocusGainedEvent
A window has gained keyboard focus.
WindowFocusLostEvent
A window has lost keyboard focus.
WindowHiddenEvent
A window has been hidden.
WindowHitTestEvent
A window had an abnormal hit test.
WindowLeaveEvent
A window has lost mouse focus.
WindowMaximizedEvent
A window has been maximised.
WindowMinimizedEvent
A window has been minimised.
WindowMovedEvent
A window has been moved.
WindowResizedEvent
A window has been resized.
WindowRestoredEvent
A window has been restored.
WindowShownEvent
A window has been shown.
WindowSize
The size of a window.
WindowSizeChangedEvent
The size of a window has changed.
WindowTakeFocusEvent
A window is being offered focus.

Mixins

CoordinatesMixin<T extends num>
Add coordinates to any event type.
WindowMixin
For events which have window IDs.

Extensions

ArrayOrderToInt
An extension for converting Dart to C values.
AssertStateToInt
An extension for converting Dart to C values.
AudioStatusToInt
An extension for converting Dart to C values.
BitmapOrderToInt
An extension for converting Dart to C values.
BlendFactorToInt
An extension for converting Dart to C values.
BlendModeToInt
An extension for converting Dart to C values.
BlendOperationToInt
An extension for converting Dart to C values.
DartSdlIntExtension
Various extension methods for integers.
DartSdlKeyCodeMethods
An extension to return a KeyCode from an integer.
DartSdlScanCodeMethods
An extension to return a ScanCode from an integer.
DisplayEventIDToInt
An extension for converting Dart to C values.
DisplayOrientationToInt
An extension for converting Dart to C values.
ErrorCodeToInt
An extension for converting Dart to C values.
EventActionToInt
An extension for converting Dart to C values.
EventTypeToInt
An extension for converting Dart to C values.
FlashOperationToInt
An extension for converting Dart to C values.
GameControllerAxisToInt
An extension for converting Dart to C values.
GameControllerBindTypeToInt
An extension for converting Dart to C values.
GameControllerButtonToInt
An extension for converting Dart to C values.
GameControllerTypeToInt
An extension for converting Dart to C values.
GLattrToInt
An extension for converting Dart to C values.
GLcontextFlagToInt
An extension for converting Dart to C values.
GLcontextReleaseFlagToInt
An extension for converting Dart to C values.
GLContextResetNotificationToInt
An extension for converting Dart to C values.
GLprofileToInt
An extension for converting Dart to C values.
HintPriorityToInt
An extension for converting Dart to C values.
HitTestResultToInt
An extension for converting Dart to C values.
IntToC
An extension for converting integers to Dart values.
JoystickPowerLevelToInt
An extension for converting Dart to C values.
JoystickTypeToInt
An extension for converting Dart to C values.
LogCategoryToInt
An extension for converting Dart to C values.
LogPriorityToInt
An extension for converting Dart to C values.
MessageBoxButtonFlagsToInt
An extension for converting Dart to C values.
MessageBoxColorTypeToInt
An extension for converting Dart to C values.
MessageBoxFlagsToInt
An extension for converting Dart to C values.
MouseButtonPressedStateExtension
Add conversions to mouse structures.
MouseWheelDirectionToInt
An extension for converting Dart to C values.
PackedLayoutToInt
An extension for converting Dart to C values.
PackedOrderToInt
An extension for converting Dart to C values.
PixelFormatToInt
An extension for converting Dart to C values.
PixelTypeToInt
An extension for converting Dart to C values.
PowerStateToInt
An extension for converting Dart to C values.
RendererFlagsToInt
An extension for converting Dart to C values.
RendererFlipToInt
An extension for converting Dart to C values.
ScaleModeToInt
An extension for converting Dart to C values.
SdlBoolToInt
An extension for converting Dart to C values.
SdlFullScreenModeValues
An extension for converting to an SDL flag.
SdlHapticConstantEffectTypeValues
An extension for converting to an SDL flag.
SdlHapticDirectionTypeValues
An extension for converting to an SDL flag.
SdlHapticEffectTypeValues
An extension for converting to an SDL flag.
SdlKeyCodeValueExtension
An extension to return an integer from a KeyCode value.
SdlKeyModValues
An extension for converting to an SDL flag.
SdlListMethods
Various list methods used by this package.
SdlScancodeValueExtension
An extension to return an integer from a ScanCode value.
SdlStringValues
An extension for converting strings to dart_sdl values.
SensorTypeToInt
An extension for converting Dart to C values.
SystemCursorToInt
An extension for converting Dart to C values.
TextureAccessToInt
An extension for converting Dart to C values.
TextureModulateToInt
An extension for converting Dart to C values.
ThreadPriorityToInt
An extension for converting Dart to C values.
TouchDeviceTypeToInt
An extension for converting Dart to C values.
WindowEventIDToInt
An extension for converting Dart to C values.
WindowFlagsToInt
An extension for converting Dart to C values.
YuvConversionModeToInt
An extension for converting Dart to C values.

Enums

ArrayOrder
SDL_ArrayOrder.
AssertState
SDL_AssertState.
AudioStatus
SDL_AudioStatus.
BitmapOrder
SDL_BitmapOrder.
BlendFactor
SDL_BlendFactor.
BlendMode
SDL_BlendMode.
BlendOperation
SDL_BlendOperation.
ControllerTouchpadEventType
Types for a ControllerTouchpadEvent.
DeviceState
Whether a device was added or removed.
DisplayEventID
SDL_DisplayEventID.
DisplayOrientation
SDL_DisplayOrientation.
DollarGestureEventType
Dollar event types.
DropEventType
The types for DropEvent instances.
ErrorCode
SDL_errorcode.
EventAction
SDL_eventaction.
EventType
SDL_EventType.
FlashOperation
SDL_FlashOperation.
FullScreenMode
Full screen modes.
GameControllerAxis
SDL_GameControllerAxis.
GameControllerBindType
SDL_GameControllerBindType.
GameControllerButton
SDL_GameControllerButton.
GameControllerType
SDL_GameControllerType.
GLattr
SDL_GLattr.
GLcontextFlag
SDL_GLcontextFlag.
GLcontextReleaseFlag
SDL_GLcontextReleaseFlag.
GLContextResetNotification
SDL_GLContextResetNotification.
GLprofile
SDL_GLprofile.
HapticConditionType
The type of a conditional haptic effect.
HapticDirectionType
Haptic directions.
HapticFeature
An enumeration of SDL haptic types.
HapticPeriodicType
The type of a haptic effect.
HintPriority
SDL_HintPriority.
HitTestResult
SDL_HitTestResult.
JoyHatValue
Possible joystick hat values.
JoystickPowerLevel
SDL_JoystickPowerLevel.
JoystickType
SDL_JoystickType.
KeyCode
Keycodes.
KeyMod
Binds SDL_Keymod.
LogCategory
SDL_LogCategory.
LogPriority
SDL_LogPriority.
MessageBoxButtonFlags
SDL_MessageBoxButtonFlags.
MessageBoxColorType
SDL_MessageBoxColorType.
MessageBoxFlags
SDL_MessageBoxFlags.
MouseButton
Which mouse button was used.
MouseWheelDirection
SDL_MouseWheelDirection.
PackedLayout
SDL_PackedLayout.
PackedOrder
SDL_PackedOrder.
PixelFormat
SDL_PixelFormatEnum.
PixelType
SDL_PixelType.
PowerState
SDL_PowerState.
PressedState
Pressed state.
RendererFlags
SDL_RendererFlags.
RendererFlip
SDL_RendererFlip.
ScaleMode
SDL_ScaleMode.
ScanCode
Scancodes.
SdlBool
SDL_bool.
SensorType
SDL_SensorType.
SystemCursor
SDL_SystemCursor.
TextureAccess
SDL_TextureAccess.
TextureModulate
SDL_TextureModulate.
ThreadPriority
SDL_ThreadPriority.
TouchDeviceType
SDL_TouchDeviceType.
TouchFingerEventType
Touch finger event types.
WindowEventID
SDL_WindowEventID.
WindowFlags
SDL_WindowFlags.
YuvConversionMode
SDL_YUV_CONVERSION_MODE.

Exceptions / Errors

SdlError
Provides the SdlError class. The base class for all exceptions.