If you want to paste this into a text editor that can handle fancy Unicode section headers, try using QuickReference instead.
// SDL3 API Quick Reference
//
// https://libsdl.org/
//
// The latest version of this document can be found at https://wiki.libsdl.org/SDL3/QuickReference
// Based on SDL version 3.1.7
//
// This can be useful in an IDE with search and syntax highlighting.
//
// Original idea for this document came from Dan Bechard (thanks!)
// ASCII art generated by: https://patorjk.com/software/taag/#p=display&f=ANSI%20Shadow (with modified 'S' for readability)
// XX XXX XX XX XXXXXXXX
// XX XXXX XX XX XX
// XX XX XX XX XX XX
// XX XX XX XX XX XX
// XX XX XXXX XX XX
bool SDL_Init(SDL_InitFlags flags); // Initialize the SDL library.
bool SDL_InitSubSystem(SDL_InitFlags flags); // Compatibility function to initialize the SDL library.
void SDL_QuitSubSystem(SDL_InitFlags flags); // Shut down specific SDL subsystems.
// Get a mask of the specified subsystems which are currently initialized.
SDL_InitFlags SDL_WasInit(SDL_InitFlags flags); void SDL_Quit(void); // Clean up all initialized subsystems.
bool SDL_IsMainThread(void); // Return whether this is the main thread.
bool SDL_RunOnMainThread(SDL_MainThreadCallback callback, void *userdata, bool wait_complete); // Call a function on the main thread during event processing.
bool SDL_SetAppMetadata(const char *appname, const char *appversion, const char *appidentifier); // Specify basic metadata about your app.
bool SDL_SetAppMetadataProperty(const char *name, const char *value); // Specify metadata about your app through a set of properties.
const char * SDL_GetAppMetadataProperty(const char *name); // Get metadata about your app.
// XX XX XX XXX XX XXXXXXXX XXXXXX
// XX XX XX XXXX XX XX XX
// XXXXXXX XX XX XX XX XX XXXXXXX
// XX XX XX XX XX XX XX XX
// XX XX XX XX XXXX XX XXXXXX
bool SDL_SetHintWithPriority(const char *name, const char *value, SDL_HintPriority priority); // Set a hint with a specific priority.
bool SDL_SetHint(const char *name, const char *value); // Set a hint with normal priority.
bool SDL_ResetHint(const char *name); // Reset a hint to the default value.
void SDL_ResetHints(void); // Reset all hints to the default values.
const char * SDL_GetHint(const char *name); // Get the value of a hint.
bool SDL_GetHintBoolean(const char *name, bool default_value); // Get the boolean value of a hint variable.
bool SDL_AddHintCallback(const char *name, SDL_HintCallback callback, void *userdata); // Add a function to watch a particular hint.
void SDL_RemoveHintCallback(const char *name, SDL_HintCallback callback, void *userdata); // Remove a function watching a particular hint.
// XXXXXXX XXXXXX XXXXXX XXXXXX XXXXXX
// XX XX XX XX XX XX XX XX XX
// XXXXX XXXXXX XXXXXX XX XX XXXXXX
// XX XX XX XX XX XX XX XX XX
// XXXXXXX XX XX XX XX XXXXXX XX XX
bool SDL_SetError(const char *fmt, ... ...); // Set the SDL error message for the current thread.
bool SDL_SetErrorV(const char *fmt, va_list ap); // Set the SDL error message for the current thread.
bool SDL_OutOfMemory(void); // Set an error indicating that memory allocation failed.
const char * SDL_GetError(void); // Retrieve a message about the last error that occurred on the current thread.
bool SDL_ClearError(void); // Clear any previous error message for this thread.
// XXXXXX XXXXXX XXXXXX XXXXXX XXXXXXX XXXXXX XXXXXXXX XX XXXXXXX XXXXXX
// XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX
// XXXXXX XXXXXX XX XX XXXXXX XXXXX XXXXXX XX XX XXXXX XXXXXXX
// XX XX XX XX XX XX XX XX XX XX XX XX XX
// XX XX XX XXXXXX XX XXXXXXX XX XX XX XX XXXXXXX XXXXXX
void); // Get the global SDL properties.
SDL_PropertiesID SDL_GetGlobalProperties(void); // Create a group of properties.
SDL_PropertiesID SDL_CreateProperties(bool SDL_CopyProperties(SDL_PropertiesID src, SDL_PropertiesID dst); // Copy a group of properties.
bool SDL_LockProperties(SDL_PropertiesID props); // Lock a group of properties.
void SDL_UnlockProperties(SDL_PropertiesID props); // Unlock a group of properties.
bool SDL_SetPointerPropertyWithCleanup(SDL_PropertiesID props, const char *name, void *value, SDL_CleanupPropertyCallback cleanup, void *userdata); // Set a pointer property in a group of properties with a cleanup function that is called when the property is deleted.
bool SDL_SetPointerProperty(SDL_PropertiesID props, const char *name, void *value); // Set a pointer property in a group of properties.
bool SDL_SetStringProperty(SDL_PropertiesID props, const char *name, const char *value); // Set a string property in a group of properties.
bool SDL_SetNumberProperty(SDL_PropertiesID props, const char *name, Sint64 value); // Set an integer property in a group of properties.
bool SDL_SetFloatProperty(SDL_PropertiesID props, const char *name, float value); // Set a floating point property in a group of properties.
bool SDL_SetBooleanProperty(SDL_PropertiesID props, const char *name, bool value); // Set a boolean property in a group of properties.
bool SDL_HasProperty(SDL_PropertiesID props, const char *name); // Return whether a property exists in a group of properties.
const char *name); // Get the type of a property in a group of properties.
SDL_PropertyType SDL_GetPropertyType(SDL_PropertiesID props, void * SDL_GetPointerProperty(SDL_PropertiesID props, const char *name, void *default_value); // Get a pointer property from a group of properties.
const char * SDL_GetStringProperty(SDL_PropertiesID props, const char *name, const char *default_value); // Get a string property from a group of properties.
const char *name, Sint64 default_value); // Get a number property from a group of properties.
Sint64 SDL_GetNumberProperty(SDL_PropertiesID props, float SDL_GetFloatProperty(SDL_PropertiesID props, const char *name, float default_value); // Get a floating point property from a group of properties.
bool SDL_GetBooleanProperty(SDL_PropertiesID props, const char *name, bool default_value); // Get a boolean property from a group of properties.
bool SDL_ClearProperty(SDL_PropertiesID props, const char *name); // Clear a property from a group of properties.
bool SDL_EnumerateProperties(SDL_PropertiesID props, SDL_EnumeratePropertiesCallback callback, void *userdata); // Enumerate the properties contained in a group of properties.
void SDL_DestroyProperties(SDL_PropertiesID props); // Destroy a group of properties.
// XX XXXXXX XXXXXX
// XX XX XX XX
// XX XX XX XX XXX
// XX XX XX XX XX
// XXXXXXX XXXXXX XXXXXX
void SDL_SetLogPriorities(SDL_LogPriority priority); // Set the priority of all log categories.
void SDL_SetLogPriority(int category, SDL_LogPriority priority); // Set the priority of a particular log category.
int category); // Get the priority of a particular log category.
SDL_LogPriority SDL_GetLogPriority(void SDL_ResetLogPriorities(void); // Reset all priorities to default.
bool SDL_SetLogPriorityPrefix(SDL_LogPriority priority, const char *prefix); // Set the text prepended to log messages of a given priority.
void SDL_Log(const char *fmt, ... ...); // Log a message with SDL_LOG_CATEGORY_APPLICATION and SDL_LOG_PRIORITY_INFO.
void SDL_LogTrace(int category, const char *fmt, ... ...); // Log a message with SDL_LOG_PRIORITY_TRACE.
void SDL_LogVerbose(int category, const char *fmt, ... ...); // Log a message with SDL_LOG_PRIORITY_VERBOSE.
void SDL_LogDebug(int category, const char *fmt, ... ...); // Log a message with SDL_LOG_PRIORITY_DEBUG.
void SDL_LogInfo(int category, const char *fmt, ... ...); // Log a message with SDL_LOG_PRIORITY_INFO.
void SDL_LogWarn(int category, const char *fmt, ... ...); // Log a message with SDL_LOG_PRIORITY_WARN.
void SDL_LogError(int category, const char *fmt, ... ...); // Log a message with SDL_LOG_PRIORITY_ERROR.
void SDL_LogCritical(int category, const char *fmt, ... ...); // Log a message with SDL_LOG_PRIORITY_CRITICAL.
void SDL_LogMessage(int category, SDL_LogPriority priority, const char *fmt, ... ...); // Log a message with the specified category and priority.
void SDL_LogMessageV(int category, SDL_LogPriority priority, const char *fmt, va_list ap); // Log a message with the specified category and priority.
void); // Get the default log output function.
SDL_LogOutputFunction SDL_GetDefaultLogOutputFunction(void SDL_GetLogOutputFunction(SDL_LogOutputFunction *callback, void **userdata); // Get the current log output function.
void SDL_SetLogOutputFunction(SDL_LogOutputFunction callback, void *userdata); // Replace the default log output function with one of your own.
// XX XX XX XXXXXX XXXXXXX XXXXXX
// XX XX XX XX XX XX XX XX
// XX XX XX XX XX XXXXX XX XX
// XX XX XX XX XX XX XX XX
// XXXX XX XXXXXX XXXXXXX XXXXXX
int SDL_GetNumVideoDrivers(void); // Get the number of video drivers compiled into SDL.
const char * SDL_GetVideoDriver(int index); // Get the name of a built in video driver.
const char * SDL_GetCurrentVideoDriver(void); // Get the name of the currently initialized video driver.
void); // Get the current system theme.
SDL_SystemTheme SDL_GetSystemTheme(int *count); // Get a list of currently connected displays.
SDL_DisplayID * SDL_GetDisplays(void); // Return the primary display.
SDL_DisplayID SDL_GetPrimaryDisplay(// Get the properties associated with a display.
SDL_PropertiesID SDL_GetDisplayProperties(SDL_DisplayID displayID); const char * SDL_GetDisplayName(SDL_DisplayID displayID); // Get the name of a display in UTF-8 encoding.
bool SDL_GetDisplayBounds(SDL_DisplayID displayID, SDL_Rect *rect); // Get the desktop area represented by a display.
bool SDL_GetDisplayUsableBounds(SDL_DisplayID displayID, SDL_Rect *rect); // Get the usable desktop area represented by a display, in screen coordinates.
// Get the orientation of a display when it is unrotated.
SDL_DisplayOrientation SDL_GetNaturalDisplayOrientation(SDL_DisplayID displayID); // Get the orientation of a display.
SDL_DisplayOrientation SDL_GetCurrentDisplayOrientation(SDL_DisplayID displayID); float SDL_GetDisplayContentScale(SDL_DisplayID displayID); // Get the content scale of a display.
int *count); // Get a list of fullscreen display modes available on a display.
SDL_DisplayMode ** SDL_GetFullscreenDisplayModes(SDL_DisplayID displayID, bool SDL_GetClosestFullscreenDisplayMode(SDL_DisplayID displayID, int w, int h, float refresh_rate, bool include_high_density_modes, SDL_DisplayMode *closest); // Get the closest match to the requested display mode.
const SDL_DisplayMode * SDL_GetDesktopDisplayMode(SDL_DisplayID displayID); // Get information about the desktop's display mode.
const SDL_DisplayMode * SDL_GetCurrentDisplayMode(SDL_DisplayID displayID); // Get information about the current display mode.
const SDL_Point *point); // Get the display containing a point.
SDL_DisplayID SDL_GetDisplayForPoint(const SDL_Rect *rect); // Get the display primarily containing a rect.
SDL_DisplayID SDL_GetDisplayForRect(// Get the display associated with a window.
SDL_DisplayID SDL_GetDisplayForWindow(SDL_Window *window); float SDL_GetWindowPixelDensity(SDL_Window *window); // Get the pixel density of a window.
float SDL_GetWindowDisplayScale(SDL_Window *window); // Get the content display scale relative to a window's pixel size.
bool SDL_SetWindowFullscreenMode(SDL_Window *window, const SDL_DisplayMode *mode); // Set the display mode to use when a window is visible and fullscreen.
const SDL_DisplayMode * SDL_GetWindowFullscreenMode(SDL_Window *window); // Query the display mode to use when a window is visible at fullscreen.
void * SDL_GetWindowICCProfile(SDL_Window *window, size_t *size); // Get the raw ICC profile data for the screen the window is currently on.
// Get the pixel format associated with the window.
SDL_PixelFormat SDL_GetWindowPixelFormat(SDL_Window *window); int *count); // Get a list of valid windows.
SDL_Window ** SDL_GetWindows(const char *title, int w, int h, SDL_WindowFlags flags); // Create a window with the specified dimensions and flags.
SDL_Window * SDL_CreateWindow(int offset_x, int offset_y, int w, int h, SDL_WindowFlags flags); // Create a child popup window of the specified parent window.
SDL_Window * SDL_CreatePopupWindow(SDL_Window *parent, // Create a window with the specified properties.
SDL_Window * SDL_CreateWindowWithProperties(SDL_PropertiesID props); // Get the numeric ID of a window.
SDL_WindowID SDL_GetWindowID(SDL_Window *window); // Get a window from a stored ID.
SDL_Window * SDL_GetWindowFromID(SDL_WindowID id); // Get parent of a window.
SDL_Window * SDL_GetWindowParent(SDL_Window *window); // Get the properties associated with a window.
SDL_PropertiesID SDL_GetWindowProperties(SDL_Window *window); // Get the window flags.
SDL_WindowFlags SDL_GetWindowFlags(SDL_Window *window); bool SDL_SetWindowTitle(SDL_Window *window, const char *title); // Set the title of a window.
const char * SDL_GetWindowTitle(SDL_Window *window); // Get the title of a window.
bool SDL_SetWindowIcon(SDL_Window *window, SDL_Surface *icon); // Set the icon for a window.
bool SDL_SetWindowPosition(SDL_Window *window, int x, int y); // Request that the window's position be set.
bool SDL_GetWindowPosition(SDL_Window *window, int *x, int *y); // Get the position of a window.
bool SDL_SetWindowSize(SDL_Window *window, int w, int h); // Request that the size of a window's client area be set.
bool SDL_GetWindowSize(SDL_Window *window, int *w, int *h); // Get the size of a window's client area.
bool SDL_GetWindowSafeArea(SDL_Window *window, SDL_Rect *rect); // Get the safe area for this window.
bool SDL_SetWindowAspectRatio(SDL_Window *window, float min_aspect, float max_aspect); // Request that the aspect ratio of a window's client area be set.
bool SDL_GetWindowAspectRatio(SDL_Window *window, float *min_aspect, float *max_aspect); // Get the size of a window's client area.
bool SDL_GetWindowBordersSize(SDL_Window *window, int *top, int *left, int *bottom, int *right); // Get the size of a window's borders (decorations) around the client area.
bool SDL_GetWindowSizeInPixels(SDL_Window *window, int *w, int *h); // Get the size of a window's client area, in pixels.
bool SDL_SetWindowMinimumSize(SDL_Window *window, int min_w, int min_h); // Set the minimum size of a window's client area.
bool SDL_GetWindowMinimumSize(SDL_Window *window, int *w, int *h); // Get the minimum size of a window's client area.
bool SDL_SetWindowMaximumSize(SDL_Window *window, int max_w, int max_h); // Set the maximum size of a window's client area.
bool SDL_GetWindowMaximumSize(SDL_Window *window, int *w, int *h); // Get the maximum size of a window's client area.
bool SDL_SetWindowBordered(SDL_Window *window, bool bordered); // Set the border state of a window.
bool SDL_SetWindowResizable(SDL_Window *window, bool resizable); // Set the user-resizable state of a window.
bool SDL_SetWindowAlwaysOnTop(SDL_Window *window, bool on_top); // Set the window to always be above the others.
bool SDL_ShowWindow(SDL_Window *window); // Show a window.
bool SDL_HideWindow(SDL_Window *window); // Hide a window.
bool SDL_RaiseWindow(SDL_Window *window); // Request that a window be raised above other windows and gain the input focus.
bool SDL_MaximizeWindow(SDL_Window *window); // Request that the window be made as large as possible.
bool SDL_MinimizeWindow(SDL_Window *window); // Request that the window be minimized to an iconic representation.
bool SDL_RestoreWindow(SDL_Window *window); // Request that the size and position of a minimized or maximized window be restored.
bool SDL_SetWindowFullscreen(SDL_Window *window, bool fullscreen); // Request that the window's fullscreen state be changed.
bool SDL_SyncWindow(SDL_Window *window); // Block until any pending window state is finalized.
bool SDL_WindowHasSurface(SDL_Window *window); // Return whether the window has a surface associated with it.
// Get the SDL surface associated with the window.
SDL_Surface * SDL_GetWindowSurface(SDL_Window *window); bool SDL_SetWindowSurfaceVSync(SDL_Window *window, int vsync); // Toggle VSync for the window surface.
bool SDL_GetWindowSurfaceVSync(SDL_Window *window, int *vsync); // Get VSync for the window surface.
bool SDL_UpdateWindowSurface(SDL_Window *window); // Copy the window surface to the screen.
bool SDL_UpdateWindowSurfaceRects(SDL_Window *window, const SDL_Rect *rects, int numrects); // Copy areas of the window surface to the screen.
bool SDL_DestroyWindowSurface(SDL_Window *window); // Destroy the surface associated with the window.
bool SDL_SetWindowKeyboardGrab(SDL_Window *window, bool grabbed); // Set a window's keyboard grab mode.
bool SDL_SetWindowMouseGrab(SDL_Window *window, bool grabbed); // Set a window's mouse grab mode.
bool SDL_GetWindowKeyboardGrab(SDL_Window *window); // Get a window's keyboard grab mode.
bool SDL_GetWindowMouseGrab(SDL_Window *window); // Get a window's mouse grab mode.
void); // Get the window that currently has an input grab enabled.
SDL_Window * SDL_GetGrabbedWindow(bool SDL_SetWindowMouseRect(SDL_Window *window, const SDL_Rect *rect); // Confines the cursor to the specified area of a window.
const SDL_Rect * SDL_GetWindowMouseRect(SDL_Window *window); // Get the mouse confinement rectangle of a window.
bool SDL_SetWindowOpacity(SDL_Window *window, float opacity); // Set the opacity for a window.
float SDL_GetWindowOpacity(SDL_Window *window); // Get the opacity of a window.
bool SDL_SetWindowParent(SDL_Window *window, SDL_Window *parent); // Set the window as a child of a parent window.
bool SDL_SetWindowModal(SDL_Window *window, bool modal); // Toggle the state of the window as modal.
bool SDL_SetWindowFocusable(SDL_Window *window, bool focusable); // Set whether the window may have input focus.
bool SDL_ShowWindowSystemMenu(SDL_Window *window, int x, int y); // Display the system-level window menu.
bool SDL_SetWindowHitTest(SDL_Window *window, SDL_HitTest callback, void *callback_data); // Provide a callback that decides if a window region has special properties.
bool SDL_SetWindowShape(SDL_Window *window, SDL_Surface *shape); // Set the shape of a transparent window.
bool SDL_FlashWindow(SDL_Window *window, SDL_FlashOperation operation); // Request a window to demand attention from the user.
void SDL_DestroyWindow(SDL_Window *window); // Destroy a window.
bool SDL_ScreenSaverEnabled(void); // Check whether the screensaver is currently enabled.
bool SDL_EnableScreenSaver(void); // Allow the screen to be blanked by a screen saver.
bool SDL_DisableScreenSaver(void); // Prevent the screen from being blanked by a screen saver.
bool SDL_GL_LoadLibrary(const char *path); // Dynamically load an OpenGL library.
const char *proc); // Get an OpenGL function by name.
SDL_FunctionPointer SDL_GL_GetProcAddress(const char *proc); // Get an EGL library function by name.
SDL_FunctionPointer SDL_EGL_GetProcAddress(void SDL_GL_UnloadLibrary(void); // Unload the OpenGL library previously loaded by SDL_GL_LoadLibrary().
bool SDL_GL_ExtensionSupported(const char *extension); // Check if an OpenGL extension is supported for the current context.
void SDL_GL_ResetAttributes(void); // Reset all previously set OpenGL context attributes to their default values.
bool SDL_GL_SetAttribute(SDL_GLAttr attr, int value); // Set an OpenGL window attribute before window creation.
bool SDL_GL_GetAttribute(SDL_GLAttr attr, int *value); // Get the actual value for an attribute from the current context.
// Create an OpenGL context for an OpenGL window, and make it current.
SDL_GLContext SDL_GL_CreateContext(SDL_Window *window); bool SDL_GL_MakeCurrent(SDL_Window *window, SDL_GLContext context); // Set up an OpenGL context for rendering into an OpenGL window.
void); // Get the currently active OpenGL window.
SDL_Window * SDL_GL_GetCurrentWindow(void); // Get the currently active OpenGL context.
SDL_GLContext SDL_GL_GetCurrentContext(void); // Get the currently active EGL display.
SDL_EGLDisplay SDL_EGL_GetCurrentDisplay(void); // Get the currently active EGL config.
SDL_EGLConfig SDL_EGL_GetCurrentConfig(// Get the EGL surface associated with the window.
SDL_EGLSurface SDL_EGL_GetWindowSurface(SDL_Window *window); void SDL_EGL_SetAttributeCallbacks(SDL_EGLAttribArrayCallback platformAttribCallback, SDL_EGLIntArrayCallback surfaceAttribCallback, SDL_EGLIntArrayCallback contextAttribCallback, void *userdata); // Sets the callbacks for defining custom EGLAttrib arrays for EGL initialization.
bool SDL_GL_SetSwapInterval(int interval); // Set the swap interval for the current OpenGL context.
bool SDL_GL_GetSwapInterval(int *interval); // Get the swap interval for the current OpenGL context.
bool SDL_GL_SwapWindow(SDL_Window *window); // Update a window with OpenGL rendering.
bool SDL_GL_DestroyContext(SDL_GLContext context); // Delete an OpenGL context.
// XXXXXXX XX XX XXXXXXX XXX XX XXXXXXXX XXXXXX
// XX XX XX XX XXXX XX XX XX
// XXXXX XX XX XXXXX XX XX XX XX XXXXXXX
// XX XX XX XX XX XX XX XX XX
// XXXXXXX XXXX XXXXXXX XX XXXX XX XXXXXX
void SDL_PumpEvents(void); // Pump the event loop, gathering events from the input devices.
int SDL_PeepEvents(SDL_Event *events, int numevents, SDL_EventAction action, Uint32 minType, Uint32 maxType); // Check the event queue for messages and optionally return them.
bool SDL_HasEvent(Uint32 type); // Check for the existence of a certain event type in the event queue.
bool SDL_HasEvents(Uint32 minType, Uint32 maxType); // Check for the existence of certain event types in the event queue.
void SDL_FlushEvent(Uint32 type); // Clear events of a specific type from the event queue.
void SDL_FlushEvents(Uint32 minType, Uint32 maxType); // Clear events of a range of types from the event queue.
bool SDL_PollEvent(SDL_Event *event); // Poll for currently pending events.
bool SDL_WaitEvent(SDL_Event *event); // Wait indefinitely for the next available event.
bool SDL_WaitEventTimeout(SDL_Event *event, Sint32 timeoutMS); // Wait until the specified timeout (in milliseconds) for the next available event.
bool SDL_PushEvent(SDL_Event *event); // Add an event to the event queue.
void SDL_SetEventFilter(SDL_EventFilter filter, void *userdata); // Set up a filter to process all events before they change internal state and are posted to the internal event queue.
bool SDL_GetEventFilter(SDL_EventFilter *filter, void **userdata); // Query the current event filter.
bool SDL_AddEventWatch(SDL_EventFilter filter, void *userdata); // Add a callback to be triggered when an event is added to the event queue.
void SDL_RemoveEventWatch(SDL_EventFilter filter, void *userdata); // Remove an event watch callback added with SDL_AddEventWatch().
void SDL_FilterEvents(SDL_EventFilter filter, void *userdata); // Run a specific filter function on the current event queue, removing any events for which the filter returns false.
void SDL_SetEventEnabled(Uint32 type, bool enabled); // Set the state of processing events by type.
bool SDL_EventEnabled(Uint32 type); // Query the state of processing events by type.
int numevents); // Allocate a set of user-defined events, and return the beginning event number for that set of events.
Uint32 SDL_RegisterEvents(const SDL_Event *event); // Get window associated with an event.
SDL_Window * SDL_GetWindowFromEvent(
// XX XX XXXXXXX XX XX XXXXXX XXXXXX XXXXX XXXXXX XXXXXX
// XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX
// XXXXX XXXXX XXXX XXXXXX XX XX XXXXXXX XXXXXX XX XX
// XX XX XX XX XX XX XX XX XX XX XX XX XX XX
// XX XX XXXXXXX XX XXXXXX XXXXXX XX XX XX XX XXXXXX
bool SDL_HasKeyboard(void); // Return whether a keyboard is currently connected.
int *count); // Get a list of currently connected keyboards.
SDL_KeyboardID * SDL_GetKeyboards(const char * SDL_GetKeyboardNameForID(SDL_KeyboardID instance_id); // Get the name of a keyboard.
void); // Query the window which currently has keyboard focus.
SDL_Window * SDL_GetKeyboardFocus(const bool * SDL_GetKeyboardState(int *numkeys); // Get a snapshot of the current state of the keyboard.
void SDL_ResetKeyboard(void); // Clear the state of the keyboard.
void); // Get the current key modifier state for the keyboard.
SDL_Keymod SDL_GetModState(void SDL_SetModState(SDL_Keymod modstate); // Set the current key modifier state for the keyboard.
bool key_event); // Get the key code corresponding to the given scancode according to the current keyboard layout.
SDL_Keycode SDL_GetKeyFromScancode(SDL_Scancode scancode, SDL_Keymod modstate, // Get the scancode corresponding to the given key code according to the current keyboard layout.
SDL_Scancode SDL_GetScancodeFromKey(SDL_Keycode key, SDL_Keymod *modstate); bool SDL_SetScancodeName(SDL_Scancode scancode, const char *name); // Set a human-readable name for a scancode.
const char * SDL_GetScancodeName(SDL_Scancode scancode); // Get a human-readable name for a scancode.
const char *name); // Get a scancode from a human-readable name.
SDL_Scancode SDL_GetScancodeFromName(const char * SDL_GetKeyName(SDL_Keycode key); // Get a human-readable name for a key.
const char *name); // Get a key code from a human-readable name.
SDL_Keycode SDL_GetKeyFromName(bool SDL_StartTextInput(SDL_Window *window); // Start accepting Unicode text input events in a window.
bool SDL_StartTextInputWithProperties(SDL_Window *window, SDL_PropertiesID props); // Start accepting Unicode text input events in a window, with properties describing the input.
bool SDL_TextInputActive(SDL_Window *window); // Check whether or not Unicode text input events are enabled for a window.
bool SDL_StopTextInput(SDL_Window *window); // Stop receiving any text input events in a window.
bool SDL_ClearComposition(SDL_Window *window); // Dismiss the composition window/IME without disabling the subsystem.
bool SDL_SetTextInputArea(SDL_Window *window, const SDL_Rect *rect, int cursor); // Set the area used to type Unicode text input.
bool SDL_GetTextInputArea(SDL_Window *window, SDL_Rect *rect, int *cursor); // Get the area used to type Unicode text input.
bool SDL_HasScreenKeyboardSupport(void); // Check whether the platform has screen keyboard support.
bool SDL_ScreenKeyboardShown(SDL_Window *window); // Check whether the screen keyboard is shown for given window.
// XXX XXX XXXXXX XX XX XXXXXX XXXXXXX
// XXXX XXXX XX XX XX XX XX XX
// XX XXXX XX XX XX XX XX XXXXXXX XXXXX
// XX XX XX XX XX XX XX XX XX
// XX XX XXXXXX XXXXXX XXXXXX XXXXXXX
bool SDL_HasMouse(void); // Return whether a mouse is currently connected.
int *count); // Get a list of currently connected mice.
SDL_MouseID * SDL_GetMice(const char * SDL_GetMouseNameForID(SDL_MouseID instance_id); // Get the name of a mouse.
void); // Get the window which currently has mouse focus.
SDL_Window * SDL_GetMouseFocus(float *x, float *y); // Query SDL's cache for the synchronous mouse button state and the window-relative SDL-cursor position.
SDL_MouseButtonFlags SDL_GetMouseState(float *x, float *y); // Query the platform for the asynchronous mouse button state and the desktop-relative platform-cursor position.
SDL_MouseButtonFlags SDL_GetGlobalMouseState(float *x, float *y); // Query SDL's cache for the synchronous mouse button state and accumulated mouse delta since last call.
SDL_MouseButtonFlags SDL_GetRelativeMouseState(void SDL_WarpMouseInWindow(SDL_Window *window, float x, float y); // Move the mouse cursor to the given position within the window.
bool SDL_WarpMouseGlobal(float x, float y); // Move the mouse to the given position in global screen space.
bool SDL_SetWindowRelativeMouseMode(SDL_Window *window, bool enabled); // Set relative mouse mode for a window.
bool SDL_GetWindowRelativeMouseMode(SDL_Window *window); // Query whether relative mouse mode is enabled for a window.
bool SDL_CaptureMouse(bool enabled); // Capture the mouse and to track input outside an SDL window.
const Uint8 *data, const Uint8 *mask, int w, int h, int hot_x, int hot_y); // Create a cursor using the specified bitmap data and mask (in MSB format).
SDL_Cursor * SDL_CreateCursor(int hot_x, int hot_y); // Create a color cursor.
SDL_Cursor * SDL_CreateColorCursor(SDL_Surface *surface, // Create a system cursor.
SDL_Cursor * SDL_CreateSystemCursor(SDL_SystemCursor id); bool SDL_SetCursor(SDL_Cursor *cursor); // Set the active cursor.
void); // Get the active cursor.
SDL_Cursor * SDL_GetCursor(void); // Get the default cursor.
SDL_Cursor * SDL_GetDefaultCursor(void SDL_DestroyCursor(SDL_Cursor *cursor); // Free a previously-created cursor.
bool SDL_ShowCursor(void); // Show the cursor.
bool SDL_HideCursor(void); // Hide the cursor.
bool SDL_CursorVisible(void); // Return whether the cursor is currently being shown.
// XXXXXXXX XXXXXX XX XX XXXXXX XX XX
// XX XX XX XX XX XX XX XX
// XX XX XX XX XX XX XXXXXXX
// XX XX XX XX XX XX XX XX
// XX XXXXXX XXXXXX XXXXXX XX XX
int *count); // Get a list of registered touch devices.
SDL_TouchID * SDL_GetTouchDevices(const char * SDL_GetTouchDeviceName(SDL_TouchID touchID); // Get the touch device name as reported from the driver.
// Get the type of the given touch device.
SDL_TouchDeviceType SDL_GetTouchDeviceType(SDL_TouchID touchID); int *count); // Get a list of active fingers for a given touch device.
SDL_Finger ** SDL_GetTouchFingers(SDL_TouchID touchID,
// XXXXXX XXXXX XXX XXX XXXXXXX XXXXXX XXXXX XXXXXX
// XX XX XX XXXX XXXX XX XX XX XX XX XX XX
// XX XXX XXXXXXX XX XXXX XX XXXXX XXXXXX XXXXXXX XX XX
// XX XX XX XX XX XX XX XX XX XX XX XX XX
// XXXXXX XX XX XX XX XXXXXXX XX XX XX XXXXXX
int SDL_AddGamepadMapping(const char *mapping); // Add support for gamepads that SDL is unaware of or change the binding of an existing gamepad.
int SDL_AddGamepadMappingsFromIO(SDL_IOStream *src, bool closeio); // Load a set of gamepad mappings from an SDL_IOStream.
int SDL_AddGamepadMappingsFromFile(const char *file); // Load a set of gamepad mappings from a file.
bool SDL_ReloadGamepadMappings(void); // Reinitialize the SDL mapping database to its initial state.
char ** SDL_GetGamepadMappings(int *count); // Get the current gamepad mappings.
char * SDL_GetGamepadMappingForGUID(SDL_GUID guid); // Get the gamepad mapping string for a given GUID.
char * SDL_GetGamepadMapping(SDL_Gamepad *gamepad); // Get the current mapping of a gamepad.
bool SDL_SetGamepadMapping(SDL_JoystickID instance_id, const char *mapping); // Set the current mapping of a joystick or gamepad.
bool SDL_HasGamepad(void); // Return whether a gamepad is currently connected.
int *count); // Get a list of currently connected gamepads.
SDL_JoystickID * SDL_GetGamepads(bool SDL_IsGamepad(SDL_JoystickID instance_id); // Check if the given joystick is supported by the gamepad interface.
const char * SDL_GetGamepadNameForID(SDL_JoystickID instance_id); // Get the implementation dependent name of a gamepad.
const char * SDL_GetGamepadPathForID(SDL_JoystickID instance_id); // Get the implementation dependent path of a gamepad.
int SDL_GetGamepadPlayerIndexForID(SDL_JoystickID instance_id); // Get the player index of a gamepad.
// Get the implementation-dependent GUID of a gamepad.
SDL_GUID SDL_GetGamepadGUIDForID(SDL_JoystickID instance_id); // Get the USB vendor ID of a gamepad, if available.
Uint16 SDL_GetGamepadVendorForID(SDL_JoystickID instance_id); // Get the USB product ID of a gamepad, if available.
Uint16 SDL_GetGamepadProductForID(SDL_JoystickID instance_id); // Get the product version of a gamepad, if available.
Uint16 SDL_GetGamepadProductVersionForID(SDL_JoystickID instance_id); // Get the type of a gamepad.
SDL_GamepadType SDL_GetGamepadTypeForID(SDL_JoystickID instance_id); // Get the type of a gamepad, ignoring any mapping override.
SDL_GamepadType SDL_GetRealGamepadTypeForID(SDL_JoystickID instance_id); char * SDL_GetGamepadMappingForID(SDL_JoystickID instance_id); // Get the mapping of a gamepad.
// Open a gamepad for use.
SDL_Gamepad * SDL_OpenGamepad(SDL_JoystickID instance_id); // Get the SDL_Gamepad associated with a joystick instance ID, if it has been opened.
SDL_Gamepad * SDL_GetGamepadFromID(SDL_JoystickID instance_id); int player_index); // Get the SDL_Gamepad associated with a player index.
SDL_Gamepad * SDL_GetGamepadFromPlayerIndex(// Get the properties associated with an opened gamepad.
SDL_PropertiesID SDL_GetGamepadProperties(SDL_Gamepad *gamepad); // Get the instance ID of an opened gamepad.
SDL_JoystickID SDL_GetGamepadID(SDL_Gamepad *gamepad); const char * SDL_GetGamepadName(SDL_Gamepad *gamepad); // Get the implementation-dependent name for an opened gamepad.
const char * SDL_GetGamepadPath(SDL_Gamepad *gamepad); // Get the implementation-dependent path for an opened gamepad.
// Get the type of an opened gamepad.
SDL_GamepadType SDL_GetGamepadType(SDL_Gamepad *gamepad); // Get the type of an opened gamepad, ignoring any mapping override.
SDL_GamepadType SDL_GetRealGamepadType(SDL_Gamepad *gamepad); int SDL_GetGamepadPlayerIndex(SDL_Gamepad *gamepad); // Get the player index of an opened gamepad.
bool SDL_SetGamepadPlayerIndex(SDL_Gamepad *gamepad, int player_index); // Set the player index of an opened gamepad.
// Get the USB vendor ID of an opened gamepad, if available.
Uint16 SDL_GetGamepadVendor(SDL_Gamepad *gamepad); // Get the USB product ID of an opened gamepad, if available.
Uint16 SDL_GetGamepadProduct(SDL_Gamepad *gamepad); // Get the product version of an opened gamepad, if available.
Uint16 SDL_GetGamepadProductVersion(SDL_Gamepad *gamepad); // Get the firmware version of an opened gamepad, if available.
Uint16 SDL_GetGamepadFirmwareVersion(SDL_Gamepad *gamepad); const char * SDL_GetGamepadSerial(SDL_Gamepad *gamepad); // Get the serial number of an opened gamepad, if available.
// Get the Steam Input handle of an opened gamepad, if available.
Uint64 SDL_GetGamepadSteamHandle(SDL_Gamepad *gamepad); // Get the connection state of a gamepad.
SDL_JoystickConnectionState SDL_GetGamepadConnectionState(SDL_Gamepad *gamepad); int *percent); // Get the battery state of a gamepad.
SDL_PowerState SDL_GetGamepadPowerInfo(SDL_Gamepad *gamepad, bool SDL_GamepadConnected(SDL_Gamepad *gamepad); // Check if a gamepad has been opened and is currently connected.
// Get the underlying joystick from a gamepad.
SDL_Joystick * SDL_GetGamepadJoystick(SDL_Gamepad *gamepad); void SDL_SetGamepadEventsEnabled(bool enabled); // Set the state of gamepad event processing.
bool SDL_GamepadEventsEnabled(void); // Query the state of gamepad event processing.
int *count); // Get the SDL joystick layer bindings for a gamepad.
SDL_GamepadBinding ** SDL_GetGamepadBindings(SDL_Gamepad *gamepad, void SDL_UpdateGamepads(void); // Manually pump gamepad updates if not using the loop.
const char *str); // Convert a string into SDL_GamepadType enum.
SDL_GamepadType SDL_GetGamepadTypeFromString(const char * SDL_GetGamepadStringForType(SDL_GamepadType type); // Convert from an SDL_GamepadType enum to a string.
const char *str); // Convert a string into SDL_GamepadAxis enum.
SDL_GamepadAxis SDL_GetGamepadAxisFromString(const char * SDL_GetGamepadStringForAxis(SDL_GamepadAxis axis); // Convert from an SDL_GamepadAxis enum to a string.
bool SDL_GamepadHasAxis(SDL_Gamepad *gamepad, SDL_GamepadAxis axis); // Query whether a gamepad has a given axis.
// Get the current state of an axis control on a gamepad.
Sint16 SDL_GetGamepadAxis(SDL_Gamepad *gamepad, SDL_GamepadAxis axis); const char *str); // Convert a string into an SDL_GamepadButton enum.
SDL_GamepadButton SDL_GetGamepadButtonFromString(const char * SDL_GetGamepadStringForButton(SDL_GamepadButton button); // Convert from an SDL_GamepadButton enum to a string.
bool SDL_GamepadHasButton(SDL_Gamepad *gamepad, SDL_GamepadButton button); // Query whether a gamepad has a given button.
bool SDL_GetGamepadButton(SDL_Gamepad *gamepad, SDL_GamepadButton button); // Get the current state of a button on a gamepad.
// Get the label of a button on a gamepad.
SDL_GamepadButtonLabel SDL_GetGamepadButtonLabelForType(SDL_GamepadType type, SDL_GamepadButton button); // Get the label of a button on a gamepad.
SDL_GamepadButtonLabel SDL_GetGamepadButtonLabel(SDL_Gamepad *gamepad, SDL_GamepadButton button); int SDL_GetNumGamepadTouchpads(SDL_Gamepad *gamepad); // Get the number of touchpads on a gamepad.
int SDL_GetNumGamepadTouchpadFingers(SDL_Gamepad *gamepad, int touchpad); // Get the number of supported simultaneous fingers on a touchpad on a game gamepad.
bool SDL_GetGamepadTouchpadFinger(SDL_Gamepad *gamepad, int touchpad, int finger, bool *down, float *x, float *y, float *pressure); // Get the current state of a finger on a touchpad on a gamepad.
bool SDL_GamepadHasSensor(SDL_Gamepad *gamepad, SDL_SensorType type); // Return whether a gamepad has a particular sensor.
bool SDL_SetGamepadSensorEnabled(SDL_Gamepad *gamepad, SDL_SensorType type, bool enabled); // Set whether data reporting for a gamepad sensor is enabled.
bool SDL_GamepadSensorEnabled(SDL_Gamepad *gamepad, SDL_SensorType type); // Query whether sensor data reporting is enabled for a gamepad.
float SDL_GetGamepadSensorDataRate(SDL_Gamepad *gamepad, SDL_SensorType type); // Get the data rate (number of events per second) of a gamepad sensor.
bool SDL_GetGamepadSensorData(SDL_Gamepad *gamepad, SDL_SensorType type, float *data, int num_values); // Get the current state of a gamepad sensor.
bool SDL_RumbleGamepad(SDL_Gamepad *gamepad, Uint16 low_frequency_rumble, Uint16 high_frequency_rumble, Uint32 duration_ms); // Start a rumble effect on a gamepad.
bool SDL_RumbleGamepadTriggers(SDL_Gamepad *gamepad, Uint16 left_rumble, Uint16 right_rumble, Uint32 duration_ms); // Start a rumble effect in the gamepad's triggers.
bool SDL_SetGamepadLED(SDL_Gamepad *gamepad, Uint8 red, Uint8 green, Uint8 blue); // Update a gamepad's LED color.
bool SDL_SendGamepadEffect(SDL_Gamepad *gamepad, const void *data, int size); // Send a gamepad specific effect packet.
void SDL_CloseGamepad(SDL_Gamepad *gamepad); // Close a gamepad previously opened with SDL_OpenGamepad().
const char * SDL_GetGamepadAppleSFSymbolsNameForButton(SDL_Gamepad *gamepad, SDL_GamepadButton button); // Return the sfSymbolsName for a given button on a gamepad on Apple platforms.
const char * SDL_GetGamepadAppleSFSymbolsNameForAxis(SDL_Gamepad *gamepad, SDL_GamepadAxis axis); // Return the sfSymbolsName for a given axis on a gamepad on Apple platforms.
// XX XXXXXX XX XX XXXXXX XXXXXXXX XX XXXXXX XX XX
// XX XX XX XX XX XX XX XX XX XX XX
// XX XX XX XXXX XXXXXXX XX XX XX XXXXX
// XX XX XX XX XX XX XX XX XX XX XX
// XXXXX XXXXXX XX XXXXXX XX XX XXXXXX XX XX
void SDL_LockJoysticks(void); // Locking for atomic access to the joystick API.
void SDL_UnlockJoysticks(void); // Unlocking for atomic access to the joystick API.
bool SDL_HasJoystick(void); // Return whether a joystick is currently connected.
int *count); // Get a list of currently connected joysticks.
SDL_JoystickID * SDL_GetJoysticks(const char * SDL_GetJoystickNameForID(SDL_JoystickID instance_id); // Get the implementation dependent name of a joystick.
const char * SDL_GetJoystickPathForID(SDL_JoystickID instance_id); // Get the implementation dependent path of a joystick.
int SDL_GetJoystickPlayerIndexForID(SDL_JoystickID instance_id); // Get the player index of a joystick.
// Get the implementation-dependent GUID of a joystick.
SDL_GUID SDL_GetJoystickGUIDForID(SDL_JoystickID instance_id); // Get the USB vendor ID of a joystick, if available.
Uint16 SDL_GetJoystickVendorForID(SDL_JoystickID instance_id); // Get the USB product ID of a joystick, if available.
Uint16 SDL_GetJoystickProductForID(SDL_JoystickID instance_id); // Get the product version of a joystick, if available.
Uint16 SDL_GetJoystickProductVersionForID(SDL_JoystickID instance_id); // Get the type of a joystick, if available.
SDL_JoystickType SDL_GetJoystickTypeForID(SDL_JoystickID instance_id); // Open a joystick for use.
SDL_Joystick * SDL_OpenJoystick(SDL_JoystickID instance_id); // Get the SDL_Joystick associated with an instance ID, if it has been opened.
SDL_Joystick * SDL_GetJoystickFromID(SDL_JoystickID instance_id); int player_index); // Get the SDL_Joystick associated with a player index.
SDL_Joystick * SDL_GetJoystickFromPlayerIndex(const SDL_VirtualJoystickDesc *desc); // Attach a new virtual joystick.
SDL_JoystickID SDL_AttachVirtualJoystick(bool SDL_DetachVirtualJoystick(SDL_JoystickID instance_id); // Detach a virtual joystick.
bool SDL_IsJoystickVirtual(SDL_JoystickID instance_id); // Query whether or not a joystick is virtual.
bool SDL_SetJoystickVirtualAxis(SDL_Joystick *joystick, int axis, Sint16 value); // Set the state of an axis on an opened virtual joystick.
bool SDL_SetJoystickVirtualBall(SDL_Joystick *joystick, int ball, Sint16 xrel, Sint16 yrel); // Generate ball motion on an opened virtual joystick.
bool SDL_SetJoystickVirtualButton(SDL_Joystick *joystick, int button, bool down); // Set the state of a button on an opened virtual joystick.
bool SDL_SetJoystickVirtualHat(SDL_Joystick *joystick, int hat, Uint8 value); // Set the state of a hat on an opened virtual joystick.
bool SDL_SetJoystickVirtualTouchpad(SDL_Joystick *joystick, int touchpad, int finger, bool down, float x, float y, float pressure); // Set touchpad finger state on an opened virtual joystick.
bool SDL_SendJoystickVirtualSensorData(SDL_Joystick *joystick, SDL_SensorType type, Uint64 sensor_timestamp, const float *data, int num_values); // Send a sensor update for an opened virtual joystick.
// Get the properties associated with a joystick.
SDL_PropertiesID SDL_GetJoystickProperties(SDL_Joystick *joystick); const char * SDL_GetJoystickName(SDL_Joystick *joystick); // Get the implementation dependent name of a joystick.
const char * SDL_GetJoystickPath(SDL_Joystick *joystick); // Get the implementation dependent path of a joystick.
int SDL_GetJoystickPlayerIndex(SDL_Joystick *joystick); // Get the player index of an opened joystick.
bool SDL_SetJoystickPlayerIndex(SDL_Joystick *joystick, int player_index); // Set the player index of an opened joystick.
// Get the implementation-dependent GUID for the joystick.
SDL_GUID SDL_GetJoystickGUID(SDL_Joystick *joystick); // Get the USB vendor ID of an opened joystick, if available.
Uint16 SDL_GetJoystickVendor(SDL_Joystick *joystick); // Get the USB product ID of an opened joystick, if available.
Uint16 SDL_GetJoystickProduct(SDL_Joystick *joystick); // Get the product version of an opened joystick, if available.
Uint16 SDL_GetJoystickProductVersion(SDL_Joystick *joystick); // Get the firmware version of an opened joystick, if available.
Uint16 SDL_GetJoystickFirmwareVersion(SDL_Joystick *joystick); const char * SDL_GetJoystickSerial(SDL_Joystick *joystick); // Get the serial number of an opened joystick, if available.
// Get the type of an opened joystick.
SDL_JoystickType SDL_GetJoystickType(SDL_Joystick *joystick); void SDL_GetJoystickGUIDInfo(SDL_GUID guid, Uint16 *vendor, Uint16 *product, Uint16 *version, Uint16 *crc16); // Get the device information encoded in a SDL_GUID structure.
bool SDL_JoystickConnected(SDL_Joystick *joystick); // Get the status of a specified joystick.
// Get the instance ID of an opened joystick.
SDL_JoystickID SDL_GetJoystickID(SDL_Joystick *joystick); int SDL_GetNumJoystickAxes(SDL_Joystick *joystick); // Get the number of general axis controls on a joystick.
int SDL_GetNumJoystickBalls(SDL_Joystick *joystick); // Get the number of trackballs on a joystick.
int SDL_GetNumJoystickHats(SDL_Joystick *joystick); // Get the number of POV hats on a joystick.
int SDL_GetNumJoystickButtons(SDL_Joystick *joystick); // Get the number of buttons on a joystick.
void SDL_SetJoystickEventsEnabled(bool enabled); // Set the state of joystick event processing.
bool SDL_JoystickEventsEnabled(void); // Query the state of joystick event processing.
void SDL_UpdateJoysticks(void); // Update the current state of the open joysticks.
int axis); // Get the current state of an axis control on a joystick.
Sint16 SDL_GetJoystickAxis(SDL_Joystick *joystick, bool SDL_GetJoystickAxisInitialState(SDL_Joystick *joystick, int axis, Sint16 *state); // Get the initial state of an axis control on a joystick.
bool SDL_GetJoystickBall(SDL_Joystick *joystick, int ball, int *dx, int *dy); // Get the ball axis change since the last poll.
int hat); // Get the current state of a POV hat on a joystick.
Uint8 SDL_GetJoystickHat(SDL_Joystick *joystick, bool SDL_GetJoystickButton(SDL_Joystick *joystick, int button); // Get the current state of a button on a joystick.
bool SDL_RumbleJoystick(SDL_Joystick *joystick, Uint16 low_frequency_rumble, Uint16 high_frequency_rumble, Uint32 duration_ms); // Start a rumble effect.
bool SDL_RumbleJoystickTriggers(SDL_Joystick *joystick, Uint16 left_rumble, Uint16 right_rumble, Uint32 duration_ms); // Start a rumble effect in the joystick's triggers.
bool SDL_SetJoystickLED(SDL_Joystick *joystick, Uint8 red, Uint8 green, Uint8 blue); // Update a joystick's LED color.
bool SDL_SendJoystickEffect(SDL_Joystick *joystick, const void *data, int size); // Send a joystick specific effect packet.
void SDL_CloseJoystick(SDL_Joystick *joystick); // Close a joystick previously opened with SDL_OpenJoystick().
// Get the connection state of a joystick.
SDL_JoystickConnectionState SDL_GetJoystickConnectionState(SDL_Joystick *joystick); int *percent); // Get the battery state of a joystick.
SDL_PowerState SDL_GetJoystickPowerInfo(SDL_Joystick *joystick,
// XX XX XXXXX XXXXXX XXXXXXXX XX XXXXXX
// XX XX XX XX XX XX XX XX XX
// XXXXXXX XXXXXXX XXXXXX XX XX XX
// XX XX XX XX XX XX XX XX
// XX XX XX XX XX XX XX XXXXXX
int *count); // Get a list of currently connected haptic devices.
SDL_HapticID * SDL_GetHaptics(const char * SDL_GetHapticNameForID(SDL_HapticID instance_id); // Get the implementation dependent name of a haptic device.
// Open a haptic device for use.
SDL_Haptic * SDL_OpenHaptic(SDL_HapticID instance_id); // Get the SDL_Haptic associated with an instance ID, if it has been opened.
SDL_Haptic * SDL_GetHapticFromID(SDL_HapticID instance_id); // Get the instance ID of an opened haptic device.
SDL_HapticID SDL_GetHapticID(SDL_Haptic *haptic); const char * SDL_GetHapticName(SDL_Haptic *haptic); // Get the implementation dependent name of a haptic device.
bool SDL_IsMouseHaptic(void); // Query whether or not the current mouse has haptic capabilities.
void); // Try to open a haptic device from the current mouse.
SDL_Haptic * SDL_OpenHapticFromMouse(bool SDL_IsJoystickHaptic(SDL_Joystick *joystick); // Query if a joystick has haptic features.
// Open a haptic device for use from a joystick device.
SDL_Haptic * SDL_OpenHapticFromJoystick(SDL_Joystick *joystick); void SDL_CloseHaptic(SDL_Haptic *haptic); // Close a haptic device previously opened with SDL_OpenHaptic().
int SDL_GetMaxHapticEffects(SDL_Haptic *haptic); // Get the number of effects a haptic device can store.
int SDL_GetMaxHapticEffectsPlaying(SDL_Haptic *haptic); // Get the number of effects a haptic device can play at the same time.
// Get the haptic device's supported features in bitwise manner.
Uint32 SDL_GetHapticFeatures(SDL_Haptic *haptic); int SDL_GetNumHapticAxes(SDL_Haptic *haptic); // Get the number of haptic axes the device has.
bool SDL_HapticEffectSupported(SDL_Haptic *haptic, const SDL_HapticEffect *effect); // Check to see if an effect is supported by a haptic device.
int SDL_CreateHapticEffect(SDL_Haptic *haptic, const SDL_HapticEffect *effect); // Create a new haptic effect on a specified device.
bool SDL_UpdateHapticEffect(SDL_Haptic *haptic, int effect, const SDL_HapticEffect *data); // Update the properties of an effect.
bool SDL_RunHapticEffect(SDL_Haptic *haptic, int effect, Uint32 iterations); // Run the haptic effect on its associated haptic device.
bool SDL_StopHapticEffect(SDL_Haptic *haptic, int effect); // Stop the haptic effect on its associated haptic device.
void SDL_DestroyHapticEffect(SDL_Haptic *haptic, int effect); // Destroy a haptic effect on the device.
bool SDL_GetHapticEffectStatus(SDL_Haptic *haptic, int effect); // Get the status of the current effect on the specified haptic device.
bool SDL_SetHapticGain(SDL_Haptic *haptic, int gain); // Set the global gain of the specified haptic device.
bool SDL_SetHapticAutocenter(SDL_Haptic *haptic, int autocenter); // Set the global autocenter of the device.
bool SDL_PauseHaptic(SDL_Haptic *haptic); // Pause a haptic device.
bool SDL_ResumeHaptic(SDL_Haptic *haptic); // Resume a haptic device.
bool SDL_StopHapticEffects(SDL_Haptic *haptic); // Stop all the currently playing effects on a haptic device.
bool SDL_HapticRumbleSupported(SDL_Haptic *haptic); // Check whether rumble is supported on a haptic device.
bool SDL_InitHapticRumble(SDL_Haptic *haptic); // Initialize a haptic device for simple rumble playback.
bool SDL_PlayHapticRumble(SDL_Haptic *haptic, float strength, Uint32 length); // Run a simple rumble effect on a haptic device.
bool SDL_StopHapticRumble(SDL_Haptic *haptic); // Stop the simple rumble on a haptic device.
// XXXXX XX XX XXXXXX XX XXXXXX
// XX XX XX XX XX XX XX XX XX
// XXXXXXX XX XX XX XX XX XX XX
// XX XX XX XX XX XX XX XX XX
// XX XX XXXXXX XXXXXX XX XXXXXX
int SDL_GetNumAudioDrivers(void); // Use this function to get the number of built-in audio drivers.
const char * SDL_GetAudioDriver(int index); // Use this function to get the name of a built in audio driver.
const char * SDL_GetCurrentAudioDriver(void); // Get the name of the current audio driver.
int *count); // Get a list of currently-connected audio playback devices.
SDL_AudioDeviceID * SDL_GetAudioPlaybackDevices(int *count); // Get a list of currently-connected audio recording devices.
SDL_AudioDeviceID * SDL_GetAudioRecordingDevices(const char * SDL_GetAudioDeviceName(SDL_AudioDeviceID devid); // Get the human-readable name of a specific audio device.
bool SDL_GetAudioDeviceFormat(SDL_AudioDeviceID devid, SDL_AudioSpec *spec, int *sample_frames); // Get the current audio format of a specific audio device.
int * SDL_GetAudioDeviceChannelMap(SDL_AudioDeviceID devid, int *count); // Get the current channel map of an audio device.
const SDL_AudioSpec *spec); // Open a specific audio device.
SDL_AudioDeviceID SDL_OpenAudioDevice(SDL_AudioDeviceID devid, bool SDL_IsAudioDevicePhysical(SDL_AudioDeviceID devid); // Determine if an audio device is physical (instead of logical).
bool SDL_IsAudioDevicePlayback(SDL_AudioDeviceID devid); // Determine if an audio device is a playback device (instead of recording).
bool SDL_PauseAudioDevice(SDL_AudioDeviceID dev); // Use this function to pause audio playback on a specified device.
bool SDL_ResumeAudioDevice(SDL_AudioDeviceID dev); // Use this function to unpause audio playback on a specified device.
bool SDL_AudioDevicePaused(SDL_AudioDeviceID dev); // Use this function to query if an audio device is paused.
float SDL_GetAudioDeviceGain(SDL_AudioDeviceID devid); // Get the gain of an audio device.
bool SDL_SetAudioDeviceGain(SDL_AudioDeviceID devid, float gain); // Change the gain of an audio device.
void SDL_CloseAudioDevice(SDL_AudioDeviceID devid); // Close a previously-opened audio device.
bool SDL_BindAudioStreams(SDL_AudioDeviceID devid, SDL_AudioStream **streams, int num_streams); // Bind a list of audio streams to an audio device.
bool SDL_BindAudioStream(SDL_AudioDeviceID devid, SDL_AudioStream *stream); // Bind a single audio stream to an audio device.
void SDL_UnbindAudioStreams(SDL_AudioStream **streams, int num_streams); // Unbind a list of audio streams from their audio devices.
void SDL_UnbindAudioStream(SDL_AudioStream *stream); // Unbind a single audio stream from its audio device.
// Query an audio stream for its currently-bound device.
SDL_AudioDeviceID SDL_GetAudioStreamDevice(SDL_AudioStream *stream); const SDL_AudioSpec *src_spec, const SDL_AudioSpec *dst_spec); // Create a new audio stream.
SDL_AudioStream * SDL_CreateAudioStream(// Get the properties associated with an audio stream.
SDL_PropertiesID SDL_GetAudioStreamProperties(SDL_AudioStream *stream); bool SDL_GetAudioStreamFormat(SDL_AudioStream *stream, SDL_AudioSpec *src_spec, SDL_AudioSpec *dst_spec); // Query the current format of an audio stream.
bool SDL_SetAudioStreamFormat(SDL_AudioStream *stream, const SDL_AudioSpec *src_spec, const SDL_AudioSpec *dst_spec); // Change the input and output formats of an audio stream.
float SDL_GetAudioStreamFrequencyRatio(SDL_AudioStream *stream); // Get the frequency ratio of an audio stream.
bool SDL_SetAudioStreamFrequencyRatio(SDL_AudioStream *stream, float ratio); // Change the frequency ratio of an audio stream.
float SDL_GetAudioStreamGain(SDL_AudioStream *stream); // Get the gain of an audio stream.
bool SDL_SetAudioStreamGain(SDL_AudioStream *stream, float gain); // Change the gain of an audio stream.
int * SDL_GetAudioStreamInputChannelMap(SDL_AudioStream *stream, int *count); // Get the current input channel map of an audio stream.
int * SDL_GetAudioStreamOutputChannelMap(SDL_AudioStream *stream, int *count); // Get the current output channel map of an audio stream.
bool SDL_SetAudioStreamInputChannelMap(SDL_AudioStream *stream, const int *chmap, int count); // Set the current input channel map of an audio stream.
bool SDL_SetAudioStreamOutputChannelMap(SDL_AudioStream *stream, const int *chmap, int count); // Set the current output channel map of an audio stream.
bool SDL_PutAudioStreamData(SDL_AudioStream *stream, const void *buf, int len); // Add data to the stream.
int SDL_GetAudioStreamData(SDL_AudioStream *stream, void *buf, int len); // Get converted/resampled data from the stream.
int SDL_GetAudioStreamAvailable(SDL_AudioStream *stream); // Get the number of converted/resampled bytes available.
int SDL_GetAudioStreamQueued(SDL_AudioStream *stream); // Get the number of bytes currently queued.
bool SDL_FlushAudioStream(SDL_AudioStream *stream); // Tell the stream that you're done sending data, and anything being buffered should be converted/resampled and made available immediately.
bool SDL_ClearAudioStream(SDL_AudioStream *stream); // Clear any pending data in the stream.
bool SDL_PauseAudioStreamDevice(SDL_AudioStream *stream); // Use this function to pause audio playback on the audio device associated with an audio stream.
bool SDL_ResumeAudioStreamDevice(SDL_AudioStream *stream); // Use this function to unpause audio playback on the audio device associated with an audio stream.
bool SDL_LockAudioStream(SDL_AudioStream *stream); // Lock an audio stream for serialized access.
bool SDL_UnlockAudioStream(SDL_AudioStream *stream); // Unlock an audio stream for serialized access.
bool SDL_SetAudioStreamGetCallback(SDL_AudioStream *stream, SDL_AudioStreamCallback callback, void *userdata); // Set a callback that runs when data is requested from an audio stream.
bool SDL_SetAudioStreamPutCallback(SDL_AudioStream *stream, SDL_AudioStreamCallback callback, void *userdata); // Set a callback that runs when data is added to an audio stream.
void SDL_DestroyAudioStream(SDL_AudioStream *stream); // Free an audio stream.
const SDL_AudioSpec *spec, SDL_AudioStreamCallback callback, void *userdata); // Convenience function for straightforward audio init for the common case.
SDL_AudioStream * SDL_OpenAudioDeviceStream(SDL_AudioDeviceID devid, bool SDL_SetAudioPostmixCallback(SDL_AudioDeviceID devid, SDL_AudioPostmixCallback callback, void *userdata); // Set a callback that fires when data is about to be fed to an audio device.
bool SDL_LoadWAV_IO(SDL_IOStream *src, bool closeio, SDL_AudioSpec *spec, Uint8 **audio_buf, Uint32 *audio_len); // Load the audio data of a WAVE file into memory.
bool SDL_LoadWAV(const char *path, SDL_AudioSpec *spec, Uint8 **audio_buf, Uint32 *audio_len); // Loads a WAV from a file path.
bool SDL_MixAudio(Uint8 *dst, const Uint8 *src, SDL_AudioFormat format, Uint32 len, float volume); // Mix audio data in a specified format.
bool SDL_ConvertAudioSamples(const SDL_AudioSpec *src_spec, const Uint8 *src_data, int src_len, const SDL_AudioSpec *dst_spec, Uint8 **dst_data, int *dst_len); // Convert some audio data of one format to another format.
const char * SDL_GetAudioFormatName(SDL_AudioFormat format); // Get the human readable name of an audio format.
int SDL_GetSilenceValueForFormat(SDL_AudioFormat format); // Get the appropriate memset value for silencing an audio format.
// XXXXXXXX XX XXX XXX XXXXXXX
// XX XX XXXX XXXX XX
// XX XX XX XXXX XX XXXXX
// XX XX XX XX XX XX
// XX XX XX XX XXXXXXX
bool SDL_GetDateTimeLocalePreferences(SDL_DateFormat *dateFormat, SDL_TimeFormat *timeFormat); // Gets the current preferred date and time format for the system locale.
bool SDL_GetCurrentTime(SDL_Time *ticks); // Gets the current value of the system realtime clock in nanoseconds since Jan 1, 1970 in Universal Coordinated Time (UTC).
bool SDL_TimeToDateTime(SDL_Time ticks, SDL_DateTime *dt, bool localTime); // Converts an SDL_Time in nanoseconds since the epoch to a calendar time in the SDL_DateTime format.
bool SDL_DateTimeToTime(const SDL_DateTime *dt, SDL_Time *ticks); // Converts a calendar time to an SDL_Time in nanoseconds since the epoch.
void SDL_TimeToWindows(SDL_Time ticks, Uint32 *dwLowDateTime, Uint32 *dwHighDateTime); // Converts an SDL time into a Windows FILETIME (100-nanosecond intervals since January 1, 1601).
// Converts a Windows FILETIME (100-nanosecond intervals since January 1, 1601) to an SDL time.
SDL_Time SDL_TimeFromWindows(Uint32 dwLowDateTime, Uint32 dwHighDateTime); int SDL_GetDaysInMonth(int year, int month); // Get the number of days in a month for a given year.
int SDL_GetDayOfYear(int year, int month, int day); // Get the day of year for a calendar date.
int SDL_GetDayOfWeek(int year, int month, int day); // Get the day of week for a calendar date.
// XXXXXXXX XX XXX XXX XXXXXXX XXXXXX
// XX XX XXXX XXXX XX XX XX
// XX XX XX XXXX XX XXXXX XXXXXX
// XX XX XX XX XX XX XX XX
// XX XX XX XX XXXXXXX XX XX
void); // Get the number of milliseconds since SDL library initialization.
Uint64 SDL_GetTicks(void); // Get the number of nanoseconds since SDL library initialization.
Uint64 SDL_GetTicksNS(void); // Get the current value of the high resolution counter.
Uint64 SDL_GetPerformanceCounter(void); // Get the count per second of the high resolution counter.
Uint64 SDL_GetPerformanceFrequency(void SDL_Delay(Uint32 ms); // Wait a specified number of milliseconds before returning.
void SDL_DelayNS(Uint64 ns); // Wait a specified number of nanoseconds before returning.
void SDL_DelayPrecise(Uint64 ns); // Wait a specified number of nanoseconds before returning.
void *userdata); // Call a callback function at a future time.
SDL_TimerID SDL_AddTimer(Uint32 interval, SDL_TimerCallback callback, void *userdata); // Call a callback function at a future time.
SDL_TimerID SDL_AddTimerNS(Uint64 interval, SDL_NSTimerCallback callback, bool SDL_RemoveTimer(SDL_TimerID id); // Remove a timer created with SDL_AddTimer().
// XXXXXX XXXXXXX XXX XX XXXXXX XXXXXXX XXXXXX
// XX XX XX XXXX XX XX XX XX XX XX
// XXXXXX XXXXX XX XX XX XX XX XXXXX XXXXXX
// XX XX XX XX XX XX XX XX XX XX XX
// XX XX XXXXXXX XX XXXX XXXXXX XXXXXXX XX XX
int SDL_GetNumRenderDrivers(void); // Get the number of 2D rendering drivers available for the current display.
const char * SDL_GetRenderDriver(int index); // Use this function to get the name of a built in 2D rendering driver.
bool SDL_CreateWindowAndRenderer(const char *title, int width, int height, SDL_WindowFlags window_flags, SDL_Window **window, SDL_Renderer **renderer); // Create a window and default renderer.
const char *name); // Create a 2D rendering context for a window.
SDL_Renderer * SDL_CreateRenderer(SDL_Window *window, // Create a 2D rendering context for a window, with the specified properties.
SDL_Renderer * SDL_CreateRendererWithProperties(SDL_PropertiesID props); // Create a 2D software rendering context for a surface.
SDL_Renderer * SDL_CreateSoftwareRenderer(SDL_Surface *surface); // Get the renderer associated with a window.
SDL_Renderer * SDL_GetRenderer(SDL_Window *window); // Get the window associated with a renderer.
SDL_Window * SDL_GetRenderWindow(SDL_Renderer *renderer); const char * SDL_GetRendererName(SDL_Renderer *renderer); // Get the name of a renderer.
// Get the properties associated with a renderer.
SDL_PropertiesID SDL_GetRendererProperties(SDL_Renderer *renderer); bool SDL_GetRenderOutputSize(SDL_Renderer *renderer, int *w, int *h); // Get the output size in pixels of a rendering context.
bool SDL_GetCurrentRenderOutputSize(SDL_Renderer *renderer, int *w, int *h); // Get the current output size in pixels of a rendering context.
int w, int h); // Create a texture for a rendering context.
SDL_Texture * SDL_CreateTexture(SDL_Renderer *renderer, SDL_PixelFormat format, SDL_TextureAccess access, // Create a texture from an existing surface.
SDL_Texture * SDL_CreateTextureFromSurface(SDL_Renderer *renderer, SDL_Surface *surface); // Create a texture for a rendering context with the specified properties.
SDL_Texture * SDL_CreateTextureWithProperties(SDL_Renderer *renderer, SDL_PropertiesID props); // Get the properties associated with a texture.
SDL_PropertiesID SDL_GetTextureProperties(SDL_Texture *texture); // Get the renderer that created an SDL_Texture.
SDL_Renderer * SDL_GetRendererFromTexture(SDL_Texture *texture); bool SDL_GetTextureSize(SDL_Texture *texture, float *w, float *h); // Get the size of a texture, as floating point values.
bool SDL_SetTextureColorMod(SDL_Texture *texture, Uint8 r, Uint8 g, Uint8 b); // Set an additional color value multiplied into render copy operations.
bool SDL_SetTextureColorModFloat(SDL_Texture *texture, float r, float g, float b); // Set an additional color value multiplied into render copy operations.
bool SDL_GetTextureColorMod(SDL_Texture *texture, Uint8 *r, Uint8 *g, Uint8 *b); // Get the additional color value multiplied into render copy operations.
bool SDL_GetTextureColorModFloat(SDL_Texture *texture, float *r, float *g, float *b); // Get the additional color value multiplied into render copy operations.
bool SDL_SetTextureAlphaMod(SDL_Texture *texture, Uint8 alpha); // Set an additional alpha value multiplied into render copy operations.
bool SDL_SetTextureAlphaModFloat(SDL_Texture *texture, float alpha); // Set an additional alpha value multiplied into render copy operations.
bool SDL_GetTextureAlphaMod(SDL_Texture *texture, Uint8 *alpha); // Get the additional alpha value multiplied into render copy operations.
bool SDL_GetTextureAlphaModFloat(SDL_Texture *texture, float *alpha); // Get the additional alpha value multiplied into render copy operations.
bool SDL_SetTextureBlendMode(SDL_Texture *texture, SDL_BlendMode blendMode); // Set the blend mode for a texture, used by SDL_RenderTexture().
bool SDL_GetTextureBlendMode(SDL_Texture *texture, SDL_BlendMode *blendMode); // Get the blend mode used for texture copy operations.
bool SDL_SetTextureScaleMode(SDL_Texture *texture, SDL_ScaleMode scaleMode); // Set the scale mode used for texture scale operations.
bool SDL_GetTextureScaleMode(SDL_Texture *texture, SDL_ScaleMode *scaleMode); // Get the scale mode used for texture scale operations.
bool SDL_UpdateTexture(SDL_Texture *texture, const SDL_Rect *rect, const void *pixels, int pitch); // Update the given texture rectangle with new pixel data.
bool SDL_UpdateYUVTexture(SDL_Texture *texture, const SDL_Rect *rect, const Uint8 *Yplane, int Ypitch, const Uint8 *Uplane, int Upitch, const Uint8 *Vplane, int Vpitch); // Update a rectangle within a planar YV12 or IYUV texture with new pixel data.
bool SDL_UpdateNVTexture(SDL_Texture *texture, const SDL_Rect *rect, const Uint8 *Yplane, int Ypitch, const Uint8 *UVplane, int UVpitch); // Update a rectangle within a planar NV12 or NV21 texture with new pixels.
bool SDL_LockTexture(SDL_Texture *texture, const SDL_Rect *rect, void **pixels, int *pitch); // Lock a portion of the texture for **write-only** pixel access.
bool SDL_LockTextureToSurface(SDL_Texture *texture, const SDL_Rect *rect, SDL_Surface **surface); // Lock a portion of the texture for **write-only** pixel access, and expose it as a SDL surface.
void SDL_UnlockTexture(SDL_Texture *texture); // Unlock a texture, uploading the changes to video memory, if needed.
bool SDL_SetRenderTarget(SDL_Renderer *renderer, SDL_Texture *texture); // Set a texture as the current rendering target.
// Get the current render target.
SDL_Texture * SDL_GetRenderTarget(SDL_Renderer *renderer); bool SDL_SetRenderLogicalPresentation(SDL_Renderer *renderer, int w, int h, SDL_RendererLogicalPresentation mode); // Set a device independent resolution and presentation mode for rendering.
bool SDL_GetRenderLogicalPresentation(SDL_Renderer *renderer, int *w, int *h, SDL_RendererLogicalPresentation *mode); // Get device independent resolution and presentation mode for rendering.
bool SDL_GetRenderLogicalPresentationRect(SDL_Renderer *renderer, SDL_FRect *rect); // Get the final presentation rectangle for rendering.
bool SDL_RenderCoordinatesFromWindow(SDL_Renderer *renderer, float window_x, float window_y, float *x, float *y); // Get a point in render coordinates when given a point in window coordinates.
bool SDL_RenderCoordinatesToWindow(SDL_Renderer *renderer, float x, float y, float *window_x, float *window_y); // Get a point in window coordinates when given a point in render coordinates.
bool SDL_ConvertEventToRenderCoordinates(SDL_Renderer *renderer, SDL_Event *event); // Convert the coordinates in an event to render coordinates.
bool SDL_SetRenderViewport(SDL_Renderer *renderer, const SDL_Rect *rect); // Set the drawing area for rendering on the current target.
bool SDL_GetRenderViewport(SDL_Renderer *renderer, SDL_Rect *rect); // Get the drawing area for the current target.
bool SDL_RenderViewportSet(SDL_Renderer *renderer); // Return whether an explicit rectangle was set as the viewport.
bool SDL_GetRenderSafeArea(SDL_Renderer *renderer, SDL_Rect *rect); // Get the safe area for rendering within the current viewport.
bool SDL_SetRenderClipRect(SDL_Renderer *renderer, const SDL_Rect *rect); // Set the clip rectangle for rendering on the specified target.
bool SDL_GetRenderClipRect(SDL_Renderer *renderer, SDL_Rect *rect); // Get the clip rectangle for the current target.
bool SDL_RenderClipEnabled(SDL_Renderer *renderer); // Get whether clipping is enabled on the given renderer.
bool SDL_SetRenderScale(SDL_Renderer *renderer, float scaleX, float scaleY); // Set the drawing scale for rendering on the current target.
bool SDL_GetRenderScale(SDL_Renderer *renderer, float *scaleX, float *scaleY); // Get the drawing scale for the current target.
bool SDL_SetRenderDrawColor(SDL_Renderer *renderer, Uint8 r, Uint8 g, Uint8 b, Uint8 a); // Set the color used for drawing operations.
bool SDL_SetRenderDrawColorFloat(SDL_Renderer *renderer, float r, float g, float b, float a); // Set the color used for drawing operations (Rect, Line and Clear).
bool SDL_GetRenderDrawColor(SDL_Renderer *renderer, Uint8 *r, Uint8 *g, Uint8 *b, Uint8 *a); // Get the color used for drawing operations (Rect, Line and Clear).
bool SDL_GetRenderDrawColorFloat(SDL_Renderer *renderer, float *r, float *g, float *b, float *a); // Get the color used for drawing operations (Rect, Line and Clear).
bool SDL_SetRenderColorScale(SDL_Renderer *renderer, float scale); // Set the color scale used for render operations.
bool SDL_GetRenderColorScale(SDL_Renderer *renderer, float *scale); // Get the color scale used for render operations.
bool SDL_SetRenderDrawBlendMode(SDL_Renderer *renderer, SDL_BlendMode blendMode); // Set the blend mode used for drawing operations (Fill and Line).
bool SDL_GetRenderDrawBlendMode(SDL_Renderer *renderer, SDL_BlendMode *blendMode); // Get the blend mode used for drawing operations.
bool SDL_RenderClear(SDL_Renderer *renderer); // Clear the current rendering target with the drawing color.
bool SDL_RenderPoint(SDL_Renderer *renderer, float x, float y); // Draw a point on the current rendering target at subpixel precision.
bool SDL_RenderPoints(SDL_Renderer *renderer, const SDL_FPoint *points, int count); // Draw multiple points on the current rendering target at subpixel precision.
bool SDL_RenderLine(SDL_Renderer *renderer, float x1, float y1, float x2, float y2); // Draw a line on the current rendering target at subpixel precision.
bool SDL_RenderLines(SDL_Renderer *renderer, const SDL_FPoint *points, int count); // Draw a series of connected lines on the current rendering target at subpixel precision.
bool SDL_RenderRect(SDL_Renderer *renderer, const SDL_FRect *rect); // Draw a rectangle on the current rendering target at subpixel precision.
bool SDL_RenderRects(SDL_Renderer *renderer, const SDL_FRect *rects, int count); // Draw some number of rectangles on the current rendering target at subpixel precision.
bool SDL_RenderFillRect(SDL_Renderer *renderer, const SDL_FRect *rect); // Fill a rectangle on the current rendering target with the drawing color at subpixel precision.
bool SDL_RenderFillRects(SDL_Renderer *renderer, const SDL_FRect *rects, int count); // Fill some number of rectangles on the current rendering target with the drawing color at subpixel precision.
bool SDL_RenderTexture(SDL_Renderer *renderer, SDL_Texture *texture, const SDL_FRect *srcrect, const SDL_FRect *dstrect); // Copy a portion of the texture to the current rendering target at subpixel precision.
bool SDL_RenderTextureRotated(SDL_Renderer *renderer, SDL_Texture *texture, const SDL_FRect *srcrect, const SDL_FRect *dstrect, double angle, const SDL_FPoint *center, SDL_FlipMode flip); // Copy a portion of the source texture to the current rendering target, with rotation and flipping, at subpixel precision.
bool SDL_RenderTextureAffine(SDL_Renderer *renderer, SDL_Texture *texture, const SDL_FRect *srcrect, const SDL_FPoint *origin, const SDL_FPoint *right, const SDL_FPoint *down); // Copy a portion of the source texture to the current rendering target, with affine transform, at subpixel precision.
bool SDL_RenderTextureTiled(SDL_Renderer *renderer, SDL_Texture *texture, const SDL_FRect *srcrect, float scale, const SDL_FRect *dstrect); // Tile a portion of the texture to the current rendering target at subpixel precision.
bool SDL_RenderTexture9Grid(SDL_Renderer *renderer, SDL_Texture *texture, const SDL_FRect *srcrect, float left_width, float right_width, float top_height, float bottom_height, float scale, const SDL_FRect *dstrect); // Perform a scaled copy using the 9-grid algorithm to the current rendering target at subpixel precision.
bool SDL_RenderGeometry(SDL_Renderer *renderer, SDL_Texture *texture, const SDL_Vertex *vertices, int num_vertices, const int *indices, int num_indices); // Render a list of triangles, optionally using a texture and indices into the vertex array Color and alpha modulation is done per vertex (SDL_SetTextureColorMod and SDL_SetTextureAlphaMod are ignored).
bool SDL_RenderGeometryRaw(SDL_Renderer *renderer, SDL_Texture *texture, const float *xy, int xy_stride, const SDL_FColor *color, int color_stride, const float *uv, int uv_stride, int num_vertices, const void *indices, int num_indices, int size_indices); // Render a list of triangles, optionally using a texture and indices into the vertex arrays Color and alpha modulation is done per vertex (SDL_SetTextureColorMod and SDL_SetTextureAlphaMod are ignored).
const SDL_Rect *rect); // Read pixels from the current rendering target.
SDL_Surface * SDL_RenderReadPixels(SDL_Renderer *renderer, bool SDL_RenderPresent(SDL_Renderer *renderer); // Update the screen with any rendering performed since the previous call.
void SDL_DestroyTexture(SDL_Texture *texture); // Destroy the specified texture.
void SDL_DestroyRenderer(SDL_Renderer *renderer); // Destroy the rendering context for a window and free all associated textures.
bool SDL_FlushRenderer(SDL_Renderer *renderer); // Force the rendering context to flush any pending commands and state.
void * SDL_GetRenderMetalLayer(SDL_Renderer *renderer); // Get the CAMetalLayer associated with the given Metal renderer.
void * SDL_GetRenderMetalCommandEncoder(SDL_Renderer *renderer); // Get the Metal command encoder for the current frame.
bool SDL_AddVulkanRenderSemaphores(SDL_Renderer *renderer, Uint32 wait_stage_mask, Sint64 wait_semaphore, Sint64 signal_semaphore); // Add a set of synchronization semaphores for the current frame.
bool SDL_SetRenderVSync(SDL_Renderer *renderer, int vsync); // Toggle VSync of the given renderer.
bool SDL_GetRenderVSync(SDL_Renderer *renderer, int *vsync); // Get VSync of the given renderer.
bool SDL_RenderDebugText(SDL_Renderer *renderer, float x, float y, const char *str); // Draw debug text to an SDL_Renderer.
bool SDL_RenderDebugTextFormat(SDL_Renderer *renderer, float x, float y, const char *fmt, ... ...); // Draw debug text to an SDL_Renderer.
// XXXXXX XX XX XXXXX XXXXXX XXXXXXX XXXXXX XXXXXX XXXXXX XX XXXXXXX XXXXXX XXXXXXXX
// XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX
// XXXXXXX XXXXXXX XXXXXXX XXXXXX XXXXX XX XX XX XX XXXXXX XX XXXXX XX XX
// XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX
// XXXXXX XX XX XX XX XX XX XXXXXXX XXXXXX XXXXXX XXXXXX XXXXX XXXXXXX XXXXXX XX
const char *sofile); // Dynamically load a shared object.
SDL_SharedObject * SDL_LoadObject(const char *name); // Look up the address of the named function in a shared object.
SDL_FunctionPointer SDL_LoadFunction(SDL_SharedObject *handle, void SDL_UnloadObject(SDL_SharedObject *handle); // Unload a shared object from memory.
// XXXXXXXX XX XX XXXXXX XXXXXXX XXXXX XXXXXX
// XX XX XX XX XX XX XX XX XX XX
// XX XXXXXXX XXXXXX XXXXX XXXXXXX XX XX
// XX XX XX XX XX XX XX XX XX XX
// XX XX XX XX XX XXXXXXX XX XX XXXXXX
const char *name, void *data); // Create a new thread with a default stack size.
SDL_Thread * SDL_CreateThread(SDL_ThreadFunction fn, // Create a new thread with with the specified properties.
SDL_Thread * SDL_CreateThreadWithProperties(SDL_PropertiesID props); const char * SDL_GetThreadName(SDL_Thread *thread); // Get the thread name as it was specified in SDL_CreateThread().
void); // Get the thread identifier for the current thread.
SDL_ThreadID SDL_GetCurrentThreadID(// Get the thread identifier for the specified thread.
SDL_ThreadID SDL_GetThreadID(SDL_Thread *thread); bool SDL_SetCurrentThreadPriority(SDL_ThreadPriority priority); // Set the priority for the current thread.
void SDL_WaitThread(SDL_Thread *thread, int *status); // Wait for a thread to finish.
void SDL_DetachThread(SDL_Thread *thread); // Let a thread clean up on exit without intervention.
void * SDL_GetTLS(SDL_TLSID *id); // Get the current thread's value associated with a thread local storage ID.
bool SDL_SetTLS(SDL_TLSID *id, const void *value, SDL_TLSDestructorCallback destructor); // Set the current thread's value associated with a thread local storage ID.
void SDL_CleanupTLS(void); // Cleanup all TLS data for this thread.
// XXX XXX XX XX XXXXXXXX XXXXXXX XX XX
// XXXX XXXX XX XX XX XX XX XX
// XX XXXX XX XX XX XX XXXXX XXX
// XX XX XX XX XX XX XX XX XX
// XX XX XXXXXX XX XXXXXXX XX XX
void); // Create a new mutex.
SDL_Mutex * SDL_CreateMutex(void SDL_LockMutex(SDL_Mutex *mutex); // Lock the mutex.
bool SDL_TryLockMutex(SDL_Mutex *mutex); // Try to lock a mutex without blocking.
void SDL_UnlockMutex(SDL_Mutex *mutex); // Unlock the mutex.
void SDL_DestroyMutex(SDL_Mutex *mutex); // Destroy a mutex created with SDL_CreateMutex().
void); // Create a new read/write lock.
SDL_RWLock * SDL_CreateRWLock(void SDL_LockRWLockForReading(SDL_RWLock *rwlock); // Lock the read/write lock for _read only_ operations.
void SDL_LockRWLockForWriting(SDL_RWLock *rwlock); // Lock the read/write lock for _write_ operations.
bool SDL_TryLockRWLockForReading(SDL_RWLock *rwlock); // Try to lock a read/write lock _for reading_ without blocking.
bool SDL_TryLockRWLockForWriting(SDL_RWLock *rwlock); // Try to lock a read/write lock _for writing_ without blocking.
void SDL_UnlockRWLock(SDL_RWLock *rwlock); // Unlock the read/write lock.
void SDL_DestroyRWLock(SDL_RWLock *rwlock); // Destroy a read/write lock created with SDL_CreateRWLock().
// Create a semaphore.
SDL_Semaphore * SDL_CreateSemaphore(Uint32 initial_value); void SDL_DestroySemaphore(SDL_Semaphore *sem); // Destroy a semaphore.
void SDL_WaitSemaphore(SDL_Semaphore *sem); // Wait until a semaphore has a positive value and then decrements it.
bool SDL_TryWaitSemaphore(SDL_Semaphore *sem); // See if a semaphore has a positive value and decrement it if it does.
bool SDL_WaitSemaphoreTimeout(SDL_Semaphore *sem, Sint32 timeoutMS); // Wait until a semaphore has a positive value and then decrements it.
void SDL_SignalSemaphore(SDL_Semaphore *sem); // Atomically increment a semaphore's value and wake waiting threads.
// Get the current value of a semaphore.
Uint32 SDL_GetSemaphoreValue(SDL_Semaphore *sem); void); // Create a condition variable.
SDL_Condition * SDL_CreateCondition(void SDL_DestroyCondition(SDL_Condition *cond); // Destroy a condition variable.
void SDL_SignalCondition(SDL_Condition *cond); // Restart one of the threads that are waiting on the condition variable.
void SDL_BroadcastCondition(SDL_Condition *cond); // Restart all threads that are waiting on the condition variable.
void SDL_WaitCondition(SDL_Condition *cond, SDL_Mutex *mutex); // Wait until a condition variable is signaled.
bool SDL_WaitConditionTimeout(SDL_Condition *cond, SDL_Mutex *mutex, Sint32 timeoutMS); // Wait until a condition variable is signaled or a certain time has passed.
bool SDL_ShouldInit(SDL_InitState *state); // Return whether initialization should be done.
bool SDL_ShouldQuit(SDL_InitState *state); // Return whether cleanup should be done.
void SDL_SetInitialized(SDL_InitState *state, bool initialized); // Finish an initialization state transition.
// XXXXX XXXXXXXX XXXXXX XXX XXX XX XXXXXX
// XX XX XX XX XX XXXX XXXX XX XX
// XXXXXXX XX XX XX XX XXXX XX XX XX
// XX XX XX XX XX XX XX XX XX XX
// XX XX XX XXXXXX XX XX XX XXXXXX
bool SDL_TryLockSpinlock(SDL_SpinLock *lock); // Try to lock a spin lock by setting it to a non-zero value.
void SDL_LockSpinlock(SDL_SpinLock *lock); // Lock a spin lock by setting it to a non-zero value.
void SDL_UnlockSpinlock(SDL_SpinLock *lock); // Unlock a spin lock by setting it to 0.
void SDL_MemoryBarrierReleaseFunction(void); // Insert a memory release barrier.
void SDL_MemoryBarrierAcquireFunction(void); // Insert a memory acquire barrier.
bool SDL_CompareAndSwapAtomicInt(SDL_AtomicInt *a, int oldval, int newval); // Set an atomic variable to a new value if it is currently an old value.
int SDL_SetAtomicInt(SDL_AtomicInt *a, int v); // Set an atomic variable to a value.
int SDL_GetAtomicInt(SDL_AtomicInt *a); // Get the value of an atomic variable.
int SDL_AddAtomicInt(SDL_AtomicInt *a, int v); // Add to an atomic variable.
#define SDL_AtomicIncRef(a) // Increment an atomic variable used as a reference count.
#define SDL_AtomicDecRef(a) // Decrement an atomic variable used as a reference count.
bool SDL_CompareAndSwapAtomicU32(SDL_AtomicU32 *a, Uint32 oldval, Uint32 newval); // Set an atomic variable to a new value if it is currently an old value.
// Set an atomic variable to a value.
Uint32 SDL_SetAtomicU32(SDL_AtomicU32 *a, Uint32 v); // Get the value of an atomic variable.
Uint32 SDL_GetAtomicU32(SDL_AtomicU32 *a); bool SDL_CompareAndSwapAtomicPointer(void **a, void *oldval, void *newval); // Set a pointer to a new value if it is currently an old value.
void * SDL_SetAtomicPointer(void **a, void *v); // Set a pointer to a value atomically.
void * SDL_GetAtomicPointer(void **a); // Get the value of a pointer atomically.
// XXXXXXX XX XX XXXXXXX XXXXXX XX XX XXXXXX XXXXXXXX XXXXXXX XXX XXX
// XX XX XX XX XX XX XX XX XX XX XXXX XXXX
// XXXXX XX XX XXXXX XXXXXXX XXXX XXXXXXX XX XXXXX XX XXXX XX
// XX XX XX XX XX XX XX XX XX XX XX XX
// XX XX XXXXXXX XXXXXXX XXXXXX XX XXXXXX XX XXXXXXX XX XX
const char * SDL_GetBasePath(void); // Get the directory where the application was run from.
char * SDL_GetPrefPath(const char *org, const char *app); // Get the user-and-app-specific path where files can be written.
const char * SDL_GetUserFolder(SDL_Folder folder); // Finds the most suitable user folder for a specific purpose.
bool SDL_CreateDirectory(const char *path); // Create a directory, and any missing parent directories.
bool SDL_EnumerateDirectory(const char *path, SDL_EnumerateDirectoryCallback callback, void *userdata); // Enumerate a directory through a callback function.
bool SDL_RemovePath(const char *path); // Remove a file or an empty directory.
bool SDL_RenamePath(const char *oldpath, const char *newpath); // Rename a file or directory.
bool SDL_CopyFile(const char *oldpath, const char *newpath); // Copy a file.
bool SDL_GetPathInfo(const char *path, SDL_PathInfo *info); // Get information about a filesystem path.
char ** SDL_GlobDirectory(const char *path, const char *pattern, SDL_GlobFlags flags, int *count); // Enumerate a directory tree, filtered by pattern, and return a list.
char * SDL_GetCurrentDirectory(void); // Get what the system believes is the "current working directory."
// XX XXXXXX XXXXXX XXXXXXXX XXXXXX XXXXXXX XXXXX XXX XXX
// XX XX XX XX XX XX XX XX XX XX XXXX XXXX
// XX XX XX XXXXXXX XX XXXXXX XXXXX XXXXXXX XX XXXX XX
// XX XX XX XX XX XX XX XX XX XX XX XX XX
// XX XXXXXX XXXXXX XX XX XX XXXXXXX XX XX XX XX
const char *file, const char *mode); // Use this function to create a new SDL_IOStream structure for reading from and/or writing to a named file.
SDL_IOStream * SDL_IOFromFile(void *mem, size_t size); // Use this function to prepare a read-write memory buffer for use with SDL_IOStream.
SDL_IOStream * SDL_IOFromMem(const void *mem, size_t size); // Use this function to prepare a read-only memory buffer for use with SDL_IOStream.
SDL_IOStream * SDL_IOFromConstMem(void); // Use this function to create an SDL_IOStream that is backed by dynamically allocated memory.
SDL_IOStream * SDL_IOFromDynamicMem(const SDL_IOStreamInterface *iface, void *userdata); // Create a custom SDL_IOStream.
SDL_IOStream * SDL_OpenIO(bool SDL_CloseIO(SDL_IOStream *context); // Close and free an allocated SDL_IOStream structure.
// Get the properties associated with an SDL_IOStream.
SDL_PropertiesID SDL_GetIOProperties(SDL_IOStream *context); // Query the stream status of an SDL_IOStream.
SDL_IOStatus SDL_GetIOStatus(SDL_IOStream *context); // Use this function to get the size of the data stream in an SDL_IOStream.
Sint64 SDL_GetIOSize(SDL_IOStream *context); // Seek within an SDL_IOStream data stream.
Sint64 SDL_SeekIO(SDL_IOStream *context, Sint64 offset, SDL_IOWhence whence); // Determine the current read/write offset in an SDL_IOStream data stream.
Sint64 SDL_TellIO(SDL_IOStream *context); size_t SDL_ReadIO(SDL_IOStream *context, void *ptr, size_t size); // Read from a data source.
size_t SDL_WriteIO(SDL_IOStream *context, const void *ptr, size_t size); // Write to an SDL_IOStream data stream.
size_t SDL_IOprintf(SDL_IOStream *context, const char *fmt, ... ...); // Print to an SDL_IOStream data stream.
size_t SDL_IOvprintf(SDL_IOStream *context, const char *fmt, va_list ap); // Print to an SDL_IOStream data stream.
bool SDL_FlushIO(SDL_IOStream *context); // Flush any buffered data in the stream.
void * SDL_LoadFile_IO(SDL_IOStream *src, size_t *datasize, bool closeio); // Load all the data from an SDL data stream.
void * SDL_LoadFile(const char *file, size_t *datasize); // Load all the data from a file path.
bool SDL_SaveFile_IO(SDL_IOStream *src, const void *data, size_t datasize, bool closeio); // Save all the data into an SDL data stream.
bool SDL_SaveFile(const char *file, const void *data, size_t datasize); // Save all the data into a file path.
bool SDL_ReadU8(SDL_IOStream *src, Uint8 *value); // Use this function to read a byte from an SDL_IOStream.
bool SDL_ReadS8(SDL_IOStream *src, Sint8 *value); // Use this function to read a signed byte from an SDL_IOStream.
bool SDL_ReadU16LE(SDL_IOStream *src, Uint16 *value); // Use this function to read 16 bits of little-endian data from an SDL_IOStream and return in native format.
bool SDL_ReadS16LE(SDL_IOStream *src, Sint16 *value); // Use this function to read 16 bits of little-endian data from an SDL_IOStream and return in native format.
bool SDL_ReadU16BE(SDL_IOStream *src, Uint16 *value); // Use this function to read 16 bits of big-endian data from an SDL_IOStream and return in native format.
bool SDL_ReadS16BE(SDL_IOStream *src, Sint16 *value); // Use this function to read 16 bits of big-endian data from an SDL_IOStream and return in native format.
bool SDL_ReadU32LE(SDL_IOStream *src, Uint32 *value); // Use this function to read 32 bits of little-endian data from an SDL_IOStream and return in native format.
bool SDL_ReadS32LE(SDL_IOStream *src, Sint32 *value); // Use this function to read 32 bits of little-endian data from an SDL_IOStream and return in native format.
bool SDL_ReadU32BE(SDL_IOStream *src, Uint32 *value); // Use this function to read 32 bits of big-endian data from an SDL_IOStream and return in native format.
bool SDL_ReadS32BE(SDL_IOStream *src, Sint32 *value); // Use this function to read 32 bits of big-endian data from an SDL_IOStream and return in native format.
bool SDL_ReadU64LE(SDL_IOStream *src, Uint64 *value); // Use this function to read 64 bits of little-endian data from an SDL_IOStream and return in native format.
bool SDL_ReadS64LE(SDL_IOStream *src, Sint64 *value); // Use this function to read 64 bits of little-endian data from an SDL_IOStream and return in native format.
bool SDL_ReadU64BE(SDL_IOStream *src, Uint64 *value); // Use this function to read 64 bits of big-endian data from an SDL_IOStream and return in native format.
bool SDL_ReadS64BE(SDL_IOStream *src, Sint64 *value); // Use this function to read 64 bits of big-endian data from an SDL_IOStream and return in native format.
bool SDL_WriteU8(SDL_IOStream *dst, Uint8 value); // Use this function to write a byte to an SDL_IOStream.
bool SDL_WriteS8(SDL_IOStream *dst, Sint8 value); // Use this function to write a signed byte to an SDL_IOStream.
bool SDL_WriteU16LE(SDL_IOStream *dst, Uint16 value); // Use this function to write 16 bits in native format to an SDL_IOStream as little-endian data.
bool SDL_WriteS16LE(SDL_IOStream *dst, Sint16 value); // Use this function to write 16 bits in native format to an SDL_IOStream as little-endian data.
bool SDL_WriteU16BE(SDL_IOStream *dst, Uint16 value); // Use this function to write 16 bits in native format to an SDL_IOStream as big-endian data.
bool SDL_WriteS16BE(SDL_IOStream *dst, Sint16 value); // Use this function to write 16 bits in native format to an SDL_IOStream as big-endian data.
bool SDL_WriteU32LE(SDL_IOStream *dst, Uint32 value); // Use this function to write 32 bits in native format to an SDL_IOStream as little-endian data.
bool SDL_WriteS32LE(SDL_IOStream *dst, Sint32 value); // Use this function to write 32 bits in native format to an SDL_IOStream as little-endian data.
bool SDL_WriteU32BE(SDL_IOStream *dst, Uint32 value); // Use this function to write 32 bits in native format to an SDL_IOStream as big-endian data.
bool SDL_WriteS32BE(SDL_IOStream *dst, Sint32 value); // Use this function to write 32 bits in native format to an SDL_IOStream as big-endian data.
bool SDL_WriteU64LE(SDL_IOStream *dst, Uint64 value); // Use this function to write 64 bits in native format to an SDL_IOStream as little-endian data.
bool SDL_WriteS64LE(SDL_IOStream *dst, Sint64 value); // Use this function to write 64 bits in native format to an SDL_IOStream as little-endian data.
bool SDL_WriteU64BE(SDL_IOStream *dst, Uint64 value); // Use this function to write 64 bits in native format to an SDL_IOStream as big-endian data.
bool SDL_WriteS64BE(SDL_IOStream *dst, Sint64 value); // Use this function to write 64 bits in native format to an SDL_IOStream as big-endian data.
// XXXXX XXXXXX XX XX XXX XX XXXXXX XX XXXXXX
// XX XX XX XX XX XXXX XX XX XX XX XX
// XXXXXXX XXXXXXX XXXX XX XX XX XX XX XX XX
// XX XX XX XX XX XX XX XX XX XX XX
// XX XX XXXXXX XX XX XXXX XXXXXX XX XXXXXX
const char *file, const char *mode); // Use this function to create a new SDL_AsyncIO object for reading from and/or writing to a named file.
SDL_AsyncIO * SDL_AsyncIOFromFile(// Use this function to get the size of the data stream in an SDL_AsyncIO.
Sint64 SDL_GetAsyncIOSize(SDL_AsyncIO *asyncio); bool SDL_ReadAsyncIO(SDL_AsyncIO *asyncio, void *ptr, Uint64 offset, Uint64 size, SDL_AsyncIOQueue *queue, void *userdata); // Start an async read.
bool SDL_WriteAsyncIO(SDL_AsyncIO *asyncio, void *ptr, Uint64 offset, Uint64 size, SDL_AsyncIOQueue *queue, void *userdata); // Start an async write.
bool SDL_CloseAsyncIO(SDL_AsyncIO *asyncio, bool flush, SDL_AsyncIOQueue *queue, void *userdata); // Close and free any allocated resources for an async I/O object.
void); // Create a task queue for tracking multiple I/O operations.
SDL_AsyncIOQueue * SDL_CreateAsyncIOQueue(void SDL_DestroyAsyncIOQueue(SDL_AsyncIOQueue *queue); // Destroy a previously-created async I/O task queue.
bool SDL_GetAsyncIOResult(SDL_AsyncIOQueue *queue, SDL_AsyncIOOutcome *outcome); // Query an async I/O task queue for completed tasks.
bool SDL_WaitAsyncIOResult(SDL_AsyncIOQueue *queue, SDL_AsyncIOOutcome *outcome, Sint32 timeoutMS); // Block until an async I/O task queue has a completed task.
void SDL_SignalAsyncIOQueue(SDL_AsyncIOQueue *queue); // Wake up any threads that are blocking in SDL_WaitAsyncIOResult().
bool SDL_LoadFileAsync(const char *file, SDL_AsyncIOQueue *queue, void *userdata); // Load all the data from a file path, asynchronously.
// XXXXXX XXXXXXXX XXXXXX XXXXXX XXXXX XXXXXX XXXXXXX
// XX XX XX XX XX XX XX XX XX XX
// XXXXXXX XX XX XX XXXXXX XXXXXXX XX XXX XXXXX
// XX XX XX XX XX XX XX XX XX XX XX
// XXXXXX XX XXXXXX XX XX XX XX XXXXXX XXXXXXX
const char *override, SDL_PropertiesID props); // Opens up a read-only container for the application's filesystem.
SDL_Storage * SDL_OpenTitleStorage(const char *org, const char *app, SDL_PropertiesID props); // Opens up a container for a user's unique read/write filesystem.
SDL_Storage * SDL_OpenUserStorage(const char *path); // Opens up a container for local filesystem storage.
SDL_Storage * SDL_OpenFileStorage(const SDL_StorageInterface *iface, void *userdata); // Opens up a container using a client-provided storage interface.
SDL_Storage * SDL_OpenStorage(bool SDL_CloseStorage(SDL_Storage *storage); // Closes and frees a storage container.
bool SDL_StorageReady(SDL_Storage *storage); // Checks if the storage container is ready to use.
bool SDL_GetStorageFileSize(SDL_Storage *storage, const char *path, Uint64 *length); // Query the size of a file within a storage container.
bool SDL_ReadStorageFile(SDL_Storage *storage, const char *path, void *destination, Uint64 length); // Synchronously read a file from a storage container into a client-provided buffer.
bool SDL_WriteStorageFile(SDL_Storage *storage, const char *path, const void *source, Uint64 length); // Synchronously write a file from client memory into a storage container.
bool SDL_CreateStorageDirectory(SDL_Storage *storage, const char *path); // Create a directory in a writable storage container.
bool SDL_EnumerateStorageDirectory(SDL_Storage *storage, const char *path, SDL_EnumerateDirectoryCallback callback, void *userdata); // Enumerate a directory in a storage container through a callback function.
bool SDL_RemoveStoragePath(SDL_Storage *storage, const char *path); // Remove a file or an empty directory in a writable storage container.
bool SDL_RenameStoragePath(SDL_Storage *storage, const char *oldpath, const char *newpath); // Rename a file or directory in a writable storage container.
bool SDL_CopyStorageFile(SDL_Storage *storage, const char *oldpath, const char *newpath); // Copy a file in a writable storage container.
bool SDL_GetStoragePathInfo(SDL_Storage *storage, const char *path, SDL_PathInfo *info); // Get information about a filesystem path in a storage container.
// Queries the remaining space in a storage container.
Uint64 SDL_GetStorageSpaceRemaining(SDL_Storage *storage); char ** SDL_GlobStorageDirectory(SDL_Storage *storage, const char *path, const char *pattern, SDL_GlobFlags flags, int *count); // Enumerate a directory tree, filtered by pattern, and return a list.
// XXXXXX XX XX XX XXXXXXX XX XXXXXX
// XX XX XX XX XX XX XX XX
// XXXXXX XX XXX XXXXX XX XXXXXXX
// XX XX XX XX XX XX XX
// XX XX XX XX XXXXXXX XXXXXXX XXXXXX
const char * SDL_GetPixelFormatName(SDL_PixelFormat format); // Get the human readable name of a pixel format.
bool SDL_GetMasksForPixelFormat(SDL_PixelFormat format, int *bpp, Uint32 *Rmask, Uint32 *Gmask, Uint32 *Bmask, Uint32 *Amask); // Convert one of the enumerated pixel formats to a bpp value and RGBA masks.
int bpp, Uint32 Rmask, Uint32 Gmask, Uint32 Bmask, Uint32 Amask); // Convert a bpp value and RGBA masks to an enumerated pixel format.
SDL_PixelFormat SDL_GetPixelFormatForMasks(const SDL_PixelFormatDetails * SDL_GetPixelFormatDetails(SDL_PixelFormat format); // Create an SDL_PixelFormatDetails structure corresponding to a pixel format.
int ncolors); // Create a palette structure with the specified number of color entries.
SDL_Palette * SDL_CreatePalette(bool SDL_SetPaletteColors(SDL_Palette *palette, const SDL_Color *colors, int firstcolor, int ncolors); // Set a range of colors in a palette.
void SDL_DestroyPalette(SDL_Palette *palette); // Free a palette created with SDL_CreatePalette().
const SDL_PixelFormatDetails *format, const SDL_Palette *palette, Uint8 r, Uint8 g, Uint8 b); // Map an RGB triple to an opaque pixel value for a given pixel format.
Uint32 SDL_MapRGB(const SDL_PixelFormatDetails *format, const SDL_Palette *palette, Uint8 r, Uint8 g, Uint8 b, Uint8 a); // Map an RGBA quadruple to a pixel value for a given pixel format.
Uint32 SDL_MapRGBA(void SDL_GetRGB(Uint32 pixel, const SDL_PixelFormatDetails *format, const SDL_Palette *palette, Uint8 *r, Uint8 *g, Uint8 *b); // Get RGB values from a pixel in the specified format.
void SDL_GetRGBA(Uint32 pixel, const SDL_PixelFormatDetails *format, const SDL_Palette *palette, Uint8 *r, Uint8 *g, Uint8 *b, Uint8 *a); // Get RGBA values from a pixel in the specified format.
// XXXXXX XX XX XXXXXX XXXXXXX XXXXX XXXXXX XXXXXXX
// XX XX XX XX XX XX XX XX XX XX
// XXXXXXX XX XX XXXXXX XXXXX XXXXXXX XX XXXXX
// XX XX XX XX XX XX XX XX XX XX
// XXXXXX XXXXXX XX XX XX XX XX XXXXXX XXXXXXX
int width, int height, SDL_PixelFormat format); // Allocate a new surface with a specific pixel format.
SDL_Surface * SDL_CreateSurface(int width, int height, SDL_PixelFormat format, void *pixels, int pitch); // Allocate a new surface with a specific pixel format and existing pixel data.
SDL_Surface * SDL_CreateSurfaceFrom(void SDL_DestroySurface(SDL_Surface *surface); // Free a surface.
// Get the properties associated with a surface.
SDL_PropertiesID SDL_GetSurfaceProperties(SDL_Surface *surface); bool SDL_SetSurfaceColorspace(SDL_Surface *surface, SDL_Colorspace colorspace); // Set the colorspace used by a surface.
// Get the colorspace used by a surface.
SDL_Colorspace SDL_GetSurfaceColorspace(SDL_Surface *surface); // Create a palette and associate it with a surface.
SDL_Palette * SDL_CreateSurfacePalette(SDL_Surface *surface); bool SDL_SetSurfacePalette(SDL_Surface *surface, SDL_Palette *palette); // Set the palette used by a surface.
// Get the palette used by a surface.
SDL_Palette * SDL_GetSurfacePalette(SDL_Surface *surface); bool SDL_AddSurfaceAlternateImage(SDL_Surface *surface, SDL_Surface *image); // Add an alternate version of a surface.
bool SDL_SurfaceHasAlternateImages(SDL_Surface *surface); // Return whether a surface has alternate versions available.
int *count); // Get an array including all versions of a surface.
SDL_Surface ** SDL_GetSurfaceImages(SDL_Surface *surface, void SDL_RemoveSurfaceAlternateImages(SDL_Surface *surface); // Remove all alternate versions of a surface.
bool SDL_LockSurface(SDL_Surface *surface); // Set up a surface for directly accessing the pixels.
void SDL_UnlockSurface(SDL_Surface *surface); // Release a surface after directly accessing the pixels.
bool closeio); // Load a BMP image from a seekable SDL data stream.
SDL_Surface * SDL_LoadBMP_IO(SDL_IOStream *src, const char *file); // Load a BMP image from a file.
SDL_Surface * SDL_LoadBMP(bool SDL_SaveBMP_IO(SDL_Surface *surface, SDL_IOStream *dst, bool closeio); // Save a surface to a seekable SDL data stream in BMP format.
bool SDL_SaveBMP(SDL_Surface *surface, const char *file); // Save a surface to a file.
bool SDL_SetSurfaceRLE(SDL_Surface *surface, bool enabled); // Set the RLE acceleration hint for a surface.
bool SDL_SurfaceHasRLE(SDL_Surface *surface); // Returns whether the surface is RLE enabled.
bool SDL_SetSurfaceColorKey(SDL_Surface *surface, bool enabled, Uint32 key); // Set the color key (transparent pixel) in a surface.
bool SDL_SurfaceHasColorKey(SDL_Surface *surface); // Returns whether the surface has a color key.
bool SDL_GetSurfaceColorKey(SDL_Surface *surface, Uint32 *key); // Get the color key (transparent pixel) for a surface.
bool SDL_SetSurfaceColorMod(SDL_Surface *surface, Uint8 r, Uint8 g, Uint8 b); // Set an additional color value multiplied into blit operations.
bool SDL_GetSurfaceColorMod(SDL_Surface *surface, Uint8 *r, Uint8 *g, Uint8 *b); // Get the additional color value multiplied into blit operations.
bool SDL_SetSurfaceAlphaMod(SDL_Surface *surface, Uint8 alpha); // Set an additional alpha value used in blit operations.
bool SDL_GetSurfaceAlphaMod(SDL_Surface *surface, Uint8 *alpha); // Get the additional alpha value used in blit operations.
bool SDL_SetSurfaceBlendMode(SDL_Surface *surface, SDL_BlendMode blendMode); // Set the blend mode used for blit operations.
bool SDL_GetSurfaceBlendMode(SDL_Surface *surface, SDL_BlendMode *blendMode); // Get the blend mode used for blit operations.
bool SDL_SetSurfaceClipRect(SDL_Surface *surface, const SDL_Rect *rect); // Set the clipping rectangle for a surface.
bool SDL_GetSurfaceClipRect(SDL_Surface *surface, SDL_Rect *rect); // Get the clipping rectangle for a surface.
bool SDL_FlipSurface(SDL_Surface *surface, SDL_FlipMode flip); // Flip a surface vertically or horizontally.
// Creates a new surface identical to the existing surface.
SDL_Surface * SDL_DuplicateSurface(SDL_Surface *surface); int width, int height, SDL_ScaleMode scaleMode); // Creates a new surface identical to the existing surface, scaled to the desired size.
SDL_Surface * SDL_ScaleSurface(SDL_Surface *surface, // Copy an existing surface to a new surface of the specified format.
SDL_Surface * SDL_ConvertSurface(SDL_Surface *surface, SDL_PixelFormat format); // Copy an existing surface to a new surface of the specified format and colorspace.
SDL_Surface * SDL_ConvertSurfaceAndColorspace(SDL_Surface *surface, SDL_PixelFormat format, SDL_Palette *palette, SDL_Colorspace colorspace, SDL_PropertiesID props); bool SDL_ConvertPixels(int width, int height, SDL_PixelFormat src_format, const void *src, int src_pitch, SDL_PixelFormat dst_format, void *dst, int dst_pitch); // Copy a block of pixels of one format to another format.
bool SDL_ConvertPixelsAndColorspace(int width, int height, SDL_PixelFormat src_format, SDL_Colorspace src_colorspace, SDL_PropertiesID src_properties, const void *src, int src_pitch, SDL_PixelFormat dst_format, SDL_Colorspace dst_colorspace, SDL_PropertiesID dst_properties, void *dst, int dst_pitch); // Copy a block of pixels of one format and colorspace to another format and colorspace.
bool SDL_PremultiplyAlpha(int width, int height, SDL_PixelFormat src_format, const void *src, int src_pitch, SDL_PixelFormat dst_format, void *dst, int dst_pitch, bool linear); // Premultiply the alpha on a block of pixels.
bool SDL_PremultiplySurfaceAlpha(SDL_Surface *surface, bool linear); // Premultiply the alpha in a surface.
bool SDL_ClearSurface(SDL_Surface *surface, float r, float g, float b, float a); // Clear a surface with a specific color, with floating point precision.
bool SDL_FillSurfaceRect(SDL_Surface *dst, const SDL_Rect *rect, Uint32 color); // Perform a fast fill of a rectangle with a specific color.
bool SDL_FillSurfaceRects(SDL_Surface *dst, const SDL_Rect *rects, int count, Uint32 color); // Perform a fast fill of a set of rectangles with a specific color.
bool SDL_BlitSurface(SDL_Surface *src, const SDL_Rect *srcrect, SDL_Surface *dst, const SDL_Rect *dstrect); // Performs a fast blit from the source surface to the destination surface.
bool SDL_BlitSurfaceUnchecked(SDL_Surface *src, const SDL_Rect *srcrect, SDL_Surface *dst, const SDL_Rect *dstrect); // Perform low-level surface blitting only.
bool SDL_BlitSurfaceScaled(SDL_Surface *src, const SDL_Rect *srcrect, SDL_Surface *dst, const SDL_Rect *dstrect, SDL_ScaleMode scaleMode); // Perform a scaled blit to a destination surface, which may be of a different format.
bool SDL_BlitSurfaceUncheckedScaled(SDL_Surface *src, const SDL_Rect *srcrect, SDL_Surface *dst, const SDL_Rect *dstrect, SDL_ScaleMode scaleMode); // Perform low-level surface scaled blitting only.
bool SDL_BlitSurfaceTiled(SDL_Surface *src, const SDL_Rect *srcrect, SDL_Surface *dst, const SDL_Rect *dstrect); // Perform a tiled blit to a destination surface, which may be of a different format.
bool SDL_BlitSurfaceTiledWithScale(SDL_Surface *src, const SDL_Rect *srcrect, float scale, SDL_ScaleMode scaleMode, SDL_Surface *dst, const SDL_Rect *dstrect); // Perform a scaled and tiled blit to a destination surface, which may be of a different format.
bool SDL_BlitSurface9Grid(SDL_Surface *src, const SDL_Rect *srcrect, int left_width, int right_width, int top_height, int bottom_height, float scale, SDL_ScaleMode scaleMode, SDL_Surface *dst, const SDL_Rect *dstrect); // Perform a scaled blit using the 9-grid algorithm to a destination surface, which may be of a different format.
// Map an RGB triple to an opaque pixel value for a surface.
Uint32 SDL_MapSurfaceRGB(SDL_Surface *surface, Uint8 r, Uint8 g, Uint8 b); // Map an RGBA quadruple to a pixel value for a surface.
Uint32 SDL_MapSurfaceRGBA(SDL_Surface *surface, Uint8 r, Uint8 g, Uint8 b, Uint8 a); bool SDL_ReadSurfacePixel(SDL_Surface *surface, int x, int y, Uint8 *r, Uint8 *g, Uint8 *b, Uint8 *a); // Retrieves a single pixel from a surface.
bool SDL_ReadSurfacePixelFloat(SDL_Surface *surface, int x, int y, float *r, float *g, float *b, float *a); // Retrieves a single pixel from a surface.
bool SDL_WriteSurfacePixel(SDL_Surface *surface, int x, int y, Uint8 r, Uint8 g, Uint8 b, Uint8 a); // Writes a single pixel to a surface.
bool SDL_WriteSurfacePixelFloat(SDL_Surface *surface, int x, int y, float r, float g, float b, float a); // Writes a single pixel to a surface.
// XXXXXX XX XXXXXXX XXX XX XXXXXX XXX XXX XXXXXX XXXXXX XXXXXXX
// XX XX XX XX XXXX XX XX XX XXXX XXXX XX XX XX XX XX
// XXXXXX XX XXXXX XX XX XX XX XX XX XXXX XX XX XX XX XX XXXXX
// XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX
// XXXXXX XXXXXXX XXXXXXX XX XXXX XXXXXX XX XX XXXXXX XXXXXX XXXXXXX
// Compose a custom blend mode for renderers.
SDL_BlendMode SDL_ComposeCustomBlendMode(SDL_BlendFactor srcColorFactor, SDL_BlendFactor dstColorFactor, SDL_BlendOperation colorOperation, SDL_BlendFactor srcAlphaFactor, SDL_BlendFactor dstAlphaFactor, SDL_BlendOperation alphaOperation);
// XXXXXX XXXXXXX XXXXXX XXXXXXXX
// XX XX XX XX XX
// XXXXXX XXXXX XX XX
// XX XX XX XX XX
// XX XX XXXXXXX XXXXXX XX
void SDL_RectToFRect(const SDL_Rect *rect, SDL_FRect *frect); // Convert an SDL_Rect to SDL_FRect
bool SDL_PointInRect(const SDL_Point *p, const SDL_Rect *r); // Determine whether a point resides inside a rectangle.
bool SDL_RectEmpty(const SDL_Rect *r); // Determine whether a rectangle has no area.
bool SDL_RectsEqual(const SDL_Rect *a, const SDL_Rect *b); // Determine whether two rectangles are equal.
bool SDL_HasRectIntersection(const SDL_Rect *A, const SDL_Rect *B); // Determine whether two rectangles intersect.
bool SDL_GetRectIntersection(const SDL_Rect *A, const SDL_Rect *B, SDL_Rect *result); // Calculate the intersection of two rectangles.
bool SDL_GetRectUnion(const SDL_Rect *A, const SDL_Rect *B, SDL_Rect *result); // Calculate the union of two rectangles.
bool SDL_GetRectEnclosingPoints(const SDL_Point *points, int count, const SDL_Rect *clip, SDL_Rect *result); // Calculate a minimal rectangle enclosing a set of points.
bool SDL_GetRectAndLineIntersection(const SDL_Rect *rect, int *X1, int *Y1, int *X2, int *Y2); // Calculate the intersection of a rectangle and line segment.
bool SDL_PointInRectFloat(const SDL_FPoint *p, const SDL_FRect *r); // Determine whether a point resides inside a floating point rectangle.
bool SDL_RectEmptyFloat(const SDL_FRect *r); // Determine whether a floating point rectangle can contain any point.
bool SDL_RectsEqualEpsilon(const SDL_FRect *a, const SDL_FRect *b, const float epsilon); // Determine whether two floating point rectangles are equal, within some given epsilon.
bool SDL_RectsEqualFloat(const SDL_FRect *a, const SDL_FRect *b); // Determine whether two floating point rectangles are equal, within a default epsilon.
bool SDL_HasRectIntersectionFloat(const SDL_FRect *A, const SDL_FRect *B); // Determine whether two rectangles intersect with float precision.
bool SDL_GetRectIntersectionFloat(const SDL_FRect *A, const SDL_FRect *B, SDL_FRect *result); // Calculate the intersection of two rectangles with float precision.
bool SDL_GetRectUnionFloat(const SDL_FRect *A, const SDL_FRect *B, SDL_FRect *result); // Calculate the union of two rectangles with float precision.
bool SDL_GetRectEnclosingPointsFloat(const SDL_FPoint *points, int count, const SDL_FRect *clip, SDL_FRect *result); // Calculate a minimal rectangle enclosing a set of points with float precision.
bool SDL_GetRectAndLineIntersectionFloat(const SDL_FRect *rect, float *X1, float *Y1, float *X2, float *Y2); // Calculate the intersection of a rectangle and line segment with float precision.
// XXXXXX XXXXX XXX XXX XXXXXXX XXXXXX XXXXX
// XX XX XX XXXX XXXX XX XX XX XX XX
// XX XXXXXXX XX XXXX XX XXXXX XXXXXX XXXXXXX
// XX XX XX XX XX XX XX XX XX XX XX
// XXXXXX XX XX XX XX XXXXXXX XX XX XX XX
int SDL_GetNumCameraDrivers(void); // Use this function to get the number of built-in camera drivers.
const char * SDL_GetCameraDriver(int index); // Use this function to get the name of a built in camera driver.
const char * SDL_GetCurrentCameraDriver(void); // Get the name of the current camera driver.
int *count); // Get a list of currently connected camera devices.
SDL_CameraID * SDL_GetCameras(int *count); // Get the list of native formats/sizes a camera supports.
SDL_CameraSpec ** SDL_GetCameraSupportedFormats(SDL_CameraID devid, const char * SDL_GetCameraName(SDL_CameraID instance_id); // Get the human-readable device name for a camera.
// Get the position of the camera in relation to the system.
SDL_CameraPosition SDL_GetCameraPosition(SDL_CameraID instance_id); const SDL_CameraSpec *spec); // Open a video recording device (a "camera").
SDL_Camera * SDL_OpenCamera(SDL_CameraID instance_id, int SDL_GetCameraPermissionState(SDL_Camera *camera); // Query if camera access has been approved by the user.
// Get the instance ID of an opened camera.
SDL_CameraID SDL_GetCameraID(SDL_Camera *camera); // Get the properties associated with an opened camera.
SDL_PropertiesID SDL_GetCameraProperties(SDL_Camera *camera); bool SDL_GetCameraFormat(SDL_Camera *camera, SDL_CameraSpec *spec); // Get the spec that a camera is using when generating images.
// Acquire a frame.
SDL_Surface * SDL_AcquireCameraFrame(SDL_Camera *camera, Uint64 *timestampNS); void SDL_ReleaseCameraFrame(SDL_Camera *camera, SDL_Surface *frame); // Release a frame of video acquired from a camera.
void SDL_CloseCamera(SDL_Camera *camera); // Use this function to shut down camera processing and close the camera device.
// XXXXXX XX XX XXXXXX XXXXXX XXXXXX XXXXX XXXXXX XXXXXX
// XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX
// XX XX XX XXXXXX XXXXXX XX XX XXXXXXX XXXXXX XX XX
// XX XX XX XX XX XX XX XX XX XX XX XX XX XX
// XXXXXX XXXXXXX XX XX XXXXXX XXXXXX XX XX XX XX XXXXXX
bool SDL_SetClipboardText(const char *text); // Put UTF-8 text into the clipboard.
char * SDL_GetClipboardText(void); // Get UTF-8 text from the clipboard.
bool SDL_HasClipboardText(void); // Query whether the clipboard exists and contains a non-empty text string.
bool SDL_SetPrimarySelectionText(const char *text); // Put UTF-8 text into the primary selection.
char * SDL_GetPrimarySelectionText(void); // Get UTF-8 text from the primary selection.
bool SDL_HasPrimarySelectionText(void); // Query whether the primary selection exists and contains a non-empty text string.
bool SDL_SetClipboardData(SDL_ClipboardDataCallback callback, SDL_ClipboardCleanupCallback cleanup, void *userdata, const char **mime_types, size_t num_mime_types); // Offer clipboard data to the OS.
bool SDL_ClearClipboardData(void); // Clear the clipboard data.
void * SDL_GetClipboardData(const char *mime_type, size_t *size); // Get the data from clipboard for a given mime type.
bool SDL_HasClipboardData(const char *mime_type); // Query whether there is data in the clipboard for the provided mime type.
char ** SDL_GetClipboardMimeTypes(size_t *num_mime_types); // Retrieve the list of mime types available in the clipboard.
// XXXXXX XX XXXXX XX XXXXXX XXXXXX
// XX XX XX XX XX XX XX XX XX
// XX XX XX XXXXXXX XX XX XX XX XXX
// XX XX XX XX XX XX XX XX XX XX
// XXXXXX XX XX XX XXXXXXX XXXXXX XXXXXX
void SDL_ShowOpenFileDialog(SDL_DialogFileCallback callback, void *userdata, SDL_Window *window, const SDL_DialogFileFilter *filters, int nfilters, const char *default_location, bool allow_many); // Displays a dialog that lets the user select a file on their filesystem.
void SDL_ShowSaveFileDialog(SDL_DialogFileCallback callback, void *userdata, SDL_Window *window, const SDL_DialogFileFilter *filters, int nfilters, const char *default_location); // Displays a dialog that lets the user choose a new or existing file on their filesystem.
void SDL_ShowOpenFolderDialog(SDL_DialogFileCallback callback, void *userdata, SDL_Window *window, const char *default_location, bool allow_many); // Displays a dialog that lets the user select a folder on their filesystem.
void SDL_ShowFileDialogWithProperties(SDL_FileDialogType type, SDL_DialogFileCallback callback, void *userdata, SDL_PropertiesID props); // Create and launch a file dialog with the specified properties.
// XXXXXX XXXXXX XX XX
// XX XX XX XX XX
// XX XXX XXXXXX XX XX
// XX XX XX XX XX
// XXXXXX XX XXXXXX
bool SDL_GPUSupportsShaderFormats(SDL_GPUShaderFormat format_flags, const char *name); // Checks for GPU runtime support.
bool SDL_GPUSupportsProperties(SDL_PropertiesID props); // Checks for GPU runtime support.
bool debug_mode, const char *name); // Creates a GPU context.
SDL_GPUDevice * SDL_CreateGPUDevice(SDL_GPUShaderFormat format_flags, // Creates a GPU context.
SDL_GPUDevice * SDL_CreateGPUDeviceWithProperties(SDL_PropertiesID props); void SDL_DestroyGPUDevice(SDL_GPUDevice *device); // Destroys a GPU context previously returned by SDL_CreateGPUDevice.
int SDL_GetNumGPUDrivers(void); // Get the number of GPU drivers compiled into SDL.
const char * SDL_GetGPUDriver(int index); // Get the name of a built in GPU driver.
const char * SDL_GetGPUDeviceDriver(SDL_GPUDevice *device); // Returns the name of the backend used to create this GPU context.
// Returns the supported shader formats for this GPU context.
SDL_GPUShaderFormat SDL_GetGPUShaderFormats(SDL_GPUDevice *device); const SDL_GPUComputePipelineCreateInfo *createinfo); // Creates a pipeline object to be used in a compute workflow.
SDL_GPUComputePipeline * SDL_CreateGPUComputePipeline(SDL_GPUDevice *device, const SDL_GPUGraphicsPipelineCreateInfo *createinfo); // Creates a pipeline object to be used in a graphics workflow.
SDL_GPUGraphicsPipeline * SDL_CreateGPUGraphicsPipeline(SDL_GPUDevice *device, const SDL_GPUSamplerCreateInfo *createinfo); // Creates a sampler object to be used when binding textures in a graphics workflow.
SDL_GPUSampler * SDL_CreateGPUSampler(SDL_GPUDevice *device, const SDL_GPUShaderCreateInfo *createinfo); // Creates a shader to be used when creating a graphics pipeline.
SDL_GPUShader * SDL_CreateGPUShader(SDL_GPUDevice *device, const SDL_GPUTextureCreateInfo *createinfo); // Creates a texture object to be used in graphics or compute workflows.
SDL_GPUTexture * SDL_CreateGPUTexture(SDL_GPUDevice *device, const SDL_GPUBufferCreateInfo *createinfo); // Creates a buffer object to be used in graphics or compute workflows.
SDL_GPUBuffer * SDL_CreateGPUBuffer(SDL_GPUDevice *device, const SDL_GPUTransferBufferCreateInfo *createinfo); // Creates a transfer buffer to be used when uploading to or downloading from graphics resources.
SDL_GPUTransferBuffer * SDL_CreateGPUTransferBuffer(SDL_GPUDevice *device, void SDL_SetGPUBufferName(SDL_GPUDevice *device, SDL_GPUBuffer *buffer, const char *text); // Sets an arbitrary string constant to label a buffer.
void SDL_SetGPUTextureName(SDL_GPUDevice *device, SDL_GPUTexture *texture, const char *text); // Sets an arbitrary string constant to label a texture.
void SDL_InsertGPUDebugLabel(SDL_GPUCommandBuffer *command_buffer, const char *text); // Inserts an arbitrary string label into the command buffer callstream.
void SDL_PushGPUDebugGroup(SDL_GPUCommandBuffer *command_buffer, const char *name); // Begins a debug group with an arbitary name.
void SDL_PopGPUDebugGroup(SDL_GPUCommandBuffer *command_buffer); // Ends the most-recently pushed debug group.
void SDL_ReleaseGPUTexture(SDL_GPUDevice *device, SDL_GPUTexture *texture); // Frees the given texture as soon as it is safe to do so.
void SDL_ReleaseGPUSampler(SDL_GPUDevice *device, SDL_GPUSampler *sampler); // Frees the given sampler as soon as it is safe to do so.
void SDL_ReleaseGPUBuffer(SDL_GPUDevice *device, SDL_GPUBuffer *buffer); // Frees the given buffer as soon as it is safe to do so.
void SDL_ReleaseGPUTransferBuffer(SDL_GPUDevice *device, SDL_GPUTransferBuffer *transfer_buffer); // Frees the given transfer buffer as soon as it is safe to do so.
void SDL_ReleaseGPUComputePipeline(SDL_GPUDevice *device, SDL_GPUComputePipeline *compute_pipeline); // Frees the given compute pipeline as soon as it is safe to do so.
void SDL_ReleaseGPUShader(SDL_GPUDevice *device, SDL_GPUShader *shader); // Frees the given shader as soon as it is safe to do so.
void SDL_ReleaseGPUGraphicsPipeline(SDL_GPUDevice *device, SDL_GPUGraphicsPipeline *graphics_pipeline); // Frees the given graphics pipeline as soon as it is safe to do so.
// Acquire a command buffer.
SDL_GPUCommandBuffer * SDL_AcquireGPUCommandBuffer(SDL_GPUDevice *device); void SDL_PushGPUVertexUniformData(SDL_GPUCommandBuffer *command_buffer, Uint32 slot_index, const void *data, Uint32 length); // Pushes data to a vertex uniform slot on the command buffer.
void SDL_PushGPUFragmentUniformData(SDL_GPUCommandBuffer *command_buffer, Uint32 slot_index, const void *data, Uint32 length); // Pushes data to a fragment uniform slot on the command buffer.
void SDL_PushGPUComputeUniformData(SDL_GPUCommandBuffer *command_buffer, Uint32 slot_index, const void *data, Uint32 length); // Pushes data to a uniform slot on the command buffer.
const SDL_GPUColorTargetInfo *color_target_infos, Uint32 num_color_targets, const SDL_GPUDepthStencilTargetInfo *depth_stencil_target_info); // Begins a render pass on a command buffer.
SDL_GPURenderPass * SDL_BeginGPURenderPass(SDL_GPUCommandBuffer *command_buffer, void SDL_BindGPUGraphicsPipeline(SDL_GPURenderPass *render_pass, SDL_GPUGraphicsPipeline *graphics_pipeline); // Binds a graphics pipeline on a render pass to be used in rendering.
void SDL_SetGPUViewport(SDL_GPURenderPass *render_pass, const SDL_GPUViewport *viewport); // Sets the current viewport state on a command buffer.
void SDL_SetGPUScissor(SDL_GPURenderPass *render_pass, const SDL_Rect *scissor); // Sets the current scissor state on a command buffer.
void SDL_SetGPUBlendConstants(SDL_GPURenderPass *render_pass, SDL_FColor blend_constants); // Sets the current blend constants on a command buffer.
void SDL_SetGPUStencilReference(SDL_GPURenderPass *render_pass, Uint8 reference); // Sets the current stencil reference value on a command buffer.
void SDL_BindGPUVertexBuffers(SDL_GPURenderPass *render_pass, Uint32 first_slot, const SDL_GPUBufferBinding *bindings, Uint32 num_bindings); // Binds vertex buffers on a command buffer for use with subsequent draw calls.
void SDL_BindGPUIndexBuffer(SDL_GPURenderPass *render_pass, const SDL_GPUBufferBinding *binding, SDL_GPUIndexElementSize index_element_size); // Binds an index buffer on a command buffer for use with subsequent draw calls.
void SDL_BindGPUVertexSamplers(SDL_GPURenderPass *render_pass, Uint32 first_slot, const SDL_GPUTextureSamplerBinding *texture_sampler_bindings, Uint32 num_bindings); // Binds texture-sampler pairs for use on the vertex shader.
void SDL_BindGPUVertexStorageTextures(SDL_GPURenderPass *render_pass, Uint32 first_slot, SDL_GPUTexture *const *storage_textures, Uint32 num_bindings); // Binds storage textures for use on the vertex shader.
void SDL_BindGPUVertexStorageBuffers(SDL_GPURenderPass *render_pass, Uint32 first_slot, SDL_GPUBuffer *const *storage_buffers, Uint32 num_bindings); // Binds storage buffers for use on the vertex shader.
void SDL_BindGPUFragmentSamplers(SDL_GPURenderPass *render_pass, Uint32 first_slot, const SDL_GPUTextureSamplerBinding *texture_sampler_bindings, Uint32 num_bindings); // Binds texture-sampler pairs for use on the fragment shader.
void SDL_BindGPUFragmentStorageTextures(SDL_GPURenderPass *render_pass, Uint32 first_slot, SDL_GPUTexture *const *storage_textures, Uint32 num_bindings); // Binds storage textures for use on the fragment shader.
void SDL_BindGPUFragmentStorageBuffers(SDL_GPURenderPass *render_pass, Uint32 first_slot, SDL_GPUBuffer *const *storage_buffers, Uint32 num_bindings); // Binds storage buffers for use on the fragment shader.
void SDL_DrawGPUIndexedPrimitives(SDL_GPURenderPass *render_pass, Uint32 num_indices, Uint32 num_instances, Uint32 first_index, Sint32 vertex_offset, Uint32 first_instance); // Draws data using bound graphics state with an index buffer and instancing enabled.
void SDL_DrawGPUPrimitives(SDL_GPURenderPass *render_pass, Uint32 num_vertices, Uint32 num_instances, Uint32 first_vertex, Uint32 first_instance); // Draws data using bound graphics state.
void SDL_DrawGPUPrimitivesIndirect(SDL_GPURenderPass *render_pass, SDL_GPUBuffer *buffer, Uint32 offset, Uint32 draw_count); // Draws data using bound graphics state and with draw parameters set from a buffer.
void SDL_DrawGPUIndexedPrimitivesIndirect(SDL_GPURenderPass *render_pass, SDL_GPUBuffer *buffer, Uint32 offset, Uint32 draw_count); // Draws data using bound graphics state with an index buffer enabled and with draw parameters set from a buffer.
void SDL_EndGPURenderPass(SDL_GPURenderPass *render_pass); // Ends the given render pass.
const SDL_GPUStorageTextureReadWriteBinding *storage_texture_bindings, Uint32 num_storage_texture_bindings, const SDL_GPUStorageBufferReadWriteBinding *storage_buffer_bindings, Uint32 num_storage_buffer_bindings); // Begins a compute pass on a command buffer.
SDL_GPUComputePass * SDL_BeginGPUComputePass(SDL_GPUCommandBuffer *command_buffer, void SDL_BindGPUComputePipeline(SDL_GPUComputePass *compute_pass, SDL_GPUComputePipeline *compute_pipeline); // Binds a compute pipeline on a command buffer for use in compute dispatch.
void SDL_BindGPUComputeSamplers(SDL_GPUComputePass *compute_pass, Uint32 first_slot, const SDL_GPUTextureSamplerBinding *texture_sampler_bindings, Uint32 num_bindings); // Binds texture-sampler pairs for use on the compute shader.
void SDL_BindGPUComputeStorageTextures(SDL_GPUComputePass *compute_pass, Uint32 first_slot, SDL_GPUTexture *const *storage_textures, Uint32 num_bindings); // Binds storage textures as readonly for use on the compute pipeline.
void SDL_BindGPUComputeStorageBuffers(SDL_GPUComputePass *compute_pass, Uint32 first_slot, SDL_GPUBuffer *const *storage_buffers, Uint32 num_bindings); // Binds storage buffers as readonly for use on the compute pipeline.
void SDL_DispatchGPUCompute(SDL_GPUComputePass *compute_pass, Uint32 groupcount_x, Uint32 groupcount_y, Uint32 groupcount_z); // Dispatches compute work.
void SDL_DispatchGPUComputeIndirect(SDL_GPUComputePass *compute_pass, SDL_GPUBuffer *buffer, Uint32 offset); // Dispatches compute work with parameters set from a buffer.
void SDL_EndGPUComputePass(SDL_GPUComputePass *compute_pass); // Ends the current compute pass.
void * SDL_MapGPUTransferBuffer(SDL_GPUDevice *device, SDL_GPUTransferBuffer *transfer_buffer, bool cycle); // Maps a transfer buffer into application address space.
void SDL_UnmapGPUTransferBuffer(SDL_GPUDevice *device, SDL_GPUTransferBuffer *transfer_buffer); // Unmaps a previously mapped transfer buffer.
// Begins a copy pass on a command buffer.
SDL_GPUCopyPass * SDL_BeginGPUCopyPass(SDL_GPUCommandBuffer *command_buffer); void SDL_UploadToGPUTexture(SDL_GPUCopyPass *copy_pass, const SDL_GPUTextureTransferInfo *source, const SDL_GPUTextureRegion *destination, bool cycle); // Uploads data from a transfer buffer to a texture.
void SDL_UploadToGPUBuffer(SDL_GPUCopyPass *copy_pass, const SDL_GPUTransferBufferLocation *source, const SDL_GPUBufferRegion *destination, bool cycle); // Uploads data from a transfer buffer to a buffer.
void SDL_CopyGPUTextureToTexture(SDL_GPUCopyPass *copy_pass, const SDL_GPUTextureLocation *source, const SDL_GPUTextureLocation *destination, Uint32 w, Uint32 h, Uint32 d, bool cycle); // Performs a texture-to-texture copy.
void SDL_CopyGPUBufferToBuffer(SDL_GPUCopyPass *copy_pass, const SDL_GPUBufferLocation *source, const SDL_GPUBufferLocation *destination, Uint32 size, bool cycle); // Performs a buffer-to-buffer copy.
void SDL_DownloadFromGPUTexture(SDL_GPUCopyPass *copy_pass, const SDL_GPUTextureRegion *source, const SDL_GPUTextureTransferInfo *destination); // Copies data from a texture to a transfer buffer on the GPU timeline.
void SDL_DownloadFromGPUBuffer(SDL_GPUCopyPass *copy_pass, const SDL_GPUBufferRegion *source, const SDL_GPUTransferBufferLocation *destination); // Copies data from a buffer to a transfer buffer on the GPU timeline.
void SDL_EndGPUCopyPass(SDL_GPUCopyPass *copy_pass); // Ends the current copy pass.
void SDL_GenerateMipmapsForGPUTexture(SDL_GPUCommandBuffer *command_buffer, SDL_GPUTexture *texture); // Generates mipmaps for the given texture.
void SDL_BlitGPUTexture(SDL_GPUCommandBuffer *command_buffer, const SDL_GPUBlitInfo *info); // Blits from a source texture region to a destination texture region.
bool SDL_WindowSupportsGPUSwapchainComposition(SDL_GPUDevice *device, SDL_Window *window, SDL_GPUSwapchainComposition swapchain_composition); // Determines whether a swapchain composition is supported by the window.
bool SDL_WindowSupportsGPUPresentMode(SDL_GPUDevice *device, SDL_Window *window, SDL_GPUPresentMode present_mode); // Determines whether a presentation mode is supported by the window.
bool SDL_ClaimWindowForGPUDevice(SDL_GPUDevice *device, SDL_Window *window); // Claims a window, creating a swapchain structure for it.
void SDL_ReleaseWindowFromGPUDevice(SDL_GPUDevice *device, SDL_Window *window); // Unclaims a window, destroying its swapchain structure.
bool SDL_SetGPUSwapchainParameters(SDL_GPUDevice *device, SDL_Window *window, SDL_GPUSwapchainComposition swapchain_composition, SDL_GPUPresentMode present_mode); // Changes the swapchain parameters for the given claimed window.
bool SDL_SetGPUAllowedFramesInFlight(SDL_GPUDevice *device, Uint32 allowed_frames_in_flight); // Configures the maximum allowed number of frames in flight.
// Obtains the texture format of the swapchain for the given window.
SDL_GPUTextureFormat SDL_GetGPUSwapchainTextureFormat(SDL_GPUDevice *device, SDL_Window *window); bool SDL_AcquireGPUSwapchainTexture(SDL_GPUCommandBuffer *command_buffer, SDL_Window *window, SDL_GPUTexture **swapchain_texture, Uint32 *swapchain_texture_width, Uint32 *swapchain_texture_height); // Acquire a texture to use in presentation.
bool SDL_WaitForGPUSwapchain(SDL_GPUDevice *device, SDL_Window *window); // Blocks the thread until a swapchain texture is available to be acquired.
bool SDL_WaitAndAcquireGPUSwapchainTexture(SDL_GPUCommandBuffer *command_buffer, SDL_Window *window, SDL_GPUTexture **swapchain_texture, Uint32 *swapchain_texture_width, Uint32 *swapchain_texture_height); // Blocks the thread until a swapchain texture is available to be acquired, and then acquires it.
bool SDL_SubmitGPUCommandBuffer(SDL_GPUCommandBuffer *command_buffer); // Submits a command buffer so its commands can be processed on the GPU.
// Submits a command buffer so its commands can be processed on the GPU, and acquires a fence associated with the command buffer.
SDL_GPUFence * SDL_SubmitGPUCommandBufferAndAcquireFence(SDL_GPUCommandBuffer *command_buffer); bool SDL_CancelGPUCommandBuffer(SDL_GPUCommandBuffer *command_buffer); // Cancels a command buffer.
bool SDL_WaitForGPUIdle(SDL_GPUDevice *device); // Blocks the thread until the GPU is completely idle.
bool SDL_WaitForGPUFences(SDL_GPUDevice *device, bool wait_all, SDL_GPUFence *const *fences, Uint32 num_fences); // Blocks the thread until the given fences are signaled.
bool SDL_QueryGPUFence(SDL_GPUDevice *device, SDL_GPUFence *fence); // Checks the status of a fence.
void SDL_ReleaseGPUFence(SDL_GPUDevice *device, SDL_GPUFence *fence); // Releases a fence obtained from SDL_SubmitGPUCommandBufferAndAcquireFence.
// Obtains the texel block size for a texture format.
Uint32 SDL_GPUTextureFormatTexelBlockSize(SDL_GPUTextureFormat format); bool SDL_GPUTextureSupportsFormat(SDL_GPUDevice *device, SDL_GPUTextureFormat format, SDL_GPUTextureType type, SDL_GPUTextureUsageFlags usage); // Determines whether a texture format is supported for a given type and usage.
bool SDL_GPUTextureSupportsSampleCount(SDL_GPUDevice *device, SDL_GPUTextureFormat format, SDL_GPUSampleCount sample_count); // Determines if a sample count for a texture format is supported.
// Calculate the size in bytes of a texture format with dimensions.
Uint32 SDL_CalculateGPUTextureFormatSize(SDL_GPUTextureFormat format, Uint32 width, Uint32 height, Uint32 depth_or_layer_count); void SDL_GDKSuspendGPU(SDL_GPUDevice *device); // Call this to suspend GPU operation on Xbox when you receive the SDL_EVENT_DID_ENTER_BACKGROUND event.
void SDL_GDKResumeGPU(SDL_GPUDevice *device); // Call this to resume GPU operation on Xbox when you receive the SDL_EVENT_WILL_ENTER_FOREGROUND event.
// XXX XXX XXXXXXX XXXXXX XXXXXX XXXXX XXXXXX XXXXXXX XXXXXX XXXXXX XX XX
// XXXX XXXX XX XX XX XX XX XX XX XX XX XX XX XX XX
// XX XXXX XX XXXXX XXXXXXX XXXXXXX XXXXXXX XX XXX XXXXX XXXXXX XX XX XXX
// XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX
// XX XX XXXXXXX XXXXXX XXXXXX XX XX XXXXXX XXXXXXX XXXXXX XXXXXX XX XX
bool SDL_ShowMessageBox(const SDL_MessageBoxData *messageboxdata, int *buttonid); // Create a modal message box.
bool SDL_ShowSimpleMessageBox(SDL_MessageBoxFlags flags, const char *title, const char *message, SDL_Window *window); // Display a simple modal message box.
// XX XX XX XX XX XX XX XXXXX XXX XX
// XX XX XX XX XX XX XX XX XX XXXX XX
// XX XX XX XX XX XXXXX XXXXXXX XX XX XX
// XX XX XX XX XX XX XX XX XX XX XX XX
// XXXX XXXXXX XXXXXXX XX XX XX XX XX XXXX
bool SDL_Vulkan_LoadLibrary(const char *path); // Dynamically load the Vulkan loader library.
void); // Get the address of the `vkGetInstanceProcAddr` function.
SDL_FunctionPointer SDL_Vulkan_GetVkGetInstanceProcAddr(void SDL_Vulkan_UnloadLibrary(void); // Unload the Vulkan library previously loaded by SDL_Vulkan_LoadLibrary().
char const * const * SDL_Vulkan_GetInstanceExtensions(Uint32 *count); // Get the Vulkan instance extensions needed for vkCreateInstance.
bool SDL_Vulkan_CreateSurface(SDL_Window *window, VkInstance instance, const struct VkAllocationCallbacks *allocator, VkSurfaceKHR *surface); // Create a Vulkan rendering surface for a window.
void SDL_Vulkan_DestroySurface(VkInstance instance, VkSurfaceKHR surface, const struct VkAllocationCallbacks *allocator); // Destroy the Vulkan rendering surface of a window.
bool SDL_Vulkan_GetPresentationSupport(VkInstance instance, VkPhysicalDevice physicalDevice, Uint32 queueFamilyIndex); // Query support for presentation via a given physical device and queue family.
// XXX XXX XXXXXXX XXXXXXXX XXXXX XX
// XXXX XXXX XX XX XX XX XX
// XX XXXX XX XXXXX XX XXXXXXX XX
// XX XX XX XX XX XX XX XX
// XX XX XXXXXXX XX XX XX XXXXXXX
// Create a CAMetalLayer-backed NSView/UIView and attach it to the specified window.
SDL_MetalView SDL_Metal_CreateView(SDL_Window *window); void SDL_Metal_DestroyView(SDL_MetalView view); // Destroy an existing SDL_MetalView object.
void * SDL_Metal_GetLayer(SDL_MetalView view); // Get a pointer to the backing CAMetalLayer for the given view.
// XXXXXX XX XXXXX XXXXXXXX XXXXXXX XXXXXX XXXXXX XXX XXX
// XX XX XX XX XX XX XX XX XX XX XX XXXX XXXX
// XXXXXX XX XXXXXXX XX XXXXX XX XX XXXXXX XX XXXX XX
// XX XX XX XX XX XX XX XX XX XX XX XX XX
// XX XXXXXXX XX XX XX XX XXXXXX XX XX XX XX
#define SDL_PLATFORM_AIX // A preprocessor macro that is only defined if compiling for AIX.
#define SDL_PLATFORM_HAIKU // A preprocessor macro that is only defined if compiling for Haiku OS.
#define SDL_PLATFORM_BSDI // A preprocessor macro that is only defined if compiling for BSDi
#define SDL_PLATFORM_FREEBSD // A preprocessor macro that is only defined if compiling for FreeBSD.
#define SDL_PLATFORM_HPUX // A preprocessor macro that is only defined if compiling for HP-UX.
#define SDL_PLATFORM_IRIX // A preprocessor macro that is only defined if compiling for IRIX.
#define SDL_PLATFORM_LINUX // A preprocessor macro that is only defined if compiling for Linux.
#define SDL_PLATFORM_ANDROID // A preprocessor macro that is only defined if compiling for Android.
#define SDL_PLATFORM_UNIX // A preprocessor macro that is only defined if compiling for a Unix-like system.
#define SDL_PLATFORM_APPLE // A preprocessor macro that is only defined if compiling for Apple platforms.
#define SDL_PLATFORM_TVOS // A preprocessor macro that is only defined if compiling for tvOS.
#define SDL_PLATFORM_VISIONOS // A preprocessor macro that is only defined if compiling for VisionOS.
#define SDL_PLATFORM_IOS // A preprocessor macro that is only defined if compiling for iOS.
#define SDL_PLATFORM_MACOS // A preprocessor macro that is only defined if compiling for macOS.
#define SDL_PLATFORM_EMSCRIPTEN // A preprocessor macro that is only defined if compiling for Emscripten.
#define SDL_PLATFORM_NETBSD // A preprocessor macro that is only defined if compiling for NetBSD.
#define SDL_PLATFORM_OPENBSD // A preprocessor macro that is only defined if compiling for OpenBSD.
#define SDL_PLATFORM_OS2 // A preprocessor macro that is only defined if compiling for OS/2.
#define SDL_PLATFORM_OSF // A preprocessor macro that is only defined if compiling for Tru64 (OSF/1).
#define SDL_PLATFORM_QNXNTO // A preprocessor macro that is only defined if compiling for QNX Neutrino.
#define SDL_PLATFORM_RISCOS // A preprocessor macro that is only defined if compiling for RISC OS.
#define SDL_PLATFORM_SOLARIS // A preprocessor macro that is only defined if compiling for SunOS/Solaris.
#define SDL_PLATFORM_CYGWIN // A preprocessor macro that is only defined if compiling for Cygwin.
#define SDL_PLATFORM_WINDOWS // A preprocessor macro that is only defined if compiling for Windows.
#define SDL_PLATFORM_WINGDK // A preprocessor macro that is only defined if compiling for Microsoft GDK for Windows.
#define SDL_PLATFORM_XBOXONE // A preprocessor macro that is only defined if compiling for Xbox One.
#define SDL_PLATFORM_XBOXSERIES // A preprocessor macro that is only defined if compiling for Xbox Series.
#define SDL_PLATFORM_WIN32 // A preprocessor macro that is only defined if compiling for desktop Windows.
#define SDL_PLATFORM_GDK // A preprocessor macro that is only defined if compiling for Microsoft GDK on any platform.
#define SDL_PLATFORM_PSP // A preprocessor macro that is only defined if compiling for Sony PSP.
#define SDL_PLATFORM_PS2 // A preprocessor macro that is only defined if compiling for Sony PlayStation 2.
#define SDL_PLATFORM_VITA // A preprocessor macro that is only defined if compiling for Sony Vita.
#define SDL_PLATFORM_3DS // A preprocessor macro that is only defined if compiling for Nintendo 3DS.
// XXXXXX XXXXXX XX XX XXXXXXX XXXXXX
// XX XX XX XX XX XX XX XX XX
// XXXXXX XX XX XX X XX XXXXX XXXXXX
// XX XX XX XX XXX XX XX XX XX
// XX XXXXXX XXX XXX XXXXXXX XX XX
int *seconds, int *percent); // Get the current power supply details.
SDL_PowerState SDL_GetPowerInfo(
// XXXXXX XXXXXXX XXX XX XXXXXX XXXXXX XXXXXX
// XX XX XXXX XX XX XX XX XX XX
// XXXXXXX XXXXX XX XX XX XXXXXXX XX XX XXXXXX
// XX XX XX XX XX XX XX XX XX XX
// XXXXXX XXXXXXX XX XXXX XXXXXX XXXXXX XX XX
int *count); // Get a list of currently connected sensors.
SDL_SensorID * SDL_GetSensors(const char * SDL_GetSensorNameForID(SDL_SensorID instance_id); // Get the implementation dependent name of a sensor.
// Get the type of a sensor.
SDL_SensorType SDL_GetSensorTypeForID(SDL_SensorID instance_id); int SDL_GetSensorNonPortableTypeForID(SDL_SensorID instance_id); // Get the platform dependent type of a sensor.
// Open a sensor for use.
SDL_Sensor * SDL_OpenSensor(SDL_SensorID instance_id); // Return the SDL_Sensor associated with an instance ID.
SDL_Sensor * SDL_GetSensorFromID(SDL_SensorID instance_id); // Get the properties associated with a sensor.
SDL_PropertiesID SDL_GetSensorProperties(SDL_Sensor *sensor); const char * SDL_GetSensorName(SDL_Sensor *sensor); // Get the implementation dependent name of a sensor.
// Get the type of a sensor.
SDL_SensorType SDL_GetSensorType(SDL_Sensor *sensor); int SDL_GetSensorNonPortableType(SDL_Sensor *sensor); // Get the platform dependent type of a sensor.
// Get the instance ID of a sensor.
SDL_SensorID SDL_GetSensorID(SDL_Sensor *sensor); bool SDL_GetSensorData(SDL_Sensor *sensor, float *data, int num_values); // Get the current state of an opened sensor.
void SDL_CloseSensor(SDL_Sensor *sensor); // Close a sensor previously opened with SDL_OpenSensor().
void SDL_UpdateSensors(void); // Update the current state of the open sensors.
// XXXXXX XXXXXX XXXXXX XXXXXX XXXXXXX XXXXXX XXXXXX
// XX XX XX XX XX XX XX XX XX XX
// XXXXXX XXXXXX XX XX XX XXXXX XXXXXXX XXXXXXX
// XX XX XX XX XX XX XX XX XX
// XX XX XX XXXXXX XXXXXX XXXXXXX XXXXXX XXXXXX
const char * const *args, bool pipe_stdio); // Create a new process.
SDL_Process * SDL_CreateProcess(// Create a new process with the specified properties.
SDL_Process * SDL_CreateProcessWithProperties(SDL_PropertiesID props); // Get the properties associated with a process.
SDL_PropertiesID SDL_GetProcessProperties(SDL_Process *process); void * SDL_ReadProcess(SDL_Process *process, size_t *datasize, int *exitcode); // Read all the output from a process.
// Get the SDL_IOStream associated with process standard input.
SDL_IOStream * SDL_GetProcessInput(SDL_Process *process); // Get the SDL_IOStream associated with process standard output.
SDL_IOStream * SDL_GetProcessOutput(SDL_Process *process); bool SDL_KillProcess(SDL_Process *process, bool force); // Stop a process.
bool SDL_WaitProcess(SDL_Process *process, bool block, int *exitcode); // Wait for a process to finish.
void SDL_DestroyProcess(SDL_Process *process); // Destroy a previously created process object.
// XXXXXX XX XXXXXXXX XXXXXX
// XX XX XX XX XX
// XXXXXX XX XX XXXXXXX
// XX XX XX XX XX
// XXXXXX XX XX XXXXXX
int SDL_MostSignificantBitIndex32(Uint32 x); // Get the index of the most significant (set) bit in a 32-bit number.
bool SDL_HasExactlyOneBitSet32(Uint32 x); // Determine if a unsigned 32-bit value has exactly one bit set.
// XXXXXXX XXX XX XXXXXX XX XXXXX XXX XX
// XX XXXX XX XX XX XX XX XX XXXX XX
// XXXXX XX XX XX XX XX XX XXXXXXX XX XX XX
// XX XX XX XX XX XX XX XX XX XX XX XX
// XXXXXXX XX XXXX XXXXXX XX XX XX XX XXXX
float SDL_SwapFloat(float x); // Byte-swap a floating point number.
// Byte-swap an unsigned 16-bit number.
Uint16 SDL_Swap16(Uint16 x); // Byte-swap an unsigned 32-bit number.
Uint32 SDL_Swap32(Uint32 x); // Byte-swap an unsigned 64-bit number.
Uint32 SDL_Swap64(Uint64 x);
// XXXXX XXXXXX XXXXXX XXXXXXX XXXXXX XXXXXXXX
// XX XX XX XX XX XX XX XX
// XXXXXXX XXXXXXX XXXXXXX XXXXX XXXXXX XX
// XX XX XX XX XX XX XX XX
// XX XX XXXXXX XXXXXX XXXXXXX XX XX XX
const char *func, const char *file, int line); // Never call this directly.
SDL_AssertState SDL_ReportAssertion(SDL_AssertData *data, #define SDL_assert(condition) // An assertion test that is normally performed only in debug builds.
#define SDL_assert_release(condition) // An assertion test that is performed even in release builds.
#define SDL_assert_paranoid(condition) // An assertion test that is performed only when built with paranoid settings.
#define SDL_assert_always(condition) // An assertion test that is always performed.
void SDL_SetAssertionHandler(SDL_AssertionHandler handler, void *userdata); // Set an application-defined assertion handler.
void); // Get the default assertion handler.
SDL_AssertionHandler SDL_GetDefaultAssertionHandler(void **puserdata); // Get the current assertion handler.
SDL_AssertionHandler SDL_GetAssertionHandler(const SDL_AssertData * SDL_GetAssertionReport(void); // Get a list of all assertion failures.
void SDL_ResetAssertionReport(void); // Clear the list of all assertion failures.
// XXXXXX XXXXXX XX XX XX XXX XX XXXXXXX XXXXXX
// XX XX XX XX XX XX XXXX XX XX XX XX
// XX XXXXXX XX XX XX XX XX XX XXXXX XX XX
// XX XX XX XX XX XX XX XX XX XX XX
// XXXXXX XX XXXXXX XX XX XXXX XX XXXXXX
int SDL_GetNumLogicalCPUCores(void); // Get the number of logical CPU cores available.
int SDL_GetCPUCacheLineSize(void); // Determine the L1 cache line size of the CPU.
bool SDL_HasAltiVec(void); // Determine whether the CPU has AltiVec features.
bool SDL_HasMMX(void); // Determine whether the CPU has MMX features.
bool SDL_HasSSE(void); // Determine whether the CPU has SSE features.
bool SDL_HasSSE2(void); // Determine whether the CPU has SSE2 features.
bool SDL_HasSSE3(void); // Determine whether the CPU has SSE3 features.
bool SDL_HasSSE41(void); // Determine whether the CPU has SSE4.1 features.
bool SDL_HasSSE42(void); // Determine whether the CPU has SSE4.2 features.
bool SDL_HasAVX(void); // Determine whether the CPU has AVX features.
bool SDL_HasAVX2(void); // Determine whether the CPU has AVX2 features.
bool SDL_HasAVX512F(void); // Determine whether the CPU has AVX-512F (foundation) features.
bool SDL_HasARMSIMD(void); // Determine whether the CPU has ARM SIMD (ARMv6) features.
bool SDL_HasNEON(void); // Determine whether the CPU has NEON (ARM SIMD) features.
bool SDL_HasLSX(void); // Determine whether the CPU has LSX (LOONGARCH SIMD) features.
bool SDL_HasLASX(void); // Determine whether the CPU has LASX (LOONGARCH SIMD) features.
int SDL_GetSystemRAM(void); // Get the amount of RAM configured in the system.
size_t SDL_GetSIMDAlignment(void); // Report the alignment this system needs for SIMD allocations.
// XX XXX XX XXXXXXXX XXXXXX XX XXX XX XXXXXX XX XXXXXX XXXXXX
// XX XXXX XX XX XX XX XX XXXX XX XX XX XX XX
// XX XX XX XX XX XXXXXX XX XX XX XX XXXXXXX XX XX XXXXXXX
// XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX
// XX XX XXXX XX XX XX XX XX XXXX XXXXXX XX XXXXXX XXXXXX
#define SDL_LSX_INTRINSICS // Defined if (and only if) the compiler supports Loongarch LSX intrinsics.
#define SDL_LASX_INTRINSICS // Defined if (and only if) the compiler supports Loongarch LSX intrinsics.
#define SDL_NEON_INTRINSICS // Defined if (and only if) the compiler supports ARM NEON intrinsics.
#define SDL_ALTIVEC_INTRINSICS // Defined if (and only if) the compiler supports PowerPC Altivec intrinsics.
#define SDL_MMX_INTRINSICS // Defined if (and only if) the compiler supports Intel MMX intrinsics.
#define SDL_SSE_INTRINSICS // Defined if (and only if) the compiler supports Intel SSE intrinsics.
#define SDL_SSE2_INTRINSICS // Defined if (and only if) the compiler supports Intel SSE2 intrinsics.
#define SDL_SSE3_INTRINSICS // Defined if (and only if) the compiler supports Intel SSE3 intrinsics.
#define SDL_SSE4_1_INTRINSICS // Defined if (and only if) the compiler supports Intel SSE4.1 intrinsics.
#define SDL_SSE4_2_INTRINSICS // Defined if (and only if) the compiler supports Intel SSE4.2 intrinsics.
#define SDL_AVX_INTRINSICS // Defined if (and only if) the compiler supports Intel AVX intrinsics.
#define SDL_AVX2_INTRINSICS // Defined if (and only if) the compiler supports Intel AVX2 intrinsics.
#define SDL_AVX512F_INTRINSICS // Defined if (and only if) the compiler supports Intel AVX-512F intrinsics.
// XX XXXXXX XXXXXX XXXXX XX XXXXXXX
// XX XX XX XX XX XX XX XX
// XX XX XX XX XXXXXXX XX XXXXX
// XX XX XX XX XX XX XX XX
// XXXXXXX XXXXXX XXXXXX XX XX XXXXXXX XXXXXXX
int *count); // Report the user's preferred locale.
SDL_Locale ** SDL_GetPreferredLocales(
// XXXXXX XX XX XXXXXX XXXXXXXX XXXXXXX XXX XXX
// XX XX XX XX XX XX XXXX XXXX
// XXXXXXX XXXX XXXXXXX XX XXXXX XX XXXX XX
// XX XX XX XX XX XX XX XX
// XXXXXX XX XXXXXX XX XXXXXXX XX XX
void SDL_SetWindowsMessageHook(SDL_WindowsMessageHook callback, void *userdata); // Set a callback for every Windows message, run before TranslateMessage().
int SDL_GetDirect3D9AdapterIndex(SDL_DisplayID displayID); // Get the D3D9 adapter index that matches the specified display.
bool SDL_GetDXGIOutputInfo(SDL_DisplayID displayID, int *adapterIndex, int *outputIndex); // Get the DXGI Adapter and Output indices for the specified display.
void SDL_SetX11EventHook(SDL_X11EventHook callback, void *userdata); // Set a callback for every X11 event.
bool SDL_SetLinuxThreadPriority(Sint64 threadID, int priority); // Sets the UNIX nice value for a thread.
bool SDL_SetLinuxThreadPriorityAndPolicy(Sint64 threadID, int sdlPriority, int schedPolicy); // Sets the priority (not nice level) and scheduling policy for a thread.
bool SDL_SetiOSAnimationCallback(SDL_Window *window, int interval, SDL_iOSAnimationCallback callback, void *callbackParam); // Use this function to set the animation callback on Apple iOS.
void SDL_SetiOSEventPump(bool enabled); // Use this function to enable or disable the SDL event pump on Apple iOS.
void * SDL_GetAndroidJNIEnv(void); // Get the Android Java Native Interface Environment of the current thread.
void * SDL_GetAndroidActivity(void); // Retrieve the Java instance of the Android activity class.
int SDL_GetAndroidSDKVersion(void); // Query Android API level of the current device.
bool SDL_IsChromebook(void); // Query if the application is running on a Chromebook.
bool SDL_IsDeXMode(void); // Query if the application is running on a Samsung DeX docking station.
void SDL_SendAndroidBackButton(void); // Trigger the Android system back button behavior.
const char * SDL_GetAndroidInternalStoragePath(void); // Get the path used for internal storage for this Android application.
void); // Get the current state of external storage for this Android application.
Uint32 SDL_GetAndroidExternalStorageState(const char * SDL_GetAndroidExternalStoragePath(void); // Get the path used for external storage for this Android application.
const char * SDL_GetAndroidCachePath(void); // Get the path used for caching data for this Android application.
bool SDL_RequestAndroidPermission(const char *permission, SDL_RequestAndroidPermissionCallback cb, void *userdata); // Request permissions at runtime, asynchronously.
bool SDL_ShowAndroidToast(const char *message, int duration, int gravity, int xoffset, int yoffset); // Shows an Android toast notification.
bool SDL_SendAndroidMessage(Uint32 command, int param); // Send a user command to SDLActivity.
bool SDL_IsTablet(void); // Query if the current device is a tablet.
bool SDL_IsTV(void); // Query if the current device is a TV.
void); // Get the application sandbox environment, if any.
SDL_Sandbox SDL_GetSandbox(void SDL_OnApplicationWillTerminate(void); // Let iOS apps with external event handling report onApplicationWillTerminate.
void SDL_OnApplicationDidReceiveMemoryWarning(void); // Let iOS apps with external event handling report onApplicationDidReceiveMemoryWarning.
void SDL_OnApplicationWillEnterBackground(void); // Let iOS apps with external event handling report onApplicationWillResignActive.
void SDL_OnApplicationDidEnterBackground(void); // Let iOS apps with external event handling report onApplicationDidEnterBackground.
void SDL_OnApplicationWillEnterForeground(void); // Let iOS apps with external event handling report onApplicationWillEnterForeground.
void SDL_OnApplicationDidEnterForeground(void); // Let iOS apps with external event handling report onApplicationDidBecomeActive.
void SDL_OnApplicationDidChangeStatusBarOrientation(void); // Let iOS apps with external event handling report onApplicationDidChangeStatusBarOrientation.
bool SDL_GetGDKTaskQueue(XTaskQueueHandle *outTaskQueue); // Gets a reference to the global async task queue handle for GDK, initializing if needed.
bool SDL_GetGDKDefaultUser(XUserHandle *outUserHandle); // Gets a reference to the default user handle for GDK.
// XXX XXX XX XXXXXX XXXXXX
// XXXX XXXX XX XX XX
// XX XXXX XX XX XXXXXXX XX
// XX XX XX XX XX XX
// XX XX XX XXXXXX XXXXXX
bool SDL_OpenURL(const char *url); // Open a URL/URI in the browser or other appropriate external application.
// XXXXXX XX XX XX XXXXXX
// XX XX XX XX XX XX
// XX XXX XX XX XX XX XX
// XX XX XX XX XX XX XX
// XXXXXX XXXXXX XX XXXXXX
void SDL_GUIDToString(SDL_GUID guid, char *pszGUID, int cbGUID); // Get an ASCII string representation for a given SDL_GUID.
const char *pchGUID); // Convert a GUID string into a SDL_GUID structure.
SDL_GUID SDL_StringToGUID(
// XXX XXX XXXXX XX XXX XX
// XXXX XXXX XX XX XX XXXX XX
// XX XXXX XX XXXXXXX XX XX XX XX
// XX XX XX XX XX XX XX XX XX
// XX XX XX XX XX XX XXXX
void **appstate, int argc, char **argv); // App-implemented initial entry point for SDL_MAIN_USE_CALLBACKS apps.
SDL_AppResult SDL_AppInit(void *appstate); // App-implemented iteration entry point for SDL_MAIN_USE_CALLBACKS apps.
SDL_AppResult SDL_AppIterate(void *appstate, SDL_Event *event); // App-implemented event entry point for SDL_MAIN_USE_CALLBACKS apps.
SDL_AppResult SDL_AppEvent(void SDL_AppQuit(void *appstate, SDL_AppResult result); // App-implemented deinit entry point for SDL_MAIN_USE_CALLBACKS apps.
int SDL_main(int argc, char **argv); // An app-supplied function for program entry.
void SDL_SetMainReady(void); // Circumvent failure of SDL_Init() when not using SDL_main() as an entry point.
int SDL_RunApp(int argc, char **argv, SDL_main_func mainFunction, void *reserved); // Initializes and launches an SDL application, by doing platform-specific initialization before calling your mainFunction and cleanups after it returns, if that is needed for a specific platform, otherwise it just calls mainFunction.
int SDL_EnterAppMainCallbacks(int argc, char **argv, SDL_AppInit_func appinit, SDL_AppIterate_func appiter, SDL_AppEvent_func appevent, SDL_AppQuit_func appquit); // An entry point for SDL's use in SDL_MAIN_USE_CALLBACKS.
bool SDL_RegisterApp(const char *name, Uint32 style, void *hInst); // Register a win32 window class for SDL's use.
void SDL_UnregisterApp(void); // Deregister the win32 window class from an SDL_RegisterApp call.
void SDL_GDKSuspendComplete(void); // Callback from the application to let the suspend continue.
// XXXXXX XXXXXXXX XXXXXX XX XXX XX XXXXXX
// XX XX XX XX XX XXXX XX XX
// XXXXXXX XX XX XX XX XX XX XX XX
// XX XX XX XX XX XX XX XX XX
// XXXXXX XX XXXXXX XX XX XXXX XXXXXX
#define SDL_COMPILE_TIME_ASSERT(name, x) // A compile-time assertion.
#define SDL_arraysize(array) // The number of elements in a static array.
#define SDL_reinterpret_cast(type, expression) // Handle a Reinterpret Cast properly whether using C or C++.
#define SDL_static_cast(type, expression) // Handle a Static Cast properly whether using C or C++.
#define SDL_const_cast(type, expression) // Handle a Const Cast properly whether using C or C++.
void * SDL_malloc(size_t size); // Allocate uninitialized memory.
void * SDL_calloc(size_t nmemb, size_t size); // Allocate a zero-initialized array.
void * SDL_realloc(void *mem, size_t size); // Change the size of allocated memory.
void SDL_free(void *mem); // Free allocated memory.
void SDL_GetOriginalMemoryFunctions(SDL_malloc_func *malloc_func, SDL_calloc_func *calloc_func, SDL_realloc_func *realloc_func, SDL_free_func *free_func); // Get the original set of SDL memory functions.
void SDL_GetMemoryFunctions(SDL_malloc_func *malloc_func, SDL_calloc_func *calloc_func, SDL_realloc_func *realloc_func, SDL_free_func *free_func); // Get the current set of SDL memory functions.
bool SDL_SetMemoryFunctions(SDL_malloc_func malloc_func, SDL_calloc_func calloc_func, SDL_realloc_func realloc_func, SDL_free_func free_func); // Replace SDL's memory allocation functions with a custom set.
void * SDL_aligned_alloc(size_t alignment, size_t size); // Allocate memory aligned to a specific alignment.
void SDL_aligned_free(void *mem); // Free memory allocated by SDL_aligned_alloc().
int SDL_GetNumAllocations(void); // Get the number of outstanding (unfreed) allocations.
void); // Get the process environment.
SDL_Environment * SDL_GetEnvironment(bool populated); // Create a set of environment variables
SDL_Environment * SDL_CreateEnvironment(const char * SDL_GetEnvironmentVariable(SDL_Environment *env, const char *name); // Get the value of a variable in the environment.
char ** SDL_GetEnvironmentVariables(SDL_Environment *env); // Get all variables in the environment.
bool SDL_SetEnvironmentVariable(SDL_Environment *env, const char *name, const char *value, bool overwrite); // Set the value of a variable in the environment.
bool SDL_UnsetEnvironmentVariable(SDL_Environment *env, const char *name); // Clear a variable from the environment.
void SDL_DestroyEnvironment(SDL_Environment *env); // Destroy a set of environment variables.
const char * SDL_getenv(const char *name); // Get the value of a variable in the environment.
const char * SDL_getenv_unsafe(const char *name); // Get the value of a variable in the environment.
int SDL_setenv_unsafe(const char *name, const char *value, int overwrite); // Set the value of a variable in the environment.
int SDL_unsetenv_unsafe(const char *name); // Clear a variable from the environment.
void SDL_qsort(void *base, size_t nmemb, size_t size, SDL_CompareCallback compare); // Sort an array.
void * SDL_bsearch(const void *key, const void *base, size_t nmemb, size_t size, SDL_CompareCallback compare); // Perform a binary search on a previously sorted array.
void SDL_qsort_r(void *base, size_t nmemb, size_t size, SDL_CompareCallback_r compare, void *userdata); // Sort an array, passing a userdata pointer to the compare function.
void * SDL_bsearch_r(const void *key, const void *base, size_t nmemb, size_t size, SDL_CompareCallback_r compare, void *userdata); // Perform a binary search on a previously sorted array, passing a userdata pointer to the compare function.
int SDL_abs(int x); // Compute the absolute value of `x`.
int SDL_isalpha(int x); // Query if a character is alphabetic (a letter).
int SDL_isalnum(int x); // Query if a character is alphabetic (a letter) or a number.
int SDL_isblank(int x); // Report if a character is blank (a space or tab).
int SDL_iscntrl(int x); // Report if a character is a control character.
int SDL_isdigit(int x); // Report if a character is a numeric digit.
int SDL_isxdigit(int x); // Report if a character is a hexadecimal digit.
int SDL_ispunct(int x); // Report if a character is a punctuation mark.
int SDL_isspace(int x); // Report if a character is whitespace.
int SDL_isupper(int x); // Report if a character is upper case.
int SDL_islower(int x); // Report if a character is lower case.
int SDL_isprint(int x); // Report if a character is "printable".
int SDL_isgraph(int x); // Report if a character is any "printable" except space.
int SDL_toupper(int x); // Convert low-ASCII English letters to uppercase.
int SDL_tolower(int x); // Convert low-ASCII English letters to lowercase.
const void *data, size_t len); // Calculate a CRC-16 value.
Uint16 SDL_crc16(Uint16 crc, const void *data, size_t len); // Calculate a CRC-32 value.
Uint32 SDL_crc32(Uint32 crc, const void *data, size_t len, Uint32 seed); // Calculate a 32-bit MurmurHash3 value for a block of data.
Uint32 SDL_murmur3_32(void * SDL_memcpy(void *dst, const void *src, size_t len); // Copy non-overlapping memory.
void * SDL_memmove(void *dst, const void *src, size_t len); // Copy memory ranges that might overlap.
void * SDL_memset(void *dst, int c, size_t len); // Initialize all bytes of buffer of memory to a specific value.
void * SDL_memset4(void *dst, Uint32 val, size_t dwords); // Initialize all 32-bit words of buffer of memory to a specific value.
int SDL_memcmp(const void *s1, const void *s2, size_t len);
size_t SDL_wcslen(const wchar_t *wstr);
size_t SDL_wcsnlen(const wchar_t *wstr, size_t maxlen);
size_t SDL_wcslcpy(wchar_t *dst, const wchar_t *src, size_t maxlen); // Copy a wide string.
size_t SDL_wcslcat(wchar_t *dst, const wchar_t *src, size_t maxlen); // Concatenate wide strings.
wchar_t * SDL_wcsdup(const wchar_t *wstr);
wchar_t * SDL_wcsstr(const wchar_t *haystack, const wchar_t *needle);
wchar_t * SDL_wcsnstr(const wchar_t *haystack, const wchar_t *needle, size_t maxlen);
int SDL_wcscmp(const wchar_t *str1, const wchar_t *str2); // Compare two null-terminated wide strings.
int SDL_wcsncmp(const wchar_t *str1, const wchar_t *str2, size_t maxlen); // Compare two wide strings up to a number of wchar_t values.
int SDL_wcscasecmp(const wchar_t *str1, const wchar_t *str2); // Compare two null-terminated wide strings, case-insensitively.
int SDL_wcsncasecmp(const wchar_t *str1, const wchar_t *str2, size_t maxlen); // Compare two wide strings, case-insensitively, up to a number of wchar_t.
long SDL_wcstol(const wchar_t *str, wchar_t **endp, int base); // Parse a `long` from a wide string.
size_t SDL_strlen(const char *str); // This works exactly like strlen() but doesn't require access to a C runtime.
size_t SDL_strnlen(const char *str, size_t maxlen); // This works exactly like strnlen() but doesn't require access to a C runtime.
size_t SDL_strlcpy(char *dst, const char *src, size_t maxlen); // Copy a string.
size_t SDL_utf8strlcpy(char *dst, const char *src, size_t dst_bytes); // Copy an UTF-8 string.
size_t SDL_strlcat(char *dst, const char *src, size_t maxlen); // Concatenate strings.
char * SDL_strdup(const char *str);
char * SDL_strndup(const char *str, size_t maxlen);
char * SDL_strrev(char *str);
char * SDL_strupr(char *str); // Convert a string to uppercase.
char * SDL_strlwr(char *str); // Convert a string to lowercase.
char * SDL_strchr(const char *str, int c); // Search a string for the first instance of a specific byte.
char * SDL_strrchr(const char *str, int c); // Search a string for the last instance of a specific byte.
char * SDL_strstr(const char *haystack, const char *needle); // Search a string for the first instance of a specific substring.
char * SDL_strnstr(const char *haystack, const char *needle, size_t maxlen); // Search a string, up to n bytes, for the first instance of a specific substring.
char * SDL_strcasestr(const char *haystack, const char *needle); // Search a UTF-8 string for the first instance of a specific substring, case-insensitively.
char * SDL_strtok_r(char *str, const char *delim, char **saveptr); // This works exactly like strtok_r() but doesn't require access to a C runtime.
size_t SDL_utf8strlen(const char *str); // Count the number of codepoints in a UTF-8 string.
size_t SDL_utf8strnlen(const char *str, size_t bytes); // Count the number of codepoints in a UTF-8 string, up to n bytes.
char * SDL_itoa(int value, char *str, int radix); // Convert an integer into a string.
char * SDL_uitoa(unsigned int value, char *str, int radix); // Convert an unsigned integer into a string.
char * SDL_ltoa(long value, char *str, int radix); // Convert a long integer into a string.
char * SDL_ultoa(unsigned long value, char *str, int radix); // Convert an unsigned long integer into a string.
char * SDL_lltoa(long long value, char *str, int radix); // Convert a long long integer into a string.
char * SDL_ulltoa(unsigned long long value, char *str, int radix); // Convert an unsigned long long integer into a string.
int SDL_atoi(const char *str); // Parse an `int` from a string.
double SDL_atof(const char *str); // Parse a `double` from a string.
long SDL_strtol(const char *str, char **endp, int base); // Parse a `long` from a string.
unsigned long SDL_strtoul(const char *str, char **endp, int base); // Parse an `unsigned long` from a string.
long long SDL_strtoll(const char *str, char **endp, int base); // Parse a `long long` from a string.
unsigned long long SDL_strtoull(const char *str, char **endp, int base); // Parse an `unsigned long long` from a string.
double SDL_strtod(const char *str, char **endp); // Parse a `double` from a string.
int SDL_strcmp(const char *str1, const char *str2); // Compare two null-terminated UTF-8 strings.
int SDL_strncmp(const char *str1, const char *str2, size_t maxlen); // Compare two UTF-8 strings up to a number of bytes.
int SDL_strcasecmp(const char *str1, const char *str2); // Compare two null-terminated UTF-8 strings, case-insensitively.
int SDL_strncasecmp(const char *str1, const char *str2, size_t maxlen); // Compare two UTF-8 strings, case-insensitively, up to a number of bytes.
char * SDL_strpbrk(const char *str, const char *breakset); // Searches a string for the first occurence of any character contained in a breakset, and returns a pointer from the string to that character.
const char **pstr, size_t *pslen); // Decode a UTF-8 string, one Unicode codepoint at a time.
Uint32 SDL_StepUTF8(const char *start, const char **pstr); // Decode a UTF-8 string in reverse, one Unicode codepoint at a time.
Uint32 SDL_StepBackUTF8(char * SDL_UCS4ToUTF8(Uint32 codepoint, char *dst); // Convert a single Unicode codepoint to UTF-8.
int SDL_sscanf(const char *text, const char *fmt, ... ...);
int SDL_vsscanf(const char *text, const char *fmt, va_list ap);
int SDL_snprintf(char *text, size_t maxlen, const char *fmt, ... ...);
int SDL_swprintf(wchar_t *text, size_t maxlen, const wchar_t *fmt, ... ...);
int SDL_vsnprintf(char *text, size_t maxlen, const char *fmt, va_list ap);
int SDL_vswprintf(wchar_t *text, size_t maxlen, const wchar_t *fmt, va_list ap);
int SDL_asprintf(char **strp, const char *fmt, ... ...);
int SDL_vasprintf(char **strp, const char *fmt, va_list ap);
void SDL_srand(Uint64 seed); // Seeds the pseudo-random number generator.
// Generate a pseudo-random number less than n for positive n
Sint32 SDL_rand(Sint32 n); float SDL_randf(void); // Generate a uniform pseudo-random floating point number less than 1.0
void); // Generate 32 pseudo-random bits.
Uint32 SDL_rand_bits(// Generate a pseudo-random number less than n for positive n
Sint32 SDL_rand_r(Uint64 *state, Sint32 n); float SDL_randf_r(Uint64 *state); // Generate a uniform pseudo-random floating point number less than 1.0
// Generate 32 pseudo-random bits.
Uint32 SDL_rand_bits_r(Uint64 *state); double SDL_acos(double x); // Compute the arc cosine of `x`.
float SDL_acosf(float x); // Compute the arc cosine of `x`.
double SDL_asin(double x); // Compute the arc sine of `x`.
float SDL_asinf(float x); // Compute the arc sine of `x`.
double SDL_atan(double x); // Compute the arc tangent of `x`.
float SDL_atanf(float x); // Compute the arc tangent of `x`.
double SDL_atan2(double y, double x); // Compute the arc tangent of `y / x`, using the signs of x and y to adjust the result's quadrant.
float SDL_atan2f(float y, float x); // Compute the arc tangent of `y / x`, using the signs of x and y to adjust the result's quadrant.
double SDL_ceil(double x); // Compute the ceiling of `x`.
float SDL_ceilf(float x); // Compute the ceiling of `x`.
double SDL_copysign(double x, double y); // Copy the sign of one floating-point value to another.
float SDL_copysignf(float x, float y); // Copy the sign of one floating-point value to another.
double SDL_cos(double x); // Compute the cosine of `x`.
float SDL_cosf(float x); // Compute the cosine of `x`.
double SDL_exp(double x); // Compute the exponential of `x`.
float SDL_expf(float x); // Compute the exponential of `x`.
double SDL_fabs(double x); // Compute the absolute value of `x`
float SDL_fabsf(float x); // Compute the absolute value of `x`
double SDL_floor(double x); // Compute the floor of `x`.
float SDL_floorf(float x); // Compute the floor of `x`.
double SDL_trunc(double x); // Truncate `x` to an integer.
float SDL_truncf(float x); // Truncate `x` to an integer.
double SDL_fmod(double x, double y); // Return the floating-point remainder of `x / y`
float SDL_fmodf(float x, float y); // Return the floating-point remainder of `x / y`
int SDL_isinf(double x); // Return whether the value is infinity.
int SDL_isinff(float x); // Return whether the value is infinity.
int SDL_isnan(double x); // Return whether the value is NaN.
int SDL_isnanf(float x); // Return whether the value is NaN.
double SDL_log(double x); // Compute the natural logarithm of `x`.
float SDL_logf(float x); // Compute the natural logarithm of `x`.
double SDL_log10(double x); // Compute the base-10 logarithm of `x`.
float SDL_log10f(float x); // Compute the base-10 logarithm of `x`.
double SDL_modf(double x, double *y); // Split `x` into integer and fractional parts
float SDL_modff(float x, float *y); // Split `x` into integer and fractional parts
double SDL_pow(double x, double y); // Raise `x` to the power `y`
float SDL_powf(float x, float y); // Raise `x` to the power `y`
double SDL_round(double x); // Round `x` to the nearest integer.
float SDL_roundf(float x); // Round `x` to the nearest integer.
long SDL_lround(double x); // Round `x` to the nearest integer representable as a long
long SDL_lroundf(float x); // Round `x` to the nearest integer representable as a long
double SDL_scalbn(double x, int n); // Scale `x` by an integer power of two.
float SDL_scalbnf(float x, int n); // Scale `x` by an integer power of two.
double SDL_sin(double x); // Compute the sine of `x`.
float SDL_sinf(float x); // Compute the sine of `x`.
double SDL_sqrt(double x); // Compute the square root of `x`.
float SDL_sqrtf(float x); // Compute the square root of `x`.
double SDL_tan(double x); // Compute the tangent of `x`.
float SDL_tanf(float x); // Compute the tangent of `x`.
const char *tocode, const char *fromcode); // This function allocates a context for the specified character set conversion.
SDL_iconv_t SDL_iconv_open(int SDL_iconv_close(SDL_iconv_t cd); // This function frees a context used for character set conversion.
size_t SDL_iconv(SDL_iconv_t cd, const char **inbuf, size_t *inbytesleft, char **outbuf, size_t *outbytesleft); // This function converts text between encodings, reading from and writing to a buffer.
char * SDL_iconv_string(const char *tocode, const char *fromcode, const char *inbuf, size_t inbytesleft); // Helper function to convert a string's encoding in one call.
bool SDL_size_mul_check_overflow(size_t a, size_t b, size_t *ret); // Multiply two integers, checking for overflow.
bool SDL_size_add_check_overflow(size_t a, size_t b, size_t *ret); // Add two integers, checking for overflow.