sdl2
Description:
Simple DirectMedia Layer is a cross-platform development library designed to provide low level access to audio, keyboard, mouse, joystick, and graphics hardware via OpenGL and Direct3D. It is used by video playback software, emulators, and popular games including Valve's award winning catalog and many Humble Bundle games.
- Home: https://www.libsdl.org/
- C-Documentation: http://wiki.libsdl.org/CategoryAPI
- Devhelp-Package download
Content:
Namespaces:
- SDL
- AudioDeviceEvent
- CommonEvent
- ControllerAxisEvent
- ControllerButtonEvent
- ControllerDeviceEvent
- DollarGestureEvent
- DropEvent
- Event
- JoyAxisEvent
- JoyBallEvent
- JoyButtonEvent
- JoyDeviceEvent
- JoyHatEvent
- KeyboardEvent
- MouseButtonEvent
- MouseMotionEvent
- MouseWheelEvent
- MultiGestureEvent
- OSEvent
- QuitEvent
- SysWMEvent
- TextEditingEvent
- TextInputEvent
- Timer
- TouchFingerEvent
- UserEvent
- Version
- WindowEvent
- ErrorCode
- EventAction
- EventState
- EventType
- HatValue
- InitFlag - These flags can be OR'd together.
- MouseWheelDirection
- PowerState
- RWFlags
- ThreadPriority
- WindowEventType
- public delegate int EventFilter (ref Event ev)
- public delegate int ThreadFunction ()
- public delegate uint32 TimerFunc (uint32 interval)
- public void clear_error ()
- public void emit_error (ErrorCode code)
- public unowned string get_error ()
- public uint32 get_initialized (uint32 flags)
Use this function to return a mask of the specified subsystems which have previously been initialized.
- public PowerState get_power_info (out int seconds_left, out int percentage_left)
- public int init (uint32 flags = EVERYTHING)
Use this function to initialize the SDL library. This must be called before using any other SDL function.
- public int init_subsystem (uint32 flags)
Use this function to initialize specific SDL subsystems.
- public void quit ()
Use this function to clean up all initialized subsystems. You should call it upon all exit conditions.
- public void quit_subsystem (uint32 flags)
Use this function to shut down specific SDL subsystems.
- public int set_error (string format, ...)
- Audio
- public delegate void AudioFilter (AudioConverter cvt, AudioFormat format)
- public delegate void AudioFunc (uint8[] stream)
- public void @unlock ()
- public void close ()
- public void do_lock ()
- public void free (ref uint8 audio_buf)
- public unowned string get_current_driver ()
- public unowned string get_driver (int index)
- public int init (string driver)
- public unowned AudioSpec? load (string file, ref AudioSpec spec, out uint8[] audio_buf, out uint32 audio_len)
- public unowned AudioSpec? load_rw (RWops src, int freesrc, ref AudioSpec spec, out uint8[] audio_buf, out uint32 audio_len)
- public void mix (uint8[] dst, uint8[] src, uint32 len, int volume)
- public void mix_device (uint8[] dst, uint8[] src, AudioFormat format, uint32 len, int volume)
- public int num_devices (int iscapture = 0)
- public int num_drivers ()
- public int open (AudioSpec desired, out AudioSpec obtained)
- public void pause (int pause_on)
- public void quit ()
- public AudioStatus status ()
- CPU
- public int get_cache_line_size ()
- public int get_num_cores ()
This function name is misleading, you get logical core count, not physical CPU count
- public int get_system_ram ()
- public bool has_3dnow ()
- public bool has_altivec ()
- public bool has_avx ()
- public bool has_avx2 ()
- public bool has_mmx ()
- public bool has_rdtsc ()
- public bool has_sse ()
- public bool has_sse2 ()
- public bool has_sse3 ()
- public bool has_sse41 ()
- public bool has_sse42 ()
- Hint
- Priority - An enumeration of hint priorities
- public const string ACCELEROMETER_AS_JOYSTICK
A variable controlling whether an Android built-in accelerometer should be listed as a joystick device, rather than listing actual joysticks only.
- public const string ALLOW_TOPMOST
If set to 0 then never set the top most bit on a SDL Window, even if the video mode expects it. This is a debugging aid for developers and not expected to be used by end users. The default is "1"
- public const string ANDROID_APK_EXPANSION_MAIN_FILE_VERSION
A hint that specifies the Android APK expansion main file version.
- public const string ANDROID_APK_EXPANSION_PATCH_FILE_VERSION
A hint that specifies the Android APK expansion patch file version.
- public const string ANDROID_SEPARATE_MOUSE_AND_TOUCH
A hint that specifies a variable to control whether mouse and touch events are to be treated together or separately.
- public const string ANDROID_TRAP_BACK_BUTTON
A variable to control whether we trap the Android back button to handle it manually. This is necessary for the right mouse button to work on some Android devices, or to be able to trap the back button for use in your code reliably. If set to true, the back button will show up as an SDL_KEYDOWN / SDL_KEYUP pair with a keycode of SDL_SCANCODE_AC_BACK.
- public const string APPLE_TV_REMOTE_ALLOW_ROTATION
A hint that specifies whether the Apple TV remote's joystick axes will automatically match the rotation of the remote.
- public const string AUDIO_RESAMPLING_MODE
A variable controlling speed/quality tradeoff of audio resampling.
- public const string BMP_SAVE_LEGACY_FORMAT
A hint that specifies whether SDL should not use version 4 of the bitmap header when saving BMPs. Version 4 includes alpha support.
- public const string EMSCRIPTEN_KEYBOARD_ELEMENT
A hint that specifies a value to override the binding element for keyboard inputs for Emscripten builds.
- public const string ENABLE_STEAM_CONTROLLERS
A variable that controls whether Steam Controllers should be exposed using the SDL joystick and game controller APIs
- public const string EVENT_LOGGING
A variable controlling whether SDL logs all events pushed onto its internal queue.
- public const string FRAMEBUFFER_ACCELERATION
A variable controlling how 3D acceleration is used to accelerate the SDL screen surface.
- public const string GAMECONTROLLERCONFIG
A variable that lets you manually hint extra gamecontroller db entries
- public const string GRAB_KEYBOARD
A variable controlling whether grabbing input grabs the keyboard
- public const string IME_INTERNAL_EDITING
A hint that specifies whether certain IMEs should handle text editing internally instead of sending SDL_TEXTEDITING events.
- public const string IOS_HIDE_HOME_INDICATOR
A variable controlling whether the home indicator bar on iPhone X should be hidden.
- public const string IOS_IDLE_TIMER_DISABLED
A variable controlling whether the idle timer is disabled on iOS.
- public const string IOS_ORIENTATIONS
A variable controlling which orientations are allowed on iOS.
- public const string JOYSTICK_ALLOW_BACKGROUND_EVENTS
A variable that lets you enable joystick (and gamecontroller) events even when your app is in the background.
- public const string JOYSTICK_HIDAPI
A variable controlling whether the HIDAPI joystick drivers should be used.
- public const string JOYSTICK_HIDAPI_GAMECUBE
A variable controlling whether the HIDAPI driver for Nintendo GameCube controllers should be used.
- public const string JOYSTICK_HIDAPI_PS4
A variable controlling whether the HIDAPI driver for PS4 controllers should be used.
- public const string JOYSTICK_HIDAPI_PS4_RUMBLE
A variable controlling whether extended input reports should be used for PS4 controllers when using the HIDAPI driver.
- public const string JOYSTICK_HIDAPI_STEAM
A variable controlling whether the HIDAPI driver for Steam Controllers should be used.
- public const string JOYSTICK_HIDAPI_SWITCH
A variable controlling whether the HIDAPI driver for Nintendo Switch controllers should be used.
- public const string JOYSTICK_HIDAPI_XBOX
A variable controlling whether the HIDAPI driver for XBox controllers should be used.
- public const string MAC_BACKGROUND_APP
A hint that specifies if the SDL app should not be forced to become a foreground process on Mac OS X.
- public const string MAC_CTRL_CLICK_EMULATE_RIGHT_CLICK
A variable that determines whether ctrl+click should generate a right- click event on Mac
- public const string MAC_MOUSE_FOCUS_CLICKTHROUGH
A variable specifying if mouse click events are sent when clicking to focus an SDL window on Apple Mac OS X.
- public const string MOUSE_DOUBLE_CLICK_RADIUS
A variable setting the double click radius, in pixels.
- public const string MOUSE_DOUBLE_CLICK_TIME
A variable setting the double click time, in milliseconds.
- public const string MOUSE_FOCUS_CLICKTHROUGH
A hint that specifies if mouse click events are sent when clicking to focus an SDL window.
- public const string MOUSE_NORMAL_SPEED_SCALE
A variable setting the speed scale for mouse motion, in floating point, when the mouse is not in relative mode
- public const string MOUSE_RELATIVE_MODE_WARP
A variable controlling whether relative mouse mode is implemented using mouse warping
- public const string MOUSE_RELATIVE_SPEED_SCALE
A variable setting the scale for mouse motion, in floating point, when the mouse is in relative mode
- public const string NO_SIGNAL_HANDLERS
A hint that specifies not to catch the SIGINT or SIGTERM signals.
- public const string RENDER_BATCHING
A variable controlling whether the 2D render API is compatible or efficient.
- public const string RENDER_DIRECT3D11_DEBUG
A variable controlling whether to enable Direct3D 11+'s Debug Layer.
- public const string RENDER_DIRECT3D_THREADSAFE
A variable controlling whether the Direct3D device is initialized for thread-safe operations.
- public const string RENDER_DRIVER
A variable specifying which render driver to use.
- public const string RENDER_LOGICAL_SIZE_MODE
A variable controlling the scaling policy for SDL_RenderSetLogicalSize.
- public const string RENDER_OPENGL_SHADERS
A variable controlling whether the OpenGL render driver uses shaders if they are available.
- public const string RENDER_SCALE_QUALITY
A variable controlling the scaling quality
- public const string RENDER_VSYNC
A variable controlling whether updates to the SDL screen surface should be synchronized with the vertical refresh, to avoid tearing.
- public const string SDL_HINT_ANDROID_BLOCK_ON_PAUSE
A variable to control whether the event loop will block itself when the app is paused.
- public const string SDL_HINT_GAMECONTROLLERCONFIG_FILE
A variable that lets you provide a file with extra gamecontroller db entries.
- public const string THREAD_STACK_SIZE
A hint that specifies a variable specifying SDL's threads stack size in bytes or "0" for the backend's default size.
- public const string TIMER_RESOLUTION
A variable that controls the timer resolution, in milliseconds.
- public const string TOUCH_MOUSE_EVENTS
A variable controlling whether touch events should generate synthetic mouse events
- public const string VIDEO_ALLOW_SCREENSAVER
A variable controlling whether the screensaver is enabled.
- public const string VIDEO_HIGHDPI_DISABLED
If set to 1, then do not allow high-DPI windows. ("Retina" on Mac).
- public const string VIDEO_MAC_FULLSCREEN_SPACES
A variable that dictates policy for fullscreen Spaces on Mac OS X.
- public const string VIDEO_MINIMIZE_ON_FOCUS_LOSS
Minimize your SDL_Window if it loses key focus when in fullscreen mode. Defaults to true.
- public const string VIDEO_WINDOW_SHARE_PIXEL_FORMAT
A variable that is the address of another SDL.Video.Window (as a hex string formatted with "%p"
- public const string VIDEO_WIN_D3DCOMPILER
A variable specifying which shader compiler to preload when using the Chrome ANGLE binaries
- public const string VIDEO_X11_NET_WM_PING
A hint that specifies whether the X11 _NET_WM_PING protocol should be supported.
- public const string VIDEO_X11_XINERAMA
A variable controlling whether the X11 Xinerama extension should be used.
- public const string VIDEO_X11_XRANDR
A variable controlling whether the X11 XRandR extension should be used.
- public const string VIDEO_X11_XVIDMODE
A variable controlling whether the X11 VidMode extension should be used.
- public const string WAVE_FACT_CHUNK
Controls how the fact chunk affects the loading of a WAVE file.
- public const string WAVE_RIFF_CHUNK_SIZE
Controls how the size of the RIFF chunk affects the loading of a WAVE file.
- public const string WAVE_TRUNCATION
Controls how a truncated WAVE file is handled.
- public const string WINDOWS_DISABLE_THREAD_NAMING
A hint that specifies whether SDL should not name threads on Microsoft Windows. Might be useful if you want to interop with C# there.
- public const string WINDOWS_ENABLE_MESSAGELOOP
A hint that specifies whether the windows message loop is processed by SDL.
- public const string WINDOWS_INTRESOURCE_ICON
A variable to specify custom icon resource id from RC file on Windows platform
- public const string WINDOWS_INTRESOURCE_ICON_SMALL
A variable to specify custom icon resource id from RC file on Windows platform (small size)
- public const string WINDOWS_NO_CLOSE_ON_ALT_F4
A hint that specifies that SDL should not to generate an SDL.WindowEvent of type SDL.WindowEventType.CLOSE for Alt+F4 on Microsoft Windows.
- public const string WINDOW_FRAME_USABLE_WHILE_CURSOR_HIDDEN
A hint that specifies whether the window frame and title bar are interactive when the cursor is hidden.
- public const string WINRT_HANDLE_BACK_BUTTON
If set to 1, back button press events on Windows Phone 8+ will be marked as handled.
- public const string WINRT_PRIVACY_POLICY_LABEL
Label text for a WinRT app's privacy policy link
- public const string WINRT_PRIVACY_POLICY_URL
A URL to a WinRT app's privacy policy
- public const string XINPUT_ENABLED
A variable that lets you disable the detection and use of Xinput gamepad devices
- public const string XINPUT_USE_OLD_JOYSTICK_MAPPING
A hint that specifies that SDL should use the old axis and button mapping for XInput devices.
- public delegate void HintFunc (string name, string old_value, string? new_value)
A callback used to watch hints.
- public void add_callback (string name, HintFunc callback)
Use this function to add a function to watch a particular hint.
- public void clear_all ()
Use this function to clear all hints.
- public void del_callback (string name, HintFunc callback)
Use this function to remove a function watching a particular hint.
- public unowned string get_hint (string name)
Use this function to get the value of a hint.
- public bool is_hint_enabled (string name, bool default_value)
Use this function on boolean hints to see if they are enabled.
- public bool set_hint (string name, string hint_value)
Use this function to set a hint with normal priority.
- public bool set_hint_enabled (string name, bool hint_value)
Use this function to set a boolean hint with normal priority.
- public bool set_hint_with_priority (string name, string hint_value, Priority priority)
Use this function to set a hint with a specific priority.
- Input
- Clipboard
- Keyboard
- public Window get_focus ()
- public Keymod get_modifierstate ()
- public unowned uint8[] get_state ()
- public void set_modifierstate (Keymod modstate)
- ScreenKeyboard
- public bool has_support ()
- public bool is_shown (Window window)
- TextInput
- Touch
- public const int64 MOUSE_TOUCH_ID
Used as the TouchID for touch events simulated with mouse input
- public const uint32 TOUCH_MOUSE_ID
Used as the device ID for mouse events simulated with touch input
- public TouchID get_touch_device (int index)
- public int load_dollar_templates (TouchID touch_id, string file)
- public int load_dollar_templates_rw (TouchID touch_id, RWops src)
- public int num_devices ()
- public int num_fingers (TouchID touch_id)
- public int record_gesture (TouchID touch_id)
- public int save_all_dollar_templates (string file)
- public int save_all_dollar_templates_rw (RWops dst)
- public int save_dollar_template (GestureID gesture_id, string file)
- public int save_dollar_template_rw (GestureID gesture_id, RWops dst)
- Video
- BlitMap
- Color
- Display
- DisplayMode
- Point
- Rect
- RendererInfo
- SysWMInfo - Remember to always check the SysWMType before accessing any field
- SysWMmsg
- Alpha
- ArrayOrder
- BitmapOrder
- BlendMode
- HitTestResult
- PackedLayout
- PackedOrder
- PixelRAWFormat
- PixelType
- RendererFlags
- RendererFlip
- SysWMType
- TextureAccess
- TextureModulate
- WindowFlags
- public delegate int BlitFunc (Surface src, Rect? srcrect, Surface dst, Rect? dstrect)
- public delegate HitTestResult HitTestFunc (Window window, Point? area)
- public void disable_screensaver ()
- public void enable_screensaver ()
- public unowned string? get_current_driver ()
- public unowned string? get_driver (int driver_index)
- public int init (string driver_name)
- public bool is_screensaver_enabled ()
- public int num_displays ()
- public int num_drivers ()
- public void quit ()
- GL
- public int get_attribute (Attributes attr, out int val)
- public Context? get_current_context ()
- public Window? get_current_window ()
- public void* get_proc_address (string proc)
- public int get_swapinterval ()
- public bool is_extension_supported (string extension)
- public int load_library (string path)
- public int make_current (Window window, Context context)
- public void reset_attributes ()
- public int set_attribute (Attributes attr, int val)
- public int set_swapinterval (int interval)
- public void swap_window (Window window)
- public void unload_library ()
- MessageBox