#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.
Data Structures | |
struct | SDL_DisplayMode |
The structure that defines a display mode. More... | |
struct | SDL_RendererInfo |
Information on the capabilities of a render driver or context. More... | |
Defines | |
#define | SDL_WINDOWPOS_UNDEFINED 0x7FFFFFF |
Used to indicate that you don't care what the window position is. | |
#define | SDL_WINDOWPOS_CENTERED 0x7FFFFFE |
Used to indicate that the window position should be centered. | |
Typedefs | |
typedef Uint32 | SDL_WindowID |
The type used to identify a window. | |
typedef Uint32 | SDL_TextureID |
An efficient driver-specific representation of pixel data. | |
typedef void * | SDL_GLContext |
An opaque handle to an OpenGL context. | |
Enumerations | |
enum | SDL_WindowFlags { SDL_WINDOW_FULLSCREEN = 0x00000001, SDL_WINDOW_OPENGL = 0x00000002, SDL_WINDOW_SHOWN = 0x00000004, SDL_WINDOW_BORDERLESS = 0x00000008, SDL_WINDOW_RESIZABLE = 0x00000010, SDL_WINDOW_MINIMIZED = 0x00000020, SDL_WINDOW_MAXIMIZED = 0x00000040, SDL_WINDOW_INPUT_GRABBED = 0x00000100, SDL_WINDOW_INPUT_FOCUS = 0x00000200, SDL_WINDOW_MOUSE_FOCUS = 0x00000400, SDL_WINDOW_FOREIGN = 0x00000800 } |
The flags on a window. More... | |
enum | SDL_WindowEventID { SDL_WINDOWEVENT_NONE, SDL_WINDOWEVENT_SHOWN, SDL_WINDOWEVENT_HIDDEN, SDL_WINDOWEVENT_EXPOSED, SDL_WINDOWEVENT_MOVED, SDL_WINDOWEVENT_RESIZED, SDL_WINDOWEVENT_MINIMIZED, SDL_WINDOWEVENT_MAXIMIZED, SDL_WINDOWEVENT_RESTORED, SDL_WINDOWEVENT_ENTER, SDL_WINDOWEVENT_LEAVE, SDL_WINDOWEVENT_FOCUS_GAINED, SDL_WINDOWEVENT_FOCUS_LOST, SDL_WINDOWEVENT_CLOSE } |
Event subtype for window events. More... | |
enum | SDL_RendererFlags { SDL_RENDERER_SINGLEBUFFER = 0x00000001, SDL_RENDERER_PRESENTCOPY = 0x00000002, SDL_RENDERER_PRESENTFLIP2 = 0x00000004, SDL_RENDERER_PRESENTFLIP3 = 0x00000008, SDL_RENDERER_PRESENTDISCARD = 0x00000010, SDL_RENDERER_PRESENTVSYNC = 0x00000020, SDL_RENDERER_ACCELERATED = 0x00000040 } |
Flags used when creating a rendering context. More... | |
enum | SDL_TextureAccess { SDL_TEXTUREACCESS_STATIC, SDL_TEXTUREACCESS_STREAMING } |
The access pattern allowed for a texture. More... | |
enum | SDL_TextureModulate { SDL_TEXTUREMODULATE_NONE = 0x00000000, SDL_TEXTUREMODULATE_COLOR = 0x00000001, SDL_TEXTUREMODULATE_ALPHA = 0x00000002 } |
The texture channel modulation used in SDL_RenderCopy(). More... | |
enum | SDL_BlendMode { SDL_BLENDMODE_NONE = 0x00000000, SDL_BLENDMODE_MASK = 0x00000001, SDL_BLENDMODE_BLEND = 0x00000002, SDL_BLENDMODE_ADD = 0x00000004, SDL_BLENDMODE_MOD = 0x00000008 } |
The blend mode used in SDL_RenderCopy() and drawing operations. More... | |
enum | SDL_TextureScaleMode { SDL_TEXTURESCALEMODE_NONE = 0x00000000, SDL_TEXTURESCALEMODE_FAST = 0x00000001, SDL_TEXTURESCALEMODE_SLOW = 0x00000002, SDL_TEXTURESCALEMODE_BEST = 0x00000004 } |
The texture scale mode used in SDL_RenderCopy(). More... | |
enum | SDL_GLattr { SDL_GL_RED_SIZE, SDL_GL_GREEN_SIZE, SDL_GL_BLUE_SIZE, SDL_GL_ALPHA_SIZE, SDL_GL_BUFFER_SIZE, SDL_GL_DOUBLEBUFFER, SDL_GL_DEPTH_SIZE, SDL_GL_STENCIL_SIZE, SDL_GL_ACCUM_RED_SIZE, SDL_GL_ACCUM_GREEN_SIZE, SDL_GL_ACCUM_BLUE_SIZE, SDL_GL_ACCUM_ALPHA_SIZE, SDL_GL_STEREO, SDL_GL_MULTISAMPLEBUFFERS, SDL_GL_MULTISAMPLESAMPLES, SDL_GL_ACCELERATED_VISUAL, SDL_GL_RETAINED_BACKING, SDL_GL_CONTEXT_MAJOR_VERSION, SDL_GL_CONTEXT_MINOR_VERSION } |
OpenGL configuration attributes. | |
Functions | |
DECLSPEC int SDLCALL | SDL_GetNumVideoDrivers (void) |
Get the number of video drivers compiled into SDL. | |
DECLSPEC const char *SDLCALL | SDL_GetVideoDriver (int index) |
Get the name of a built in video driver. | |
DECLSPEC int SDLCALL | SDL_VideoInit (const char *driver_name, Uint32 flags) |
Initialize the video subsystem, optionally specifying a video driver. | |
DECLSPEC void SDLCALL | SDL_VideoQuit (void) |
Shuts down the video subsystem. | |
DECLSPEC const char *SDLCALL | SDL_GetCurrentVideoDriver (void) |
Returns the name of the currently initialized video driver. | |
DECLSPEC int SDLCALL | SDL_GetNumVideoDisplays (void) |
Returns the number of available video displays. | |
DECLSPEC int SDLCALL | SDL_SelectVideoDisplay (int index) |
Set the index of the currently selected display. | |
DECLSPEC int SDLCALL | SDL_GetCurrentVideoDisplay (void) |
Get the index of the currently selected display. | |
DECLSPEC int SDLCALL | SDL_GetNumDisplayModes (void) |
Returns the number of available display modes for the current display. | |
DECLSPEC int SDLCALL | SDL_GetDisplayMode (int index, SDL_DisplayMode *mode) |
Fill in information about a specific display mode. | |
DECLSPEC int SDLCALL | SDL_GetDesktopDisplayMode (SDL_DisplayMode *mode) |
Fill in information about the desktop display mode for the current display. | |
DECLSPEC int SDLCALL | SDL_GetCurrentDisplayMode (SDL_DisplayMode *mode) |
Fill in information about the current display mode. | |
DECLSPEC SDL_DisplayMode *SDLCALL | SDL_GetClosestDisplayMode (const SDL_DisplayMode *mode, SDL_DisplayMode *closest) |
Get the closest match to the requested display mode. | |
DECLSPEC int SDLCALL | SDL_SetFullscreenDisplayMode (const SDL_DisplayMode *mode) |
Set the display mode used when a fullscreen window is visible on the currently selected display. | |
DECLSPEC int SDLCALL | SDL_GetFullscreenDisplayMode (SDL_DisplayMode *mode) |
Fill in information about the display mode used when a fullscreen window is visible on the currently selected display. | |
DECLSPEC int SDLCALL | SDL_SetDisplayPalette (const SDL_Color *colors, int firstcolor, int ncolors) |
Set the palette entries for indexed display modes. | |
DECLSPEC int SDLCALL | SDL_GetDisplayPalette (SDL_Color *colors, int firstcolor, int ncolors) |
Gets the palette entries for indexed display modes. | |
DECLSPEC int SDLCALL | SDL_SetGamma (float red, float green, float blue) |
Set the gamma correction for each of the color channels on the currently selected display. | |
DECLSPEC int SDLCALL | SDL_SetGammaRamp (const Uint16 *red, const Uint16 *green, const Uint16 *blue) |
Set the gamma ramp for the currently selected display. | |
DECLSPEC int SDLCALL | SDL_GetGammaRamp (Uint16 *red, Uint16 *green, Uint16 *blue) |
Get the gamma ramp for the currently selected display. | |
DECLSPEC SDL_WindowID 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. | |
DECLSPEC SDL_WindowID SDLCALL | SDL_CreateWindowFrom (const void *data) |
DECLSPEC Uint32 SDLCALL | SDL_GetWindowFlags (SDL_WindowID windowID) |
Get the window flags. | |
DECLSPEC void SDLCALL | SDL_SetWindowTitle (SDL_WindowID windowID, const char *title) |
Set the title of the window, in UTF-8 format. | |
DECLSPEC const char *SDLCALL | SDL_GetWindowTitle (SDL_WindowID windowID) |
Get the title of the window, in UTF-8 format. | |
DECLSPEC void SDLCALL | SDL_SetWindowIcon (SDL_WindowID windowID, SDL_Surface *icon) |
Set the icon of the window. | |
DECLSPEC void SDLCALL | SDL_SetWindowData (SDL_WindowID windowID, void *userdata) |
Associate an arbitrary pointer with the window. | |
DECLSPEC void *SDLCALL | SDL_GetWindowData (SDL_WindowID windowID) |
Retrieve the data pointer associated with the window. | |
DECLSPEC void SDLCALL | SDL_SetWindowPosition (SDL_WindowID windowID, int x, int y) |
Set the position of the window. | |
DECLSPEC void SDLCALL | SDL_GetWindowPosition (SDL_WindowID windowID, int *x, int *y) |
Get the position of the window. | |
DECLSPEC void SDLCALL | SDL_SetWindowSize (SDL_WindowID windowID, int w, int h) |
Set the size of the window's client area. | |
DECLSPEC void SDLCALL | SDL_GetWindowSize (SDL_WindowID windowID, int *w, int *h) |
Get the size of the window's client area. | |
DECLSPEC void SDLCALL | SDL_ShowWindow (SDL_WindowID windowID) |
Show the window. | |
DECLSPEC void SDLCALL | SDL_HideWindow (SDL_WindowID windowID) |
Hide the window. | |
DECLSPEC void SDLCALL | SDL_RaiseWindow (SDL_WindowID windowID) |
Raise the window above other windows and set the input focus. | |
DECLSPEC void SDLCALL | SDL_MaximizeWindow (SDL_WindowID windowID) |
Make the window as large as possible. | |
DECLSPEC void SDLCALL | SDL_MinimizeWindow (SDL_WindowID windowID) |
Minimize the window to an iconic representation. | |
DECLSPEC void SDLCALL | SDL_RestoreWindow (SDL_WindowID windowID) |
Restore the size and position of a minimized or maximized window. | |
DECLSPEC int SDLCALL | SDL_SetWindowFullscreen (SDL_WindowID windowID, int fullscreen) |
Set the window's fullscreen state. | |
DECLSPEC void SDLCALL | SDL_SetWindowGrab (SDL_WindowID windowID, int mode) |
Set the window's input grab mode. | |
DECLSPEC int SDLCALL | SDL_GetWindowGrab (SDL_WindowID windowID) |
Get the window's input grab mode. | |
DECLSPEC SDL_bool SDLCALL | SDL_GetWindowWMInfo (SDL_WindowID windowID, struct SDL_SysWMinfo *info) |
DECLSPEC void SDLCALL | SDL_DestroyWindow (SDL_WindowID windowID) |
Destroy a window. | |
DECLSPEC int SDLCALL | SDL_GetNumRenderDrivers (void) |
Get the number of 2D rendering drivers available for the current display. | |
DECLSPEC int SDLCALL | SDL_GetRenderDriverInfo (int index, SDL_RendererInfo *info) |
Get information about a specific 2D rendering driver for the current display. | |
DECLSPEC int SDLCALL | SDL_CreateRenderer (SDL_WindowID windowID, int index, Uint32 flags) |
Create and make active a 2D rendering context for a window. | |
DECLSPEC int SDLCALL | SDL_SelectRenderer (SDL_WindowID windowID) |
Select the rendering context for a particular window. | |
DECLSPEC int SDLCALL | SDL_GetRendererInfo (SDL_RendererInfo *info) |
Get information about the current rendering context. | |
DECLSPEC SDL_TextureID SDLCALL | SDL_CreateTexture (Uint32 format, int access, int w, int h) |
Create a texture for the current rendering context. | |
DECLSPEC SDL_TextureID SDLCALL | SDL_CreateTextureFromSurface (Uint32 format, SDL_Surface *surface) |
Create a texture from an existing surface. | |
DECLSPEC int SDLCALL | SDL_QueryTexture (SDL_TextureID textureID, Uint32 *format, int *access, int *w, int *h) |
Query the attributes of a texture. | |
DECLSPEC int SDLCALL | SDL_QueryTexturePixels (SDL_TextureID textureID, void **pixels, int *pitch) |
DECLSPEC int SDLCALL | SDL_SetTexturePalette (SDL_TextureID textureID, const SDL_Color *colors, int firstcolor, int ncolors) |
Set the color palette of an indexed texture. | |
DECLSPEC int SDLCALL | SDL_GetTexturePalette (SDL_TextureID textureID, SDL_Color *colors, int firstcolor, int ncolors) |
Get the color palette from an indexed texture if it has one. | |
DECLSPEC int SDLCALL | SDL_SetTextureColorMod (SDL_TextureID textureID, Uint8 r, Uint8 g, Uint8 b) |
Set an additional color value used in render copy operations. | |
DECLSPEC int SDLCALL | SDL_GetTextureColorMod (SDL_TextureID textureID, Uint8 *r, Uint8 *g, Uint8 *b) |
Get the additional color value used in render copy operations. | |
DECLSPEC int SDLCALL | SDL_SetTextureAlphaMod (SDL_TextureID textureID, Uint8 alpha) |
Set an additional alpha value used in render copy operations. | |
DECLSPEC int SDLCALL | SDL_GetTextureAlphaMod (SDL_TextureID textureID, Uint8 *alpha) |
Get the additional alpha value used in render copy operations. | |
DECLSPEC int SDLCALL | SDL_SetTextureBlendMode (SDL_TextureID textureID, int blendMode) |
Set the blend mode used for texture copy operations. | |
DECLSPEC int SDLCALL | SDL_GetTextureBlendMode (SDL_TextureID textureID, int *blendMode) |
Get the blend mode used for texture copy operations. | |
DECLSPEC int SDLCALL | SDL_SetTextureScaleMode (SDL_TextureID textureID, int scaleMode) |
Set the scale mode used for texture copy operations. | |
DECLSPEC int SDLCALL | SDL_GetTextureScaleMode (SDL_TextureID textureID, int *scaleMode) |
Get the scale mode used for texture copy operations. | |
DECLSPEC int SDLCALL | SDL_UpdateTexture (SDL_TextureID textureID, const SDL_Rect *rect, const void *pixels, int pitch) |
Update the given texture rectangle with new pixel data. | |
DECLSPEC int SDLCALL | SDL_LockTexture (SDL_TextureID textureID, const SDL_Rect *rect, int markDirty, void **pixels, int *pitch) |
Lock a portion of the texture for pixel access. | |
DECLSPEC void SDLCALL | SDL_UnlockTexture (SDL_TextureID textureID) |
Unlock a texture, uploading the changes to video memory, if needed. | |
DECLSPEC void SDLCALL | SDL_DirtyTexture (SDL_TextureID textureID, int numrects, const SDL_Rect *rects) |
Mark the specified rectangles of the texture as dirty. | |
DECLSPEC int | SDL_SetRenderDrawColor (Uint8 r, Uint8 g, Uint8 b, Uint8 a) |
Set the color used for drawing operations (Fill and Line). | |
DECLSPEC int | SDL_GetRenderDrawColor (Uint8 *r, Uint8 *g, Uint8 *b, Uint8 *a) |
Get the color used for drawing operations (Fill and Line). | |
DECLSPEC int SDLCALL | SDL_SetRenderDrawBlendMode (int blendMode) |
Set the blend mode used for drawing operations (Fill and Line). | |
DECLSPEC int SDLCALL | SDL_GetRenderDrawBlendMode (int *blendMode) |
Get the blend mode used for drawing operations. | |
DECLSPEC int SDLCALL | SDL_RenderPoint (int x, int y) |
Draw a point on the current rendering target. | |
DECLSPEC int SDLCALL | SDL_RenderLine (int x1, int y1, int x2, int y2) |
Draw a line on the current rendering target. | |
DECLSPEC int SDLCALL | SDL_RenderFill (const SDL_Rect *rect) |
Fill the current rendering target with the drawing color. | |
DECLSPEC int SDLCALL | SDL_RenderCopy (SDL_TextureID textureID, const SDL_Rect *srcrect, const SDL_Rect *dstrect) |
Copy a portion of the texture to the current rendering target. | |
DECLSPEC int SDLCALL | SDL_RenderReadPixels (const SDL_Rect *rect, void *pixels, int pitch) |
Read pixels from the current rendering target. | |
DECLSPEC int SDLCALL | SDL_RenderWritePixels (const SDL_Rect *rect, const void *pixels, int pitch) |
Write pixels to the current rendering target. | |
DECLSPEC void SDLCALL | SDL_RenderPresent (void) |
Update the screen with rendering performed. | |
DECLSPEC void SDLCALL | SDL_DestroyTexture (SDL_TextureID textureID) |
Destroy the specified texture. | |
DECLSPEC void SDLCALL | SDL_DestroyRenderer (SDL_WindowID windowID) |
Destroy the rendering context for a window and free associated textures. | |
DECLSPEC SDL_bool SDLCALL | SDL_IsScreenSaverEnabled (void) |
Returns whether the screensaver is currently enabled (default off). | |
DECLSPEC void SDLCALL | SDL_EnableScreenSaver (void) |
Allow the screen to be blanked by a screensaver. | |
DECLSPEC void SDLCALL | SDL_DisableScreenSaver (void) |
Prevent the screen from being blanked by a screensaver. | |
DECLSPEC int SDLCALL | SDL_GL_LoadLibrary (const char *path) |
Dynamically load an OpenGL library. | |
DECLSPEC void *SDLCALL | SDL_GL_GetProcAddress (const char *proc) |
Get the address of an OpenGL function. | |
DECLSPEC void SDLCALL | SDL_GL_UnloadLibrary (void) |
Unload the OpenGL library previously loaded by SDL_GL_LoadLibrary(). | |
DECLSPEC SDL_bool SDLCALL | SDL_GL_ExtensionSupported (const char *extension) |
Return true if an OpenGL extension is supported for the current context. | |
DECLSPEC int SDLCALL | SDL_GL_SetAttribute (SDL_GLattr attr, int value) |
Set an OpenGL window attribute before window creation. | |
DECLSPEC int SDLCALL | SDL_GL_GetAttribute (SDL_GLattr attr, int *value) |
DECLSPEC SDL_GLContext SDLCALL | SDL_GL_CreateContext (SDL_WindowID windowID) |
Create an OpenGL context for use with an OpenGL window, and make it current. | |
DECLSPEC int SDLCALL | SDL_GL_MakeCurrent (SDL_WindowID windowID, SDL_GLContext context) |
Set up an OpenGL context for rendering into an OpenGL window. | |
DECLSPEC int SDLCALL | SDL_GL_SetSwapInterval (int interval) |
Set the swap interval for the current OpenGL context. | |
DECLSPEC int SDLCALL | SDL_GL_GetSwapInterval (void) |
Get the swap interval for the current OpenGL context. | |
DECLSPEC void SDLCALL | SDL_GL_SwapWindow (SDL_WindowID windowID) |
Swap the OpenGL buffers for the window, if double-buffering is supported. | |
DECLSPEC void SDLCALL | SDL_GL_DeleteContext (SDL_GLContext context) |
Delete an OpenGL context. |
enum SDL_BlendMode |
The blend mode used in SDL_RenderCopy() and drawing operations.
enum SDL_RendererFlags |
Flags used when creating a rendering context.
enum SDL_TextureAccess |
enum SDL_TextureModulate |
The texture channel modulation used in SDL_RenderCopy().
enum SDL_TextureScaleMode |
The texture scale mode used in SDL_RenderCopy().
enum SDL_WindowEventID |
Event subtype for window events.
enum SDL_WindowFlags |
The flags on a window.
int SDL_CreateRenderer | ( | SDL_WindowID | window, | |
int | index, | |||
Uint32 | flags | |||
) |
Create and make active a 2D rendering context for a window.
windowID | The window used for rendering | |
index | The index of the rendering driver to initialize, or -1 to initialize the first one supporting the requested flags. | |
flags | SDL_RendererFlags |
SDL_TextureID SDL_CreateTexture | ( | Uint32 | format, | |
int | access, | |||
int | w, | |||
int | h | |||
) |
Create a texture for the current rendering context.
format | The format of the texture | |
access | One of the enumerated values in SDL_TextureAccess | |
w | The width of the texture in pixels | |
h | The height of the texture in pixels |
SDL_TextureID SDL_CreateTextureFromSurface | ( | Uint32 | format, | |
SDL_Surface * | surface | |||
) |
Create a texture from an existing surface.
format | The format of the texture, or 0 to pick an appropriate format | |
surface | The surface containing pixel data used to fill the texture |
SDL_WindowID 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 | |
h | The height of the window | |
flags | The flags for the window, a mask of any of the following: SDL_WINDOW_FULLSCREEN, SDL_WINDOW_OPENGL, SDL_WINDOW_SHOWN, SDL_WINDOW_BORDERLESS, SDL_WINDOW_RESIZABLE, SDL_WINDOW_MAXIMIZED, SDL_WINDOW_MINIMIZED, SDL_WINDOW_INPUT_GRABBED |
void SDL_DestroyRenderer | ( | SDL_WindowID | windowID | ) |
Destroy the rendering context for a window and free associated textures.
void SDL_DestroyTexture | ( | SDL_TextureID | textureID | ) |
void SDL_DirtyTexture | ( | SDL_TextureID | textureID, | |
int | numrects, | |||
const SDL_Rect * | rects | |||
) |
Mark the specified rectangles of the texture as dirty.
textureID | The texture to mark dirty, which was created with SDL_TEXTUREACCESS_STREAMING. | |
numrects | The number of rectangles pointed to by rects. | |
rects | The pointer to an array of dirty rectangles. |
void SDL_DisableScreenSaver | ( | void | ) |
Prevent the screen from being blanked by a screensaver.
void SDL_EnableScreenSaver | ( | void | ) |
Allow the screen to be blanked by a screensaver.
SDL_DisplayMode * SDL_GetClosestDisplayMode | ( | const SDL_DisplayMode * | mode, | |
SDL_DisplayMode * | closest | |||
) |
Get the closest match to the requested display mode.
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. |
int SDL_GetCurrentVideoDisplay | ( | void | ) |
Get the index of the currently selected display.
const char * SDL_GetCurrentVideoDriver | ( | void | ) |
Returns the name of the currently initialized video driver.
int SDL_GetDisplayMode | ( | int | index, | |
SDL_DisplayMode * | mode | |||
) |
Fill in information about a specific display mode.
int SDL_GetDisplayPalette | ( | SDL_Color * | colors, | |
int | firstcolor, | |||
int | ncolors | |||
) |
Gets the palette entries for indexed display modes.
Get the gamma ramp for the currently selected display.
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. |
int SDL_GetNumDisplayModes | ( | void | ) |
Returns the number of available display modes for the current display.
int SDL_GetNumRenderDrivers | ( | void | ) |
Get the number of 2D rendering drivers available for the current display.
A render driver is a set of code that handles rendering and texture management on a particular display. Normally there is only one, but some drivers may have several available with different capabilities.
int SDL_GetNumVideoDisplays | ( | void | ) |
int SDL_GetNumVideoDrivers | ( | void | ) |
int SDL_GetRenderDrawBlendMode | ( | int * | blendMode | ) |
Get the blend mode used for drawing operations.
blendMode | A pointer filled in with the current blend mode |
Get the color used for drawing operations (Fill and Line).
r | A pointer to the red value used to draw on the rendering target | |
g | A pointer to the green value used to draw on the rendering target | |
b | A pointer to the blue value used to draw on the rendering target | |
a | A pointer to the alpha value used to draw on the rendering target, usually SDL_ALPHA_OPAQUE (255) |
int SDL_GetRenderDriverInfo | ( | int | index, | |
SDL_RendererInfo * | info | |||
) |
Get information about a specific 2D rendering driver for the current display.
index | The index of the driver to query information about. | |
info | A pointer to an SDL_RendererInfo struct to be filled with information on the rendering driver. |
int SDL_GetTextureAlphaMod | ( | SDL_TextureID | textureID, | |
Uint8 * | alpha | |||
) |
Get the additional alpha value used in render copy operations.
texture | The texture to query | |
alpha | A pointer filled in with the source alpha value |
int SDL_GetTextureBlendMode | ( | SDL_TextureID | textureID, | |
int * | blendMode | |||
) |
Get the blend mode used for texture copy operations.
texture | The texture to query | |
blendMode | A pointer filled in with the current blend mode |
int SDL_GetTextureColorMod | ( | SDL_TextureID | textureID, | |
Uint8 * | r, | |||
Uint8 * | g, | |||
Uint8 * | b | |||
) |
Get the additional color value used in render copy operations.
texture | The texture to query | |
r | A pointer filled in with the source red color value | |
g | A pointer filled in with the source green color value | |
b | A pointer filled in with the source blue color value |
int SDL_GetTexturePalette | ( | SDL_TextureID | textureID, | |
SDL_Color * | colors, | |||
int | firstcolor, | |||
int | ncolors | |||
) |
Get the color palette from an indexed texture if it has one.
texture | The texture to update | |
colors | The array to fill with RGB color data | |
firstcolor | The first index to retrieve | |
ncolors | The number of palette entries to retrieve |
int SDL_GetTextureScaleMode | ( | SDL_TextureID | textureID, | |
int * | scaleMode | |||
) |
Get the scale mode used for texture copy operations.
texture | The texture to query | |
scaleMode | A pointer filled in with the current scale mode |
const char * SDL_GetVideoDriver | ( | int | index | ) |
Get the name of a built in video driver.
void * SDL_GetWindowData | ( | SDL_WindowID | windowID | ) |
int SDL_GetWindowGrab | ( | SDL_WindowID | windowID | ) |
Get the window's input grab mode.
void SDL_GetWindowPosition | ( | SDL_WindowID | windowID, | |
int * | x, | |||
int * | y | |||
) |
void SDL_GetWindowSize | ( | SDL_WindowID | windowID, | |
int * | w, | |||
int * | h | |||
) |
const char * SDL_GetWindowTitle | ( | SDL_WindowID | windowID | ) |
SDL_GLContext SDL_GL_CreateContext | ( | SDL_WindowID | windowID | ) |
Create an OpenGL context for use with an OpenGL window, and make it current.
void SDL_GL_DeleteContext | ( | SDL_GLContext | context | ) |
int SDL_GL_GetSwapInterval | ( | void | ) |
Get the swap interval for the current OpenGL context.
int SDL_GL_LoadLibrary | ( | const char * | path | ) |
Dynamically load an OpenGL library.
path | The platform dependent OpenGL library name, or NULL to open the default OpenGL library |
int SDL_GL_MakeCurrent | ( | SDL_WindowID | windowID, | |
SDL_GLContext | context | |||
) |
Set up an OpenGL context for rendering into an OpenGL window.
int SDL_GL_SetSwapInterval | ( | int | interval | ) |
Set the swap interval for the current OpenGL context.
interval | 0 for immediate updates, 1 for updates synchronized with the vertical retrace |
void SDL_GL_UnloadLibrary | ( | void | ) |
void SDL_HideWindow | ( | SDL_WindowID | windowID | ) |
SDL_bool SDL_IsScreenSaverEnabled | ( | void | ) |
Returns whether the screensaver is currently enabled (default off).
void SDL_LockTexture | ( | SDL_TextureID | textureID, | |
const SDL_Rect * | rect, | |||
int | markDirty, | |||
void ** | pixels, | |||
int * | pitch | |||
) |
Lock a portion of the texture for pixel access.
textureID | The texture to lock for access, which was created with SDL_TEXTUREACCESS_STREAMING. | |
rect | A pointer to the rectangle to lock for access. If the rect is NULL, the entire texture will be locked. | |
markDirty | If this is nonzero, the locked area will be marked dirty when the texture is unlocked. | |
pixels | This is filled in with a pointer to the locked pixels, appropriately offset by the locked area. | |
pitch | This is filled in with the pitch of the locked pixels. |
void SDL_MaximizeWindow | ( | SDL_WindowID | windowID | ) |
void SDL_MinimizeWindow | ( | SDL_WindowID | windowID | ) |
int SDL_QueryTexture | ( | SDL_TextureID | textureID, | |
Uint32 * | format, | |||
int * | access, | |||
int * | w, | |||
int * | h | |||
) |
Query the attributes of a texture.
texture | A texture to be queried | |
format | A pointer filled in with the raw format of the texture. The actual format may differ, but pixel transfers will use this format. | |
access | A pointer filled in with the actual access to the texture. | |
w | A pointer filled in with the width of the texture in pixels | |
h | A pointer filled in with the height of the texture in pixels |
int SDL_RenderCopy | ( | SDL_TextureID | textureID, | |
const SDL_Rect * | srcrect, | |||
const SDL_Rect * | dstrect | |||
) |
Copy a portion of the texture to the current rendering target.
texture | The source texture. | |
srcrect | A pointer to the source rectangle, or NULL for the entire texture. | |
dstrect | A pointer to the destination rectangle, or NULL for the entire rendering target. |
void SDL_RenderFill | ( | const SDL_Rect * | rect | ) |
Fill the current rendering target with the drawing color.
rect | A pointer to the destination rectangle, or NULL for the entire rendering target. |
int SDL_RenderLine | ( | int | x1, | |
int | y1, | |||
int | x2, | |||
int | y2 | |||
) |
Draw a line on the current rendering target.
x1 | The x coordinate of the start point | |
y1 | The y coordinate of the start point | |
x2 | The x coordinate of the end point | |
y2 | The y coordinate of the end point |
int SDL_RenderPoint | ( | int | x, | |
int | y | |||
) |
Draw a point on the current rendering target.
x | The x coordinate of the point | |
y | The y coordinate of the point |
int SDL_RenderReadPixels | ( | const SDL_Rect * | rect, | |
void * | pixels, | |||
int | pitch | |||
) |
Read pixels from the current rendering target.
rect | A pointer to the rectangle to read, or NULL for the entire render target | |
pixels | A pointer to be filled in with the pixel data in the rendering target format | |
pitch | The pitch of the pixels parameter |
int SDL_RenderWritePixels | ( | const SDL_Rect * | rect, | |
const void * | pixels, | |||
int | pitch | |||
) |
Write pixels to the current rendering target.
rect | A pointer to the rectangle to write, or NULL for the entire render target | |
pixels | A pointer to the pixel data to write | |
pitch | The pitch of the pixels parameter |
void SDL_RestoreWindow | ( | SDL_WindowID | windowID | ) |
int SDL_SelectRenderer | ( | SDL_WindowID | windowID | ) |
Select the rendering context for a particular window.
int SDL_SelectVideoDisplay | ( | int | index | ) |
Set the index of the currently selected display.
int SDL_SetDisplayPalette | ( | const SDL_Color * | colors, | |
int | firstcolor, | |||
int | ncolors | |||
) |
Set the palette entries for indexed display modes.
int SDL_SetFullscreenDisplayMode | ( | const SDL_DisplayMode * | mode | ) |
Set the display mode used when a fullscreen window is visible on the currently selected display.
mode | The mode to use, or NULL for the desktop mode. |
int SDL_SetGamma | ( | float | red, | |
float | green, | |||
float | blue | |||
) |
Set the gamma correction for each of the color channels on the currently selected display.
Set the gamma ramp for the currently selected display.
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 |
int SDL_SetRenderDrawBlendMode | ( | int | blendMode | ) |
Set the blend mode used for drawing operations (Fill and Line).
blendMode | SDL_BlendMode to use for blending |
Set the color used for drawing operations (Fill and Line).
r | The red value used to draw on the rendering target | |
g | The green value used to draw on the rendering target | |
b | The blue value used to draw on the rendering target | |
a | The alpha value used to draw on the rendering target, usually SDL_ALPHA_OPAQUE (255) |
int SDL_SetTextureAlphaMod | ( | SDL_TextureID | textureID, | |
Uint8 | alpha | |||
) |
Set an additional alpha value used in render copy operations.
texture | The texture to update | |
alpha | The source alpha value multiplied into copy operations. |
int SDL_SetTextureBlendMode | ( | SDL_TextureID | textureID, | |
int | blendMode | |||
) |
Set the blend mode used for texture copy operations.
texture | The texture to update | |
blendMode | SDL_TextureBlendMode to use for texture blending |
int SDL_SetTextureColorMod | ( | SDL_TextureID | textureID, | |
Uint8 | r, | |||
Uint8 | g, | |||
Uint8 | b | |||
) |
Set an additional color value used in render copy operations.
texture | The texture to update | |
r | The red source color value multiplied into copy operations | |
g | The green source color value multiplied into copy operations | |
b | The blue source color value multiplied into copy operations |
int SDL_SetTexturePalette | ( | SDL_TextureID | textureID, | |
const SDL_Color * | colors, | |||
int | firstcolor, | |||
int | ncolors | |||
) |
Set the color palette of an indexed texture.
texture | The texture to update | |
colors | The array of RGB color data | |
firstcolor | The first index to update | |
ncolors | The number of palette entries to fill with the color data |
int SDL_SetTextureScaleMode | ( | SDL_TextureID | textureID, | |
int | scaleMode | |||
) |
Set the scale mode used for texture copy operations.
texture | The texture to update | |
scaleMode | SDL_TextureScaleMode to use for texture scaling |
void SDL_SetWindowData | ( | SDL_WindowID | windowID, | |
void * | userdata | |||
) |
int SDL_SetWindowFullscreen | ( | SDL_WindowID | windowID, | |
int | fullscreen | |||
) |
Set the window's fullscreen state.
void SDL_SetWindowGrab | ( | SDL_WindowID | windowID, | |
int | mode | |||
) |
Set the window's input grab mode.
mode | This is 1 to grab input, and 0 to release input. |
void SDL_SetWindowIcon | ( | SDL_WindowID | windowID, | |
SDL_Surface * | icon | |||
) |
Set the icon of the window.
icon | The icon for the window |
void SDL_SetWindowPosition | ( | SDL_WindowID | windowID, | |
int | x, | |||
int | y | |||
) |
Set the position of the window.
windowID | The window to reposition | |
x | The x coordinate of the window, SDL_WINDOWPOS_CENTERED, or SDL_WINDOWPOS_UNDEFINED | |
y | The y coordinate of the window, SDL_WINDOWPOS_CENTERED, or SDL_WINDOWPOS_UNDEFINED |
void SDL_SetWindowSize | ( | SDL_WindowID | windowID, | |
int | w, | |||
int | w | |||
) |
Set the size of the window's client area.
void SDL_SetWindowTitle | ( | SDL_WindowID | windowID, | |
const char * | title | |||
) |
void SDL_ShowWindow | ( | SDL_WindowID | windowID | ) |
void SDL_UnlockTexture | ( | SDL_TextureID | textureID | ) |
int SDL_UpdateTexture | ( | SDL_TextureID | textureID, | |
const SDL_Rect * | rect, | |||
const void * | pixels, | |||
int | pitch | |||
) |
Update the given texture rectangle with new pixel data.
texture | The texture to update | |
rect | A pointer to the rectangle of pixels to update, or NULL to update the entire texture. | |
pixels | The raw pixel data | |
pitch | The number of bytes between rows of pixel data |
int SDL_VideoInit | ( | const char * | driver_name, | |
Uint32 | flags | |||
) |
Initialize the video subsystem, optionally specifying a video driver.
driver_name | Initialize a specific driver by name, or NULL for the default video driver. | |
flags | FIXME: Still needed? |
void SDL_VideoQuit | ( | void | ) |
Shuts down the video subsystem.
This function closes all windows, and restores the original video mode.