arsa
2.7
|
#include "SDL_stdinc.h"
#include "SDL_pixels.h"
#include "SDL_rect.h"
#include "SDL_surface.h"
#include "begin_code.h"
#include "close_code.h"
Go to the source code of this file.
Classes | |
struct | SDL_DisplayMode |
The structure that defines a display mode. More... | |
Macros | |
#define | SDL_WINDOWPOS_UNDEFINED_MASK 0x1FFF0000u |
Used to indicate that you don't care what the window position is. More... | |
#define | SDL_WINDOWPOS_UNDEFINED_DISPLAY(X) (SDL_WINDOWPOS_UNDEFINED_MASK|(X)) |
#define | SDL_WINDOWPOS_UNDEFINED SDL_WINDOWPOS_UNDEFINED_DISPLAY(0) |
#define | SDL_WINDOWPOS_ISUNDEFINED(X) (((X)&0xFFFF0000) == SDL_WINDOWPOS_UNDEFINED_MASK) |
#define | SDL_WINDOWPOS_CENTERED_MASK 0x2FFF0000u |
Used to indicate that the window position should be centered. More... | |
#define | SDL_WINDOWPOS_CENTERED_DISPLAY(X) (SDL_WINDOWPOS_CENTERED_MASK|(X)) |
#define | SDL_WINDOWPOS_CENTERED SDL_WINDOWPOS_CENTERED_DISPLAY(0) |
#define | SDL_WINDOWPOS_ISCENTERED(X) (((X)&0xFFFF0000) == SDL_WINDOWPOS_CENTERED_MASK) |
Typedefs | |
typedef struct SDL_Window | SDL_Window |
The type used to identify a window. More... | |
typedef void * | SDL_GLContext |
An opaque handle to an OpenGL context. More... | |
typedef SDL_HitTestResult(SDLCALL * | SDL_HitTest) (SDL_Window *win, const SDL_Point *area, void *data) |
Callback used for hit-testing. More... | |
Functions | |
DECLSPEC int SDLCALL | SDL_GetNumVideoDrivers (void) |
Get the number of video drivers compiled into SDL. More... | |
DECLSPEC const char *SDLCALL | SDL_GetVideoDriver (int index) |
Get the name of a built in video driver. More... | |
DECLSPEC int SDLCALL | SDL_VideoInit (const char *driver_name) |
Initialize the video subsystem, optionally specifying a video driver. More... | |
DECLSPEC void SDLCALL | SDL_VideoQuit (void) |
Shuts down the video subsystem. More... | |
DECLSPEC const char *SDLCALL | SDL_GetCurrentVideoDriver (void) |
Returns the name of the currently initialized video driver. More... | |
DECLSPEC int SDLCALL | SDL_GetNumVideoDisplays (void) |
Returns the number of available video displays. More... | |
DECLSPEC const char *SDLCALL | SDL_GetDisplayName (int displayIndex) |
Get the name of a display in UTF-8 encoding. More... | |
DECLSPEC int SDLCALL | SDL_GetDisplayBounds (int displayIndex, SDL_Rect *rect) |
Get the desktop area represented by a display, with the primary display located at 0,0. More... | |
DECLSPEC int SDLCALL | SDL_GetDisplayUsableBounds (int displayIndex, SDL_Rect *rect) |
Get the usable desktop area represented by a display, with the primary display located at 0,0. More... | |
DECLSPEC int SDLCALL | SDL_GetDisplayDPI (int displayIndex, float *ddpi, float *hdpi, float *vdpi) |
Get the dots/pixels-per-inch for a display. More... | |
DECLSPEC SDL_DisplayOrientation SDLCALL | SDL_GetDisplayOrientation (int displayIndex) |
Get the orientation of a display. More... | |
DECLSPEC int SDLCALL | SDL_GetNumDisplayModes (int displayIndex) |
Returns the number of available display modes. More... | |
DECLSPEC int SDLCALL | SDL_GetDisplayMode (int displayIndex, int modeIndex, SDL_DisplayMode *mode) |
Fill in information about a specific display mode. More... | |
DECLSPEC int SDLCALL | SDL_GetDesktopDisplayMode (int displayIndex, SDL_DisplayMode *mode) |
Fill in information about the desktop display mode. More... | |
DECLSPEC int SDLCALL | SDL_GetCurrentDisplayMode (int displayIndex, SDL_DisplayMode *mode) |
Fill in information about the current display mode. More... | |
DECLSPEC SDL_DisplayMode *SDLCALL | SDL_GetClosestDisplayMode (int displayIndex, const SDL_DisplayMode *mode, SDL_DisplayMode *closest) |
Get the closest match to the requested display mode. More... | |
DECLSPEC int SDLCALL | SDL_GetWindowDisplayIndex (SDL_Window *window) |
Get the display index associated with a window. More... | |
DECLSPEC int SDLCALL | SDL_SetWindowDisplayMode (SDL_Window *window, const SDL_DisplayMode *mode) |
Set the display mode used when a fullscreen window is visible. More... | |
DECLSPEC int SDLCALL | SDL_GetWindowDisplayMode (SDL_Window *window, SDL_DisplayMode *mode) |
Fill in information about the display mode used when a fullscreen window is visible. More... | |
DECLSPEC Uint32 SDLCALL | SDL_GetWindowPixelFormat (SDL_Window *window) |
Get the pixel format associated with the window. More... | |
DECLSPEC SDL_Window *SDLCALL | SDL_CreateWindow (const char *title, int x, int y, int w, int h, Uint32 flags) |
Create a window with the specified position, dimensions, and flags. More... | |
DECLSPEC SDL_Window *SDLCALL | SDL_CreateWindowFrom (const void *data) |
Create an SDL window from an existing native window. More... | |
DECLSPEC Uint32 SDLCALL | SDL_GetWindowID (SDL_Window *window) |
Get the numeric ID of a window, for logging purposes. More... | |
DECLSPEC SDL_Window *SDLCALL | SDL_GetWindowFromID (Uint32 id) |
Get a window from a stored ID, or NULL if it doesn't exist. More... | |
DECLSPEC Uint32 SDLCALL | SDL_GetWindowFlags (SDL_Window *window) |
Get the window flags. More... | |
DECLSPEC void SDLCALL | SDL_SetWindowTitle (SDL_Window *window, const char *title) |
Set the title of a window, in UTF-8 format. More... | |
DECLSPEC const char *SDLCALL | SDL_GetWindowTitle (SDL_Window *window) |
Get the title of a window, in UTF-8 format. More... | |
DECLSPEC void SDLCALL | SDL_SetWindowIcon (SDL_Window *window, SDL_Surface *icon) |
Set the icon for a window. More... | |
DECLSPEC void *SDLCALL | SDL_SetWindowData (SDL_Window *window, const char *name, void *userdata) |
Associate an arbitrary named pointer with a window. More... | |
DECLSPEC void *SDLCALL | SDL_GetWindowData (SDL_Window *window, const char *name) |
Retrieve the data pointer associated with a window. More... | |
DECLSPEC void SDLCALL | SDL_SetWindowPosition (SDL_Window *window, int x, int y) |
Set the position of a window. More... | |
DECLSPEC void SDLCALL | SDL_GetWindowPosition (SDL_Window *window, int *x, int *y) |
Get the position of a window. More... | |
DECLSPEC void SDLCALL | SDL_SetWindowSize (SDL_Window *window, int w, int h) |
Set the size of a window's client area. More... | |
DECLSPEC void SDLCALL | SDL_GetWindowSize (SDL_Window *window, int *w, int *h) |
Get the size of a window's client area. More... | |
DECLSPEC int SDLCALL | 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. More... | |
DECLSPEC void SDLCALL | SDL_SetWindowMinimumSize (SDL_Window *window, int min_w, int min_h) |
Set the minimum size of a window's client area. More... | |
DECLSPEC void SDLCALL | SDL_GetWindowMinimumSize (SDL_Window *window, int *w, int *h) |
Get the minimum size of a window's client area. More... | |
DECLSPEC void SDLCALL | SDL_SetWindowMaximumSize (SDL_Window *window, int max_w, int max_h) |
Set the maximum size of a window's client area. More... | |
DECLSPEC void SDLCALL | SDL_GetWindowMaximumSize (SDL_Window *window, int *w, int *h) |
Get the maximum size of a window's client area. More... | |
DECLSPEC void SDLCALL | SDL_SetWindowBordered (SDL_Window *window, SDL_bool bordered) |
Set the border state of a window. More... | |
DECLSPEC void SDLCALL | SDL_SetWindowResizable (SDL_Window *window, SDL_bool resizable) |
Set the user-resizable state of a window. More... | |
DECLSPEC void SDLCALL | SDL_ShowWindow (SDL_Window *window) |
Show a window. More... | |
DECLSPEC void SDLCALL | SDL_HideWindow (SDL_Window *window) |
Hide a window. More... | |
DECLSPEC void SDLCALL | SDL_RaiseWindow (SDL_Window *window) |
Raise a window above other windows and set the input focus. More... | |
DECLSPEC void SDLCALL | SDL_MaximizeWindow (SDL_Window *window) |
Make a window as large as possible. More... | |
DECLSPEC void SDLCALL | SDL_MinimizeWindow (SDL_Window *window) |
Minimize a window to an iconic representation. More... | |
DECLSPEC void SDLCALL | SDL_RestoreWindow (SDL_Window *window) |
Restore the size and position of a minimized or maximized window. More... | |
DECLSPEC int SDLCALL | SDL_SetWindowFullscreen (SDL_Window *window, Uint32 flags) |
Set a window's fullscreen state. More... | |
DECLSPEC SDL_Surface *SDLCALL | SDL_GetWindowSurface (SDL_Window *window) |
Get the SDL surface associated with the window. More... | |
DECLSPEC int SDLCALL | SDL_UpdateWindowSurface (SDL_Window *window) |
Copy the window surface to the screen. More... | |
DECLSPEC int SDLCALL | SDL_UpdateWindowSurfaceRects (SDL_Window *window, const SDL_Rect *rects, int numrects) |
Copy a number of rectangles on the window surface to the screen. More... | |
DECLSPEC void SDLCALL | SDL_SetWindowGrab (SDL_Window *window, SDL_bool grabbed) |
Set a window's input grab mode. More... | |
DECLSPEC SDL_bool SDLCALL | SDL_GetWindowGrab (SDL_Window *window) |
Get a window's input grab mode. More... | |
DECLSPEC SDL_Window *SDLCALL | SDL_GetGrabbedWindow (void) |
Get the window that currently has an input grab enabled. More... | |
DECLSPEC int SDLCALL | SDL_SetWindowBrightness (SDL_Window *window, float brightness) |
Set the brightness (gamma correction) for a window. More... | |
DECLSPEC float SDLCALL | SDL_GetWindowBrightness (SDL_Window *window) |
Get the brightness (gamma correction) for a window. More... | |
DECLSPEC int SDLCALL | SDL_SetWindowOpacity (SDL_Window *window, float opacity) |
Set the opacity for a window. More... | |
DECLSPEC int SDLCALL | SDL_GetWindowOpacity (SDL_Window *window, float *out_opacity) |
Get the opacity of a window. More... | |
DECLSPEC int SDLCALL | SDL_SetWindowModalFor (SDL_Window *modal_window, SDL_Window *parent_window) |
Sets the window as a modal for another window (TODO: reconsider this function and/or its name) More... | |
DECLSPEC int SDLCALL | SDL_SetWindowInputFocus (SDL_Window *window) |
Explicitly sets input focus to the window. More... | |
DECLSPEC int SDLCALL | SDL_SetWindowGammaRamp (SDL_Window *window, const Uint16 *red, const Uint16 *green, const Uint16 *blue) |
Set the gamma ramp for a window. More... | |
DECLSPEC int SDLCALL | SDL_GetWindowGammaRamp (SDL_Window *window, Uint16 *red, Uint16 *green, Uint16 *blue) |
Get the gamma ramp for a window. More... | |
DECLSPEC int SDLCALL | SDL_SetWindowHitTest (SDL_Window *window, SDL_HitTest callback, void *callback_data) |
Provide a callback that decides if a window region has special properties. More... | |
DECLSPEC void SDLCALL | SDL_DestroyWindow (SDL_Window *window) |
Destroy a window. More... | |
DECLSPEC SDL_bool SDLCALL | SDL_IsScreenSaverEnabled (void) |
Returns whether the screensaver is currently enabled (default off). More... | |
DECLSPEC void SDLCALL | SDL_EnableScreenSaver (void) |
Allow the screen to be blanked by a screensaver. More... | |
DECLSPEC void SDLCALL | SDL_DisableScreenSaver (void) |
Prevent the screen from being blanked by a screensaver. More... | |
OpenGL support functions | |
DECLSPEC int SDLCALL | SDL_GL_LoadLibrary (const char *path) |
Dynamically load an OpenGL library. More... | |
DECLSPEC void *SDLCALL | SDL_GL_GetProcAddress (const char *proc) |
Get the address of an OpenGL function. More... | |
DECLSPEC void SDLCALL | SDL_GL_UnloadLibrary (void) |
Unload the OpenGL library previously loaded by SDL_GL_LoadLibrary(). More... | |
DECLSPEC SDL_bool SDLCALL | SDL_GL_ExtensionSupported (const char *extension) |
Return true if an OpenGL extension is supported for the current context. More... | |
DECLSPEC void SDLCALL | SDL_GL_ResetAttributes (void) |
Reset all previously set OpenGL context attributes to their default values. More... | |
DECLSPEC int SDLCALL | SDL_GL_SetAttribute (SDL_GLattr attr, int value) |
Set an OpenGL window attribute before window creation. More... | |
DECLSPEC int SDLCALL | SDL_GL_GetAttribute (SDL_GLattr attr, int *value) |
Get the actual value for an attribute from the current context. More... | |
DECLSPEC SDL_GLContext SDLCALL | SDL_GL_CreateContext (SDL_Window *window) |
Create an OpenGL context for use with an OpenGL window, and make it current. More... | |
DECLSPEC int SDLCALL | SDL_GL_MakeCurrent (SDL_Window *window, SDL_GLContext context) |
Set up an OpenGL context for rendering into an OpenGL window. More... | |
DECLSPEC SDL_Window *SDLCALL | SDL_GL_GetCurrentWindow (void) |
Get the currently active OpenGL window. More... | |
DECLSPEC SDL_GLContext SDLCALL | SDL_GL_GetCurrentContext (void) |
Get the currently active OpenGL context. More... | |
DECLSPEC void SDLCALL | SDL_GL_GetDrawableSize (SDL_Window *window, int *w, int *h) |
Get the size of a window's underlying drawable in pixels (for use with glViewport). More... | |
DECLSPEC int SDLCALL | SDL_GL_SetSwapInterval (int interval) |
Set the swap interval for the current OpenGL context. More... | |
DECLSPEC int SDLCALL | SDL_GL_GetSwapInterval (void) |
Get the swap interval for the current OpenGL context. More... | |
DECLSPEC void SDLCALL | SDL_GL_SwapWindow (SDL_Window *window) |
Swap the OpenGL buffers for a window, if double-buffering is supported. More... | |
DECLSPEC void SDLCALL | SDL_GL_DeleteContext (SDL_GLContext context) |
Delete an OpenGL context. More... | |
Header file for SDL video functions.
Definition in file SDL_video.h.
#define SDL_WINDOWPOS_CENTERED SDL_WINDOWPOS_CENTERED_DISPLAY(0) |
Definition at line 139 of file SDL_video.h.
#define SDL_WINDOWPOS_CENTERED_DISPLAY | ( | X | ) | (SDL_WINDOWPOS_CENTERED_MASK|(X)) |
Definition at line 138 of file SDL_video.h.
#define SDL_WINDOWPOS_CENTERED_MASK 0x2FFF0000u |
Used to indicate that the window position should be centered.
Definition at line 137 of file SDL_video.h.
#define SDL_WINDOWPOS_ISCENTERED | ( | X | ) | (((X)&0xFFFF0000) == SDL_WINDOWPOS_CENTERED_MASK) |
Definition at line 140 of file SDL_video.h.
#define SDL_WINDOWPOS_ISUNDEFINED | ( | X | ) | (((X)&0xFFFF0000) == SDL_WINDOWPOS_UNDEFINED_MASK) |
Definition at line 131 of file SDL_video.h.
#define SDL_WINDOWPOS_UNDEFINED SDL_WINDOWPOS_UNDEFINED_DISPLAY(0) |
Definition at line 130 of file SDL_video.h.
#define SDL_WINDOWPOS_UNDEFINED_DISPLAY | ( | X | ) | (SDL_WINDOWPOS_UNDEFINED_MASK|(X)) |
Definition at line 129 of file SDL_video.h.
#define SDL_WINDOWPOS_UNDEFINED_MASK 0x1FFF0000u |
Used to indicate that you don't care what the window position is.
Definition at line 128 of file SDL_video.h.
typedef void* SDL_GLContext |
An opaque handle to an OpenGL context.
Definition at line 193 of file SDL_video.h.
typedef SDL_HitTestResult(SDLCALL * SDL_HitTest) (SDL_Window *win, const SDL_Point *area, void *data) |
Callback used for hit-testing.
Definition at line 1039 of file SDL_video.h.
typedef struct SDL_Window SDL_Window |
The type used to identify a window.
Definition at line 90 of file SDL_video.h.
enum SDL_DisplayEventID |
Event subtype for display events.
Enumerator | |
---|---|
SDL_DISPLAYEVENT_NONE | Never used |
SDL_DISPLAYEVENT_ORIENTATION | Display orientation has changed to data1 |
Definition at line 175 of file SDL_video.h.
Definition at line 181 of file SDL_video.h.
enum SDL_GLattr |
OpenGL configuration attributes.
Definition at line 198 of file SDL_video.h.
enum SDL_GLcontextFlag |
Enumerator | |
---|---|
SDL_GL_CONTEXT_DEBUG_FLAG | |
SDL_GL_CONTEXT_FORWARD_COMPATIBLE_FLAG | |
SDL_GL_CONTEXT_ROBUST_ACCESS_FLAG | |
SDL_GL_CONTEXT_RESET_ISOLATION_FLAG |
Definition at line 236 of file SDL_video.h.
Enumerator | |
---|---|
SDL_GL_CONTEXT_RELEASE_BEHAVIOR_NONE | |
SDL_GL_CONTEXT_RELEASE_BEHAVIOR_FLUSH |
Definition at line 244 of file SDL_video.h.
Enumerator | |
---|---|
SDL_GL_CONTEXT_RESET_NO_NOTIFICATION | |
SDL_GL_CONTEXT_RESET_LOSE_CONTEXT |
Definition at line 250 of file SDL_video.h.
enum SDL_GLprofile |
Enumerator | |
---|---|
SDL_GL_CONTEXT_PROFILE_CORE | |
SDL_GL_CONTEXT_PROFILE_COMPATIBILITY | |
SDL_GL_CONTEXT_PROFILE_ES | GLX_CONTEXT_ES2_PROFILE_BIT_EXT |
Definition at line 229 of file SDL_video.h.
enum SDL_HitTestResult |
Possible return values from the SDL_HitTest callback.
Definition at line 1020 of file SDL_video.h.
enum SDL_WindowEventID |
Event subtype for window events.
Definition at line 146 of file SDL_video.h.
enum SDL_WindowFlags |
The flags on a window.
Definition at line 97 of file SDL_video.h.
DECLSPEC SDL_Window* SDLCALL SDL_CreateWindow | ( | const char * | title, |
int | x, | ||
int | y, | ||
int | w, | ||
int | h, | ||
Uint32 | flags | ||
) |
Create a window with the specified position, dimensions, and flags.
title | The title of the window, in UTF-8 encoding. |
x | The x position of the window, SDL_WINDOWPOS_CENTERED, or SDL_WINDOWPOS_UNDEFINED. |
y | The y position of the window, SDL_WINDOWPOS_CENTERED, or SDL_WINDOWPOS_UNDEFINED. |
w | The width of the window, in screen coordinates. |
h | The height of the window, in screen coordinates. |
flags | The flags for the window, a mask of any of the following: SDL_WINDOW_FULLSCREEN, SDL_WINDOW_OPENGL, SDL_WINDOW_HIDDEN, SDL_WINDOW_BORDERLESS, SDL_WINDOW_RESIZABLE, SDL_WINDOW_MAXIMIZED, SDL_WINDOW_MINIMIZED, SDL_WINDOW_INPUT_GRABBED, SDL_WINDOW_ALLOW_HIGHDPI, SDL_WINDOW_VULKAN. |
If the window is created with the SDL_WINDOW_ALLOW_HIGHDPI flag, its size in pixels may differ from its size in screen coordinates on platforms with high-DPI support (e.g. iOS and Mac OS X). Use SDL_GetWindowSize() to query the client area's size in screen coordinates, and SDL_GL_GetDrawableSize(), SDL_Vulkan_GetDrawableSize(), or SDL_GetRendererOutputSize() to query the drawable size in pixels.
If the window is created with any of the SDL_WINDOW_OPENGL or SDL_WINDOW_VULKAN flags, then the corresponding LoadLibrary function (SDL_GL_LoadLibrary or SDL_Vulkan_LoadLibrary) is called and the corresponding UnloadLibrary function is called by SDL_DestroyWindow().
If SDL_WINDOW_VULKAN is specified and there isn't a working Vulkan driver, SDL_CreateWindow() will fail because SDL_Vulkan_LoadLibrary() will fail.
DECLSPEC SDL_Window* SDLCALL SDL_CreateWindowFrom | ( | const void * | data | ) |
Create an SDL window from an existing native window.
data | A pointer to driver-dependent window creation data |
DECLSPEC void SDLCALL SDL_DestroyWindow | ( | SDL_Window * | window | ) |
Destroy a window.
Prevent the screen from being blanked by a screensaver.
Allow the screen to be blanked by a screensaver.
DECLSPEC SDL_DisplayMode* SDLCALL SDL_GetClosestDisplayMode | ( | int | displayIndex, |
const SDL_DisplayMode * | mode, | ||
SDL_DisplayMode * | closest | ||
) |
Get the closest match to the requested display mode.
displayIndex | The index of display from which mode should be queried. |
mode | The desired display mode |
closest | A pointer to a display mode to be filled in with the closest match of the available display modes. |
closest
, or NULL if no matching video mode was available.The available display modes are scanned, and closest
is filled in with the closest mode matching the requested mode and returned. The mode format and refresh_rate default to the desktop mode if they are 0. The modes are scanned with size being first priority, format being second priority, and finally checking the refresh_rate. If all the available modes are too small, then NULL is returned.
DECLSPEC int SDLCALL SDL_GetCurrentDisplayMode | ( | int | displayIndex, |
SDL_DisplayMode * | mode | ||
) |
Fill in information about the current display mode.
Returns the name of the currently initialized video driver.
DECLSPEC int SDLCALL SDL_GetDesktopDisplayMode | ( | int | displayIndex, |
SDL_DisplayMode * | mode | ||
) |
Fill in information about the desktop display mode.
Get the desktop area represented by a display, with the primary display located at 0,0.
DECLSPEC int SDLCALL SDL_GetDisplayDPI | ( | int | displayIndex, |
float * | ddpi, | ||
float * | hdpi, | ||
float * | vdpi | ||
) |
Get the dots/pixels-per-inch for a display.
DECLSPEC int SDLCALL SDL_GetDisplayMode | ( | int | displayIndex, |
int | modeIndex, | ||
SDL_DisplayMode * | mode | ||
) |
Fill in information about a specific display mode.
Get the name of a display in UTF-8 encoding.
DECLSPEC SDL_DisplayOrientation SDLCALL SDL_GetDisplayOrientation | ( | int | displayIndex | ) |
Get the orientation of a display.
Get the usable desktop area represented by a display, with the primary display located at 0,0.
This is the same area as SDL_GetDisplayBounds() reports, but with portions reserved by the system removed. For example, on Mac OS X, this subtracts the area occupied by the menu bar and dock.
Setting a window to be fullscreen generally bypasses these unusable areas, so these are good guidelines for the maximum space available to a non-fullscreen window.
DECLSPEC SDL_Window* SDLCALL SDL_GetGrabbedWindow | ( | void | ) |
Get the window that currently has an input grab enabled.
Returns the number of available display modes.
Returns the number of available video displays.
Get the number of video drivers compiled into SDL.
Get the name of a built in video driver.
DECLSPEC int SDLCALL 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.
window | The window to query. |
top | Pointer to variable for storing the size of the top border. NULL is permitted. |
left | Pointer to variable for storing the size of the left border. NULL is permitted. |
bottom | Pointer to variable for storing the size of the bottom border. NULL is permitted. |
right | Pointer to variable for storing the size of the right border. NULL is permitted. |
DECLSPEC float SDLCALL SDL_GetWindowBrightness | ( | SDL_Window * | window | ) |
Get the brightness (gamma correction) for a window.
DECLSPEC void* SDLCALL SDL_GetWindowData | ( | SDL_Window * | window, |
const char * | name | ||
) |
Retrieve the data pointer associated with a window.
window | The window to query. |
name | The name of the pointer. |
DECLSPEC int SDLCALL SDL_GetWindowDisplayIndex | ( | SDL_Window * | window | ) |
Get the display index associated with a window.
DECLSPEC int SDLCALL SDL_GetWindowDisplayMode | ( | SDL_Window * | window, |
SDL_DisplayMode * | mode | ||
) |
Fill in information about the display mode used when a fullscreen window is visible.
DECLSPEC Uint32 SDLCALL SDL_GetWindowFlags | ( | SDL_Window * | window | ) |
Get the window flags.
DECLSPEC SDL_Window* SDLCALL SDL_GetWindowFromID | ( | Uint32 | id | ) |
Get a window from a stored ID, or NULL if it doesn't exist.
DECLSPEC int SDLCALL SDL_GetWindowGammaRamp | ( | SDL_Window * | window, |
Uint16 * | red, | ||
Uint16 * | green, | ||
Uint16 * | blue | ||
) |
Get the gamma ramp for a window.
window | The window from which the gamma ramp should be queried. |
red | A pointer to a 256 element array of 16-bit quantities to hold the translation table for the red channel, or NULL. |
green | A pointer to a 256 element array of 16-bit quantities to hold the translation table for the green channel, or NULL. |
blue | A pointer to a 256 element array of 16-bit quantities to hold the translation table for the blue channel, or NULL. |
DECLSPEC SDL_bool SDLCALL SDL_GetWindowGrab | ( | SDL_Window * | window | ) |
Get a window's input grab mode.
DECLSPEC Uint32 SDLCALL SDL_GetWindowID | ( | SDL_Window * | window | ) |
Get the numeric ID of a window, for logging purposes.
DECLSPEC void SDLCALL SDL_GetWindowMaximumSize | ( | SDL_Window * | window, |
int * | w, | ||
int * | h | ||
) |
Get the maximum size of a window's client area.
window | The window to query. |
w | Pointer to variable for storing the maximum width, may be NULL |
h | Pointer to variable for storing the maximum height, may be NULL |
DECLSPEC void SDLCALL SDL_GetWindowMinimumSize | ( | SDL_Window * | window, |
int * | w, | ||
int * | h | ||
) |
Get the minimum size of a window's client area.
window | The window to query. |
w | Pointer to variable for storing the minimum width, may be NULL |
h | Pointer to variable for storing the minimum height, may be NULL |
DECLSPEC int SDLCALL SDL_GetWindowOpacity | ( | SDL_Window * | window, |
float * | out_opacity | ||
) |
Get the opacity of a window.
If transparency isn't supported on this platform, opacity will be reported as 1.0f without error.
window | The window in question. |
out_opacity | Opacity (0.0f - transparent, 1.0f - opaque) |
DECLSPEC Uint32 SDLCALL SDL_GetWindowPixelFormat | ( | SDL_Window * | window | ) |
Get the pixel format associated with the window.
DECLSPEC void SDLCALL SDL_GetWindowPosition | ( | SDL_Window * | window, |
int * | x, | ||
int * | y | ||
) |
Get the position of a window.
window | The window to query. |
x | Pointer to variable for storing the x position, in screen coordinates. May be NULL. |
y | Pointer to variable for storing the y position, in screen coordinates. May be NULL. |
DECLSPEC void SDLCALL SDL_GetWindowSize | ( | SDL_Window * | window, |
int * | w, | ||
int * | h | ||
) |
Get the size of a window's client area.
window | The window to query. |
w | Pointer to variable for storing the width, in screen coordinates. May be NULL. |
h | Pointer to variable for storing the height, in screen coordinates. May be NULL. |
The window size in screen coordinates may differ from the size in pixels, if the window was created with SDL_WINDOW_ALLOW_HIGHDPI on a platform with high-dpi support (e.g. iOS or OS X). Use SDL_GL_GetDrawableSize() or SDL_GetRendererOutputSize() to get the real client area size in pixels.
DECLSPEC SDL_Surface* SDLCALL SDL_GetWindowSurface | ( | SDL_Window * | window | ) |
Get the SDL surface associated with the window.
A new surface will be created with the optimal format for the window, if necessary. This surface will be freed when the window is destroyed.
DECLSPEC const char* SDLCALL SDL_GetWindowTitle | ( | SDL_Window * | window | ) |
Get the title of a window, in UTF-8 format.
DECLSPEC SDL_GLContext SDLCALL SDL_GL_CreateContext | ( | SDL_Window * | window | ) |
Create an OpenGL context for use with an OpenGL window, and make it current.
DECLSPEC void SDLCALL SDL_GL_DeleteContext | ( | SDL_GLContext | context | ) |
Delete an OpenGL context.
Return true if an OpenGL extension is supported for the current context.
DECLSPEC int SDLCALL SDL_GL_GetAttribute | ( | SDL_GLattr | attr, |
int * | value | ||
) |
Get the actual value for an attribute from the current context.
value
will be modified in either case. DECLSPEC SDL_GLContext SDLCALL SDL_GL_GetCurrentContext | ( | void | ) |
Get the currently active OpenGL context.
DECLSPEC SDL_Window* SDLCALL SDL_GL_GetCurrentWindow | ( | void | ) |
Get the currently active OpenGL window.
DECLSPEC void SDLCALL SDL_GL_GetDrawableSize | ( | SDL_Window * | window, |
int * | w, | ||
int * | h | ||
) |
Get the size of a window's underlying drawable in pixels (for use with glViewport).
window | Window from which the drawable size should be queried |
w | Pointer to variable for storing the width in pixels, may be NULL |
h | Pointer to variable for storing the height in pixels, may be NULL |
This may differ from SDL_GetWindowSize() if we're rendering to a high-DPI drawable, i.e. the window was created with SDL_WINDOW_ALLOW_HIGHDPI on a platform with high-DPI support (Apple calls this "Retina"), and not disabled by the SDL_HINT_VIDEO_HIGHDPI_DISABLED hint.
Get the address of an OpenGL function.
Get the swap interval for the current OpenGL context.
Dynamically load an OpenGL library.
path | The platform dependent OpenGL library name, or NULL to open the default OpenGL library. |
This should be done after initializing the video driver, but before creating any OpenGL windows. If no OpenGL library is loaded, the default library will be loaded upon creation of the first OpenGL window.
DECLSPEC int SDLCALL SDL_GL_MakeCurrent | ( | SDL_Window * | window, |
SDL_GLContext | context | ||
) |
Set up an OpenGL context for rendering into an OpenGL window.
Reset all previously set OpenGL context attributes to their default values.
DECLSPEC int SDLCALL SDL_GL_SetAttribute | ( | SDL_GLattr | attr, |
int | value | ||
) |
Set an OpenGL window attribute before window creation.
Set the swap interval for the current OpenGL context.
interval | 0 for immediate updates, 1 for updates synchronized with the vertical retrace. If the system supports it, you may specify -1 to allow late swaps to happen immediately instead of waiting for the next retrace. |
DECLSPEC void SDLCALL SDL_GL_SwapWindow | ( | SDL_Window * | window | ) |
Swap the OpenGL buffers for a window, if double-buffering is supported.
Unload the OpenGL library previously loaded by SDL_GL_LoadLibrary().
DECLSPEC void SDLCALL SDL_HideWindow | ( | SDL_Window * | window | ) |
Hide a window.
Returns whether the screensaver is currently enabled (default off).
DECLSPEC void SDLCALL SDL_MaximizeWindow | ( | SDL_Window * | window | ) |
Make a window as large as possible.
DECLSPEC void SDLCALL SDL_MinimizeWindow | ( | SDL_Window * | window | ) |
Minimize a window to an iconic representation.
DECLSPEC void SDLCALL SDL_RaiseWindow | ( | SDL_Window * | window | ) |
Raise a window above other windows and set the input focus.
DECLSPEC void SDLCALL SDL_RestoreWindow | ( | SDL_Window * | window | ) |
Restore the size and position of a minimized or maximized window.
DECLSPEC void SDLCALL SDL_SetWindowBordered | ( | SDL_Window * | window, |
SDL_bool | bordered | ||
) |
Set the border state of a window.
This will add or remove the window's SDL_WINDOW_BORDERLESS flag and add or remove the border from the actual window. This is a no-op if the window's border already matches the requested state.
window | The window of which to change the border state. |
bordered | SDL_FALSE to remove border, SDL_TRUE to add border. |
DECLSPEC int SDLCALL SDL_SetWindowBrightness | ( | SDL_Window * | window, |
float | brightness | ||
) |
Set the brightness (gamma correction) for a window.
DECLSPEC void* SDLCALL SDL_SetWindowData | ( | SDL_Window * | window, |
const char * | name, | ||
void * | userdata | ||
) |
Associate an arbitrary named pointer with a window.
window | The window to associate with the pointer. |
name | The name of the pointer. |
userdata | The associated pointer. |
DECLSPEC int SDLCALL SDL_SetWindowDisplayMode | ( | SDL_Window * | window, |
const SDL_DisplayMode * | mode | ||
) |
Set the display mode used when a fullscreen window is visible.
By default the window's dimensions and the desktop format and refresh rate are used.
window | The window for which the display mode should be set. |
mode | The mode to use, or NULL for the default mode. |
DECLSPEC int SDLCALL SDL_SetWindowFullscreen | ( | SDL_Window * | window, |
Uint32 | flags | ||
) |
Set a window's fullscreen state.
DECLSPEC int SDLCALL SDL_SetWindowGammaRamp | ( | SDL_Window * | window, |
const Uint16 * | red, | ||
const Uint16 * | green, | ||
const Uint16 * | blue | ||
) |
Set the gamma ramp for a window.
window | The window for which the gamma ramp should be set. |
red | The translation table for the red channel, or NULL. |
green | The translation table for the green channel, or NULL. |
blue | The translation table for the blue channel, or NULL. |
Set the gamma translation table for the red, green, and blue channels of the video hardware. Each table is an array of 256 16-bit quantities, representing a mapping between the input and output for that channel. The input is the index into the array, and the output is the 16-bit gamma value at that index, scaled to the output color precision.
DECLSPEC void SDLCALL SDL_SetWindowGrab | ( | SDL_Window * | window, |
SDL_bool | grabbed | ||
) |
Set a window's input grab mode.
window | The window for which the input grab mode should be set. |
grabbed | This is SDL_TRUE to grab input, and SDL_FALSE to release input. |
If the caller enables a grab while another window is currently grabbed, the other window loses its grab in favor of the caller's window.
DECLSPEC int SDLCALL SDL_SetWindowHitTest | ( | SDL_Window * | window, |
SDL_HitTest | callback, | ||
void * | callback_data | ||
) |
Provide a callback that decides if a window region has special properties.
Normally windows are dragged and resized by decorations provided by the system window manager (a title bar, borders, etc), but for some apps, it makes sense to drag them from somewhere else inside the window itself; for example, one might have a borderless window that wants to be draggable from any part, or simulate its own title bar, etc.
This function lets the app provide a callback that designates pieces of a given window as special. This callback is run during event processing if we need to tell the OS to treat a region of the window specially; the use of this callback is known as "hit testing."
Mouse input may not be delivered to your application if it is within a special area; the OS will often apply that input to moving the window or resizing the window and not deliver it to the application.
Specifying NULL for a callback disables hit-testing. Hit-testing is disabled by default.
Platforms that don't support this functionality will return -1 unconditionally, even if you're attempting to disable hit-testing.
Your callback may fire at any time, and its firing does not indicate any specific behavior (for example, on Windows, this certainly might fire when the OS is deciding whether to drag your window, but it fires for lots of other reasons, too, some unrelated to anything you probably care about and when the mouse isn't actually at the location it is testing). Since this can fire at any time, you should try to keep your callback efficient, devoid of allocations, etc.
window | The window to set hit-testing on. |
callback | The callback to call when doing a hit-test. |
callback_data | An app-defined void pointer passed to the callback. |
DECLSPEC void SDLCALL SDL_SetWindowIcon | ( | SDL_Window * | window, |
SDL_Surface * | icon | ||
) |
Set the icon for a window.
window | The window for which the icon should be set. |
icon | The icon for the window. |
DECLSPEC int SDLCALL SDL_SetWindowInputFocus | ( | SDL_Window * | window | ) |
Explicitly sets input focus to the window.
You almost certainly want SDL_RaiseWindow() instead of this function. Use this with caution, as you might give focus to a window that's completely obscured by other windows.
window | The window that should get the input focus |
DECLSPEC void SDLCALL SDL_SetWindowMaximumSize | ( | SDL_Window * | window, |
int | max_w, | ||
int | max_h | ||
) |
Set the maximum size of a window's client area.
window | The window to set a new maximum size. |
max_w | The maximum width of the window, must be >0 |
max_h | The maximum height of the window, must be >0 |
DECLSPEC void SDLCALL SDL_SetWindowMinimumSize | ( | SDL_Window * | window, |
int | min_w, | ||
int | min_h | ||
) |
Set the minimum size of a window's client area.
window | The window to set a new minimum size. |
min_w | The minimum width of the window, must be >0 |
min_h | The minimum height of the window, must be >0 |
DECLSPEC int SDLCALL SDL_SetWindowModalFor | ( | SDL_Window * | modal_window, |
SDL_Window * | parent_window | ||
) |
Sets the window as a modal for another window (TODO: reconsider this function and/or its name)
modal_window | The window that should be modal |
parent_window | The parent window |
DECLSPEC int SDLCALL SDL_SetWindowOpacity | ( | SDL_Window * | window, |
float | opacity | ||
) |
Set the opacity for a window.
window | The window which will be made transparent or opaque |
opacity | Opacity (0.0f - transparent, 1.0f - opaque) This will be clamped internally between 0.0f and 1.0f. |
DECLSPEC void SDLCALL SDL_SetWindowPosition | ( | SDL_Window * | window, |
int | x, | ||
int | y | ||
) |
Set the position of a window.
window | The window to reposition. |
x | The x coordinate of the window in screen coordinates, or SDL_WINDOWPOS_CENTERED or SDL_WINDOWPOS_UNDEFINED. |
y | The y coordinate of the window in screen coordinates, or SDL_WINDOWPOS_CENTERED or SDL_WINDOWPOS_UNDEFINED. |
DECLSPEC void SDLCALL SDL_SetWindowResizable | ( | SDL_Window * | window, |
SDL_bool | resizable | ||
) |
Set the user-resizable state of a window.
This will add or remove the window's SDL_WINDOW_RESIZABLE flag and allow/disallow user resizing of the window. This is a no-op if the window's resizable state already matches the requested state.
window | The window of which to change the resizable state. |
resizable | SDL_TRUE to allow resizing, SDL_FALSE to disallow. |
DECLSPEC void SDLCALL SDL_SetWindowSize | ( | SDL_Window * | window, |
int | w, | ||
int | h | ||
) |
Set the size of a window's client area.
window | The window to resize. |
w | The width of the window, in screen coordinates. Must be >0. |
h | The height of the window, in screen coordinates. Must be >0. |
The window size in screen coordinates may differ from the size in pixels, if the window was created with SDL_WINDOW_ALLOW_HIGHDPI on a platform with high-dpi support (e.g. iOS or OS X). Use SDL_GL_GetDrawableSize() or SDL_GetRendererOutputSize() to get the real client area size in pixels.
DECLSPEC void SDLCALL SDL_SetWindowTitle | ( | SDL_Window * | window, |
const char * | title | ||
) |
Set the title of a window, in UTF-8 format.
DECLSPEC void SDLCALL SDL_ShowWindow | ( | SDL_Window * | window | ) |
Show a window.
DECLSPEC int SDLCALL SDL_UpdateWindowSurface | ( | SDL_Window * | window | ) |
Copy the window surface to the screen.
DECLSPEC int SDLCALL SDL_UpdateWindowSurfaceRects | ( | SDL_Window * | window, |
const SDL_Rect * | rects, | ||
int | numrects | ||
) |
Copy a number of rectangles on the window surface to the screen.
Initialize the video subsystem, optionally specifying a video driver.
driver_name | Initialize a specific driver by name, or NULL for the default video driver. |
This function initializes the video subsystem; setting up a connection to the window manager, etc, and determines the available display modes and pixel formats, but does not initialize a window or graphics mode.
Shuts down the video subsystem.
This function closes all windows, and restores the original video mode.