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