zenilib  0.5.3.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
SDL_video.c File Reference
#include "SDL_config.h"
#include "SDL.h"
#include "SDL_video.h"
#include "SDL_sysvideo.h"
#include "SDL_blit.h"
#include "SDL_pixels_c.h"
#include "SDL_rect_c.h"
#include "../events/SDL_events_c.h"
#include "../timer/SDL_timer_c.h"
#include "SDL_syswm.h"

Go to the source code of this file.

Macros

#define CHECK_DISPLAY_INDEX(displayIndex, retval)
 
#define CHECK_WINDOW_MAGIC(window, retval)
 
#define CREATE_FLAGS   (SDL_WINDOW_OPENGL | SDL_WINDOW_BORDERLESS | SDL_WINDOW_RESIZABLE)
 
#define FULLSCREEN_MASK   ( SDL_WINDOW_FULLSCREEN_DESKTOP | SDL_WINDOW_FULLSCREEN )
 
#define SDL_WINDOWTEXTUREDATA   "_SDL_WindowTextureData"
 

Functions

static int cmpmodes (const void *A, const void *B)
 
static __inline__ SDL_bool isAtLeastGL3 (const char *verstr)
 
int SDL_AddBasicVideoDisplay (const SDL_DisplayMode *desktop_mode)
 
SDL_bool SDL_AddDisplayMode (SDL_VideoDisplay *display, const SDL_DisplayMode *mode)
 
int SDL_AddVideoDisplay (const SDL_VideoDisplay *display)
 
SDL_WindowSDL_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...
 
static SDL_SurfaceSDL_CreateWindowFramebuffer (SDL_Window *window)
 
SDL_WindowSDL_CreateWindowFrom (const void *data)
 Create an SDL window from an existing native window. More...
 
static int SDL_CreateWindowTexture (_THIS, SDL_Window *window, Uint32 *format, void **pixels, int *pitch)
 
void SDL_DestroyWindow (SDL_Window *window)
 Destroy a window. More...
 
static void SDL_DestroyWindowTexture (_THIS, SDL_Window *window)
 
void SDL_DisableScreenSaver ()
 Prevent the screen from being blanked by a screensaver. More...
 
void SDL_EnableScreenSaver ()
 Allow the screen to be blanked by a screensaver. More...
 
static void SDL_FinishWindowCreation (SDL_Window *window, Uint32 flags)
 
SDL_DisplayModeSDL_GetClosestDisplayMode (int displayIndex, const SDL_DisplayMode *mode, SDL_DisplayMode *closest)
 Get the closest match to the requested display mode. More...
 
static SDL_DisplayModeSDL_GetClosestDisplayModeForDisplay (SDL_VideoDisplay *display, const SDL_DisplayMode *mode, SDL_DisplayMode *closest)
 
int SDL_GetCurrentDisplayMode (int displayIndex, SDL_DisplayMode *mode)
 Fill in information about the current display mode. More...
 
const char * SDL_GetCurrentVideoDriver ()
 Returns the name of the currently initialized video driver. More...
 
int SDL_GetDesktopDisplayMode (int displayIndex, SDL_DisplayMode *mode)
 Fill in information about the desktop display mode. More...
 
int SDL_GetDisplayBounds (int displayIndex, SDL_Rect *rect)
 Get the desktop area represented by a display, with the primary display located at 0,0. More...
 
voidSDL_GetDisplayDriverData (int displayIndex)
 
SDL_VideoDisplaySDL_GetDisplayForWindow (SDL_Window *window)
 
int SDL_GetDisplayMode (int displayIndex, int index, SDL_DisplayMode *mode)
 Fill in information about a specific display mode. More...
 
const char * SDL_GetDisplayName (int displayIndex)
 Get the name of a display in UTF-8 encoding. More...
 
SDL_WindowSDL_GetFocusWindow (void)
 
static int SDL_GetIndexOfDisplay (SDL_VideoDisplay *display)
 
int SDL_GetNumDisplayModes (int displayIndex)
 Returns the number of available display modes. More...
 
static int SDL_GetNumDisplayModesForDisplay (SDL_VideoDisplay *display)
 
int SDL_GetNumVideoDisplays (void)
 Returns the number of available video displays. More...
 
int SDL_GetNumVideoDrivers (void)
 Get the number of video drivers compiled into SDL. More...
 
SDL_VideoDeviceSDL_GetVideoDevice (void)
 
const char * SDL_GetVideoDriver (int index)
 Get the name of a built in video driver. More...
 
float SDL_GetWindowBrightness (SDL_Window *window)
 Get the brightness (gamma correction) for a window. More...
 
voidSDL_GetWindowData (SDL_Window *window, const char *name)
 Retrieve the data pointer associated with a window. More...
 
int SDL_GetWindowDisplayIndex (SDL_Window *window)
 Get the display index associated with a window. More...
 
int SDL_GetWindowDisplayMode (SDL_Window *window, SDL_DisplayMode *mode)
 Fill in information about the display mode used when a fullscreen window is visible. More...
 
Uint32 SDL_GetWindowFlags (SDL_Window *window)
 Get the window flags. More...
 
SDL_WindowSDL_GetWindowFromID (Uint32 id)
 Get a window from a stored ID, or NULL if it doesn't exist. More...
 
int SDL_GetWindowGammaRamp (SDL_Window *window, Uint16 *red, Uint16 *green, Uint16 *blue)
 Get the gamma ramp for a window. More...
 
SDL_bool SDL_GetWindowGrab (SDL_Window *window)
 Get a window's input grab mode. More...
 
Uint32 SDL_GetWindowID (SDL_Window *window)
 Get the numeric ID of a window, for logging purposes. More...
 
void SDL_GetWindowMaximumSize (SDL_Window *window, int *max_w, int *max_h)
 Get the maximum size of a window's client area. More...
 
void SDL_GetWindowMinimumSize (SDL_Window *window, int *min_w, int *min_h)
 Get the minimum size of a window's client area. More...
 
Uint32 SDL_GetWindowPixelFormat (SDL_Window *window)
 Get the pixel format associated with the window. More...
 
void SDL_GetWindowPosition (SDL_Window *window, int *x, int *y)
 Get the position of a window. More...
 
void SDL_GetWindowSize (SDL_Window *window, int *w, int *h)
 Get the size of a window's client area. More...
 
SDL_SurfaceSDL_GetWindowSurface (SDL_Window *window)
 Get the SDL surface associated with the window. More...
 
const char * SDL_GetWindowTitle (SDL_Window *window)
 Get the title of a window, in UTF-8 format. More...
 
SDL_bool SDL_GetWindowWMInfo (SDL_Window *window, struct SDL_SysWMinfo *info)
 This function allows access to driver-dependent window information. More...
 
SDL_GLContext SDL_GL_CreateContext (SDL_Window *window)
 Create an OpenGL context for use with an OpenGL window, and make it current. More...
 
void SDL_GL_DeleteContext (SDL_GLContext context)
 Delete an OpenGL context. More...
 
SDL_bool SDL_GL_ExtensionSupported (const char *extension)
 Return true if an OpenGL extension is supported for the current context. More...
 
int SDL_GL_GetAttribute (SDL_GLattr attr, int *value)
 Get the actual value for an attribute from the current context. More...
 
SDL_GLContext SDL_GL_GetCurrentContext (void)
 Get the currently active OpenGL context. More...
 
SDL_WindowSDL_GL_GetCurrentWindow (void)
 Get the currently active OpenGL window. More...
 
void SDL_GL_GetDrawableSize (SDL_Window *window, int *w, int *h)
 Get the size of a window's underlying drawable (for use with glViewport). More...
 
voidSDL_GL_GetProcAddress (const char *proc)
 Get the address of an OpenGL function. More...
 
int SDL_GL_GetSwapInterval (void)
 Get the swap interval for the current OpenGL context. More...
 
int SDL_GL_LoadLibrary (const char *path)
 Dynamically load an OpenGL library. More...
 
int SDL_GL_MakeCurrent (SDL_Window *window, SDL_GLContext ctx)
 Set up an OpenGL context for rendering into an OpenGL window. More...
 
int SDL_GL_SetAttribute (SDL_GLattr attr, int value)
 Set an OpenGL window attribute before window creation. More...
 
int SDL_GL_SetSwapInterval (int interval)
 Set the swap interval for the current OpenGL context. More...
 
void SDL_GL_SwapWindow (SDL_Window *window)
 Swap the OpenGL buffers for a window, if double-buffering is supported. More...
 
void SDL_GL_UnloadLibrary (void)
 Unload the OpenGL library previously loaded by SDL_GL_LoadLibrary(). More...
 
SDL_bool SDL_HasScreenKeyboardSupport (void)
 Returns whether the platform has some screen keyboard support. More...
 
void SDL_HideWindow (SDL_Window *window)
 Hide a window. More...
 
SDL_bool SDL_IsScreenKeyboardShown (SDL_Window *window)
 Returns whether the screen keyboard is shown for given window. More...
 
SDL_bool SDL_IsScreenSaverEnabled ()
 Returns whether the screensaver is currently enabled (default on). More...
 
SDL_bool SDL_IsTextInputActive (void)
 Return whether or not Unicode text input events are enabled. More...
 
void SDL_MaximizeWindow (SDL_Window *window)
 Make a window as large as possible. More...
 
static SDL_bool SDL_MessageboxValidForDriver (const SDL_MessageBoxData *messageboxdata, SDL_SYSWM_TYPE drivertype)
 
void SDL_MinimizeWindow (SDL_Window *window)
 Minimize a window to an iconic representation. More...
 
void SDL_OnWindowEnter (SDL_Window *window)
 
void SDL_OnWindowFocusGained (SDL_Window *window)
 
void SDL_OnWindowFocusLost (SDL_Window *window)
 
void SDL_OnWindowHidden (SDL_Window *window)
 
void SDL_OnWindowLeave (SDL_Window *window)
 
void SDL_OnWindowMinimized (SDL_Window *window)
 
void SDL_OnWindowResized (SDL_Window *window)
 
void SDL_OnWindowRestored (SDL_Window *window)
 
void SDL_OnWindowShown (SDL_Window *window)
 
void SDL_RaiseWindow (SDL_Window *window)
 Raise a window above other windows and set the input focus. More...
 
int SDL_RecreateWindow (SDL_Window *window, Uint32 flags)
 
static void SDL_RestoreMousePosition (SDL_Window *window)
 
void SDL_RestoreWindow (SDL_Window *window)
 Restore the size and position of a minimized or maximized window. More...
 
static int SDL_SetDisplayModeForDisplay (SDL_VideoDisplay *display, const SDL_DisplayMode *mode)
 
void SDL_SetTextInputRect (SDL_Rect *rect)
 Set the rectangle used to type Unicode text inputs. This is used as a hint for IME and on-screen keyboard placement. More...
 
void SDL_SetWindowBordered (SDL_Window *window, SDL_bool bordered)
 Set the border state of a window. More...
 
int SDL_SetWindowBrightness (SDL_Window *window, float brightness)
 Set the brightness (gamma correction) for a window. More...
 
voidSDL_SetWindowData (SDL_Window *window, const char *name, void *userdata)
 Associate an arbitrary named pointer with a window. More...
 
int SDL_SetWindowDisplayMode (SDL_Window *window, const SDL_DisplayMode *mode)
 Set the display mode used when a fullscreen window is visible. More...
 
int SDL_SetWindowFullscreen (SDL_Window *window, Uint32 flags)
 Set a window's fullscreen state. More...
 
int SDL_SetWindowGammaRamp (SDL_Window *window, const Uint16 *red, const Uint16 *green, const Uint16 *blue)
 Set the gamma ramp for a window. More...
 
void SDL_SetWindowGrab (SDL_Window *window, SDL_bool grabbed)
 Set a window's input grab mode. More...
 
void SDL_SetWindowIcon (SDL_Window *window, SDL_Surface *icon)
 Set the icon for a window. More...
 
void SDL_SetWindowMaximumSize (SDL_Window *window, int max_w, int max_h)
 Set the maximum size of a window's client area. More...
 
void SDL_SetWindowMinimumSize (SDL_Window *window, int min_w, int min_h)
 Set the minimum size of a window's client area. More...
 
void SDL_SetWindowPosition (SDL_Window *window, int x, int y)
 Set the position of a window. More...
 
void SDL_SetWindowSize (SDL_Window *window, int w, int h)
 Set the size of a window's client area. More...
 
void SDL_SetWindowTitle (SDL_Window *window, const char *title)
 Set the title of a window, in UTF-8 format. More...
 
SDL_bool SDL_ShouldAllowTopmost (void)
 
int SDL_ShowMessageBox (const SDL_MessageBoxData *messageboxdata, int *buttonid)
 Create a modal message box. More...
 
int SDL_ShowSimpleMessageBox (Uint32 flags, const char *title, const char *message, SDL_Window *window)
 Create a simple modal message box. More...
 
void SDL_ShowWindow (SDL_Window *window)
 Show a window. More...
 
void SDL_StartTextInput (void)
 Start accepting Unicode text input events. This function will show the on-screen keyboard if supported. More...
 
void SDL_StopTextInput (void)
 Stop receiving any text input events. This function will hide the on-screen keyboard if supported. More...
 
static int SDL_UninitializedVideo ()
 
static void SDL_UpdateFullscreenMode (SDL_Window *window, SDL_bool fullscreen)
 
void SDL_UpdateWindowGrab (SDL_Window *window)
 
int SDL_UpdateWindowSurface (SDL_Window *window)
 Copy the window surface to the screen. More...
 
int SDL_UpdateWindowSurfaceRects (SDL_Window *window, const SDL_Rect *rects, int numrects)
 Copy a number of rectangles on the window surface to the screen. More...
 
static int SDL_UpdateWindowTexture (_THIS, SDL_Window *window, const SDL_Rect *rects, int numrects)
 
int SDL_VideoInit (const char *driver_name)
 Initialize the video subsystem, optionally specifying a video driver. More...
 
void SDL_VideoQuit (void)
 Shuts down the video subsystem. More...
 
static SDL_bool ShouldMinimizeOnFocusLoss ()
 
static SDL_bool ShouldUseTextureFramebuffer ()
 

Variables

static SDL_VideoDevice_this = NULL
 
static VideoBootStrapbootstrap []
 

Macro Definition Documentation

#define CHECK_DISPLAY_INDEX (   displayIndex,
  retval 
)
Value:
if (!_this) { \
return retval; \
} \
if (displayIndex < 0 || displayIndex >= _this->num_displays) { \
SDL_SetError("displayIndex must be in the range 0 - %d", \
return retval; \
}
return
Definition: pngrutil.c:1266
if(!yyg->yy_init)
static SDL_VideoDevice * _this
Definition: SDL_video.c:92
DECLSPEC int SDLCALL SDL_SetError(const char *fmt,...)
Definition: SDL_error.c:53
static int SDL_UninitializedVideo()
Definition: SDL_video.c:382

Definition at line 104 of file SDL_video.c.

Referenced by SDL_GetClosestDisplayMode(), SDL_GetCurrentDisplayMode(), SDL_GetDesktopDisplayMode(), SDL_GetDisplayBounds(), SDL_GetDisplayDriverData(), SDL_GetDisplayMode(), SDL_GetDisplayName(), and SDL_GetNumDisplayModes().

#define CHECK_WINDOW_MAGIC (   window,
  retval 
)
Value:
if (!_this) { \
return retval; \
} \
if (!window || window->magic != &_this->window_magic) { \
SDL_SetError("Invalid window"); \
return retval; \
}
return
Definition: pngrutil.c:1266
if(!yyg->yy_init)
static SDL_VideoDevice * _this
Definition: SDL_video.c:92
DECLSPEC int SDLCALL SDL_SetError(const char *fmt,...)
Definition: SDL_error.c:53
static int SDL_UninitializedVideo()
Definition: SDL_video.c:382

Definition at line 94 of file SDL_video.c.

Referenced by SDL_DestroyWindow(), SDL_GetWindowBrightness(), SDL_GetWindowData(), SDL_GetWindowDisplayIndex(), SDL_GetWindowDisplayMode(), SDL_GetWindowFlags(), SDL_GetWindowGammaRamp(), SDL_GetWindowGrab(), SDL_GetWindowID(), SDL_GetWindowMaximumSize(), SDL_GetWindowMinimumSize(), SDL_GetWindowPixelFormat(), SDL_GetWindowPosition(), SDL_GetWindowSize(), SDL_GetWindowSurface(), SDL_GetWindowTitle(), SDL_GetWindowWMInfo(), SDL_GL_CreateContext(), SDL_GL_GetDrawableSize(), SDL_GL_MakeCurrent(), SDL_GL_SwapWindow(), SDL_HideWindow(), SDL_MaximizeWindow(), SDL_MinimizeWindow(), SDL_RaiseWindow(), SDL_RestoreWindow(), SDL_SetWindowBordered(), SDL_SetWindowBrightness(), SDL_SetWindowData(), SDL_SetWindowDisplayMode(), SDL_SetWindowFullscreen(), SDL_SetWindowGammaRamp(), SDL_SetWindowGrab(), SDL_SetWindowIcon(), SDL_SetWindowMaximumSize(), SDL_SetWindowMinimumSize(), SDL_SetWindowPosition(), SDL_SetWindowSize(), SDL_SetWindowTitle(), SDL_ShowWindow(), SDL_UpdateWindowSurface(), and SDL_UpdateWindowSurfaceRects().

Definition at line 1161 of file SDL_video.c.

Referenced by SDL_CreateWindow(), and SDL_RecreateWindow().

#define FULLSCREEN_MASK   ( SDL_WINDOW_FULLSCREEN_DESKTOP | SDL_WINDOW_FULLSCREEN )

Definition at line 1812 of file SDL_video.c.

Referenced by SDL_SetWindowFullscreen().

#define SDL_WINDOWTEXTUREDATA   "_SDL_WindowTextureData"

Function Documentation

static __inline__ SDL_bool isAtLeastGL3 ( const char *  verstr)
static

Definition at line 2379 of file SDL_video.c.

References SDL_atoi().

Referenced by SDL_GL_ExtensionSupported().

int SDL_AddBasicVideoDisplay ( const SDL_DisplayMode desktop_mode)
SDL_Window* 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.

Parameters
titleThe title of the window, in UTF-8 encoding.
xThe x position of the window, SDL_WINDOWPOS_CENTERED, or SDL_WINDOWPOS_UNDEFINED.
yThe y position of the window, SDL_WINDOWPOS_CENTERED, or SDL_WINDOWPOS_UNDEFINED.
wThe width of the window.
hThe height of the window.
flagsThe 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.
Returns
The id of the window created, or zero if window creation failed.
See Also
SDL_DestroyWindow()

Definition at line 1190 of file SDL_video.c.

References SDL_Window::brightness, CREATE_FLAGS, SDL_VideoDevice::CreateWindow, display, SDL_Window::flags, FULLSCREEN_VISIBLE, SDL_VideoDevice::GL_CreateContext, SDL_Rect::h, SDL_Window::h, SDL_Window::id, SDL_Window::magic, SDL_Window::next, SDL_VideoDevice::next_object_id, NULL, SDL_Window::prev, SDL_calloc(), SDL_DestroyWindow(), SDL_FinishWindowCreation(), SDL_GetDisplayBounds(), SDL_GetDisplayForWindow(), SDL_GetHint(), SDL_GetIndexOfDisplay(), SDL_GL_LoadLibrary(), SDL_HINT_VIDEO_HIGHDPI_DISABLED, SDL_OutOfMemory, SDL_SetError(), SDL_SetWindowTitle(), SDL_UpdateFullscreenMode(), SDL_VideoInit(), SDL_WINDOW_ALLOW_HIGHDPI, SDL_WINDOW_HIDDEN, SDL_WINDOW_OPENGL, SDL_WINDOWPOS_ISCENTERED, SDL_WINDOWPOS_ISUNDEFINED, SDL_Rect::w, SDL_Window::w, SDL_VideoDevice::window_magic, SDL_VideoDevice::windows, SDL_Rect::x, SDL_Window::x, SDL_Rect::y, and SDL_Window::y.

Referenced by SDL_CreateShapedWindow(), SDL_CreateWindowAndRenderer(), SDLTest_CommonInit(), ShouldUseTextureFramebuffer(), and Zeni::Window::Window().

SDL_Window* SDL_CreateWindowFrom ( const void data)

Create an SDL window from an existing native window.

Parameters
dataA pointer to driver-dependent window creation data
Returns
The id of the window created, or zero if window creation failed.
See Also
SDL_DestroyWindow()

Definition at line 1285 of file SDL_video.c.

References SDL_Window::brightness, SDL_VideoDevice::CreateWindowFrom, SDL_Window::flags, SDL_Window::id, SDL_Window::magic, SDL_Window::next, SDL_VideoDevice::next_object_id, NULL, SDL_Window::prev, SDL_calloc(), SDL_DestroyWindow(), SDL_OutOfMemory, SDL_UninitializedVideo(), SDL_WINDOW_FOREIGN, SDL_VideoDevice::window_magic, and SDL_VideoDevice::windows.

static void SDL_DestroyWindowTexture ( _THIS  ,
SDL_Window window 
)
static
void SDL_DisableScreenSaver ( void  )

Prevent the screen from being blanked by a screensaver.

See Also
SDL_IsScreenSaverEnabled()
SDL_EnableScreenSaver()

Definition at line 2250 of file SDL_video.c.

References SDL_TRUE, SDL_VideoDevice::suspend_screensaver, and SDL_VideoDevice::SuspendScreenSaver.

Referenced by Zeni::Core::set_screen_saver().

void SDL_EnableScreenSaver ( void  )

Allow the screen to be blanked by a screensaver.

See Also
SDL_IsScreenSaverEnabled()
SDL_DisableScreenSaver()

Definition at line 2235 of file SDL_video.c.

References SDL_FALSE, SDL_VideoDevice::suspend_screensaver, and SDL_VideoDevice::SuspendScreenSaver.

Referenced by SDL_VideoQuit(), and Zeni::Core::set_screen_saver().

SDL_DisplayMode* SDL_GetClosestDisplayMode ( int  displayIndex,
const SDL_DisplayMode mode,
SDL_DisplayMode closest 
)

Get the closest match to the requested display mode.

Parameters
displayIndexThe index of display from which mode should be queried.
modeThe desired display mode
closestA pointer to a display mode to be filled in with the closest match of the available display modes.
Returns
The passed in value 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.

See Also
SDL_GetNumDisplayModes()
SDL_GetDisplayMode()

Definition at line 874 of file SDL_video.c.

References CHECK_DISPLAY_INDEX, display, SDL_VideoDevice::displays, NULL, and SDL_GetClosestDisplayModeForDisplay().

int SDL_GetCurrentDisplayMode ( int  displayIndex,
SDL_DisplayMode mode 
)

Fill in information about the current display mode.

Definition at line 753 of file SDL_video.c.

References CHECK_DISPLAY_INDEX, SDL_VideoDisplay::current_mode, display, and SDL_VideoDevice::displays.

const char* SDL_GetCurrentVideoDriver ( void  )

Returns the name of the currently initialized video driver.

Returns
The name of the current video driver or NULL if no driver has been initialized
See Also
SDL_GetNumVideoDrivers()
SDL_GetVideoDriver()

Definition at line 538 of file SDL_video.c.

References SDL_VideoDevice::name, NULL, and SDL_UninitializedVideo().

Referenced by SDLTest_CommonInit().

int SDL_GetDesktopDisplayMode ( int  displayIndex,
SDL_DisplayMode mode 
)

Fill in information about the desktop display mode.

Definition at line 739 of file SDL_video.c.

References CHECK_DISPLAY_INDEX, SDL_VideoDisplay::desktop_mode, display, and SDL_VideoDevice::displays.

Referenced by SDLTest_CommonInit().

int SDL_GetDisplayBounds ( int  displayIndex,
SDL_Rect rect 
)
void* SDL_GetDisplayDriverData ( int  displayIndex)
int SDL_GetDisplayMode ( int  displayIndex,
int  modeIndex,
SDL_DisplayMode mode 
)

Fill in information about a specific display mode.

Note
The display modes are sorted in this priority:
  • bits per pixel -> more colors to fewer colors
  • width -> largest to smallest
  • height -> largest to smallest
  • refresh rate -> highest to lowest
See Also
SDL_GetNumDisplayModes()

Definition at line 721 of file SDL_video.c.

References CHECK_DISPLAY_INDEX, display, SDL_VideoDisplay::display_modes, SDL_VideoDevice::displays, SDL_GetNumDisplayModesForDisplay(), and SDL_SetError().

Referenced by SDLTest_CommonInit(), and Zeni::Window::Window().

const char* SDL_GetDisplayName ( int  displayIndex)

Get the name of a display in UTF-8 encoding.

Returns
The name of a display, or NULL for an invalid display index.
See Also
SDL_GetNumVideoDisplays()

Definition at line 630 of file SDL_video.c.

References CHECK_DISPLAY_INDEX, SDL_VideoDevice::displays, SDL_VideoDisplay::name, and NULL.

Referenced by SDLTest_CommonInit().

static int SDL_GetIndexOfDisplay ( SDL_VideoDisplay display)
static
int SDL_GetNumDisplayModes ( int  displayIndex)

Returns the number of available display modes.

See Also
SDL_GetDisplayMode()

Definition at line 713 of file SDL_video.c.

References CHECK_DISPLAY_INDEX, SDL_VideoDevice::displays, and SDL_GetNumDisplayModesForDisplay().

Referenced by SDLTest_CommonInit(), and Zeni::Window::Window().

int SDL_GetNumVideoDisplays ( void  )

Returns the number of available video displays.

See Also
SDL_GetDisplayBounds()

Definition at line 597 of file SDL_video.c.

References SDL_VideoDevice::num_displays, and SDL_UninitializedVideo().

Referenced by SDLTest_CommonInit().

int SDL_GetNumVideoDrivers ( void  )

Get the number of video drivers compiled into SDL.

See Also
SDL_GetVideoDriver()

Definition at line 388 of file SDL_video.c.

References SDL_arraysize.

Referenced by SDL_GetVideoDriver(), and SDLTest_CommonInit().

const char* SDL_GetVideoDriver ( int  index)

Get the name of a built in video driver.

Note
The video drivers are presented in the order in which they are normally checked during initialization.
See Also
SDL_GetNumVideoDrivers()

Definition at line 394 of file SDL_video.c.

References VideoBootStrap::name, NULL, and SDL_GetNumVideoDrivers().

Referenced by SDLTest_CommonInit().

float SDL_GetWindowBrightness ( SDL_Window window)

Get the brightness (gamma correction) for a window.

Returns
The last brightness value passed to SDL_SetWindowBrightness()
See Also
SDL_SetWindowBrightness()

Definition at line 1920 of file SDL_video.c.

References SDL_Window::brightness, and CHECK_WINDOW_MAGIC.

void* SDL_GetWindowData ( SDL_Window window,
const char *  name 
)

Retrieve the data pointer associated with a window.

Parameters
windowThe window to query.
nameThe name of the pointer.
Returns
The value associated with 'name'
See Also
SDL_SetWindowData()

Definition at line 1514 of file SDL_video.c.

References CHECK_WINDOW_MAGIC, SDL_WindowUserData::data, SDL_Window::data, SDL_WindowUserData::name, SDL_WindowUserData::next, NULL, SDL_InvalidParamError, and SDL_strcmp().

Referenced by SDL_CreateWindowTexture(), SDL_GetRenderer(), and SDL_UpdateWindowTexture().

int SDL_GetWindowDisplayIndex ( SDL_Window window)
Uint32 SDL_GetWindowFlags ( SDL_Window window)

Get the window flags.

Definition at line 1409 of file SDL_video.c.

References CHECK_WINDOW_MAGIC, and SDL_Window::flags.

Referenced by FullscreenTo(), SDL_CreateRenderer(), SDL_PromptAssertion(), SDL_RendererEventWatch(), and SDLTest_CommonEvent().

SDL_Window* SDL_GetWindowFromID ( Uint32  id)

Get a window from a stored ID, or NULL if it doesn't exist.

Definition at line 1393 of file SDL_video.c.

References SDL_Window::id, SDL_Window::next, NULL, and SDL_VideoDevice::windows.

Referenced by FullscreenTo(), SDL_RendererEventWatch(), and SDLTest_CommonEvent().

int SDL_GetWindowGammaRamp ( SDL_Window window,
Uint16 red,
Uint16 green,
Uint16 blue 
)

Get the gamma ramp for a window.

Parameters
windowThe window from which the gamma ramp should be queried.
redA pointer to a 256 element array of 16-bit quantities to hold the translation table for the red channel, or NULL.
greenA pointer to a 256 element array of 16-bit quantities to hold the translation table for the green channel, or NULL.
blueA pointer to a 256 element array of 16-bit quantities to hold the translation table for the blue channel, or NULL.
Returns
0 on success, or -1 if gamma ramps are unsupported.
See Also
SDL_SetWindowGammaRamp()

Definition at line 1961 of file SDL_video.c.

References CHECK_WINDOW_MAGIC, SDL_Window::gamma, SDL_VideoDevice::GetWindowGammaRamp, i, SDL_Window::saved_gamma, SDL_malloc(), SDL_memcpy(), and SDL_OutOfMemory.

Referenced by SDL_SetWindowGammaRamp().

SDL_bool SDL_GetWindowGrab ( SDL_Window window)

Get a window's input grab mode.

Returns
This returns SDL_TRUE if input is grabbed, and SDL_FALSE otherwise.
See Also
SDL_SetWindowGrab()

Definition at line 2037 of file SDL_video.c.

References CHECK_WINDOW_MAGIC, SDL_Window::flags, SDL_FALSE, and SDL_WINDOW_INPUT_GRABBED.

Referenced by Zeni::Window::get_mouse_state(), and SDLTest_CommonEvent().

Uint32 SDL_GetWindowID ( SDL_Window window)

Get the numeric ID of a window, for logging purposes.

Definition at line 1385 of file SDL_video.c.

References CHECK_WINDOW_MAGIC, and SDL_Window::id.

Referenced by Zeni::Game::run().

void SDL_GetWindowMaximumSize ( SDL_Window window,
int w,
int h 
)

Get the maximum size of a window's client area.

Parameters
windowThe window to query.
wPointer to variable for storing the maximum width, may be NULL
hPointer to variable for storing the maximum height, may be NULL
See Also
SDL_GetWindowMinimumSize()
SDL_SetWindowMaximumSize()

Definition at line 1710 of file SDL_video.c.

References CHECK_WINDOW_MAGIC, SDL_Window::max_h, and SDL_Window::max_w.

void SDL_GetWindowMinimumSize ( SDL_Window window,
int w,
int h 
)

Get the minimum size of a window's client area.

Parameters
windowThe window to query.
wPointer to variable for storing the minimum width, may be NULL
hPointer to variable for storing the minimum height, may be NULL
See Also
SDL_GetWindowMaximumSize()
SDL_SetWindowMinimumSize()

Definition at line 1674 of file SDL_video.c.

References CHECK_WINDOW_MAGIC, SDL_Window::min_h, and SDL_Window::min_w.

Uint32 SDL_GetWindowPixelFormat ( SDL_Window window)

Get the pixel format associated with the window.

Definition at line 1059 of file SDL_video.c.

References CHECK_WINDOW_MAGIC, SDL_VideoDisplay::current_mode, display, SDL_DisplayMode::format, SDL_GetDisplayForWindow(), and SDL_PIXELFORMAT_UNKNOWN.

Referenced by SDL_RenderReadPixels().

void SDL_GetWindowPosition ( SDL_Window window,
int x,
int y 
)

Get the position of a window.

Parameters
windowThe window to query.
xPointer to variable for storing the x position, may be NULL
yPointer to variable for storing the y position, may be NULL
See Also
SDL_SetWindowPosition()

Definition at line 1570 of file SDL_video.c.

References CHECK_WINDOW_MAGIC, SDL_Window::flags, SDL_WINDOW_FULLSCREEN, SDL_Window::x, and SDL_Window::y.

void SDL_GetWindowSize ( SDL_Window window,
int w,
int h 
)

Get the size of a window's client area.

Parameters
windowThe window to query.
wPointer to variable for storing the width, may be NULL
hPointer to variable for storing the height, may be NULL
See Also
SDL_SetWindowSize()

Definition at line 1638 of file SDL_video.c.

References CHECK_WINDOW_MAGIC, SDL_Window::h, and SDL_Window::w.

Referenced by SDL_GetRendererOutputSize(), SDL_GL_GetDrawableSize(), SDL_PrivateSendMouseMotion(), SDL_RendererEventWatch(), SDL_UpdateMouseFocus(), SDLTest_CommonEvent(), and SDLTest_CommonInit().

SDL_Surface* SDL_GetWindowSurface ( SDL_Window window)

Get the SDL surface associated with the window.

Returns
The window's framebuffer surface, or NULL on error.

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.

Note
You may not combine this with 3D or the rendering API on this window.
See Also
SDL_UpdateWindowSurface()
SDL_UpdateWindowSurfaceRects()

Definition at line 1858 of file SDL_video.c.

References CHECK_WINDOW_MAGIC, SDL_Surface::flags, NULL, SDL_CreateWindowFramebuffer(), SDL_DONTFREE, SDL_FreeSurface(), SDL_TRUE, SDL_Window::surface, and SDL_Window::surface_valid.

Referenced by SW_ActivateRenderer(), and SW_CreateRenderer().

const char* SDL_GetWindowTitle ( SDL_Window window)

Get the title of a window, in UTF-8 format.

See Also
SDL_SetWindowTitle()

Definition at line 1437 of file SDL_video.c.

References CHECK_WINDOW_MAGIC, and SDL_Window::title.

SDL_bool SDL_GetWindowWMInfo ( SDL_Window window,
SDL_SysWMinfo info 
)

This function allows access to driver-dependent window information.

Parameters
windowThe window about which information is being requested
infoThis structure must be initialized with the SDL version, and is then filled in with information about the given window.
Returns
SDL_TRUE if the function is implemented and the version member of the info struct is valid, SDL_FALSE otherwise.

You typically use this function like this:

* if ( SDL_GetWindowWMInfo(window, &info) ) { ... }
*

Definition at line 3002 of file SDL_video.c.

References CHECK_WINDOW_MAGIC, SDL_VideoDevice::GetWindowWMInfo, SDL_FALSE, SDL_SYSWM_UNKNOWN, and SDL_SysWMinfo::subsystem.

Referenced by Zeni::Video_DX9::init(), SDL_MessageboxValidForDriver(), and Zeni::Window::Window().

SDL_bool SDL_GL_ExtensionSupported ( const char *  extension)

Return true if an OpenGL extension is supported for the current context.

Definition at line 2385 of file SDL_video.c.

References APIENTRY, GL_EXTENSIONS, GL_NUM_EXTENSIONS, GL_VERSION, i, isAtLeastGL3(), SDL_FALSE, SDL_getenv(), SDL_GL_GetProcAddress(), SDL_strchr(), SDL_strcmp(), SDL_strlen(), SDL_strstr(), and SDL_TRUE.

SDL_GLContext SDL_GL_GetCurrentContext ( void  )

Get the currently active OpenGL context.

Definition at line 2822 of file SDL_video.c.

References SDL_VideoDevice::current_glctx_tls, NULL, SDL_TLSGet(), and SDL_UninitializedVideo().

Referenced by SDL_GL_DeleteContext(), SDL_GL_GetSwapInterval(), SDL_GL_MakeCurrent(), and SDL_GL_SetSwapInterval().

SDL_Window* SDL_GL_GetCurrentWindow ( void  )

Get the currently active OpenGL window.

Definition at line 2812 of file SDL_video.c.

References SDL_VideoDevice::current_glwin_tls, NULL, SDL_TLSGet(), and SDL_UninitializedVideo().

Referenced by SDL_GL_MakeCurrent(), and SDL_GL_SwapWindow().

void SDL_GL_GetDrawableSize ( SDL_Window window,
int w,
int h 
)

Get the size of a window's underlying drawable (for use with glViewport).

Parameters
windowWindow from which the drawable size should be queried
wPointer to variable for storing the width, may be NULL
hPointer to variable for storing the height, 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.

See Also
SDL_GetWindowSize()
SDL_CreateWindow()

Definition at line 2831 of file SDL_video.c.

References CHECK_WINDOW_MAGIC, SDL_VideoDevice::GL_GetDrawableSize, and SDL_GetWindowSize().

int SDL_GL_GetSwapInterval ( void  )

Get the swap interval for the current OpenGL context.

Returns
0 if there is no vertical retrace synchronization, 1 if the buffer swap is synchronized with the vertical retrace, and -1 if late swaps happen immediately instead of waiting for the next retrace. If the system can't determine the swap interval, or there isn't a valid current context, this will return 0 as a safe default.
See Also
SDL_GL_SetSwapInterval()

Definition at line 2857 of file SDL_video.c.

References SDL_VideoDevice::GL_GetSwapInterval, NULL, and SDL_GL_GetCurrentContext().

int SDL_GL_LoadLibrary ( const char *  path)

Dynamically load an OpenGL library.

Parameters
pathThe platform dependent OpenGL library name, or NULL to open the default OpenGL library.
Returns
0 on success, or -1 if the library couldn't be loaded.

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.

Note
If you do this, you need to retrieve all of the GL functions used in your program from the dynamic library using SDL_GL_GetProcAddress().
See Also
SDL_GL_GetProcAddress()
SDL_GL_UnloadLibrary()

Definition at line 2315 of file SDL_video.c.

References SDL_VideoDevice::driver_loaded, SDL_VideoDevice::driver_path, SDL_VideoDevice::gl_config, SDL_VideoDevice::GL_LoadLibrary, SDL_SetError(), SDL_strcmp(), and SDL_UninitializedVideo().

Referenced by SDL_CreateWindow(), and SDL_RecreateWindow().

int SDL_GL_MakeCurrent ( SDL_Window window,
SDL_GLContext  context 
)
int SDL_GL_SetAttribute ( SDL_GLattr  attr,
int  value 
)

Set an OpenGL window attribute before window creation.

Definition at line 2469 of file SDL_video.c.

References SDL_VideoDevice::accelerated, SDL_VideoDevice::accum_alpha_size, SDL_VideoDevice::accum_blue_size, SDL_VideoDevice::accum_green_size, SDL_VideoDevice::accum_red_size, SDL_VideoDevice::alpha_size, SDL_VideoDevice::blue_size, SDL_VideoDevice::buffer_size, SDL_VideoDevice::depth_size, SDL_VideoDevice::double_buffer, SDL_VideoDevice::flags, SDL_VideoDevice::gl_config, SDL_VideoDevice::green_size, SDL_VideoDevice::major_version, SDL_VideoDevice::minor_version, SDL_VideoDevice::multisamplebuffers, SDL_VideoDevice::multisamplesamples, SDL_VideoDevice::profile_mask, SDL_VideoDevice::red_size, SDL_VideoDevice::retained_backing, SDL_GL_ACCELERATED_VISUAL, SDL_GL_ACCUM_ALPHA_SIZE, SDL_GL_ACCUM_BLUE_SIZE, SDL_GL_ACCUM_GREEN_SIZE, SDL_GL_ACCUM_RED_SIZE, SDL_GL_ALPHA_SIZE, SDL_GL_BLUE_SIZE, SDL_GL_BUFFER_SIZE, SDL_GL_CONTEXT_DEBUG_FLAG, SDL_GL_CONTEXT_EGL, SDL_GL_CONTEXT_FLAGS, SDL_GL_CONTEXT_FORWARD_COMPATIBLE_FLAG, SDL_GL_CONTEXT_MAJOR_VERSION, SDL_GL_CONTEXT_MINOR_VERSION, SDL_GL_CONTEXT_PROFILE_COMPATIBILITY, SDL_GL_CONTEXT_PROFILE_CORE, SDL_GL_CONTEXT_PROFILE_ES, SDL_GL_CONTEXT_PROFILE_MASK, SDL_GL_CONTEXT_RESET_ISOLATION_FLAG, SDL_GL_CONTEXT_ROBUST_ACCESS_FLAG, SDL_GL_DEPTH_SIZE, SDL_GL_DOUBLEBUFFER, SDL_GL_GREEN_SIZE, SDL_GL_MULTISAMPLEBUFFERS, SDL_GL_MULTISAMPLESAMPLES, SDL_GL_RED_SIZE, SDL_GL_RETAINED_BACKING, SDL_GL_SetAttribute(), SDL_GL_SHARE_WITH_CURRENT_CONTEXT, SDL_GL_STENCIL_SIZE, SDL_GL_STEREO, SDL_SetError(), SDL_UninitializedVideo(), SDL_Unsupported, SDL_VideoDevice::share_with_current_context, SDL_VideoDevice::stencil_size, and SDL_VideoDevice::stereo.

Referenced by Zeni::Video_GL_Shader::init(), Zeni::Video_GL_Fixed::init(), SDL_GL_SetAttribute(), SDLTest_CommonInit(), Zeni::Video_GL_Shader::set_vertical_sync(), Zeni::Video_GL_Fixed::set_vertical_sync(), and Zeni::Window::Window().

int SDL_GL_SetSwapInterval ( int  interval)

Set the swap interval for the current OpenGL context.

Parameters
interval0 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.
Returns
0 on success, or -1 if setting the swap interval is not supported.
See Also
SDL_GL_GetSwapInterval()

Definition at line 2843 of file SDL_video.c.

References SDL_VideoDevice::GL_SetSwapInterval, NULL, SDL_GL_GetCurrentContext(), SDL_SetError(), and SDL_UninitializedVideo().

Referenced by Zeni::Video_GL_Shader::init(), Zeni::Video_GL_Fixed::init(), Zeni::Video_GL_Shader::set_vertical_sync(), and Zeni::Video_GL_Fixed::set_vertical_sync().

void SDL_GL_SwapWindow ( SDL_Window window)

Swap the OpenGL buffers for a window, if double-buffering is supported.

Definition at line 2871 of file SDL_video.c.

References CHECK_WINDOW_MAGIC, SDL_Window::flags, SDL_VideoDevice::GL_SwapWindow, SDL_GL_GetCurrentWindow(), SDL_SetError(), and SDL_WINDOW_OPENGL.

Referenced by Zeni::Video_GL_Fixed::end_render(), and Zeni::Video_GL_Shader::end_render().

void SDL_GL_UnloadLibrary ( void  )
SDL_bool SDL_HasScreenKeyboardSupport ( void  )

Returns whether the platform has some screen keyboard support.

Returns
SDL_TRUE if some keyboard support is available else SDL_FALSE.
Note
Not all screen keyboard functions are supported on all platforms.
See Also
SDL_IsScreenKeyboardShown()

Definition at line 3074 of file SDL_video.c.

References SDL_VideoDevice::HasScreenKeyboardSupport, and SDL_FALSE.

Referenced by SDL_VideoInit().

SDL_bool SDL_IsScreenKeyboardShown ( SDL_Window window)

Returns whether the screen keyboard is shown for given window.

Parameters
windowThe window for which screen keyboard should be queried.
Returns
SDL_TRUE if screen keyboard is shown else SDL_FALSE.
See Also
SDL_HasScreenKeyboardSupport()

Definition at line 3083 of file SDL_video.c.

References SDL_VideoDevice::IsScreenKeyboardShown, and SDL_FALSE.

SDL_bool SDL_IsScreenSaverEnabled ( void  )

Returns whether the screensaver is currently enabled (default on).

See Also
SDL_EnableScreenSaver()
SDL_DisableScreenSaver()

Definition at line 2226 of file SDL_video.c.

References SDL_FALSE, SDL_TRUE, and SDL_VideoDevice::suspend_screensaver.

Referenced by Zeni::Core::is_screen_saver_enabled().

SDL_bool SDL_IsTextInputActive ( void  )

Return whether or not Unicode text input events are enabled.

See Also
SDL_StartTextInput()
SDL_StopTextInput()

Definition at line 3039 of file SDL_video.c.

References SDL_ENABLE, SDL_GetEventState, and SDL_TEXTINPUT.

void SDL_MaximizeWindow ( SDL_Window window)

Make a window as large as possible.

See Also
SDL_RestoreWindow()

Definition at line 1767 of file SDL_video.c.

References CHECK_WINDOW_MAGIC, SDL_Window::flags, SDL_VideoDevice::MaximizeWindow, and SDL_WINDOW_MAXIMIZED.

Referenced by SDL_FinishWindowCreation(), and SDLTest_CommonEvent().

static SDL_bool SDL_MessageboxValidForDriver ( const SDL_MessageBoxData messageboxdata,
SDL_SYSWM_TYPE  drivertype 
)
static
void SDL_OnWindowEnter ( SDL_Window window)

Definition at line 2080 of file SDL_video.c.

References SDL_VideoDevice::OnWindowEnter.

Referenced by SDL_SendWindowEvent().

void SDL_OnWindowHidden ( SDL_Window window)

Definition at line 2051 of file SDL_video.c.

References SDL_FALSE, and SDL_UpdateFullscreenMode().

Referenced by SDL_SendWindowEvent().

void SDL_OnWindowLeave ( SDL_Window window)

Definition at line 2088 of file SDL_video.c.

Referenced by SDL_SendWindowEvent().

void SDL_OnWindowMinimized ( SDL_Window window)

Definition at line 2064 of file SDL_video.c.

References SDL_FALSE, and SDL_UpdateFullscreenMode().

Referenced by SDL_SendWindowEvent().

void SDL_OnWindowRestored ( SDL_Window window)
void SDL_OnWindowShown ( SDL_Window window)

Definition at line 2045 of file SDL_video.c.

References SDL_OnWindowRestored().

Referenced by SDL_SendWindowEvent().

void SDL_RaiseWindow ( SDL_Window window)

Raise a window above other windows and set the input focus.

Definition at line 1754 of file SDL_video.c.

References CHECK_WINDOW_MAGIC, SDL_Window::flags, SDL_VideoDevice::RaiseWindow, and SDL_WINDOW_SHOWN.

Referenced by SDL_OnWindowRestored().

static void SDL_RestoreMousePosition ( SDL_Window window)
static

Definition at line 1070 of file SDL_video.c.

References SDL_GetMouseFocus(), SDL_GetMouseState(), and SDL_WarpMouseInWindow().

Referenced by SDL_UpdateFullscreenMode().

void SDL_RestoreWindow ( SDL_Window window)

Restore the size and position of a minimized or maximized window.

See Also
SDL_MaximizeWindow()
SDL_MinimizeWindow()

Definition at line 1799 of file SDL_video.c.

References CHECK_WINDOW_MAGIC, SDL_Window::flags, SDL_VideoDevice::RestoreWindow, SDL_WINDOW_MAXIMIZED, and SDL_WINDOW_MINIMIZED.

Referenced by SDL_PromptAssertion(), and SDLTest_CommonEvent().

void SDL_SetTextInputRect ( SDL_Rect rect)

Set the rectangle used to type Unicode text inputs. This is used as a hint for IME and on-screen keyboard placement.

See Also
SDL_StartTextInput()

Definition at line 3066 of file SDL_video.c.

References SDL_VideoDevice::SetTextInputRect.

void 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.

Parameters
windowThe window of which to change the border state.
borderedSDL_FALSE to remove border, SDL_TRUE to add border.
Note
You can't change the border state of a fullscreen window.
See Also
SDL_GetWindowFlags()

Definition at line 1593 of file SDL_video.c.

References CHECK_WINDOW_MAGIC, SDL_Window::flags, SDL_FALSE, SDL_WINDOW_BORDERLESS, SDL_WINDOW_FULLSCREEN, and SDL_VideoDevice::SetWindowBordered.

Referenced by SDLTest_CommonEvent().

int SDL_SetWindowBrightness ( SDL_Window window,
float  brightness 
)

Set the brightness (gamma correction) for a window.

Returns
0 on success, or -1 if setting the brightness isn't supported.
See Also
SDL_GetWindowBrightness()
SDL_SetWindowGammaRamp()

Definition at line 1904 of file SDL_video.c.

References SDL_Window::brightness, CHECK_WINDOW_MAGIC, SDL_CalculateGammaRamp(), and SDL_SetWindowGammaRamp().

void* SDL_SetWindowData ( SDL_Window window,
const char *  name,
void userdata 
)

Associate an arbitrary named pointer with a window.

Parameters
windowThe window to associate with the pointer.
nameThe name of the pointer.
userdataThe associated pointer.
Returns
The previous value associated with 'name'
Note
The name is case-sensitive.
See Also
SDL_GetWindowData()

Definition at line 1467 of file SDL_video.c.

References CHECK_WINDOW_MAGIC, SDL_WindowUserData::data, SDL_Window::data, SDL_WindowUserData::name, SDL_WindowUserData::next, NULL, SDL_free(), SDL_InvalidParamError, SDL_malloc(), SDL_strcmp(), and SDL_strdup().

Referenced by SDL_CreateRenderer(), SDL_CreateWindowTexture(), SDL_DestroyRenderer(), and SDL_DestroyWindowTexture().

int 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.

Parameters
windowThe window for which the display mode should be set.
modeThe mode to use, or NULL for the default mode.
Returns
0 on success, or -1 if setting the display mode failed.
See Also
SDL_GetWindowDisplayMode()
SDL_SetWindowFullscreen()

Definition at line 1007 of file SDL_video.c.

References CHECK_WINDOW_MAGIC, SDL_Window::fullscreen_mode, and SDL_zero.

Referenced by SDLTest_CommonInit().

int SDL_SetWindowFullscreen ( SDL_Window window,
Uint32  flags 
)

Set a window's fullscreen state.

Returns
0 on success, or -1 if setting the display mode failed.
See Also
SDL_SetWindowDisplayMode()
SDL_GetWindowDisplayMode()

Definition at line 1814 of file SDL_video.c.

References CHECK_WINDOW_MAGIC, SDL_Window::flags, FULLSCREEN_MASK, FULLSCREEN_VISIBLE, and SDL_UpdateFullscreenMode().

Referenced by FullscreenTo(), SDL_FinishWindowCreation(), and SDLTest_CommonEvent().

int SDL_SetWindowGammaRamp ( SDL_Window window,
const Uint16 red,
const Uint16 green,
const Uint16 blue 
)

Set the gamma ramp for a window.

Parameters
windowThe window for which the gamma ramp should be set.
redThe translation table for the red channel, or NULL.
greenThe translation table for the green channel, or NULL.
blueThe translation table for the blue channel, or NULL.
Returns
0 on success, or -1 if gamma ramps are unsupported.

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.

See Also
SDL_GetWindowGammaRamp()

Definition at line 1928 of file SDL_video.c.

References CHECK_WINDOW_MAGIC, SDL_Window::flags, SDL_Window::gamma, NULL, SDL_GetWindowGammaRamp(), SDL_memcpy(), SDL_Unsupported, SDL_WINDOW_INPUT_FOCUS, and SDL_VideoDevice::SetWindowGammaRamp.

Referenced by SDL_SetWindowBrightness().

void SDL_SetWindowGrab ( SDL_Window window,
SDL_bool  grabbed 
)

Set a window's input grab mode.

Parameters
windowThe window for which the input grab mode should be set.
grabbedThis is SDL_TRUE to grab input, and SDL_FALSE to release input.
See Also
SDL_GetWindowGrab()

Definition at line 2021 of file SDL_video.c.

References CHECK_WINDOW_MAGIC, SDL_Window::flags, SDL_UpdateWindowGrab(), and SDL_WINDOW_INPUT_GRABBED.

Referenced by SDL_FinishWindowCreation(), SDLTest_CommonEvent(), and Zeni::Window::set_mouse_state().

void SDL_SetWindowIcon ( SDL_Window window,
SDL_Surface icon 
)

Set the icon for a window.

Parameters
windowThe window for which the icon should be set.
iconThe icon for the window.

Definition at line 1445 of file SDL_video.c.

References CHECK_WINDOW_MAGIC, SDL_Window::icon, SDL_ConvertSurfaceFormat(), SDL_FreeSurface(), SDL_PIXELFORMAT_ARGB8888, and SDL_VideoDevice::SetWindowIcon.

Referenced by Zeni::Window::alert_window_resized(), SDL_RecreateWindow(), and SDLTest_CommonInit().

void SDL_SetWindowMaximumSize ( SDL_Window window,
int  max_w,
int  max_h 
)

Set the maximum size of a window's client area.

Parameters
windowThe window to set a new maximum size.
max_wThe maximum width of the window, must be >0
max_hThe maximum height of the window, must be >0
Note
You can't change the maximum size of a fullscreen window, it automatically matches the size of the display mode.
See Also
SDL_GetWindowMaximumSize()
SDL_SetWindowMinimumSize()

Definition at line 1686 of file SDL_video.c.

References CHECK_WINDOW_MAGIC, SDL_Window::flags, SDL_Window::h, SDL_Window::max_h, SDL_Window::max_w, SDL_InvalidParamError, SDL_min, SDL_SetWindowSize(), SDL_WINDOW_FULLSCREEN, SDL_VideoDevice::SetWindowMaximumSize, and SDL_Window::w.

Referenced by SDLTest_CommonInit().

void SDL_SetWindowMinimumSize ( SDL_Window window,
int  min_w,
int  min_h 
)

Set the minimum size of a window's client area.

Parameters
windowThe window to set a new minimum size.
min_wThe minimum width of the window, must be >0
min_hThe minimum height of the window, must be >0
Note
You can't change the minimum size of a fullscreen window, it automatically matches the size of the display mode.
See Also
SDL_GetWindowMinimumSize()
SDL_SetWindowMaximumSize()

Definition at line 1650 of file SDL_video.c.

References CHECK_WINDOW_MAGIC, SDL_Window::flags, SDL_Window::h, SDL_Window::min_h, SDL_Window::min_w, SDL_InvalidParamError, SDL_max, SDL_SetWindowSize(), SDL_WINDOW_FULLSCREEN, SDL_VideoDevice::SetWindowMinimumSize, and SDL_Window::w.

Referenced by SDLTest_CommonInit().

void SDL_SetWindowPosition ( SDL_Window window,
int  x,
int  y 
)
void SDL_SetWindowSize ( SDL_Window window,
int  w,
int  h 
)

Set the size of a window's client area.

Parameters
windowThe window to resize.
wThe width of the window, must be >0
hThe height of the window, must be >0
Note
You can't change the size of a fullscreen window, it automatically matches the size of the display mode.
See Also
SDL_GetWindowSize()

Definition at line 1611 of file SDL_video.c.

References CHECK_WINDOW_MAGIC, SDL_Window::flags, SDL_Window::h, SDL_InvalidParamError, SDL_OnWindowResized(), SDL_WINDOW_FULLSCREEN, SDL_VideoDevice::SetWindowSize, and SDL_Window::w.

Referenced by SDL_SetWindowMaximumSize(), SDL_SetWindowMinimumSize(), and SDLTest_CommonEvent().

void SDL_SetWindowTitle ( SDL_Window window,
const char *  title 
)

Set the title of a window, in UTF-8 format.

See Also
SDL_GetWindowTitle()

Definition at line 1417 of file SDL_video.c.

References CHECK_WINDOW_MAGIC, NULL, SDL_free(), SDL_strdup(), SDL_VideoDevice::SetWindowTitle, and SDL_Window::title.

Referenced by Zeni::Window::alert_window_resized(), SDL_CreateWindow(), and SDL_RecreateWindow().

SDL_bool SDL_ShouldAllowTopmost ( void  )

Definition at line 3207 of file SDL_video.c.

References SDL_FALSE, SDL_GetHint(), SDL_HINT_ALLOW_TOPMOST, and SDL_TRUE.

int SDL_ShowMessageBox ( const SDL_MessageBoxData messageboxdata,
int buttonid 
)

Create a modal message box.

Parameters
messageboxdataThe SDL_MessageBoxData structure with title, text, etc.
buttonidThe pointer to which user id of hit button should be copied.
Returns
-1 on error, otherwise 0 and buttonid contains user id of button hit or -1 if dialog was closed.
Note
This function should be called on the thread that created the parent window, or on the main thread if the messagebox has no parent. It will block execution of that thread until the user clicks a button or closes the messagebox.

Definition at line 3122 of file SDL_video.c.

References SDL_FALSE, SDL_GetRelativeMouseMode(), SDL_InvalidParamError, SDL_MessageboxValidForDriver(), SDL_SetError(), SDL_SetRelativeMouseMode(), SDL_ShowCursor(), SDL_SYSWM_COCOA, SDL_SYSWM_UIKIT, SDL_SYSWM_WINDOWS, SDL_SYSWM_X11, and SDL_VideoDevice::ShowMessageBox.

Referenced by SDL_PromptAssertion(), and SDL_ShowSimpleMessageBox().

int SDL_ShowSimpleMessageBox ( Uint32  flags,
const char *  title,
const char *  message,
SDL_Window window 
)

Create a simple modal message box.

Parameters
flagsSDL_MessageBoxFlags
titleUTF-8 title text
messageUTF-8 message text
windowThe parent window, or NULL for no parent
Returns
0 on success, -1 on error
See Also
SDL_ShowMessageBox

Definition at line 3185 of file SDL_video.c.

References SDL_MessageBoxData::buttons, SDL_MessageBoxButtonData::flags, SDL_MessageBoxData::flags, SDL_MessageBoxData::message, NULL, SDL_MessageBoxData::numbuttons, SDL_MESSAGEBOX_BUTTON_ESCAPEKEY_DEFAULT, SDL_MESSAGEBOX_BUTTON_RETURNKEY_DEFAULT, SDL_ShowMessageBox(), SDL_zero, SDL_MessageBoxButtonData::text, SDL_MessageBoxData::title, and SDL_MessageBoxData::window.

Referenced by SDLTest_CommonEvent().

void SDL_StartTextInput ( void  )

Start accepting Unicode text input events. This function will show the on-screen keyboard if supported.

See Also
SDL_StopTextInput()
SDL_SetTextInputRect()
SDL_HasScreenKeyboardSupport()

Definition at line 3018 of file SDL_video.c.

References SDL_ENABLE, SDL_EventState(), SDL_GetFocusWindow(), SDL_TEXTEDITING, SDL_TEXTINPUT, SDL_VideoDevice::ShowScreenKeyboard, and SDL_VideoDevice::StartTextInput.

Referenced by SDL_VideoInit().

void SDL_StopTextInput ( void  )

Stop receiving any text input events. This function will hide the on-screen keyboard if supported.

See Also
SDL_StartTextInput()
SDL_HasScreenKeyboardSupport()

Definition at line 3045 of file SDL_video.c.

References SDL_VideoDevice::HideScreenKeyboard, SDL_DISABLE, SDL_EventState(), SDL_GetFocusWindow(), SDL_TEXTEDITING, SDL_TEXTINPUT, and SDL_VideoDevice::StopTextInput.

int SDL_UpdateWindowSurface ( SDL_Window window)

Copy the window surface to the screen.

Returns
0 on success, or -1 on error.
See Also
SDL_GetWindowSurface()
SDL_UpdateWindowSurfaceRects()

Definition at line 1877 of file SDL_video.c.

References CHECK_WINDOW_MAGIC, SDL_Rect::h, SDL_Window::h, SDL_UpdateWindowSurfaceRects(), SDL_Rect::w, SDL_Window::w, SDL_Rect::x, and SDL_Rect::y.

Referenced by SW_RenderPresent().

int SDL_UpdateWindowSurfaceRects ( SDL_Window window,
const SDL_Rect rects,
int  numrects 
)

Copy a number of rectangles on the window surface to the screen.

Returns
0 on success, or -1 on error.
See Also
SDL_GetWindowSurface()
SDL_UpdateWindowSurfaceRect()

Definition at line 1891 of file SDL_video.c.

References CHECK_WINDOW_MAGIC, SDL_SetError(), SDL_Window::surface_valid, and SDL_VideoDevice::UpdateWindowFramebuffer.

Referenced by SDL_UpdateWindowSurface().

static int SDL_UpdateWindowTexture ( _THIS  ,
SDL_Window window,
const SDL_Rect rects,
int  numrects 
)
static
int SDL_VideoInit ( const char *  driver_name)

Initialize the video subsystem, optionally specifying a video driver.

Parameters
driver_nameInitialize a specific driver by name, or NULL for the default video driver.
Returns
0 on success, -1 on error

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.

See Also
SDL_VideoQuit()

Definition at line 406 of file SDL_video.c.

References SDL_VideoDevice::accelerated, SDL_VideoDevice::accum_alpha_size, SDL_VideoDevice::accum_blue_size, SDL_VideoDevice::accum_green_size, SDL_VideoDevice::accum_red_size, SDL_VideoDevice::alpha_size, SDL_VideoDevice::blue_size, SDL_VideoDevice::buffer_size, VideoBootStrap::create, SDL_VideoDevice::CreateWindowFramebuffer, SDL_VideoDevice::current_glctx_tls, SDL_VideoDevice::current_glwin_tls, SDL_VideoDevice::depth_size, SDL_VideoDevice::DestroyWindowFramebuffer, SDL_VideoDevice::dll_handle, SDL_VideoDevice::double_buffer, SDL_VideoDevice::driver_loaded, SDL_VideoDevice::flags, SDL_VideoDevice::gl_config, SDL_VideoDevice::green_size, i, SDL_VideoDevice::major_version, SDL_VideoDevice::minor_version, SDL_VideoDevice::multisamplebuffers, SDL_VideoDevice::multisamplesamples, SDL_VideoDevice::name, VideoBootStrap::name, SDL_VideoDevice::next_object_id, NULL, SDL_VideoDevice::num_displays, SDL_VideoDevice::profile_mask, SDL_VideoDevice::red_size, SDL_VideoDevice::retained_backing, SDL_CreateWindowTexture(), SDL_DestroyWindowTexture(), SDL_getenv(), SDL_GL_CONTEXT_PROFILE_ES, SDL_HasScreenKeyboardSupport(), SDL_INIT_EVENTS, SDL_InitSubSystem(), SDL_InitTicks(), SDL_KeyboardInit(), SDL_MouseInit(), SDL_SetError(), SDL_StartTextInput(), SDL_strlen(), SDL_strncasecmp(), SDL_TLSCreate(), SDL_TouchInit(), SDL_UpdateWindowTexture(), SDL_VideoQuit(), SDL_VideoDevice::share_with_current_context, ShouldUseTextureFramebuffer(), SDL_VideoDevice::stencil_size, SDL_VideoDevice::stereo, SDL_VideoDevice::UpdateWindowFramebuffer, and SDL_VideoDevice::VideoInit.

Referenced by SDL_CreateWindow(), SDL_InitSubSystem(), and SDLTest_CommonInit().

static SDL_bool ShouldMinimizeOnFocusLoss ( )
static

Definition at line 2109 of file SDL_video.c.

References SDL_FALSE, SDL_GetHint(), SDL_HINT_VIDEO_MINIMIZE_ON_FOCUS_LOSS, and SDL_TRUE.

Referenced by SDL_OnWindowFocusLost().

Variable Documentation

VideoBootStrap* bootstrap[]
static

Definition at line 55 of file SDL_video.c.