SDL
2.0
|
#include "../SDL_internal.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"
#include "SDL_opengl.h"
#include "x11/SDL_x11messagebox.h"
Go to the source code of this file.
Data Structures | |
struct | SDL_WindowTextureData |
Macros | |
#define | CHECK_WINDOW_MAGIC(window, retval) |
#define | CHECK_DISPLAY_INDEX(displayIndex, retval) |
#define | FULLSCREEN_MASK (SDL_WINDOW_FULLSCREEN_DESKTOP | SDL_WINDOW_FULLSCREEN) |
#define | SDL_WINDOWTEXTUREDATA "_SDL_WindowTextureData" |
#define | CREATE_FLAGS (SDL_WINDOW_OPENGL | SDL_WINDOW_BORDERLESS | SDL_WINDOW_RESIZABLE | SDL_WINDOW_ALLOW_HIGHDPI | SDL_WINDOW_ALWAYS_ON_TOP | SDL_WINDOW_SKIP_TASKBAR | SDL_WINDOW_POPUP_MENU | SDL_WINDOW_UTILITY | SDL_WINDOW_TOOLTIP | SDL_WINDOW_VULKAN) |
#define | GL_NUM_EXTENSIONS 0x821D |
#define | NOT_A_VULKAN_WINDOW "The specified window isn't a Vulkan window" |
Functions | |
static SDL_bool | ShouldUseTextureFramebuffer () |
static int | SDL_CreateWindowTexture (SDL_VideoDevice *unused, SDL_Window *window, Uint32 *format, void **pixels, int *pitch) |
static int | SDL_UpdateWindowTexture (SDL_VideoDevice *unused, SDL_Window *window, const SDL_Rect *rects, int numrects) |
static void | SDL_DestroyWindowTexture (SDL_VideoDevice *unused, SDL_Window *window) |
static int | cmpmodes (const void *A, const void *B) |
static int | SDL_UninitializedVideo () |
int | SDL_GetNumVideoDrivers (void) |
Get the number of video drivers compiled into SDL. More... | |
const char * | SDL_GetVideoDriver (int index) |
Get the name of a built in video driver. More... | |
int | SDL_VideoInit (const char *driver_name) |
Initialize the video subsystem, optionally specifying a video driver. More... | |
const char * | SDL_GetCurrentVideoDriver () |
Returns the name of the currently initialized video driver. More... | |
SDL_VideoDevice * | SDL_GetVideoDevice (void) |
int | SDL_AddBasicVideoDisplay (const SDL_DisplayMode *desktop_mode) |
int | SDL_AddVideoDisplay (const SDL_VideoDisplay *display) |
int | SDL_GetNumVideoDisplays (void) |
Returns the number of available video displays. More... | |
static int | SDL_GetIndexOfDisplay (SDL_VideoDisplay *display) |
void * | SDL_GetDisplayDriverData (int displayIndex) |
const char * | SDL_GetDisplayName (int displayIndex) |
Get the name of a display in UTF-8 encoding. 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... | |
int | 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... | |
int | SDL_GetDisplayDPI (int displayIndex, float *ddpi, float *hdpi, float *vdpi) |
Get the dots/pixels-per-inch for a display. More... | |
SDL_bool | SDL_AddDisplayMode (SDL_VideoDisplay *display, const SDL_DisplayMode *mode) |
static int | SDL_GetNumDisplayModesForDisplay (SDL_VideoDisplay *display) |
int | SDL_GetNumDisplayModes (int displayIndex) |
Returns the number of available display modes. More... | |
int | SDL_GetDisplayMode (int displayIndex, int index, SDL_DisplayMode *mode) |
Fill in information about a specific display mode. More... | |
int | SDL_GetDesktopDisplayMode (int displayIndex, SDL_DisplayMode *mode) |
Fill in information about the desktop display mode. More... | |
int | SDL_GetCurrentDisplayMode (int displayIndex, SDL_DisplayMode *mode) |
Fill in information about the current display mode. More... | |
static SDL_DisplayMode * | SDL_GetClosestDisplayModeForDisplay (SDL_VideoDisplay *display, const SDL_DisplayMode *mode, SDL_DisplayMode *closest) |
SDL_DisplayMode * | SDL_GetClosestDisplayMode (int displayIndex, const SDL_DisplayMode *mode, SDL_DisplayMode *closest) |
Get the closest match to the requested display mode. More... | |
static int | SDL_SetDisplayModeForDisplay (SDL_VideoDisplay *display, const SDL_DisplayMode *mode) |
int | SDL_GetWindowDisplayIndex (SDL_Window *window) |
Get the display index associated with a window. More... | |
SDL_VideoDisplay * | SDL_GetDisplayForWindow (SDL_Window *window) |
int | SDL_SetWindowDisplayMode (SDL_Window *window, const SDL_DisplayMode *mode) |
Set the display mode used when a fullscreen window is visible. 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_GetWindowPixelFormat (SDL_Window *window) |
Get the pixel format associated with the window. More... | |
static void | SDL_RestoreMousePosition (SDL_Window *window) |
static int | SDL_UpdateFullscreenMode (SDL_Window *window, SDL_bool fullscreen) |
static void | SDL_FinishWindowCreation (SDL_Window *window, Uint32 flags) |
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. More... | |
SDL_Window * | SDL_CreateWindowFrom (const void *data) |
Create an SDL window from an existing native window. More... | |
int | SDL_RecreateWindow (SDL_Window *window, Uint32 flags) |
SDL_bool | SDL_HasWindows (void) |
Uint32 | SDL_GetWindowID (SDL_Window *window) |
Get the numeric ID of a window, for logging purposes. More... | |
SDL_Window * | SDL_GetWindowFromID (Uint32 id) |
Get a window from a stored ID, or NULL if it doesn't exist. More... | |
Uint32 | SDL_GetWindowFlags (SDL_Window *window) |
Get the window flags. More... | |
void | SDL_SetWindowTitle (SDL_Window *window, const char *title) |
Set the title of a window, in UTF-8 format. More... | |
const char * | SDL_GetWindowTitle (SDL_Window *window) |
Get the title of a window, in UTF-8 format. More... | |
void | SDL_SetWindowIcon (SDL_Window *window, SDL_Surface *icon) |
Set the icon for a window. More... | |
void * | SDL_SetWindowData (SDL_Window *window, const char *name, void *userdata) |
Associate an arbitrary named pointer with a window. More... | |
void * | SDL_GetWindowData (SDL_Window *window, const char *name) |
Retrieve the data pointer associated with a window. More... | |
void | SDL_SetWindowPosition (SDL_Window *window, int x, int y) |
Set the position of a window. More... | |
void | SDL_GetWindowPosition (SDL_Window *window, int *x, int *y) |
Get the position of a window. More... | |
void | SDL_SetWindowBordered (SDL_Window *window, SDL_bool bordered) |
Set the border state of a window. More... | |
void | SDL_SetWindowResizable (SDL_Window *window, SDL_bool resizable) |
Set the user-resizable state 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_GetWindowSize (SDL_Window *window, int *w, int *h) |
Get the size of a window's client area. More... | |
int | 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... | |
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_GetWindowMinimumSize (SDL_Window *window, int *min_w, int *min_h) |
Get the minimum size of a window's client area. 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_GetWindowMaximumSize (SDL_Window *window, int *max_w, int *max_h) |
Get the maximum size of a window's client area. More... | |
void | SDL_ShowWindow (SDL_Window *window) |
Show a window. More... | |
void | SDL_HideWindow (SDL_Window *window) |
Hide a window. More... | |
void | SDL_RaiseWindow (SDL_Window *window) |
Raise a window above other windows and set the input focus. More... | |
void | SDL_MaximizeWindow (SDL_Window *window) |
Make a window as large as possible. More... | |
void | SDL_MinimizeWindow (SDL_Window *window) |
Minimize a window to an iconic representation. More... | |
void | SDL_RestoreWindow (SDL_Window *window) |
Restore the size and position of a minimized or maximized window. More... | |
int | SDL_SetWindowFullscreen (SDL_Window *window, Uint32 flags) |
Set a window's fullscreen state. More... | |
static SDL_Surface * | SDL_CreateWindowFramebuffer (SDL_Window *window) |
SDL_Surface * | SDL_GetWindowSurface (SDL_Window *window) |
Get the SDL surface associated with the window. More... | |
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... | |
int | SDL_SetWindowBrightness (SDL_Window *window, float brightness) |
Set the brightness (gamma correction) for a window. More... | |
float | SDL_GetWindowBrightness (SDL_Window *window) |
Get the brightness (gamma correction) for a window. More... | |
int | SDL_SetWindowOpacity (SDL_Window *window, float opacity) |
Set the opacity for a window. More... | |
int | SDL_GetWindowOpacity (SDL_Window *window, float *out_opacity) |
Get the opacity of a window. More... | |
int | 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... | |
int | SDL_SetWindowInputFocus (SDL_Window *window) |
Explicitly sets input focus to the window. More... | |
int | SDL_SetWindowGammaRamp (SDL_Window *window, const Uint16 *red, const Uint16 *green, const Uint16 *blue) |
Set the gamma ramp for a window. More... | |
int | SDL_GetWindowGammaRamp (SDL_Window *window, Uint16 *red, Uint16 *green, Uint16 *blue) |
Get the gamma ramp for a window. More... | |
void | SDL_UpdateWindowGrab (SDL_Window *window) |
void | SDL_SetWindowGrab (SDL_Window *window, SDL_bool grabbed) |
Set a window's input grab mode. More... | |
SDL_bool | SDL_GetWindowGrab (SDL_Window *window) |
Get a window's input grab mode. More... | |
SDL_Window * | SDL_GetGrabbedWindow (void) |
Get the window that currently has an input grab enabled. More... | |
void | SDL_OnWindowShown (SDL_Window *window) |
void | SDL_OnWindowHidden (SDL_Window *window) |
void | SDL_OnWindowResized (SDL_Window *window) |
void | SDL_OnWindowMinimized (SDL_Window *window) |
void | SDL_OnWindowRestored (SDL_Window *window) |
void | SDL_OnWindowEnter (SDL_Window *window) |
void | SDL_OnWindowLeave (SDL_Window *window) |
void | SDL_OnWindowFocusGained (SDL_Window *window) |
static SDL_bool | ShouldMinimizeOnFocusLoss (SDL_Window *window) |
void | SDL_OnWindowFocusLost (SDL_Window *window) |
SDL_Window * | SDL_GetFocusWindow (void) |
void | SDL_DestroyWindow (SDL_Window *window) |
Destroy a window. More... | |
SDL_bool | SDL_IsScreenSaverEnabled () |
Returns whether the screensaver is currently enabled (default off). More... | |
void | SDL_EnableScreenSaver () |
Allow the screen to be blanked by a screensaver. More... | |
void | SDL_DisableScreenSaver () |
Prevent the screen from being blanked by a screensaver. More... | |
void | SDL_VideoQuit (void) |
Shuts down the video subsystem. More... | |
int | SDL_GL_LoadLibrary (const char *path) |
Dynamically load an OpenGL library. More... | |
void * | SDL_GL_GetProcAddress (const char *proc) |
Get the address of an OpenGL function. More... | |
void | SDL_GL_UnloadLibrary (void) |
Unload the OpenGL library previously loaded by SDL_GL_LoadLibrary(). More... | |
static SDL_INLINE SDL_bool | isAtLeastGL3 (const char *verstr) |
SDL_bool | SDL_GL_ExtensionSupported (const char *extension) |
Return true if an OpenGL extension is supported for the current context. More... | |
void | SDL_GL_DeduceMaxSupportedESProfile (int *major, int *minor) |
void | SDL_GL_ResetAttributes () |
Reset all previously set OpenGL context attributes to their default values. More... | |
int | SDL_GL_SetAttribute (SDL_GLattr attr, int value) |
Set an OpenGL window attribute before window creation. 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_CreateContext (SDL_Window *window) |
Create an OpenGL context for use with an OpenGL window, and make it current. More... | |
int | SDL_GL_MakeCurrent (SDL_Window *window, SDL_GLContext ctx) |
Set up an OpenGL context for rendering into an OpenGL window. More... | |
SDL_Window * | SDL_GL_GetCurrentWindow (void) |
Get the currently active OpenGL window. More... | |
SDL_GLContext | SDL_GL_GetCurrentContext (void) |
Get the currently active OpenGL context. More... | |
void | 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... | |
int | SDL_GL_SetSwapInterval (int interval) |
Set the swap interval for the current OpenGL context. More... | |
int | SDL_GL_GetSwapInterval (void) |
Get 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_DeleteContext (SDL_GLContext context) |
Delete an OpenGL context. More... | |
SDL_bool | SDL_GetWindowWMInfo (SDL_Window *window, struct SDL_SysWMinfo *info) |
This function allows access to driver-dependent window information. More... | |
void | SDL_StartTextInput (void) |
Start accepting Unicode text input events. This function will show the on-screen keyboard if supported. More... | |
SDL_bool | SDL_IsTextInputActive (void) |
Return whether or not Unicode text input events are enabled. More... | |
void | SDL_StopTextInput (void) |
Stop receiving any text input events. This function will hide the on-screen keyboard if supported. More... | |
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... | |
SDL_bool | SDL_HasScreenKeyboardSupport (void) |
Returns whether the platform has some screen keyboard support. More... | |
SDL_bool | SDL_IsScreenKeyboardShown (SDL_Window *window) |
Returns whether the screen keyboard is shown for given window. More... | |
static SDL_bool | SDL_MessageboxValidForDriver (const SDL_MessageBoxData *messageboxdata, SDL_SYSWM_TYPE drivertype) |
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... | |
SDL_bool | SDL_ShouldAllowTopmost (void) |
int | SDL_SetWindowHitTest (SDL_Window *window, SDL_HitTest callback, void *userdata) |
Provide a callback that decides if a window region has special properties. More... | |
float | SDL_ComputeDiagonalDPI (int hpix, int vpix, float hinches, float vinches) |
void | SDL_OnApplicationWillTerminate (void) |
void | SDL_OnApplicationDidReceiveMemoryWarning (void) |
void | SDL_OnApplicationWillResignActive (void) |
void | SDL_OnApplicationDidEnterBackground (void) |
void | SDL_OnApplicationWillEnterForeground (void) |
void | SDL_OnApplicationDidBecomeActive (void) |
int | SDL_Vulkan_LoadLibrary (const char *path) |
Dynamically load a Vulkan loader library. More... | |
void * | SDL_Vulkan_GetVkGetInstanceProcAddr (void) |
Get the address of the vkGetInstanceProcAddr function. More... | |
void | SDL_Vulkan_UnloadLibrary (void) |
Unload the Vulkan loader library previously loaded by SDL_Vulkan_LoadLibrary() . More... | |
SDL_bool | SDL_Vulkan_GetInstanceExtensions (SDL_Window *window, unsigned *count, const char **names) |
SDL_bool | SDL_Vulkan_CreateSurface (SDL_Window *window, VkInstance instance, VkSurfaceKHR *surface) |
Create a Vulkan rendering surface for a window. More... | |
void | SDL_Vulkan_GetDrawableSize (SDL_Window *window, int *w, int *h) |
Get the size of a window's underlying drawable in pixels (for use with setting viewport, scissor & etc). More... | |
Variables | |
static VideoBootStrap * | bootstrap [] |
static SDL_VideoDevice * | _this = NULL |
#define CHECK_DISPLAY_INDEX | ( | displayIndex, | |
retval | |||
) |
Definition at line 134 of file SDL_video.c.
Referenced by SDL_GetClosestDisplayMode(), SDL_GetCurrentDisplayMode(), SDL_GetDesktopDisplayMode(), SDL_GetDisplayBounds(), SDL_GetDisplayDPI(), SDL_GetDisplayDriverData(), SDL_GetDisplayMode(), SDL_GetDisplayName(), SDL_GetDisplayUsableBounds(), and SDL_GetNumDisplayModes().
Definition at line 123 of file SDL_video.c.
Referenced by SDL_DestroyWindow(), SDL_GetWindowBordersSize(), SDL_GetWindowBrightness(), SDL_GetWindowData(), SDL_GetWindowDisplayIndex(), SDL_GetWindowDisplayMode(), SDL_GetWindowFlags(), SDL_GetWindowGammaRamp(), SDL_GetWindowGrab(), SDL_GetWindowID(), SDL_GetWindowMaximumSize(), SDL_GetWindowMinimumSize(), SDL_GetWindowOpacity(), 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_SetWindowHitTest(), SDL_SetWindowIcon(), SDL_SetWindowInputFocus(), SDL_SetWindowMaximumSize(), SDL_SetWindowMinimumSize(), SDL_SetWindowModalFor(), SDL_SetWindowOpacity(), SDL_SetWindowPosition(), SDL_SetWindowResizable(), SDL_SetWindowSize(), SDL_SetWindowTitle(), SDL_ShowWindow(), SDL_UpdateFullscreenMode(), SDL_UpdateWindowSurface(), SDL_UpdateWindowSurfaceRects(), SDL_Vulkan_CreateSurface(), SDL_Vulkan_GetDrawableSize(), and SDL_Vulkan_GetInstanceExtensions().
Definition at line 1324 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 147 of file SDL_video.c.
Referenced by SDL_SetWindowFullscreen(), and SDL_UpdateFullscreenMode().
#define GL_NUM_EXTENSIONS 0x821D |
Referenced by SDL_GL_ExtensionSupported().
Definition at line 3970 of file SDL_video.c.
Referenced by SDL_Vulkan_CreateSurface(), and SDL_Vulkan_GetInstanceExtensions().
#define SDL_WINDOWTEXTUREDATA "_SDL_WindowTextureData" |
Definition at line 158 of file SDL_video.c.
Referenced by SDL_CreateWindowTexture(), SDL_DestroyWindowTexture(), and SDL_UpdateWindowTexture().
Definition at line 419 of file SDL_video.c.
References SDL_DisplayMode::format, SDL_DisplayMode::h, SDL_DisplayMode::refresh_rate, SDL_BITSPERPIXEL, SDL_PIXELLAYOUT, and SDL_DisplayMode::w.
Referenced by SDL_AddDisplayMode(), and SDL_GetNumDisplayModesForDisplay().
|
static |
Definition at line 2845 of file SDL_video.c.
References SDL_atoi.
Referenced by SDL_GL_ExtensionSupported(), and SDL_GL_GetAttribute().
int SDL_AddBasicVideoDisplay | ( | const SDL_DisplayMode * | desktop_mode | ) |
Definition at line 592 of file SDL_video.c.
References SDL_VideoDisplay::current_mode, SDL_VideoDisplay::desktop_mode, SDL_AddVideoDisplay(), and SDL_zero.
SDL_bool SDL_AddDisplayMode | ( | SDL_VideoDisplay * | display, |
const SDL_DisplayMode * | mode | ||
) |
Definition at line 743 of file SDL_video.c.
References cmpmodes(), SDL_VideoDisplay::display_modes, i, SDL_VideoDisplay::max_display_modes, SDL_VideoDisplay::num_display_modes, SDL_FALSE, SDL_qsort, SDL_realloc, and SDL_TRUE.
int SDL_AddVideoDisplay | ( | const SDL_VideoDisplay * | display | ) |
Definition at line 606 of file SDL_video.c.
References _this, SDL_VideoDisplay::device, SDL_VideoDevice::displays, SDL_VideoDisplay::name, SDL_VideoDevice::num_displays, SDL_itoa, SDL_OutOfMemory, SDL_realloc, and SDL_strdup.
Referenced by SDL_AddBasicVideoDisplay(), and videoInit().
float SDL_ComputeDiagonalDPI | ( | int | hpix, |
int | vpix, | ||
float | hinches, | ||
float | vinches | ||
) |
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.
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.
Definition at line 1348 of file SDL_video.c.
References SDL_Window::brightness, CREATE_FLAGS, SDL_VideoDevice::CreateSDLWindow, SDL_Window::flags, FULLSCREEN_VISIBLE, SDL_VideoDevice::GL_CreateContext, SDL_Rect::h, SDL_Window::h, SDL_Window::id, SDL_Window::is_destroying, SDL_VideoDevice::is_dummy, SDL_Window::last_fullscreen_flags, SDL_Window::magic, SDL_Window::next, SDL_VideoDevice::next_object_id, NULL, SDL_Window::opacity, SDL_Window::prev, SDL_calloc, SDL_DestroyWindow(), SDL_FALSE, SDL_FinishWindowCreation(), SDL_GetDisplayBounds(), SDL_GetDisplayForWindow(), SDL_GetHintBoolean, SDL_GetIndexOfDisplay(), SDL_GL_LoadLibrary(), SDL_HINT_VIDEO_HIGHDPI_DISABLED, SDL_OutOfMemory, SDL_SetError, SDL_SetWindowTitle(), SDL_UpdateFullscreenMode(), SDL_VideoInit(), SDL_Vulkan_LoadLibrary(), SDL_WINDOW_ALLOW_HIGHDPI, SDL_WINDOW_FULLSCREEN, SDL_WINDOW_HIDDEN, SDL_WINDOW_OPENGL, SDL_WINDOW_POPUP_MENU, SDL_WINDOW_TOOLTIP, SDL_WINDOW_UTILITY, SDL_WINDOW_VULKAN, SDL_WINDOWPOS_ISCENTERED, SDL_WINDOWPOS_ISUNDEFINED, SDL_VideoDevice::Vulkan_CreateSurface, SDL_Rect::w, SDL_Window::w, SDL_VideoDevice::window_magic, SDL_Window::windowed, SDL_VideoDevice::windows, SDL_Rect::x, SDL_Window::x, SDL_Rect::y, and SDL_Window::y.
Referenced by ShouldUseTextureFramebuffer().
|
static |
Definition at line 2192 of file SDL_video.c.
References SDL_VideoDevice::CreateWindowFramebuffer, SDL_Window::h, NULL, SDL_CreateRGBSurfaceFrom, SDL_PixelFormatEnumToMasks, SDL_VideoDevice::UpdateWindowFramebuffer, and SDL_Window::w.
Referenced by SDL_GetWindowSurface().
SDL_Window* SDL_CreateWindowFrom | ( | const void * | data | ) |
Create an SDL window from an existing native window.
data | A pointer to driver-dependent window creation data |
Definition at line 1504 of file SDL_video.c.
References SDL_Window::brightness, SDL_VideoDevice::CreateSDLWindowFrom, SDL_Window::flags, SDL_Window::id, SDL_Window::is_destroying, SDL_Window::last_fullscreen_flags, SDL_Window::magic, SDL_Window::next, SDL_VideoDevice::next_object_id, NULL, SDL_Window::opacity, SDL_Window::prev, SDL_calloc, SDL_DestroyWindow(), SDL_FALSE, SDL_OutOfMemory, SDL_UninitializedVideo(), SDL_Unsupported, SDL_WINDOW_FOREIGN, SDL_VideoDevice::window_magic, and SDL_VideoDevice::windows.
|
static |
Definition at line 259 of file SDL_video.c.
References SDL_WindowTextureData::bytes_per_pixel, SDL_Window::h, i, SDL_RendererInfo::name, NULL, SDL_RendererInfo::num_texture_formats, SDL_WindowTextureData::pitch, SDL_WindowTextureData::pixels, renderer, SDL_WindowTextureData::renderer, SDL_BYTESPERPIXEL, SDL_calloc, SDL_CreateRenderer, SDL_CreateTexture, SDL_DestroyRenderer, SDL_DestroyTexture, SDL_free, SDL_GetHint, SDL_GetNumRenderDrivers, SDL_GetRenderDriverInfo, SDL_GetRendererInfo, SDL_GetWindowData(), SDL_HINT_FRAMEBUFFER_ACCELERATION, SDL_ISPIXELFORMAT_ALPHA, SDL_ISPIXELFORMAT_FOURCC, SDL_malloc, SDL_OutOfMemory, SDL_RenderSetViewport, SDL_SetError, SDL_SetWindowData(), SDL_strcasecmp, SDL_strcmp, SDL_TEXTUREACCESS_STREAMING, SDL_WINDOWTEXTUREDATA, SDL_WindowTextureData::texture, SDL_RendererInfo::texture_formats, and SDL_Window::w.
Referenced by SDL_VideoInit().
void SDL_DestroyWindow | ( | SDL_Window * | window | ) |
Destroy a window.
Definition at line 2610 of file SDL_video.c.
References CHECK_WINDOW_MAGIC, SDL_VideoDevice::current_glwin, SDL_Window::data, SDL_VideoDevice::DestroyWindow, SDL_VideoDevice::DestroyWindowFramebuffer, SDL_Surface::flags, SDL_Window::flags, SDL_VideoDisplay::fullscreen_window, SDL_Window::gamma, SDL_Window::icon, SDL_Window::is_destroying, SDL_Window::magic, SDL_WindowUserData::name, SDL_WindowUserData::next, SDL_Window::next, NULL, SDL_Window::prev, SDL_DONTFREE, SDL_free, SDL_FreeSurface, SDL_GetDisplayForWindow(), SDL_GetKeyboardFocus, SDL_GetMouseFocus, SDL_GL_MakeCurrent(), SDL_GL_UnloadLibrary(), SDL_HideWindow(), SDL_SetKeyboardFocus(), SDL_SetMouseFocus(), SDL_TRUE, SDL_Vulkan_UnloadLibrary(), SDL_WINDOW_OPENGL, SDL_WINDOW_VULKAN, SDL_Window::surface, SDL_Window::title, and SDL_VideoDevice::windows.
Referenced by SDL_CreateWindow(), SDL_CreateWindowFrom(), SDL_VideoQuit(), and ShouldUseTextureFramebuffer().
|
static |
Definition at line 399 of file SDL_video.c.
References NULL, SDL_WindowTextureData::pixels, SDL_WindowTextureData::renderer, SDL_DestroyRenderer, SDL_DestroyTexture, SDL_free, SDL_SetWindowData(), SDL_WINDOWTEXTUREDATA, and SDL_WindowTextureData::texture.
Referenced by SDL_VideoInit().
Prevent the screen from being blanked by a screensaver.
Definition at line 2711 of file SDL_video.c.
References SDL_TRUE, SDL_VideoDevice::suspend_screensaver, and SDL_VideoDevice::SuspendScreenSaver.
Referenced by SDL_VideoInit().
Allow the screen to be blanked by a screensaver.
Definition at line 2696 of file SDL_video.c.
References SDL_FALSE, SDL_VideoDevice::suspend_screensaver, and SDL_VideoDevice::SuspendScreenSaver.
Referenced by SDL_VideoQuit().
|
static |
Definition at line 1328 of file SDL_video.c.
References SDL_MaximizeWindow(), SDL_MinimizeWindow(), SDL_SetWindowFullscreen(), SDL_SetWindowGrab(), SDL_ShowWindow(), SDL_TRUE, SDL_WINDOW_FULLSCREEN, SDL_WINDOW_HIDDEN, SDL_WINDOW_INPUT_GRABBED, SDL_WINDOW_MAXIMIZED, and SDL_WINDOW_MINIMIZED.
Referenced by SDL_CreateWindow(), and SDL_RecreateWindow().
SDL_DisplayMode* 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.
Definition at line 951 of file SDL_video.c.
References CHECK_DISPLAY_INDEX, SDL_VideoDevice::displays, NULL, and SDL_GetClosestDisplayModeForDisplay().
|
static |
Definition at line 844 of file SDL_video.c.
References SDL_VideoDisplay::desktop_mode, SDL_VideoDisplay::display_modes, SDL_DisplayMode::driverdata, SDL_DisplayMode::format, SDL_DisplayMode::h, i, NULL, SDL_DisplayMode::refresh_rate, SDL_BITSPERPIXEL, SDL_GetNumDisplayModesForDisplay(), SDL_PIXELFORMAT_RGB888, SDL_PIXELTYPE, SDL_SetError, and SDL_DisplayMode::w.
Referenced by SDL_GetClosestDisplayMode(), SDL_GetWindowDisplayMode(), and SDL_SetDisplayModeForDisplay().
int SDL_GetCurrentDisplayMode | ( | int | displayIndex, |
SDL_DisplayMode * | mode | ||
) |
Fill in information about the current display mode.
Definition at line 830 of file SDL_video.c.
References CHECK_DISPLAY_INDEX, SDL_VideoDisplay::current_mode, and SDL_VideoDevice::displays.
const char* SDL_GetCurrentVideoDriver | ( | void | ) |
Returns the name of the currently initialized video driver.
Definition at line 576 of file SDL_video.c.
References SDL_VideoDevice::name, NULL, and SDL_UninitializedVideo().
int SDL_GetDesktopDisplayMode | ( | int | displayIndex, |
SDL_DisplayMode * | mode | ||
) |
Fill in information about the desktop display mode.
Definition at line 816 of file SDL_video.c.
References CHECK_DISPLAY_INDEX, SDL_VideoDisplay::desktop_mode, and SDL_VideoDevice::displays.
int SDL_GetDisplayBounds | ( | int | displayIndex, |
SDL_Rect * | rect | ||
) |
Get the desktop area represented by a display, with the primary display located at 0,0.
Definition at line 676 of file SDL_video.c.
References CHECK_DISPLAY_INDEX, SDL_VideoDisplay::current_mode, SDL_VideoDevice::displays, SDL_VideoDevice::GetDisplayBounds, SDL_DisplayMode::h, SDL_Rect::h, SDL_DisplayMode::w, SDL_Rect::w, SDL_Rect::x, and SDL_Rect::y.
Referenced by SDL_CreateWindow(), SDL_GetDisplayUsableBounds(), SDL_GetWindowDisplayIndex(), SDL_GetWindowPosition(), and SDL_SetWindowPosition().
int SDL_GetDisplayDPI | ( | int | displayIndex, |
float * | ddpi, | ||
float * | hdpi, | ||
float * | vdpi | ||
) |
Get the dots/pixels-per-inch for a display.
Definition at line 723 of file SDL_video.c.
References CHECK_DISPLAY_INDEX, SDL_VideoDevice::displays, SDL_VideoDevice::GetDisplayDPI, and SDL_Unsupported.
void* SDL_GetDisplayDriverData | ( | int | displayIndex | ) |
Definition at line 660 of file SDL_video.c.
References CHECK_DISPLAY_INDEX, SDL_VideoDevice::displays, SDL_VideoDisplay::driverdata, and NULL.
SDL_VideoDisplay* SDL_GetDisplayForWindow | ( | SDL_Window * | window | ) |
Definition at line 1073 of file SDL_video.c.
References SDL_VideoDevice::displays, NULL, and SDL_GetWindowDisplayIndex().
Referenced by SDL_CreateWindow(), SDL_DestroyWindow(), SDL_GetWindowDisplayMode(), SDL_GetWindowPixelFormat(), SDL_SetWindowDisplayMode(), and SDL_UpdateFullscreenMode().
int SDL_GetDisplayMode | ( | int | displayIndex, |
int | modeIndex, | ||
SDL_DisplayMode * | mode | ||
) |
Fill in information about a specific display mode.
Definition at line 798 of file SDL_video.c.
References CHECK_DISPLAY_INDEX, SDL_VideoDisplay::display_modes, SDL_VideoDevice::displays, SDL_GetNumDisplayModesForDisplay(), and SDL_SetError.
const char* SDL_GetDisplayName | ( | int | displayIndex | ) |
Get the name of a display in UTF-8 encoding.
Definition at line 668 of file SDL_video.c.
References CHECK_DISPLAY_INDEX, SDL_VideoDevice::displays, SDL_VideoDisplay::name, and NULL.
int SDL_GetDisplayUsableBounds | ( | int | displayIndex, |
SDL_Rect * | rect | ||
) |
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.
Definition at line 703 of file SDL_video.c.
References CHECK_DISPLAY_INDEX, SDL_VideoDevice::displays, SDL_VideoDevice::GetDisplayUsableBounds, and SDL_GetDisplayBounds().
SDL_Window* SDL_GetFocusWindow | ( | void | ) |
Definition at line 2594 of file SDL_video.c.
References SDL_Window::flags, SDL_Window::next, NULL, SDL_WINDOW_INPUT_FOCUS, and SDL_VideoDevice::windows.
Referenced by SDL_PromptAssertion(), SDL_StartTextInput(), and SDL_StopTextInput().
SDL_Window* SDL_GetGrabbedWindow | ( | void | ) |
Get the window that currently has an input grab enabled.
Definition at line 2482 of file SDL_video.c.
References SDL_Window::flags, SDL_VideoDevice::grabbed_window, SDL_assert, and SDL_WINDOW_INPUT_GRABBED.
|
static |
Definition at line 645 of file SDL_video.c.
References SDL_VideoDevice::displays, and SDL_VideoDevice::num_displays.
Referenced by SDL_CreateWindow().
int SDL_GetNumDisplayModes | ( | int | displayIndex | ) |
Returns the number of available display modes.
Definition at line 790 of file SDL_video.c.
References CHECK_DISPLAY_INDEX, SDL_VideoDevice::displays, and SDL_GetNumDisplayModesForDisplay().
|
static |
Definition at line 779 of file SDL_video.c.
References cmpmodes(), SDL_VideoDisplay::display_modes, SDL_VideoDevice::GetDisplayModes, SDL_VideoDisplay::num_display_modes, and SDL_qsort.
Referenced by SDL_GetClosestDisplayModeForDisplay(), SDL_GetDisplayMode(), and SDL_GetNumDisplayModes().
int SDL_GetNumVideoDisplays | ( | void | ) |
Returns the number of available video displays.
Definition at line 635 of file SDL_video.c.
References SDL_VideoDevice::num_displays, and SDL_UninitializedVideo().
int SDL_GetNumVideoDrivers | ( | void | ) |
Get the number of video drivers compiled into SDL.
Definition at line 446 of file SDL_video.c.
References SDL_arraysize.
Referenced by SDL_GetVideoDriver().
SDL_VideoDevice* SDL_GetVideoDevice | ( | void | ) |
Definition at line 586 of file SDL_video.c.
References _this.
Referenced by SDL_CreateShapedWindow(), SDL_GetClipboardText(), SDL_GetTouch(), SDL_HasClipboardText(), SDL_PumpEvents(), SDL_SetClipboardText(), SDL_SetKeyboardFocus(), and SDL_SetWindowShape().
const char* SDL_GetVideoDriver | ( | int | index | ) |
Get the name of a built in video driver.
Definition at line 452 of file SDL_video.c.
References VideoBootStrap::name, NULL, and SDL_GetNumVideoDrivers().
int 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. |
Definition at line 1966 of file SDL_video.c.
References CHECK_WINDOW_MAGIC, SDL_VideoDevice::GetWindowBordersSize, and SDL_Unsupported.
float SDL_GetWindowBrightness | ( | SDL_Window * | window | ) |
Get the brightness (gamma correction) for a window.
Definition at line 2278 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.
window | The window to query. |
name | The name of the pointer. |
Definition at line 1762 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(), and SDL_UpdateWindowTexture().
int SDL_GetWindowDisplayIndex | ( | SDL_Window * | window | ) |
Get the display index associated with a window.
Definition at line 1013 of file SDL_video.c.
References CHECK_WINDOW_MAGIC, SDL_VideoDevice::displays, SDL_VideoDisplay::fullscreen_window, SDL_Rect::h, SDL_Window::h, i, NULL, SDL_VideoDevice::num_displays, rect, SDL_EnclosePoints, SDL_GetDisplayBounds(), SDL_SetError, SDL_WINDOWPOS_ISCENTERED, SDL_WINDOWPOS_ISUNDEFINED, SDL_Rect::w, SDL_Window::w, SDL_Point::x, SDL_Rect::x, SDL_Window::x, SDL_Point::y, SDL_Rect::y, and SDL_Window::y.
Referenced by SDL_GetDisplayForWindow(), and SDL_GetWindowPosition().
int SDL_GetWindowDisplayMode | ( | SDL_Window * | window, |
SDL_DisplayMode * | mode | ||
) |
Fill in information about the display mode used when a fullscreen window is visible.
Definition at line 1104 of file SDL_video.c.
References CHECK_WINDOW_MAGIC, SDL_VideoDisplay::desktop_mode, SDL_Window::flags, SDL_Window::fullscreen_mode, SDL_DisplayMode::h, SDL_Rect::h, SDL_GetClosestDisplayModeForDisplay(), SDL_GetDisplayForWindow(), SDL_InvalidParamError, SDL_SetError, SDL_WINDOW_FULLSCREEN_DESKTOP, SDL_DisplayMode::w, SDL_Rect::w, and SDL_Window::windowed.
Referenced by SDL_SetWindowDisplayMode(), and SDL_UpdateFullscreenMode().
Uint32 SDL_GetWindowFlags | ( | SDL_Window * | window | ) |
Get the window flags.
Definition at line 1660 of file SDL_video.c.
References CHECK_WINDOW_MAGIC, and SDL_Window::flags.
Referenced by SDL_ShowMessageBox().
SDL_Window* SDL_GetWindowFromID | ( | Uint32 | id | ) |
Get a window from a stored ID, or NULL if it doesn't exist.
Definition at line 1644 of file SDL_video.c.
References SDL_Window::id, SDL_Window::next, NULL, and SDL_VideoDevice::windows.
int 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. |
Definition at line 2382 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.
Definition at line 2474 of file SDL_video.c.
References CHECK_WINDOW_MAGIC, SDL_Window::flags, SDL_VideoDevice::grabbed_window, SDL_assert, SDL_FALSE, and SDL_WINDOW_INPUT_GRABBED.
Uint32 SDL_GetWindowID | ( | SDL_Window * | window | ) |
Get the numeric ID of a window, for logging purposes.
Definition at line 1636 of file SDL_video.c.
References CHECK_WINDOW_MAGIC, and SDL_Window::id.
void 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 |
Definition at line 2061 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.
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 |
Definition at line 2019 of file SDL_video.c.
References CHECK_WINDOW_MAGIC, SDL_Window::min_h, and SDL_Window::min_w.
int 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) |
Definition at line 2310 of file SDL_video.c.
References CHECK_WINDOW_MAGIC, and SDL_Window::opacity.
Uint32 SDL_GetWindowPixelFormat | ( | SDL_Window * | window | ) |
Get the pixel format associated with the window.
Definition at line 1141 of file SDL_video.c.
References CHECK_WINDOW_MAGIC, SDL_VideoDisplay::current_mode, SDL_DisplayMode::format, SDL_GetDisplayForWindow(), and SDL_PIXELFORMAT_UNKNOWN.
void 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. |
Definition at line 1828 of file SDL_video.c.
References CHECK_WINDOW_MAGIC, SDL_Window::flags, SDL_GetDisplayBounds(), SDL_GetWindowDisplayIndex(), SDL_WINDOW_FULLSCREEN, SDL_zero, SDL_Rect::x, SDL_Window::x, SDL_Rect::y, and SDL_Window::y.
void 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.
Definition at line 1954 of file SDL_video.c.
References CHECK_WINDOW_MAGIC, SDL_Window::h, and SDL_Window::w.
Referenced by SDL_GL_GetDrawableSize(), and SDL_Vulkan_GetDrawableSize().
SDL_Surface* 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.
Definition at line 2216 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.
const char* SDL_GetWindowTitle | ( | SDL_Window * | window | ) |
Get the title of a window, in UTF-8 format.
Definition at line 1685 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.
window | The window about which information is being requested |
info | This structure must be initialized with the SDL version, and is then filled in with information about the given window. |
info
struct is valid, SDL_FALSE otherwise.You typically use this function like this:
Definition at line 3635 of file SDL_video.c.
References CHECK_WINDOW_MAGIC, SDL_VideoDevice::GetWindowWMInfo, SDL_FALSE, SDL_InvalidParamError, SDL_SYSWM_UNKNOWN, SDL_Unsupported, and SDL_SysWMinfo::subsystem.
Referenced by SDL_MessageboxValidForDriver().
SDL_GLContext SDL_GL_CreateContext | ( | SDL_Window * | window | ) |
Create an OpenGL context for use with an OpenGL window, and make it current.
Definition at line 3391 of file SDL_video.c.
References CHECK_WINDOW_MAGIC, SDL_VideoDevice::current_glctx, SDL_VideoDevice::current_glctx_tls, SDL_VideoDevice::current_glwin, SDL_VideoDevice::current_glwin_tls, SDL_Window::flags, SDL_VideoDevice::GL_CreateContext, NULL, SDL_SetError, SDL_TLSSet, and SDL_WINDOW_OPENGL.
Referenced by ShouldUseTextureFramebuffer().
void SDL_GL_DeduceMaxSupportedESProfile | ( | int * | major, |
int * | minor | ||
) |
Definition at line 2942 of file SDL_video.c.
References SDL_GL_ExtensionSupported().
void SDL_GL_DeleteContext | ( | SDL_GLContext | context | ) |
Delete an OpenGL context.
Definition at line 3522 of file SDL_video.c.
References SDL_PixelFormat::Amask, SDL_PixelFormat::BytesPerPixel, SDL_Surface::flags, SDL_Surface::format, SDL_VideoDevice::GL_DeleteContext, SDL_Surface::h, NULL, SDL_Surface::pitch, SDL_Surface::pixels, SDL_free, SDL_GL_GetCurrentContext(), SDL_GL_MakeCurrent(), SDL_malloc, SDL_memset, and SDL_Surface::w.
Referenced by ShouldUseTextureFramebuffer().
SDL_bool SDL_GL_ExtensionSupported | ( | const char * | extension | ) |
Return true if an OpenGL extension is supported for the current context.
Definition at line 2852 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, SDL_TRUE, and void.
Referenced by SDL_GL_DeduceMaxSupportedESProfile().
int 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. Definition at line 3142 of file SDL_video.c.
References SDL_VideoDevice::accelerated, APIENTRY, SDL_VideoDevice::double_buffer, SDL_VideoDevice::flags, SDL_VideoDevice::framebuffer_srgb_capable, GL_ACCUM_ALPHA_BITS, GL_ACCUM_BLUE_BITS, GL_ACCUM_GREEN_BITS, GL_ACCUM_RED_BITS, GL_ALPHA_BITS, GL_BACK_LEFT, GL_BLUE_BITS, SDL_VideoDevice::gl_config, GL_CONTEXT_RELEASE_BEHAVIOR, GL_CONTEXT_RELEASE_BEHAVIOR_KHR, GL_DEPTH, GL_DEPTH_BITS, GL_DOUBLEBUFFER, GL_FRAMEBUFFER, GL_FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE, GL_FRAMEBUFFER_ATTACHMENT_BLUE_SIZE, GL_FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE, GL_FRAMEBUFFER_ATTACHMENT_GREEN_SIZE, GL_FRAMEBUFFER_ATTACHMENT_RED_SIZE, GL_FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE, GL_GREEN_BITS, GL_INVALID_ENUM, GL_INVALID_VALUE, GL_NO_ERROR, GL_RED_BITS, GL_SAMPLE_BUFFERS, GL_SAMPLES, GL_STENCIL, GL_STENCIL_BITS, GL_STEREO, GL_VERSION, isAtLeastGL3(), SDL_VideoDevice::major_version, SDL_VideoDevice::minor_version, SDL_VideoDevice::no_error, SDL_VideoDevice::profile_mask, 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_EGL, SDL_GL_CONTEXT_FLAGS, SDL_GL_CONTEXT_MAJOR_VERSION, SDL_GL_CONTEXT_MINOR_VERSION, SDL_GL_CONTEXT_NO_ERROR, SDL_GL_CONTEXT_PROFILE_ES, SDL_GL_CONTEXT_PROFILE_MASK, SDL_GL_CONTEXT_RELEASE_BEHAVIOR, SDL_GL_DEPTH_SIZE, SDL_GL_DOUBLEBUFFER, SDL_GL_FRAMEBUFFER_SRGB_CAPABLE, SDL_GL_GetProcAddress(), SDL_GL_GREEN_SIZE, SDL_GL_MULTISAMPLEBUFFERS, SDL_GL_MULTISAMPLESAMPLES, SDL_GL_RED_SIZE, SDL_GL_RETAINED_BACKING, SDL_GL_SHARE_WITH_CURRENT_CONTEXT, SDL_GL_STENCIL_SIZE, SDL_GL_STEREO, SDL_InvalidParamError, SDL_SetError, SDL_UninitializedVideo(), SDL_Unsupported, SDL_VideoDevice::share_with_current_context, and void.
SDL_GLContext SDL_GL_GetCurrentContext | ( | void | ) |
Get the currently active OpenGL context.
Definition at line 3455 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 3445 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 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.
Definition at line 3464 of file SDL_video.c.
References CHECK_WINDOW_MAGIC, SDL_VideoDevice::GL_GetDrawableSize, and SDL_GetWindowSize().
void* SDL_GL_GetProcAddress | ( | const char * | proc | ) |
Get the address of an OpenGL function.
Definition at line 2805 of file SDL_video.c.
References SDL_VideoDevice::driver_loaded, SDL_VideoDevice::gl_config, SDL_VideoDevice::GL_GetProcAddress, NULL, SDL_SetError, and SDL_UninitializedVideo().
Referenced by SDL_GL_ExtensionSupported(), SDL_GL_GetAttribute(), and ShouldUseTextureFramebuffer().
int SDL_GL_GetSwapInterval | ( | void | ) |
Get the swap interval for the current OpenGL context.
Definition at line 3490 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.
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.
Definition at line 2776 of file SDL_video.c.
References SDL_VideoDevice::driver_loaded, SDL_VideoDevice::driver_path, SDL_VideoDevice::gl_config, SDL_VideoDevice::GL_LoadLibrary, SDL_VideoDevice::GL_UnloadLibrary, retval, SDL_SetError, SDL_strcmp, and SDL_UninitializedVideo().
Referenced by SDL_CreateWindow(), and SDL_RecreateWindow().
int SDL_GL_MakeCurrent | ( | SDL_Window * | window, |
SDL_GLContext | context | ||
) |
Set up an OpenGL context for rendering into an OpenGL window.
Definition at line 3414 of file SDL_video.c.
References CHECK_WINDOW_MAGIC, SDL_VideoDevice::current_glctx, SDL_VideoDevice::current_glctx_tls, SDL_VideoDevice::current_glwin, SDL_VideoDevice::current_glwin_tls, SDL_Window::flags, SDL_VideoDevice::GL_MakeCurrent, NULL, retval, SDL_GL_GetCurrentContext(), SDL_GL_GetCurrentWindow(), SDL_SetError, SDL_TLSSet, and SDL_WINDOW_OPENGL.
Referenced by SDL_DestroyWindow(), and SDL_GL_DeleteContext().
Reset all previously set OpenGL context attributes to their default values.
Definition at line 2967 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::framebuffer_srgb_capable, SDL_VideoDevice::gl_config, SDL_VideoDevice::GL_DefaultProfileConfig, SDL_VideoDevice::green_size, SDL_VideoDevice::major_version, SDL_VideoDevice::minor_version, SDL_VideoDevice::multisamplebuffers, SDL_VideoDevice::multisamplesamples, SDL_VideoDevice::no_error, SDL_VideoDevice::profile_mask, SDL_VideoDevice::red_size, SDL_VideoDevice::release_behavior, SDL_VideoDevice::reset_notification, SDL_VideoDevice::retained_backing, SDL_GL_CONTEXT_PROFILE_ES, SDL_GL_CONTEXT_RELEASE_BEHAVIOR_FLUSH, SDL_GL_CONTEXT_RESET_NO_NOTIFICATION, SDL_VideoDevice::share_with_current_context, SDL_VideoDevice::stencil_size, and SDL_VideoDevice::stereo.
Referenced by SDL_VideoInit().
int SDL_GL_SetAttribute | ( | SDL_GLattr | attr, |
int | value | ||
) |
Set an OpenGL window attribute before window creation.
Definition at line 3021 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::framebuffer_srgb_capable, SDL_VideoDevice::gl_config, SDL_VideoDevice::green_size, SDL_VideoDevice::major_version, SDL_VideoDevice::minor_version, SDL_VideoDevice::multisamplebuffers, SDL_VideoDevice::multisamplesamples, SDL_VideoDevice::no_error, SDL_VideoDevice::profile_mask, SDL_VideoDevice::red_size, SDL_VideoDevice::release_behavior, SDL_VideoDevice::reset_notification, SDL_VideoDevice::retained_backing, retval, 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_NO_ERROR, SDL_GL_CONTEXT_PROFILE_COMPATIBILITY, SDL_GL_CONTEXT_PROFILE_CORE, SDL_GL_CONTEXT_PROFILE_ES, SDL_GL_CONTEXT_PROFILE_MASK, SDL_GL_CONTEXT_RELEASE_BEHAVIOR, SDL_GL_CONTEXT_RESET_ISOLATION_FLAG, SDL_GL_CONTEXT_RESET_NOTIFICATION, SDL_GL_CONTEXT_ROBUST_ACCESS_FLAG, SDL_GL_DEPTH_SIZE, SDL_GL_DOUBLEBUFFER, SDL_GL_FRAMEBUFFER_SRGB_CAPABLE, SDL_GL_GREEN_SIZE, SDL_GL_MULTISAMPLEBUFFERS, SDL_GL_MULTISAMPLESAMPLES, SDL_GL_RED_SIZE, SDL_GL_RETAINED_BACKING, 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.
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. If the system supports it, you may specify -1 to allow late swaps to happen immediately instead of waiting for the next retrace. |
Definition at line 3476 of file SDL_video.c.
References SDL_VideoDevice::GL_SetSwapInterval, NULL, SDL_GL_GetCurrentContext(), SDL_SetError, and SDL_UninitializedVideo().
void SDL_GL_SwapWindow | ( | SDL_Window * | window | ) |
Swap the OpenGL buffers for a window, if double-buffering is supported.
Definition at line 3504 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.
Unload the OpenGL library previously loaded by SDL_GL_LoadLibrary().
Definition at line 2827 of file SDL_video.c.
References SDL_VideoDevice::driver_loaded, SDL_VideoDevice::gl_config, SDL_VideoDevice::GL_UnloadLibrary, SDL_INLINE, and SDL_UninitializedVideo().
Referenced by SDL_DestroyWindow(), and SDL_RecreateWindow().
Returns whether the platform has some screen keyboard support.
Definition at line 3709 of file SDL_video.c.
References SDL_VideoDevice::HasScreenKeyboardSupport, and SDL_FALSE.
Referenced by SDL_VideoInit().
Definition at line 1630 of file SDL_video.c.
References NULL, and SDL_VideoDevice::windows.
Referenced by SDL_PrivateJoystickShouldIgnoreEvent().
void SDL_HideWindow | ( | SDL_Window * | window | ) |
Hide a window.
Definition at line 2088 of file SDL_video.c.
References CHECK_WINDOW_MAGIC, SDL_Window::flags, SDL_VideoDevice::HideWindow, SDL_Window::is_hiding, SDL_FALSE, SDL_SendWindowEvent(), SDL_TRUE, SDL_UpdateFullscreenMode(), SDL_WINDOW_SHOWN, and SDL_WINDOWEVENT_HIDDEN.
Referenced by SDL_DestroyWindow(), and SDL_RecreateWindow().
SDL_bool SDL_IsScreenKeyboardShown | ( | SDL_Window * | window | ) |
Returns whether the screen keyboard is shown for given window.
window | The window for which screen keyboard should be queried. |
Definition at line 3718 of file SDL_video.c.
References SDL_VideoDevice::IsScreenKeyboardShown, and SDL_FALSE.
Returns whether the screensaver is currently enabled (default off).
Definition at line 2687 of file SDL_video.c.
References SDL_FALSE, SDL_TRUE, and SDL_VideoDevice::suspend_screensaver.
Return whether or not Unicode text input events are enabled.
Definition at line 3674 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.
Definition at line 2120 of file SDL_video.c.
References CHECK_WINDOW_MAGIC, SDL_Window::flags, SDL_VideoDevice::MaximizeWindow, and SDL_WINDOW_MAXIMIZED.
Referenced by SDL_FinishWindowCreation().
|
static |
Definition at line 3747 of file SDL_video.c.
References SDL_GetWindowWMInfo(), SDL_TRUE, SDL_VERSION, SDL_SysWMinfo::subsystem, SDL_SysWMinfo::version, and SDL_MessageBoxData::window.
Referenced by SDL_ShowMessageBox().
void SDL_MinimizeWindow | ( | SDL_Window * | window | ) |
Minimize a window to an iconic representation.
Definition at line 2136 of file SDL_video.c.
References CHECK_WINDOW_MAGIC, SDL_Window::flags, SDL_VideoDevice::MinimizeWindow, SDL_FALSE, SDL_UpdateFullscreenMode(), and SDL_WINDOW_MINIMIZED.
Referenced by SDL_FinishWindowCreation(), SDL_OnWindowFocusLost(), and SDL_UpdateFullscreenMode().
Definition at line 3957 of file SDL_video.c.
References SDL_Window::next, NULL, SDL_APP_DIDENTERFOREGROUND, SDL_SendAppEvent(), SDL_SendWindowEvent(), SDL_WINDOWEVENT_FOCUS_GAINED, SDL_WINDOWEVENT_RESTORED, and SDL_VideoDevice::windows.
Definition at line 3947 of file SDL_video.c.
References SDL_APP_DIDENTERBACKGROUND, and SDL_SendAppEvent().
Definition at line 3930 of file SDL_video.c.
References SDL_APP_LOWMEMORY, and SDL_SendAppEvent().
Definition at line 3952 of file SDL_video.c.
References SDL_APP_WILLENTERFOREGROUND, and SDL_SendAppEvent().
Definition at line 3935 of file SDL_video.c.
References SDL_Window::next, NULL, SDL_APP_WILLENTERBACKGROUND, SDL_SendAppEvent(), SDL_SendWindowEvent(), SDL_WINDOWEVENT_FOCUS_LOST, SDL_WINDOWEVENT_MINIMIZED, and SDL_VideoDevice::windows.
Definition at line 3925 of file SDL_video.c.
References SDL_APP_TERMINATING, and SDL_SendAppEvent().
void SDL_OnWindowEnter | ( | SDL_Window * | window | ) |
Definition at line 2530 of file SDL_video.c.
References SDL_VideoDevice::OnWindowEnter.
Referenced by SDL_SendWindowEvent().
void SDL_OnWindowFocusGained | ( | SDL_Window * | window | ) |
Definition at line 2543 of file SDL_video.c.
References SDL_Window::gamma, SDL_Window::h, SDL_Mouse::relative_mode, SDL_GetMouse(), SDL_SetMouseFocus(), SDL_UpdateWindowGrab(), SDL_WarpMouseInWindow, SDL_VideoDevice::SetWindowGammaRamp, and SDL_Window::w.
Referenced by SDL_SendWindowEvent().
void SDL_OnWindowFocusLost | ( | SDL_Window * | window | ) |
Definition at line 2578 of file SDL_video.c.
References SDL_Window::gamma, SDL_Window::saved_gamma, SDL_MinimizeWindow(), SDL_UpdateWindowGrab(), SDL_VideoDevice::SetWindowGammaRamp, and ShouldMinimizeOnFocusLoss().
Referenced by SDL_SendWindowEvent().
void SDL_OnWindowHidden | ( | SDL_Window * | window | ) |
Definition at line 2495 of file SDL_video.c.
References SDL_FALSE, and SDL_UpdateFullscreenMode().
Referenced by SDL_SendWindowEvent().
void SDL_OnWindowLeave | ( | SDL_Window * | window | ) |
void SDL_OnWindowMinimized | ( | SDL_Window * | window | ) |
Definition at line 2508 of file SDL_video.c.
References SDL_FALSE, and SDL_UpdateFullscreenMode().
Referenced by SDL_SendWindowEvent().
void SDL_OnWindowResized | ( | SDL_Window * | window | ) |
Definition at line 2501 of file SDL_video.c.
References SDL_Window::h, SDL_FALSE, SDL_SendWindowEvent(), SDL_WINDOWEVENT_SIZE_CHANGED, SDL_Window::surface_valid, and SDL_Window::w.
Referenced by SDL_SendWindowEvent(), SDL_SetWindowSize(), and SDL_UpdateFullscreenMode().
void SDL_OnWindowRestored | ( | SDL_Window * | window | ) |
Definition at line 2514 of file SDL_video.c.
References FULLSCREEN_VISIBLE, SDL_TRUE, and SDL_UpdateFullscreenMode().
Referenced by SDL_OnWindowShown(), and SDL_SendWindowEvent().
void SDL_OnWindowShown | ( | SDL_Window * | window | ) |
Definition at line 2489 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 2107 of file SDL_video.c.
References CHECK_WINDOW_MAGIC, SDL_Window::flags, SDL_VideoDevice::RaiseWindow, and SDL_WINDOW_SHOWN.
Referenced by SDL_ShowMessageBox().
int SDL_RecreateWindow | ( | SDL_Window * | window, |
Uint32 | flags | ||
) |
Definition at line 1542 of file SDL_video.c.
References CREATE_FLAGS, SDL_VideoDevice::CreateSDLWindow, SDL_VideoDevice::DestroyWindow, SDL_VideoDevice::DestroyWindowFramebuffer, SDL_Surface::flags, SDL_Window::flags, SDL_VideoDevice::GL_CreateContext, SDL_Window::hit_test, SDL_Window::icon, SDL_Window::is_destroying, SDL_Window::last_fullscreen_flags, NULL, SDL_DONTFREE, SDL_FALSE, SDL_FinishWindowCreation(), SDL_FreeSurface, SDL_GL_LoadLibrary(), SDL_GL_UnloadLibrary(), SDL_HideWindow(), SDL_SetError, SDL_TRUE, SDL_WINDOW_FOREIGN, SDL_WINDOW_HIDDEN, SDL_WINDOW_OPENGL, SDL_WINDOW_VULKAN, SDL_VideoDevice::SetWindowHitTest, SDL_VideoDevice::SetWindowIcon, SDL_VideoDevice::SetWindowTitle, SDL_Window::surface, and SDL_Window::title.
|
static |
Definition at line 1152 of file SDL_video.c.
References SDL_GetMouseFocus, SDL_GetMouseState, SDL_WarpMouseInWindow, and WINRT_DetectWindowFlags().
Referenced by SDL_UpdateFullscreenMode().
void SDL_RestoreWindow | ( | SDL_Window * | window | ) |
Restore the size and position of a minimized or maximized window.
Definition at line 2152 of file SDL_video.c.
References CHECK_WINDOW_MAGIC, SDL_Window::flags, SDL_VideoDevice::RestoreWindow, SDL_WINDOW_MAXIMIZED, and SDL_WINDOW_MINIMIZED.
|
static |
Definition at line 964 of file SDL_video.c.
References SDL_VideoDisplay::current_mode, SDL_VideoDisplay::desktop_mode, SDL_DisplayMode::format, SDL_DisplayMode::h, SDL_DisplayMode::refresh_rate, SDL_GetClosestDisplayModeForDisplay(), SDL_memcmp, SDL_SetError, SDL_VideoDevice::SetDisplayMode, and SDL_DisplayMode::w.
Referenced by SDL_SetWindowDisplayMode(), and SDL_UpdateFullscreenMode().
Set the rectangle used to type Unicode text inputs. This is used as a hint for IME and on-screen keyboard placement.
Definition at line 3701 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.
window | The window of which to change the border state. |
bordered | SDL_FALSE to remove border, SDL_TRUE to add border. |
Definition at line 1870 of file SDL_video.c.
References CHECK_WINDOW_MAGIC, SDL_Window::flags, SDL_FALSE, SDL_WINDOW_BORDERLESS, SDL_WINDOW_FULLSCREEN, and SDL_VideoDevice::SetWindowBordered.
int SDL_SetWindowBrightness | ( | SDL_Window * | window, |
float | brightness | ||
) |
Set the brightness (gamma correction) for a window.
Definition at line 2262 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.
window | The window to associate with the pointer. |
name | The name of the pointer. |
userdata | The associated pointer. |
Definition at line 1715 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_CreateWindowTexture(), 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.
window | The window for which the display mode should be set. |
mode | The mode to use, or NULL for the default mode. |
Definition at line 1084 of file SDL_video.c.
References CHECK_WINDOW_MAGIC, SDL_Window::flags, SDL_Window::fullscreen_mode, FULLSCREEN_VISIBLE, SDL_GetDisplayForWindow(), SDL_GetWindowDisplayMode(), SDL_SetDisplayModeForDisplay(), SDL_WINDOW_FULLSCREEN_DESKTOP, and SDL_zero.
int SDL_SetWindowFullscreen | ( | SDL_Window * | window, |
Uint32 | flags | ||
) |
Set a window's fullscreen state.
Definition at line 2166 of file SDL_video.c.
References CHECK_WINDOW_MAGIC, SDL_Window::flags, FULLSCREEN_MASK, FULLSCREEN_VISIBLE, and SDL_UpdateFullscreenMode().
Referenced by SDL_FinishWindowCreation().
int 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.
Definition at line 2348 of file SDL_video.c.
References CHECK_WINDOW_MAGIC, SDL_Window::flags, SDL_Window::gamma, NULL, SDL_assert, 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.
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.
Definition at line 2458 of file SDL_video.c.
References CHECK_WINDOW_MAGIC, SDL_Window::flags, SDL_UpdateWindowGrab(), and SDL_WINDOW_INPUT_GRABBED.
Referenced by SDL_FinishWindowCreation().
int 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. |
Definition at line 3894 of file SDL_video.c.
References callback(), CHECK_WINDOW_MAGIC, SDL_Window::hit_test, SDL_Window::hit_test_data, NULL, SDL_Unsupported, and SDL_VideoDevice::SetWindowHitTest.
void 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. |
Definition at line 1693 of file SDL_video.c.
References CHECK_WINDOW_MAGIC, SDL_Window::icon, SDL_ConvertSurfaceFormat, SDL_FreeSurface, SDL_PIXELFORMAT_ARGB8888, and SDL_VideoDevice::SetWindowIcon.
int 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 |
Definition at line 2335 of file SDL_video.c.
References CHECK_WINDOW_MAGIC, SDL_Unsupported, and SDL_VideoDevice::SetWindowInputFocus.
void 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 |
Definition at line 2031 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_SetError, SDL_SetWindowSize(), SDL_WINDOW_FULLSCREEN, SDL_VideoDevice::SetWindowMaximumSize, and SDL_Window::w.
void 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 |
Definition at line 1988 of file SDL_video.c.
References CHECK_WINDOW_MAGIC, SDL_Window::flags, SDL_Window::h, SDL_Window::max_h, SDL_Window::max_w, SDL_Window::min_h, SDL_Window::min_w, SDL_InvalidParamError, SDL_max, SDL_SetError, SDL_SetWindowSize(), SDL_WINDOW_FULLSCREEN, SDL_VideoDevice::SetWindowMinimumSize, and SDL_Window::w.
int 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 |
Definition at line 2322 of file SDL_video.c.
References CHECK_WINDOW_MAGIC, SDL_Unsupported, and SDL_VideoDevice::SetWindowModalFor.
int 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. |
Definition at line 2286 of file SDL_video.c.
References CHECK_WINDOW_MAGIC, SDL_Window::opacity, retval, SDL_Unsupported, and SDL_VideoDevice::SetWindowOpacity.
void 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. |
Definition at line 1783 of file SDL_video.c.
References CHECK_WINDOW_MAGIC, SDL_Window::flags, SDL_Rect::h, SDL_Window::h, SDL_VideoDevice::num_displays, SDL_GetDisplayBounds(), SDL_SendWindowEvent(), SDL_WINDOW_FULLSCREEN, SDL_WINDOWEVENT_MOVED, SDL_WINDOWPOS_ISCENTERED, SDL_WINDOWPOS_ISUNDEFINED, SDL_zero, SDL_VideoDevice::SetWindowPosition, SDL_Rect::w, SDL_Window::w, SDL_Window::windowed, SDL_Rect::x, SDL_Window::x, SDL_Rect::y, and SDL_Window::y.
void 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. |
Definition at line 1888 of file SDL_video.c.
References CHECK_WINDOW_MAGIC, SDL_Window::flags, SDL_FALSE, SDL_WINDOW_FULLSCREEN, SDL_WINDOW_RESIZABLE, and SDL_VideoDevice::SetWindowResizable.
void 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.
Definition at line 1906 of file SDL_video.c.
References CHECK_WINDOW_MAGIC, SDL_Window::flags, FULLSCREEN_VISIBLE, SDL_Rect::h, SDL_Window::h, SDL_Window::last_fullscreen_flags, SDL_Window::max_h, SDL_Window::max_w, SDL_Window::min_h, SDL_Window::min_w, SDL_InvalidParamError, SDL_OnWindowResized(), SDL_TRUE, SDL_UpdateFullscreenMode(), SDL_WINDOW_FULLSCREEN, SDL_WINDOW_FULLSCREEN_DESKTOP, SDL_VideoDevice::SetWindowSize, SDL_Rect::w, SDL_Window::w, and SDL_Window::windowed.
Referenced by SDL_SetWindowMaximumSize(), and SDL_SetWindowMinimumSize().
void SDL_SetWindowTitle | ( | SDL_Window * | window, |
const char * | title | ||
) |
Set the title of a window, in UTF-8 format.
Definition at line 1668 of file SDL_video.c.
References CHECK_WINDOW_MAGIC, SDL_free, SDL_strdup, SDL_VideoDevice::SetWindowTitle, and SDL_Window::title.
Referenced by SDL_CreateWindow().
Definition at line 3888 of file SDL_video.c.
References SDL_GetHintBoolean, SDL_HINT_ALLOW_TOPMOST, and SDL_TRUE.
int SDL_ShowMessageBox | ( | const SDL_MessageBoxData * | messageboxdata, |
int * | buttonid | ||
) |
Create a modal message box.
messageboxdata | The SDL_MessageBoxData structure with title, text, etc. |
buttonid | The pointer to which user id of hit button should be copied. |
Definition at line 3766 of file SDL_video.c.
References retval, SDL_CaptureMouse, SDL_FALSE, SDL_GetKeyboardFocus, SDL_GetRelativeMouseMode, SDL_GetWindowFlags(), SDL_InvalidParamError, SDL_MessageboxValidForDriver(), SDL_RaiseWindow(), SDL_ResetKeyboard(), SDL_SetError, SDL_SetRelativeMouseMode, SDL_ShowCursor, SDL_SYSWM_COCOA, SDL_SYSWM_UIKIT, SDL_SYSWM_WINDOWS, SDL_SYSWM_WINRT, SDL_SYSWM_X11, SDL_TRUE, SDL_WINDOW_MOUSE_CAPTURE, and SDL_VideoDevice::ShowMessageBox.
Referenced by SDL_ShowSimpleMessageBox().
int SDL_ShowSimpleMessageBox | ( | Uint32 | flags, |
const char * | title, | ||
const char * | message, | ||
SDL_Window * | window | ||
) |
Create a simple modal message box.
flags | SDL_MessageBoxFlags |
title | UTF-8 title text |
message | UTF-8 message text |
window | The parent window, or NULL for no parent |
Definition at line 3855 of file SDL_video.c.
References button, 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.
void SDL_ShowWindow | ( | SDL_Window * | window | ) |
Show a window.
Definition at line 2073 of file SDL_video.c.
References CHECK_WINDOW_MAGIC, SDL_Window::flags, SDL_SendWindowEvent(), SDL_WINDOW_SHOWN, SDL_WINDOWEVENT_SHOWN, and SDL_VideoDevice::ShowWindow.
Referenced by SDL_FinishWindowCreation().
Start accepting Unicode text input events. This function will show the on-screen keyboard if supported.
Definition at line 3653 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().
Stop receiving any text input events. This function will hide the on-screen keyboard if supported.
Definition at line 3680 of file SDL_video.c.
References SDL_VideoDevice::HideScreenKeyboard, SDL_DISABLE, SDL_EventState, SDL_GetFocusWindow(), SDL_TEXTEDITING, SDL_TEXTINPUT, and SDL_VideoDevice::StopTextInput.
|
static |
Definition at line 440 of file SDL_video.c.
References SDL_SetError.
Referenced by SDL_CreateWindowFrom(), SDL_GetCurrentVideoDriver(), SDL_GetNumVideoDisplays(), SDL_GL_GetAttribute(), SDL_GL_GetCurrentContext(), SDL_GL_GetCurrentWindow(), SDL_GL_GetProcAddress(), SDL_GL_LoadLibrary(), SDL_GL_SetAttribute(), SDL_GL_SetSwapInterval(), SDL_GL_UnloadLibrary(), SDL_Vulkan_GetVkGetInstanceProcAddr(), SDL_Vulkan_LoadLibrary(), and SDL_Vulkan_UnloadLibrary().
|
static |
Definition at line 1167 of file SDL_video.c.
References CHECK_WINDOW_MAGIC, SDL_Window::flags, FULLSCREEN_MASK, FULLSCREEN_VISIBLE, SDL_VideoDisplay::fullscreen_window, SDL_DisplayMode::h, SDL_Window::h, SDL_Window::is_destroying, SDL_Window::is_hiding, SDL_Window::last_fullscreen_flags, SDL_VideoDevice::name, SDL_Window::next, NULL, SDL_FALSE, SDL_GetDisplayForWindow(), SDL_GetWindowDisplayMode(), SDL_MinimizeWindow(), SDL_OnWindowResized(), SDL_RestoreMousePosition(), SDL_SendWindowEvent(), SDL_SetDisplayModeForDisplay(), SDL_strcmp, SDL_TRUE, SDL_WINDOW_FULLSCREEN, SDL_WINDOW_FULLSCREEN_DESKTOP, SDL_WINDOWEVENT_RESIZED, SDL_zero, SDL_VideoDevice::SetWindowFullscreen, SDL_DisplayMode::w, SDL_Window::w, SDL_VideoDevice::windows, and WINRT_DetectWindowFlags().
Referenced by SDL_CreateWindow(), SDL_HideWindow(), SDL_MinimizeWindow(), SDL_OnWindowHidden(), SDL_OnWindowMinimized(), SDL_OnWindowRestored(), SDL_SetWindowFullscreen(), and SDL_SetWindowSize().
void SDL_UpdateWindowGrab | ( | SDL_Window * | window | ) |
Definition at line 2427 of file SDL_video.c.
References SDL_Window::flags, SDL_VideoDevice::grabbed_window, NULL, SDL_FALSE, SDL_GetMouse(), SDL_TRUE, SDL_WINDOW_INPUT_FOCUS, SDL_WINDOW_INPUT_GRABBED, and SDL_VideoDevice::SetWindowGrab.
Referenced by SDL_OnWindowFocusGained(), SDL_OnWindowFocusLost(), SDL_SetRelativeMouseMode(), and SDL_SetWindowGrab().
int SDL_UpdateWindowSurface | ( | SDL_Window * | window | ) |
Copy the window surface to the screen.
Definition at line 2235 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.
int SDL_UpdateWindowSurfaceRects | ( | SDL_Window * | window, |
const SDL_Rect * | rects, | ||
int | numrects | ||
) |
Copy a number of rectangles on the window surface to the screen.
Definition at line 2249 of file SDL_video.c.
References CHECK_WINDOW_MAGIC, SDL_SetError, SDL_Window::surface_valid, and SDL_VideoDevice::UpdateWindowFramebuffer.
Referenced by SDL_UpdateWindowSurface().
|
static |
Definition at line 369 of file SDL_video.c.
References SDL_WindowTextureData::bytes_per_pixel, SDL_Window::h, NULL, SDL_WindowTextureData::pitch, SDL_WindowTextureData::pixels, rect, SDL_WindowTextureData::renderer, SDL_GetSpanEnclosingRect(), SDL_GetWindowData(), SDL_RenderCopy, SDL_RenderPresent, SDL_SetError, SDL_UpdateTexture, SDL_WINDOWTEXTUREDATA, SDL_WindowTextureData::texture, SDL_Window::w, SDL_Rect::x, and SDL_Rect::y.
Referenced by SDL_VideoInit().
int SDL_VideoInit | ( | const char * | driver_name | ) |
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.
Definition at line 464 of file SDL_video.c.
References available(), VideoBootStrap::create, SDL_VideoDevice::CreateWindowFramebuffer, SDL_VideoDevice::current_glctx_tls, SDL_VideoDevice::current_glwin_tls, SDL_VideoDevice::DestroyWindowFramebuffer, SDL_VideoDevice::dll_handle, SDL_VideoDevice::driver_loaded, SDL_VideoDevice::gl_config, i, SDL_VideoDevice::name, VideoBootStrap::name, SDL_VideoDevice::next_object_id, NULL, SDL_VideoDevice::num_displays, SDL_CreateWindowTexture(), SDL_DestroyWindowTexture(), SDL_DisableScreenSaver(), SDL_FALSE, SDL_getenv, SDL_GetHintBoolean, SDL_GL_ResetAttributes(), SDL_HasScreenKeyboardSupport(), SDL_HINT_VIDEO_ALLOW_SCREENSAVER, SDL_INIT_EVENTS, SDL_InitSubSystem, SDL_KeyboardInit(), SDL_MouseInit(), SDL_SetError, SDL_StartTextInput(), SDL_strlen, SDL_strncasecmp, SDL_TicksInit(), SDL_TLSCreate, SDL_TouchInit(), SDL_UpdateWindowTexture(), SDL_VideoQuit(), ShouldUseTextureFramebuffer(), SDL_VideoDevice::UpdateWindowFramebuffer, and SDL_VideoDevice::VideoInit.
Referenced by SDL_CreateWindow().
Shuts down the video subsystem.
This function closes all windows, and restores the original video mode.
Definition at line 2726 of file SDL_video.c.
References SDL_VideoDevice::clipboard_text, SDL_VideoDisplay::desktop_mode, SDL_VideoDisplay::display_modes, SDL_VideoDevice::displays, SDL_DisplayMode::driverdata, SDL_VideoDisplay::driverdata, SDL_VideoDevice::free, i, j, SDL_VideoDisplay::name, NULL, SDL_VideoDisplay::num_display_modes, SDL_VideoDevice::num_displays, SDL_DestroyWindow(), SDL_EnableScreenSaver(), SDL_free, SDL_INIT_EVENTS, SDL_KeyboardQuit(), SDL_MouseQuit(), SDL_QuitSubSystem, SDL_TouchQuit(), SDL_VideoDevice::VideoQuit, and SDL_VideoDevice::windows.
Referenced by SDL_VideoInit().
SDL_bool SDL_Vulkan_CreateSurface | ( | SDL_Window * | window, |
VkInstance | instance, | ||
VkSurfaceKHR * | surface | ||
) |
Create a Vulkan rendering surface for a window.
[in] | window | SDL_Window to which to attach the rendering surface. |
[in] | instance | handle to the Vulkan instance to use. |
[out] | surface | pointer to a VkSurfaceKHR handle to receive the handle of the newly created surface. |
SDL_TRUE
on success, SDL_FALSE
on error.SDL_WINDOW_VULKAN
flag.SDL_Vulkan_CreateSurface()
enabled.Definition at line 4042 of file SDL_video.c.
References CHECK_WINDOW_MAGIC, SDL_Window::flags, NOT_A_VULKAN_WINDOW, SDL_FALSE, SDL_InvalidParamError, SDL_SetError, SDL_WINDOW_VULKAN, and SDL_VideoDevice::Vulkan_CreateSurface.
void SDL_Vulkan_GetDrawableSize | ( | SDL_Window * | window, |
int * | w, | ||
int * | h | ||
) |
Get the size of a window's underlying drawable in pixels (for use with setting viewport, scissor & etc).
window | SDL_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.
Definition at line 4066 of file SDL_video.c.
References CHECK_WINDOW_MAGIC, SDL_GetWindowSize(), and SDL_VideoDevice::Vulkan_GetDrawableSize.
SDL_bool SDL_Vulkan_GetInstanceExtensions | ( | SDL_Window * | window, |
unsigned * | count, | ||
const char ** | names | ||
) |
Definition at line 4025 of file SDL_video.c.
References CHECK_WINDOW_MAGIC, SDL_Window::flags, NOT_A_VULKAN_WINDOW, SDL_FALSE, SDL_InvalidParamError, SDL_SetError, SDL_WINDOW_VULKAN, and SDL_VideoDevice::Vulkan_GetInstanceExtensions.
Get the address of the vkGetInstanceProcAddr
function.
Definition at line 3996 of file SDL_video.c.
References SDL_VideoDevice::loader_loaded, NULL, SDL_SetError, SDL_UninitializedVideo(), SDL_VideoDevice::vkGetInstanceProcAddr, and SDL_VideoDevice::vulkan_config.
int SDL_Vulkan_LoadLibrary | ( | const char * | path | ) |
Dynamically load a Vulkan loader library.
[in] | path | The platform dependent Vulkan loader library name, or NULL . |
0
on success, or -1
if the library couldn't be loaded.If path is NULL SDL will use the value of the environment variable SDL_VULKAN_LIBRARY
, if set, otherwise it loads the default Vulkan loader library.
This should be called after initializing the video driver, but before creating any Vulkan windows. If no Vulkan loader library is loaded, the default library will be loaded upon creation of the first Vulkan window.
path
, an application should retrieve all of the Vulkan functions it uses from the dynamic library using SDL_Vulkan_GetVkGetInstanceProcAddr()
unless you can guarantee path
points to the same vulkan loader library the application linked to.vulkan.framework/vulkan
, libvulkan.1.dylib
, MoltenVK.framework/MoltenVK
and libMoltenVK.dylib
in that order. On iOS SDL will attempt to load libMoltenVK.dylib
. Applications using a dynamic framework or .dylib must ensure it is included in its application bundle.Definition at line 3972 of file SDL_video.c.
References SDL_VideoDevice::loader_loaded, SDL_VideoDevice::loader_path, retval, SDL_SetError, SDL_strcmp, SDL_UninitializedVideo(), SDL_VideoDevice::vulkan_config, and SDL_VideoDevice::Vulkan_LoadLibrary.
Referenced by SDL_CreateWindow().
Unload the Vulkan loader library previously loaded by SDL_Vulkan_LoadLibrary()
.
Definition at line 4009 of file SDL_video.c.
References SDL_VideoDevice::loader_loaded, SDL_UninitializedVideo(), SDL_VideoDevice::vulkan_config, and SDL_VideoDevice::Vulkan_UnloadLibrary.
Referenced by SDL_DestroyWindow().
|
static |
Definition at line 2560 of file SDL_video.c.
References SDL_Window::flags, SDL_Window::is_destroying, SDL_VideoDevice::name, SDL_FALSE, SDL_GetHintBoolean, SDL_HINT_VIDEO_MINIMIZE_ON_FOCUS_LOSS, SDL_strcmp, SDL_TRUE, and SDL_WINDOW_FULLSCREEN.
Referenced by SDL_OnWindowFocusLost().
|
static |
Definition at line 169 of file SDL_video.c.
References APIENTRY, context, SDL_VideoDevice::CreateWindowFramebuffer, GL_VENDOR, SDL_VideoDevice::is_dummy, NULL, SDL_CreateWindow(), SDL_DestroyWindow(), SDL_FALSE, SDL_GetHint, SDL_GL_CreateContext(), SDL_GL_DeleteContext(), SDL_GL_GetProcAddress(), SDL_HINT_FRAMEBUFFER_ACCELERATION, SDL_HINT_RENDER_DRIVER, SDL_strcasecmp, SDL_strstr, SDL_TRUE, SDL_WINDOW_HIDDEN, and SDL_WINDOW_OPENGL.
Referenced by SDL_VideoInit().
|
static |
Definition at line 121 of file SDL_video.c.
Referenced by SDL_AddVideoDisplay(), SDL_GetClipboardText(), SDL_GetVideoDevice(), SDL_HasClipboardText(), SDL_PumpEvents(), SDL_SetClipboardText(), and videoInit().
|
static |
Definition at line 60 of file SDL_video.c.