7#include <SDL3/SDL_render.h>
8#include <SDL3/SDL_video.h>
9#include "SDL3pp_properties.h"
10#include "SDL3pp_rect.h"
11#include "SDL3pp_surface.h"
73 SDL_ORIENTATION_UNKNOWN;
86 SDL_ORIENTATION_LANDSCAPE_FLIPPED;
89 SDL_ORIENTATION_PORTRAIT;
92 SDL_ORIENTATION_PORTRAIT_FLIPPED;
141 SDL_WINDOW_FULLSCREEN;
157 SDL_WINDOW_BORDERLESS;
160 SDL_WINDOW_RESIZABLE;
163 SDL_WINDOW_MINIMIZED;
166 SDL_WINDOW_MAXIMIZED;
169 SDL_WINDOW_MOUSE_GRABBED;
172 SDL_WINDOW_INPUT_FOCUS;
175 SDL_WINDOW_MOUSE_FOCUS;
193 SDL_WINDOW_MOUSE_RELATIVE_MODE;
196 SDL_WINDOW_ALWAYS_ON_TOP;
216 SDL_WINDOW_KEYBOARD_GRABBED;
225 SDL_WINDOW_TRANSPARENT;
228 SDL_WINDOW_NOT_FOCUSABLE;
254 SDL_FLASH_UNTIL_FOCUSED;
281 SDL_HITTEST_DRAGGABLE;
284 SDL_HITTEST_RESIZE_TOPLEFT;
288 SDL_HITTEST_RESIZE_TOP;
291 SDL_HITTEST_RESIZE_TOPRIGHT;
295 SDL_HITTEST_RESIZE_RIGHT;
301 SDL_HITTEST_RESIZE_BOTTOMRIGHT;
304 SDL_HITTEST_RESIZE_BOTTOM;
307 SDL_HITTEST_RESIZE_BOTTOMLEFT;
311 SDL_HITTEST_RESIZE_LEFT;
377 SDL_DisplayID m_displayID;
385 constexpr Display(SDL_DisplayID displayID = {})
386 : m_displayID(displayID)
408 constexpr operator SDL_DisplayID()
const {
return m_displayID; }
415 constexpr explicit operator bool()
const {
return m_displayID != 0; }
431 auto data =
reinterpret_cast<Display*
>(SDL_GetDisplays(&count));
476 return CheckError(SDL_GetDisplayProperties(m_displayID));
491 const char*
GetName()
const {
return SDL_GetDisplayName(m_displayID); }
512 SDL_GetDisplayBounds(m_displayID, &bounds);
541 CheckError(SDL_GetDisplayUsableBounds(m_displayID, &bounds));
559 return SDL_GetNaturalDisplayOrientation(m_displayID);
576 return SDL_GetCurrentDisplayOrientation(m_displayID);
605 return SDL_GetDisplayContentScale(m_displayID);
634 auto data =
CheckError(SDL_GetFullscreenDisplayModes(m_displayID, &count));
668 bool include_high_density_modes)
const
670 SDL_DisplayMode closest;
671 CheckError(SDL_GetClosestFullscreenDisplayMode(
672 m_displayID, w, h, refresh_rate, include_high_density_modes, &closest));
696 return CheckError(SDL_GetDesktopDisplayMode(m_displayID));
719 return SDL_GetCurrentDisplayMode(m_displayID);
738 return {SDL_GetDisplayForPoint(&point)};
758 return SDL_GetDisplayForRect(&rect);
782namespace prop::Global {
797constexpr auto VIDEO_WAYLAND_WL_DISPLAY_POINTER =
798 SDL_PROP_GLOBAL_VIDEO_WAYLAND_WL_DISPLAY_POINTER;
815 SDL_SYSTEM_THEME_UNKNOWN;
818 SDL_SYSTEM_THEME_LIGHT;
821 SDL_SYSTEM_THEME_DARK;
1236 return SDL_GetWindowFullscreenMode(
get());
1770 CheckError(SDL_SetWindowAspectRatio(
get(), min_aspect, max_aspect));
1790 CheckError(SDL_GetWindowAspectRatio(
get(), min_aspect, max_aspect));
1827 CheckError(SDL_GetWindowBordersSize(
get(), top, left, bottom, right));
2343 CheckError(SDL_UpdateWindowSurfaceRects(
get(), rects.data(), rects.size()));
2697 CheckError(SDL_SetWindowHitTest(
get(), callback, callback_data));
2825 void reset(SDL_Window* newResource = {})
2827 SDL_DestroyWindow(
release(newResource));
2878 constexpr explicit Window(SDL_Window* resource = {})
2883 constexpr Window(
const Window& other) =
delete;
2915#define SDL_WINDOWPOS_UNDEFINED_MASK 0x1FFF0000u
2927#define SDL_WINDOWPOS_UNDEFINED_DISPLAY(X) (SDL_WINDOWPOS_UNDEFINED_MASK | (X))
2936#define SDL_WINDOWPOS_UNDEFINED SDL_WINDOWPOS_UNDEFINED_DISPLAY(0)
2945#define SDL_WINDOWPOS_ISUNDEFINED(X) \
2946 (((X) & 0xFFFF0000) == SDL_WINDOWPOS_UNDEFINED_MASK)
2956#define SDL_WINDOWPOS_CENTERED_MASK 0x2FFF0000u
2968#define SDL_WINDOWPOS_CENTERED_DISPLAY(X) (SDL_WINDOWPOS_CENTERED_MASK | (X))
2977#define SDL_WINDOWPOS_CENTERED SDL_WINDOWPOS_CENTERED_DISPLAY(0)
2986#define SDL_WINDOWPOS_ISCENTERED(X) \
2987 (((X) & 0xFFFF0000) == SDL_WINDOWPOS_CENTERED_MASK)
3108 bool reset(SDL_GLContextState* newResource = {})
3110 return SDL_GL_DestroyContext(
release(newResource));
3129 constexpr explicit GLContext(SDL_GLContextState* resource = {})
3134 constexpr GLContext(
const GLContext& other) =
delete;
3417 SDL_GL_RETAINED_BACKING;
3420 SDL_GL_CONTEXT_MAJOR_VERSION;
3423 SDL_GL_CONTEXT_MINOR_VERSION;
3438 SDL_GL_SHARE_WITH_CURRENT_CONTEXT;
3441 SDL_GL_FRAMEBUFFER_SRGB_CAPABLE;
3455 SDL_GL_CONTEXT_RESET_NOTIFICATION;
3458 SDL_GL_CONTEXT_NO_ERROR;
3479 SDL_GL_CONTEXT_PROFILE_CORE;
3482 SDL_GL_CONTEXT_PROFILE_COMPATIBILITY;
3486 SDL_GL_CONTEXT_PROFILE_ES;
3503 SDL_GL_CONTEXT_DEBUG_FLAG;
3506 SDL_GL_CONTEXT_FORWARD_COMPATIBLE_FLAG;
3509 SDL_GL_CONTEXT_ROBUST_ACCESS_FLAG;
3512 SDL_GL_CONTEXT_RESET_ISOLATION_FLAG;
3530 SDL_GL_CONTEXT_RELEASE_BEHAVIOR_NONE;
3533 SDL_GL_CONTEXT_RELEASE_BEHAVIOR_FLUSH;
3550 SDL_GL_CONTEXT_RESET_NO_NOTIFICATION;
3553 SDL_GL_CONTEXT_RESET_LOSE_CONTEXT;
3591 return SDL_GetVideoDriver(index);
3613 return SDL_GetCurrentVideoDriver();
3627namespace prop::Display {
3629constexpr auto HDR_ENABLED_BOOLEAN = SDL_PROP_DISPLAY_HDR_ENABLED_BOOLEAN;
3631constexpr auto KMSDRM_PANEL_ORIENTATION_NUMBER =
3632 SDL_PROP_DISPLAY_KMSDRM_PANEL_ORIENTATION_NUMBER;
3653namespace prop::Window {
3655constexpr auto CREATE_ALWAYS_ON_TOP_BOOLEAN =
3656 SDL_PROP_WINDOW_CREATE_ALWAYS_ON_TOP_BOOLEAN;
3658constexpr auto CREATE_BORDERLESS_BOOLEAN =
3659 SDL_PROP_WINDOW_CREATE_BORDERLESS_BOOLEAN;
3661constexpr auto CREATE_FOCUSABLE_BOOLEAN =
3662 SDL_PROP_WINDOW_CREATE_FOCUSABLE_BOOLEAN;
3664constexpr auto CREATE_EXTERNAL_GRAPHICS_CONTEXT_BOOLEAN =
3665 SDL_PROP_WINDOW_CREATE_EXTERNAL_GRAPHICS_CONTEXT_BOOLEAN;
3667constexpr auto CREATE_FLAGS_NUMBER = SDL_PROP_WINDOW_CREATE_FLAGS_NUMBER;
3669constexpr auto CREATE_FULLSCREEN_BOOLEAN =
3670 SDL_PROP_WINDOW_CREATE_FULLSCREEN_BOOLEAN;
3672constexpr auto CREATE_HEIGHT_NUMBER = SDL_PROP_WINDOW_CREATE_HEIGHT_NUMBER;
3674constexpr auto CREATE_HIDDEN_BOOLEAN = SDL_PROP_WINDOW_CREATE_HIDDEN_BOOLEAN;
3676constexpr auto CREATE_HIGH_PIXEL_DENSITY_BOOLEAN =
3677 SDL_PROP_WINDOW_CREATE_HIGH_PIXEL_DENSITY_BOOLEAN;
3679constexpr auto CREATE_MAXIMIZED_BOOLEAN =
3680 SDL_PROP_WINDOW_CREATE_MAXIMIZED_BOOLEAN;
3682constexpr auto CREATE_MENU_BOOLEAN = SDL_PROP_WINDOW_CREATE_MENU_BOOLEAN;
3684constexpr auto CREATE_METAL_BOOLEAN = SDL_PROP_WINDOW_CREATE_METAL_BOOLEAN;
3686constexpr auto CREATE_MINIMIZED_BOOLEAN =
3687 SDL_PROP_WINDOW_CREATE_MINIMIZED_BOOLEAN;
3689constexpr auto CREATE_MODAL_BOOLEAN = SDL_PROP_WINDOW_CREATE_MODAL_BOOLEAN;
3691constexpr auto CREATE_MOUSE_GRABBED_BOOLEAN =
3692 SDL_PROP_WINDOW_CREATE_MOUSE_GRABBED_BOOLEAN;
3694constexpr auto CREATE_OPENGL_BOOLEAN = SDL_PROP_WINDOW_CREATE_OPENGL_BOOLEAN;
3696constexpr auto CREATE_PARENT_POINTER = SDL_PROP_WINDOW_CREATE_PARENT_POINTER;
3698constexpr auto CREATE_RESIZABLE_BOOLEAN =
3699 SDL_PROP_WINDOW_CREATE_RESIZABLE_BOOLEAN;
3701constexpr auto CREATE_TITLE_STRING = SDL_PROP_WINDOW_CREATE_TITLE_STRING;
3703constexpr auto CREATE_TRANSPARENT_BOOLEAN =
3704 SDL_PROP_WINDOW_CREATE_TRANSPARENT_BOOLEAN;
3706constexpr auto CREATE_TOOLTIP_BOOLEAN = SDL_PROP_WINDOW_CREATE_TOOLTIP_BOOLEAN;
3708constexpr auto CREATE_UTILITY_BOOLEAN = SDL_PROP_WINDOW_CREATE_UTILITY_BOOLEAN;
3710constexpr auto CREATE_VULKAN_BOOLEAN = SDL_PROP_WINDOW_CREATE_VULKAN_BOOLEAN;
3712constexpr auto CREATE_WIDTH_NUMBER = SDL_PROP_WINDOW_CREATE_WIDTH_NUMBER;
3714constexpr auto CREATE_X_NUMBER = SDL_PROP_WINDOW_CREATE_X_NUMBER;
3716constexpr auto CREATE_Y_NUMBER = SDL_PROP_WINDOW_CREATE_Y_NUMBER;
3718constexpr auto CREATE_COCOA_WINDOW_POINTER =
3719 SDL_PROP_WINDOW_CREATE_COCOA_WINDOW_POINTER;
3721constexpr auto CREATE_COCOA_VIEW_POINTER =
3722 SDL_PROP_WINDOW_CREATE_COCOA_VIEW_POINTER;
3724constexpr auto CREATE_WAYLAND_SURFACE_ROLE_CUSTOM_BOOLEAN =
3725 SDL_PROP_WINDOW_CREATE_WAYLAND_SURFACE_ROLE_CUSTOM_BOOLEAN;
3727constexpr auto CREATE_WAYLAND_CREATE_EGL_WINDOW_BOOLEAN =
3728 SDL_PROP_WINDOW_CREATE_WAYLAND_CREATE_EGL_WINDOW_BOOLEAN;
3730constexpr auto CREATE_WAYLAND_WL_SURFACE_POINTER =
3731 SDL_PROP_WINDOW_CREATE_WAYLAND_WL_SURFACE_POINTER;
3733constexpr auto CREATE_WIN32_HWND_POINTER =
3734 SDL_PROP_WINDOW_CREATE_WIN32_HWND_POINTER;
3736constexpr auto CREATE_WIN32_PIXEL_FORMAT_HWND_POINTER =
3737 SDL_PROP_WINDOW_CREATE_WIN32_PIXEL_FORMAT_HWND_POINTER;
3739constexpr auto CREATE_X11_WINDOW_NUMBER =
3740 SDL_PROP_WINDOW_CREATE_X11_WINDOW_NUMBER;
3742constexpr auto SHAPE_POINTER = SDL_PROP_WINDOW_SHAPE_POINTER;
3744constexpr auto HDR_ENABLED_BOOLEAN = SDL_PROP_WINDOW_HDR_ENABLED_BOOLEAN;
3746constexpr auto SDR_WHITE_LEVEL_FLOAT = SDL_PROP_WINDOW_SDR_WHITE_LEVEL_FLOAT;
3748constexpr auto HDR_HEADROOM_FLOAT = SDL_PROP_WINDOW_HDR_HEADROOM_FLOAT;
3750constexpr auto ANDROID_WINDOW_POINTER = SDL_PROP_WINDOW_ANDROID_WINDOW_POINTER;
3752constexpr auto ANDROID_SURFACE_POINTER =
3753 SDL_PROP_WINDOW_ANDROID_SURFACE_POINTER;
3755constexpr auto UIKIT_WINDOW_POINTER = SDL_PROP_WINDOW_UIKIT_WINDOW_POINTER;
3757constexpr auto UIKIT_METAL_VIEW_TAG_NUMBER =
3758 SDL_PROP_WINDOW_UIKIT_METAL_VIEW_TAG_NUMBER;
3760constexpr auto UIKIT_OPENGL_FRAMEBUFFER_NUMBER =
3761 SDL_PROP_WINDOW_UIKIT_OPENGL_FRAMEBUFFER_NUMBER;
3763constexpr auto UIKIT_OPENGL_RENDERBUFFER_NUMBER =
3764 SDL_PROP_WINDOW_UIKIT_OPENGL_RENDERBUFFER_NUMBER;
3766constexpr auto UIKIT_OPENGL_RESOLVE_FRAMEBUFFER_NUMBER =
3767 SDL_PROP_WINDOW_UIKIT_OPENGL_RESOLVE_FRAMEBUFFER_NUMBER;
3769constexpr auto KMSDRM_DEVICE_INDEX_NUMBER =
3770 SDL_PROP_WINDOW_KMSDRM_DEVICE_INDEX_NUMBER;
3772constexpr auto KMSDRM_DRM_FD_NUMBER = SDL_PROP_WINDOW_KMSDRM_DRM_FD_NUMBER;
3774constexpr auto KMSDRM_GBM_DEVICE_POINTER =
3775 SDL_PROP_WINDOW_KMSDRM_GBM_DEVICE_POINTER;
3777constexpr auto COCOA_WINDOW_POINTER = SDL_PROP_WINDOW_COCOA_WINDOW_POINTER;
3779constexpr auto COCOA_METAL_VIEW_TAG_NUMBER =
3780 SDL_PROP_WINDOW_COCOA_METAL_VIEW_TAG_NUMBER;
3782constexpr auto OPENVR_OVERLAY_ID = SDL_PROP_WINDOW_OPENVR_OVERLAY_ID;
3784constexpr auto VIVANTE_DISPLAY_POINTER =
3785 SDL_PROP_WINDOW_VIVANTE_DISPLAY_POINTER;
3787constexpr auto VIVANTE_WINDOW_POINTER = SDL_PROP_WINDOW_VIVANTE_WINDOW_POINTER;
3789constexpr auto VIVANTE_SURFACE_POINTER =
3790 SDL_PROP_WINDOW_VIVANTE_SURFACE_POINTER;
3792constexpr auto WIN32_HWND_POINTER = SDL_PROP_WINDOW_WIN32_HWND_POINTER;
3794constexpr auto WIN32_HDC_POINTER = SDL_PROP_WINDOW_WIN32_HDC_POINTER;
3796constexpr auto WIN32_INSTANCE_POINTER = SDL_PROP_WINDOW_WIN32_INSTANCE_POINTER;
3798constexpr auto WAYLAND_DISPLAY_POINTER =
3799 SDL_PROP_WINDOW_WAYLAND_DISPLAY_POINTER;
3801constexpr auto WAYLAND_SURFACE_POINTER =
3802 SDL_PROP_WINDOW_WAYLAND_SURFACE_POINTER;
3804constexpr auto WAYLAND_VIEWPORT_POINTER =
3805 SDL_PROP_WINDOW_WAYLAND_VIEWPORT_POINTER;
3807constexpr auto WAYLAND_EGL_WINDOW_POINTER =
3808 SDL_PROP_WINDOW_WAYLAND_EGL_WINDOW_POINTER;
3810constexpr auto WAYLAND_XDG_SURFACE_POINTER =
3811 SDL_PROP_WINDOW_WAYLAND_XDG_SURFACE_POINTER;
3813constexpr auto WAYLAND_XDG_TOPLEVEL_POINTER =
3814 SDL_PROP_WINDOW_WAYLAND_XDG_TOPLEVEL_POINTER;
3816constexpr auto WAYLAND_XDG_TOPLEVEL_EXPORT_HANDLE_STRING =
3817 SDL_PROP_WINDOW_WAYLAND_XDG_TOPLEVEL_EXPORT_HANDLE_STRING;
3819constexpr auto WAYLAND_XDG_POPUP_POINTER =
3820 SDL_PROP_WINDOW_WAYLAND_XDG_POPUP_POINTER;
3822constexpr auto WAYLAND_XDG_POSITIONER_POINTER =
3823 SDL_PROP_WINDOW_WAYLAND_XDG_POSITIONER_POINTER;
3825constexpr auto X11_DISPLAY_POINTER = SDL_PROP_WINDOW_X11_DISPLAY_POINTER;
3827constexpr auto X11_SCREEN_NUMBER = SDL_PROP_WINDOW_X11_SCREEN_NUMBER;
3829constexpr auto X11_WINDOW_NUMBER = SDL_PROP_WINDOW_X11_WINDOW_NUMBER;
3835 return SDL_GetWindowFromID(
id);
3840 return SDL_GetWindowParent(
get());
3846#define SDL_WINDOW_SURFACE_VSYNC_DISABLED 0
3849#define SDL_WINDOW_SURFACE_VSYNC_ADAPTIVE (-1)
3988 return SDL_GL_GetProcAddress(proc);
4010 return SDL_EGL_GetProcAddress(proc);
4047 return SDL_GL_ExtensionSupported(extension);
4084 CheckError(SDL_GL_SetAttribute(attr, value));
4104 CheckError(SDL_GL_GetAttribute(attr, value));
4119 return CheckError(SDL_GL_GetCurrentWindow());
4136 return CheckError(SDL_GL_GetCurrentContext());
4151 return CheckError(SDL_EGL_GetCurrentDisplay());
4166 return CheckError(SDL_EGL_GetCurrentConfig());
4211 SDL_EGL_SetAttributeCallbacks(platformAttribCallback,
4212 surfaceAttribCallback,
4213 contextAttribCallback,
4247 CheckError(SDL_GL_SetSwapInterval(interval));
4270 CheckError(SDL_GL_GetSwapInterval(interval));
4302 void* cbHandle = Wrapper::Wrap(
get(), std::move(callback));
4304 [](SDL_Window* win,
const SDL_Point* area,
void* data) {
4310#pragma endregion impl
This is a unique ID for a display for the time it is connected to the system, and is never reused for...
Definition SDL3pp_video.h:376
Rect GetBounds() const
Get the desktop area represented by a display.
Definition SDL3pp_video.h:509
const DisplayMode * GetDesktopMode() const
Get information about the desktop's display mode.
Definition SDL3pp_video.h:694
OwnArray< DisplayMode * > GetFullscreenModes() const
Get a list of fullscreen display modes available on a display.
Definition SDL3pp_video.h:631
static Display GetForPoint(const SDL_Point &point)
Get the display containing a point.
Definition SDL3pp_video.h:736
static Display GetForRect(const SDL_Rect &rect)
Get the display primarily containing a rect.
Definition SDL3pp_video.h:756
static Display GetForWindow(WindowBase &window)
Get the display associated with a window.
PropertiesRef GetProperties() const
Get the properties associated with a display.
Definition SDL3pp_video.h:474
DisplayMode GetClosestFullscreenMode(int w, int h, float refresh_rate, bool include_high_density_modes) const
Get the closest match to the requested display mode.
Definition SDL3pp_video.h:665
float GetContentScale() const
Get the content scale of a display.
Definition SDL3pp_video.h:603
constexpr bool operator==(const Display &other) const =default
Default comparison operator.
const char * GetName() const
Get the name of a display in UTF-8 encoding.
Definition SDL3pp_video.h:491
DisplayOrientation GetNaturalOrientation() const
Get the orientation of a display when it is unrotated.
Definition SDL3pp_video.h:557
static Display GetPrimary()
Return the primary display.
Definition SDL3pp_video.h:447
DisplayOrientation GetCurrentOrientation() const
Get the orientation of a display.
Definition SDL3pp_video.h:574
static OwnArray< Display > GetAll()
Get a list of currently connected displays.
Definition SDL3pp_video.h:428
const DisplayMode * GetCurrentMode() const
Get information about the current display mode.
Definition SDL3pp_video.h:717
Rect GetUsableBounds() const
Get the usable desktop area represented by a display, in screen coordinates.
Definition SDL3pp_video.h:538
constexpr bool operator==(SDL_DisplayID displayID) const
Compares with the underlying type.
Definition SDL3pp_video.h:398
constexpr Display(SDL_DisplayID displayID={})
Wraps Display.
Definition SDL3pp_video.h:385
Optional-like shim for references.
Definition SDL3pp_optionalRef.h:20
A optional reference to resource.
Definition SDL3pp_resource.h:88
Base class for SDL memory allocated array wrap.
Definition SDL3pp_ownPtr.h:43
A SDL managed resource.
Definition SDL3pp_resource.h:17
constexpr SDL_Window * release(SDL_Window * newResource={})
Return contained resource and empties or replace value.
Definition SDL3pp_resource.h:60
constexpr Resource(T resource={})
Constructs the underlying resource.
Definition SDL3pp_resource.h:22
constexpr SDL_Window * get() const
Return contained resource;.
Definition SDL3pp_resource.h:57
span-like for empty-derived structs
Definition SDL3pp_spanRef.h:24
Helpers to use C++ strings parameters.
Definition SDL3pp_strings.h:43
#define SDL_assert_paranoid(condition)
An assertion test that is performed only when built with paranoid settings.
Definition SDL3pp_assert.h:374
constexpr void CheckError(bool result)
Check and throw if returned value from SDL is an error.
Definition SDL3pp_error.h:206
void GetTextInputArea(Rect *rect, int *cursor)
Get the area used to type Unicode text input.
Definition SDL3pp_keyboard.h:609
void StopTextInput()
Stop receiving any text input events in a window.
Definition SDL3pp_keyboard.h:546
bool IsScreenKeyboardShown() const
Check whether the screen keyboard is shown for given window.
Definition SDL3pp_keyboard.h:643
bool IsTextInputActive() const
Check whether or not Unicode text input events are enabled for a window.
Definition SDL3pp_keyboard.h:527
void StartTextInput()
Start accepting Unicode text input events in a window.
Definition SDL3pp_keyboard.h:373
void SetTextInputArea(const SDL_Rect &rect, int cursor)
Set the area used to type Unicode text input.
Definition SDL3pp_keyboard.h:587
void ClearComposition()
Dismiss the composition window/IME without disabling the subsystem.
Definition SDL3pp_keyboard.h:563
void WarpMouse(float x, float y)
Move the mouse cursor to the given position within the window.
Definition SDL3pp_mouse.h:657
bool GetRelativeMouseMode() const
Query whether relative mouse mode is enabled for a window.
Definition SDL3pp_mouse.h:728
void SetRelativeMouseMode(bool enabled)
Set relative mouse mode for a window.
Definition SDL3pp_mouse.h:712
std::unique_ptr< T, PtrDeleter > OwnPtr
Handle to an owned SDL memory allocated pointer.
Definition SDL3pp_ownPtr.h:32
RendererRef GetRenderer() const
Get the renderer associated with a window.
Definition SDL3pp_render.h:3226
SDL_FunctionPointer FunctionPointer
A generic function pointer.
Definition SDL3pp_stdinc.h:5484
void DisableScreenSaver()
Prevent the screen from being blanked by a screen saver.
Definition SDL3pp_video.h:3905
constexpr GLContextFlag GL_CONTEXT_RESET_ISOLATION_FLAG
RESET_ISOLATION_FLAG.
Definition SDL3pp_video.h:3511
SDL_DisplayOrientation DisplayOrientation
Display orientation values; the way a display is rotated.
Definition SDL3pp_video.h:70
constexpr GLAttr GL_CONTEXT_RELEASE_BEHAVIOR
sets context the release behavior.
Definition SDL3pp_video.h:3448
void GL_SetSwapInterval(int interval)
Set the swap interval for the current OpenGL context.
Definition SDL3pp_video.h:4245
constexpr HitTestResult HITTEST_DRAGGABLE
Region can drag entire window.
Definition SDL3pp_video.h:280
constexpr HitTestResult HITTEST_RESIZE_BOTTOMLEFT
Region is the resizable bottom-left corner border.
Definition SDL3pp_video.h:306
SDL_GLAttr GLAttr
An enumeration of OpenGL configuration attributes.
Definition SDL3pp_video.h:3325
SDL_WindowFlags WindowFlags
The flags on a window.
Definition SDL3pp_video.h:138
constexpr FlashOperation FLASH_CANCEL
Cancel any window flash state.
Definition SDL3pp_video.h:247
constexpr SystemTheme SYSTEM_THEME_LIGHT
Light colored system theme.
Definition SDL3pp_video.h:817
constexpr WindowFlags WINDOW_MAXIMIZED
window is maximized
Definition SDL3pp_video.h:165
void EnableScreenSaver()
Allow the screen to be blanked by a screen saver.
Definition SDL3pp_video.h:3885
void GL_GetSwapInterval(int *interval)
Get the swap interval for the current OpenGL context.
Definition SDL3pp_video.h:4268
constexpr GLAttr GL_FRAMEBUFFER_SRGB_CAPABLE
requests sRGB capable visual; defaults to 0.
Definition SDL3pp_video.h:3440
constexpr GLAttr GL_MULTISAMPLESAMPLES
the number of samples used around the current pixel used for multisample anti-aliasing.
Definition SDL3pp_video.h:3408
constexpr SystemTheme SYSTEM_THEME_DARK
Dark colored system theme.
Definition SDL3pp_video.h:820
constexpr WindowFlags WINDOW_UTILITY
window should be treated as a utility window, not showing in the task bar and window list
Definition SDL3pp_video.h:202
constexpr WindowFlags WINDOW_MOUSE_FOCUS
window has mouse focus
Definition SDL3pp_video.h:174
constexpr GLAttr GL_STENCIL_SIZE
the minimum number of bits in the stencil buffer; defaults to 0.
Definition SDL3pp_video.h:3370
Uint32 GLContextReleaseFlag
Possible values to be set for the GL_CONTEXT_RELEASE_BEHAVIOR attribute.
Definition SDL3pp_video.h:3527
constexpr WindowFlags WINDOW_TRANSPARENT
window with transparent buffer
Definition SDL3pp_video.h:224
FunctionPointer EGL_GetProcAddress(StringParam proc)
Get an EGL library function by name.
Definition SDL3pp_video.h:4008
constexpr GLProfile GL_CONTEXT_PROFILE_CORE
OpenGL Core Profile context.
Definition SDL3pp_video.h:3478
constexpr DisplayOrientation ORIENTATION_UNKNOWN
The display orientation can't be determined.
Definition SDL3pp_video.h:72
SDL_HitTest HitTest
Callback used for hit-testing.
Definition SDL3pp_video.h:330
constexpr HitTestResult HITTEST_RESIZE_TOPRIGHT
Region is the resizable top-right corner border.
Definition SDL3pp_video.h:290
constexpr GLAttr GL_CONTEXT_MAJOR_VERSION
OpenGL context major version.
Definition SDL3pp_video.h:3419
constexpr HitTestResult HITTEST_NORMAL
Region is normal. No special properties.
Definition SDL3pp_video.h:277
constexpr GLContextFlag GL_CONTEXT_FORWARD_COMPATIBLE_FLAG
FORWARD_COMPATIBLE_FLAG.
Definition SDL3pp_video.h:3505
WindowRef GL_GetCurrentWindow()
Get the currently active OpenGL window.
Definition SDL3pp_video.h:4117
constexpr GLAttr GL_RETAINED_BACKING
not used (deprecated).
Definition SDL3pp_video.h:3416
constexpr HitTestResult HITTEST_RESIZE_RIGHT
Region is the resizable right border.
Definition SDL3pp_video.h:294
constexpr FlashOperation FLASH_BRIEFLY
Flash the window briefly to get attention.
Definition SDL3pp_video.h:250
void GL_UnloadLibrary()
Unload the OpenGL library previously loaded by GL_LoadLibrary().
Definition SDL3pp_video.h:4022
constexpr GLAttr GL_STEREO
whether the output is stereo 3D; defaults to off.
Definition SDL3pp_video.h:3396
constexpr GLAttr GL_CONTEXT_MINOR_VERSION
OpenGL context minor version.
Definition SDL3pp_video.h:3422
constexpr GLAttr GL_CONTEXT_PROFILE_MASK
type of GL context (Core, Compatibility, ES).
Definition SDL3pp_video.h:3435
constexpr GLAttr GL_RED_SIZE
the minimum number of bits for the red channel of the color buffer; defaults to 8.
Definition SDL3pp_video.h:3331
constexpr WindowFlags WINDOW_MOUSE_GRABBED
window has grabbed mouse input
Definition SDL3pp_video.h:168
bool ScreenSaverEnabled()
Check whether the screensaver is currently enabled.
Definition SDL3pp_video.h:3871
GLContextRef GL_GetCurrentContext()
Get the currently active OpenGL context.
Definition SDL3pp_video.h:4134
constexpr GLAttr GL_GREEN_SIZE
the minimum number of bits for the green channel of the color buffer; defaults to 8.
Definition SDL3pp_video.h:3337
FunctionPointer GL_GetProcAddress(StringParam proc)
Get an OpenGL function by name.
Definition SDL3pp_video.h:3986
SDL_EGLAttribArrayCallback EGLAttribArrayCallback
EGL platform attribute initialization callback.
Definition SDL3pp_video.h:3214
constexpr GLAttr GL_CONTEXT_RESET_NOTIFICATION
set context reset notification.
Definition SDL3pp_video.h:3454
constexpr GLProfile GL_CONTEXT_PROFILE_COMPATIBILITY
OpenGL Compatibility Profile context.
Definition SDL3pp_video.h:3481
SDL_DisplayMode DisplayMode
The structure that defines a display mode.
Definition SDL3pp_video.h:119
void EGL_SetAttributeCallbacks(EGLAttribArrayCallback platformAttribCallback, EGLIntArrayCallback surfaceAttribCallback, EGLIntArrayCallback contextAttribCallback, void *userdata)
Sets the callbacks for defining custom EGLAttrib arrays for EGL initialization.
Definition SDL3pp_video.h:4205
SDL_HitTestResult HitTestResult
Possible return values from the HitTest callback.
Definition SDL3pp_video.h:275
constexpr WindowFlags WINDOW_METAL
window usable for Metal view
Definition SDL3pp_video.h:221
constexpr WindowFlags WINDOW_MINIMIZED
window is minimized
Definition SDL3pp_video.h:162
constexpr GLAttr GL_ACCUM_ALPHA_SIZE
the minimum number of bits for the alpha channel of the accumulation buffer; defaults to 0.
Definition SDL3pp_video.h:3394
constexpr DisplayOrientation ORIENTATION_PORTRAIT
The display is in portrait mode.
Definition SDL3pp_video.h:88
constexpr GLAttr GL_ACCUM_RED_SIZE
the minimum number of bits for the red channel of the accumulation buffer; defaults to 0.
Definition SDL3pp_video.h:3376
SDL_SystemTheme SystemTheme
System theme.
Definition SDL3pp_video.h:812
constexpr WindowFlags WINDOW_HIGH_PIXEL_DENSITY
window uses high pixel density back buffer if possible
Definition SDL3pp_video.h:185
constexpr GLAttr GL_CONTEXT_FLAGS
some combination of 0 or more of elements of the GLContextFlag enumeration; defaults to 0.
Definition SDL3pp_video.h:3429
constexpr GLProfile GL_CONTEXT_PROFILE_ES
GLX_CONTEXT_ES2_PROFILE_BIT_EXT.
Definition SDL3pp_video.h:3485
constexpr GLAttr GL_DOUBLEBUFFER
whether the output is single or double buffered; defaults to double buffering on.
Definition SDL3pp_video.h:3360
SDL_DisplayModeData DisplayModeData
Internal display mode data.
Definition SDL3pp_video.h:106
constexpr HitTestResult HITTEST_RESIZE_LEFT
Region is the resizable left border.
Definition SDL3pp_video.h:310
void GL_GetAttribute(GLAttr attr, int *value)
Get the actual value for an attribute from the current context.
Definition SDL3pp_video.h:4102
void GL_SetAttribute(GLAttr attr, int value)
Set an OpenGL window attribute before window creation.
Definition SDL3pp_video.h:4082
const char * GetCurrentVideoDriver()
Get the name of the currently initialized video driver.
Definition SDL3pp_video.h:3611
constexpr GLAttr GL_MULTISAMPLEBUFFERS
the number of buffers used for multisample anti-aliasing; defaults to 0.
Definition SDL3pp_video.h:3402
constexpr GLAttr GL_ALPHA_SIZE
the minimum number of bits for the alpha channel of the color buffer; defaults to 8.
Definition SDL3pp_video.h:3349
constexpr WindowFlags WINDOW_MODAL
window is modal
Definition SDL3pp_video.h:180
int GetNumVideoDrivers()
Get the number of video drivers compiled into SDL.
Definition SDL3pp_video.h:3568
bool GL_ExtensionSupported(StringParam extension)
Check if an OpenGL extension is supported for the current context.
Definition SDL3pp_video.h:4045
constexpr WindowFlags WINDOW_INPUT_FOCUS
window has input focus
Definition SDL3pp_video.h:171
constexpr GLAttr GL_ACCUM_GREEN_SIZE
the minimum number of bits for the green channel of the accumulation buffer; defaults to 0.
Definition SDL3pp_video.h:3382
constexpr GLContextFlag GL_CONTEXT_DEBUG_FLAG
DEBUG_FLAG.
Definition SDL3pp_video.h:3502
Uint32 GLContextFlag
Possible flags to be set for the GL_CONTEXT_FLAGS attribute.
Definition SDL3pp_video.h:3500
SDL_WindowID WindowID
This is a unique ID for a window.
Definition SDL3pp_video.h:780
static WindowRef FromID(WindowID id)
Get a window from a stored ID.
Definition SDL3pp_video.h:3833
constexpr HitTestResult HITTEST_RESIZE_TOP
Region is the resizable top border.
Definition SDL3pp_video.h:287
const char * GetVideoDriver(int index)
Get the name of a built in video driver.
Definition SDL3pp_video.h:3589
SDL_EGLSurface EGLSurface
Opaque type for an EGL surface.
Definition SDL3pp_video.h:3175
SDL_FlashOperation FlashOperation
Window flash operation.
Definition SDL3pp_video.h:245
constexpr WindowFlags WINDOW_VULKAN
window usable for Vulkan surface
Definition SDL3pp_video.h:218
constexpr HitTestResult HITTEST_RESIZE_TOPLEFT
Region is the resizable top-left corner border.
Definition SDL3pp_video.h:283
constexpr HitTestResult HITTEST_RESIZE_BOTTOMRIGHT
Region is the resizable bottom-right corner border.
Definition SDL3pp_video.h:300
SDL_EGLConfig EGLConfig
Opaque type for an EGL config.
Definition SDL3pp_video.h:3168
constexpr SystemTheme SYSTEM_THEME_UNKNOWN
Unknown system theme.
Definition SDL3pp_video.h:814
constexpr WindowFlags WINDOW_KEYBOARD_GRABBED
window has grabbed keyboard input
Definition SDL3pp_video.h:215
constexpr GLAttr GL_BLUE_SIZE
the minimum number of bits for the blue channel of the color buffer; defaults to 8.
Definition SDL3pp_video.h:3343
constexpr GLAttr GL_EGL_PLATFORM
GL_EGL_PLATFORM.
Definition SDL3pp_video.h:3462
WindowRef GetParent() const
Get parent of a window.
Definition SDL3pp_video.h:3838
constexpr WindowFlags WINDOW_BORDERLESS
no window decoration
Definition SDL3pp_video.h:156
SDL_EGLDisplay EGLDisplay
Opaque type for an EGL display.
Definition SDL3pp_video.h:3161
constexpr WindowFlags WINDOW_TOOLTIP
window should be treated as a tooltip and does not get mouse or keyboard focus, requires a parent win...
Definition SDL3pp_video.h:208
constexpr WindowFlags WINDOW_MOUSE_CAPTURE
window has mouse captured (unrelated to MOUSE_GRABBED)
Definition SDL3pp_video.h:190
constexpr GLAttr GL_BUFFER_SIZE
the minimum number of bits for frame buffer size; defaults to 0.
Definition SDL3pp_video.h:3354
constexpr DisplayOrientation ORIENTATION_LANDSCAPE
The display is in landscape mode, with the right side up, relative to portrait mode.
Definition SDL3pp_video.h:79
constexpr DisplayOrientation ORIENTATION_PORTRAIT_FLIPPED
The display is in portrait mode, upside down.
Definition SDL3pp_video.h:91
constexpr WindowFlags WINDOW_OPENGL
window usable with OpenGL context
Definition SDL3pp_video.h:143
constexpr GLAttr GL_CONTEXT_NO_ERROR
GL_CONTEXT_NO_ERROR.
Definition SDL3pp_video.h:3457
SDL_EGLint EGLint
An EGL integer attribute, used when creating an EGL surface.
Definition SDL3pp_video.h:3189
constexpr GLContextFlag GL_CONTEXT_ROBUST_ACCESS_FLAG
ROBUST_ACCESS_FLAG.
Definition SDL3pp_video.h:3508
constexpr DisplayOrientation ORIENTATION_LANDSCAPE_FLIPPED
The display is in landscape mode, with the left side up, relative to portrait mode.
Definition SDL3pp_video.h:85
constexpr WindowFlags WINDOW_MOUSE_RELATIVE_MODE
window has relative mode enabled
Definition SDL3pp_video.h:192
std::function< HitTestResult(WindowRef window, const Point &area)> HitTestCB
Callback used for hit-testing.
Definition SDL3pp_video.h:344
constexpr WindowFlags WINDOW_OCCLUDED
window is occluded
Definition SDL3pp_video.h:146
constexpr FlashOperation FLASH_UNTIL_FOCUSED
Flash the window until it gets focus.
Definition SDL3pp_video.h:253
Uint32 GLProfile
Possible values to be set for the GL_CONTEXT_PROFILE_MASK attribute.
Definition SDL3pp_video.h:3476
EGLSurface EGL_GetWindowSurface(WindowBase &window)
Get the EGL surface associated with the window.
Definition SDL3pp_video.h:4180
SystemTheme GetSystemTheme()
Get the current system theme.
Definition SDL3pp_video.h:3625
constexpr WindowFlags WINDOW_NOT_FOCUSABLE
window should not be focusable
Definition SDL3pp_video.h:227
constexpr GLContextResetNotification GL_CONTEXT_RESET_NO_NOTIFICATION
NO_NOTIFICATION.
Definition SDL3pp_video.h:3549
constexpr GLAttr GL_FLOATBUFFERS
GL_FLOATBUFFERS.
Definition SDL3pp_video.h:3460
constexpr WindowFlags WINDOW_RESIZABLE
window can be resized
Definition SDL3pp_video.h:159
OwnArray< WindowRef > GetWindows()
Get a list of valid windows.
Definition SDL3pp_video.h:3646
constexpr WindowFlags WINDOW_POPUP_MENU
window should be treated as a popup menu, requires a parent window
Definition SDL3pp_video.h:213
constexpr GLContextResetNotification GL_CONTEXT_RESET_LOSE_CONTEXT
LOSE_CONTEXT.
Definition SDL3pp_video.h:3552
void GL_ResetAttributes()
Reset all previously set OpenGL context attributes to their default values.
Definition SDL3pp_video.h:4060
Uint32 GLContextResetNotification
Possible values to be set GL_CONTEXT_RESET_NOTIFICATION attribute.
Definition SDL3pp_video.h:3547
constexpr WindowFlags WINDOW_EXTERNAL
window not created by SDL
Definition SDL3pp_video.h:177
constexpr WindowFlags WINDOW_ALWAYS_ON_TOP
window should always be above others
Definition SDL3pp_video.h:195
std::function< SDL_EGLAttrib *()> EGLAttribArrayCB
EGL platform attribute initialization callback.
Definition SDL3pp_video.h:3239
static WindowRef GetGrabbed()
Get the window that currently has an input grab enabled.
Definition SDL3pp_video.h:3853
constexpr WindowFlags WINDOW_HIDDEN
window is neither mapped onto the desktop nor shown in the taskbar/dock/window list; WindowBase....
Definition SDL3pp_video.h:154
constexpr GLAttr GL_SHARE_WITH_CURRENT_CONTEXT
OpenGL context sharing; defaults to 0.
Definition SDL3pp_video.h:3437
EGLConfig EGL_GetCurrentConfig()
Get the currently active EGL config.
Definition SDL3pp_video.h:4164
constexpr HitTestResult HITTEST_RESIZE_BOTTOM
Region is the resizable bottom border.
Definition SDL3pp_video.h:303
constexpr GLAttr GL_ACCUM_BLUE_SIZE
the minimum number of bits for the blue channel of the accumulation buffer; defaults to 0.
Definition SDL3pp_video.h:3388
constexpr WindowFlags WINDOW_FULLSCREEN
window is in fullscreen mode
Definition SDL3pp_video.h:140
constexpr GLContextReleaseFlag GL_CONTEXT_RELEASE_BEHAVIOR_NONE
BEHAVIOR_NONE.
Definition SDL3pp_video.h:3529
void GL_SwapWindow(WindowBase &window)
Update a window with OpenGL rendering.
Definition SDL3pp_video.h:4290
SDL_EGLAttrib EGLAttrib
An EGL attribute, used when creating an EGL context.
Definition SDL3pp_video.h:3182
void GL_LoadLibrary(StringParam path)
Dynamically load an OpenGL library.
Definition SDL3pp_video.h:3928
constexpr GLAttr GL_DEPTH_SIZE
the minimum number of bits in the depth buffer; defaults to 16.
Definition SDL3pp_video.h:3365
std::function< SDL_EGLint *(SDL_EGLDisplay, SDL_EGLConfig)> EGLIntArrayCB
EGL surface/context attribute initialization callback types.
Definition SDL3pp_video.h:3301
EGLDisplay EGL_GetCurrentDisplay()
Get the currently active EGL display.
Definition SDL3pp_video.h:4149
constexpr GLContextReleaseFlag GL_CONTEXT_RELEASE_BEHAVIOR_FLUSH
BEHAVIOR_FLUSH.
Definition SDL3pp_video.h:3532
constexpr GLAttr GL_ACCELERATED_VISUAL
set to 1 to require hardware acceleration, set to 0 to force software rendering; defaults to allow ei...
Definition SDL3pp_video.h:3414
SDL_EGLIntArrayCallback EGLIntArrayCallback
EGL surface/context attribute initialization callback types.
Definition SDL3pp_video.h:3270
the main namespace where all SDL3pp public functions and types live
Definition SDL3pp_assert.h:7
An opaque handle to an OpenGL context.
Definition SDL3pp_video.h:3004
GLContextBase(WindowBase &window)
Create an OpenGL context for an OpenGL window, and make it current.
Definition SDL3pp_video.h:3029
void MakeCurrent(WindowBase &window)
Set up an OpenGL context for rendering into an OpenGL window.
Definition SDL3pp_video.h:3048
Handle to a non owned gLContext.
Definition SDL3pp_video.h:3063
bool reset(SDL_GLContextState *newResource={})
Delete an OpenGL context.
Definition SDL3pp_video.h:3108
constexpr ~GLContextRef()=default
Default constructor.
constexpr GLContextRef(const GLContextRef &other)
Copy constructor.
Definition SDL3pp_video.h:3069
GLContextRef & operator=(GLContextRef other)
Assignment operator.
Definition SDL3pp_video.h:3090
constexpr GLContextRef(GLContextRef &&other)
Move constructor.
Definition SDL3pp_video.h:3077
Handle to an owned gLContext.
Definition SDL3pp_video.h:3123
constexpr GLContext(GLContext &&other)=default
Move constructor.
~GLContext()
Frees up resource when object goes out of scope.
Definition SDL3pp_video.h:3144
constexpr GLContext(SDL_GLContextState *resource={})
Constructs from the underlying resource.
Definition SDL3pp_video.h:3129
GLContext & operator=(GLContext other)
Assignment operator.
Definition SDL3pp_video.h:3149
Store callbacks by key.
Definition SDL3pp_callbackWrapper.h:222
The structure that defines a point (using integers)
Definition SDL3pp_rect.h:41
Wrap properties id.
Definition SDL3pp_properties.h:203
Handle to a non owned properties.
Definition SDL3pp_properties.h:693
A rectangle, with the origin at the upper left (using integers).
Definition SDL3pp_rect.h:817
constexpr Point GetTopLeft() const
Get top left corner of the rect.
Definition SDL3pp_rect.h:1084
constexpr Point GetSize() const
Get size of the rect.
Definition SDL3pp_rect.h:1116
Handle to a non owned renderer.
Definition SDL3pp_render.h:1886
A collection of pixels used in software blitting.
Definition SDL3pp_surface.h:138
Handle to a non owned surface.
Definition SDL3pp_surface.h:1814
Represents a handle to a window.
Definition SDL3pp_video.h:838
void SetSurfaceVSync(int vsync)
Toggle VSync for the window surface.
Definition SDL3pp_video.h:2273
void Maximize()
Request that the window be made as large as possible.
Definition SDL3pp_video.h:2091
OwnPtr< void > GetICCProfile(size_t *size) const
Get the raw ICC profile data for the screen the window is currently on.
Definition SDL3pp_video.h:1250
void SetKeyboardGrab(bool grabbed)
Set a window's keyboard grab mode.
Definition SDL3pp_video.h:2389
float GetPixelDensity() const
Get the pixel density of a window.
Definition SDL3pp_video.h:1160
void SetResizable(bool resizable)
Set the user-resizable state of a window.
Definition SDL3pp_video.h:1990
void SetMouseGrab(bool grabbed)
Set a window's mouse grab mode.
Definition SDL3pp_video.h:2411
void SetFocusable(bool focusable)
Set whether the window may have input focus.
Definition SDL3pp_video.h:2583
void SetModal(bool modal)
Toggle the state of the window as modal.
Definition SDL3pp_video.h:2571
void Sync()
Block until any pending window state is finalized.
Definition SDL3pp_video.h:2207
void SetPosition(SDL_Point p)
Request that the window's position be set.
Definition SDL3pp_video.h:1569
const char * GetTitle() const
Get the title of a window.
Definition SDL3pp_video.h:1475
Rect GetSafeArea() const
Get the safe area for this window.
Definition SDL3pp_video.h:1724
void GetPosition(int *x, int *y) const
Get the position of a window.
Definition SDL3pp_video.h:1618
PropertiesRef GetProperties() const
Get the properties associated with a window.
Definition SDL3pp_video.h:1420
float GetOpacity() const
Get the opacity of a window.
Definition SDL3pp_video.h:2521
Display GetDisplay() const
Get the display associated with a window.
Definition SDL3pp_video.h:1142
int GetSurfaceVSync() const
Get VSync for the window surface.
Definition SDL3pp_video.h:2290
void SetIcon(SurfaceBase &icon)
Set the icon for a window.
Definition SDL3pp_video.h:1497
void SetMouseRect(const SDL_Rect &rect)
Confines the cursor to the specified area of a window.
Definition SDL3pp_video.h:2463
void SetShape(SurfaceBase &shape)
Set the shape of a transparent window.
Definition SDL3pp_video.h:2724
void SetAspectRatio(float min_aspect, float max_aspect)
Request that the aspect ratio of a window's client area be set.
Definition SDL3pp_video.h:1768
void Raise()
Request that a window be raised above other windows and gain the input focus.
Definition SDL3pp_video.h:2059
void SetMaximumSize(SDL_Point p)
Set the maximum size of a window's client area.
Definition SDL3pp_video.h:1923
void SetFullscreenMode(OptionalRef< const DisplayMode > mode)
Set the display mode to use when a window is visible and fullscreen.
Definition SDL3pp_video.h:1216
void Show()
Show a window.
Definition SDL3pp_video.h:2027
void SetMinimumSize(SDL_Point p)
Set the minimum size of a window's client area.
Definition SDL3pp_video.h:1884
const DisplayMode * GetFullscreenMode() const
Query the display mode to use when a window is visible at fullscreen.
Definition SDL3pp_video.h:1234
void Restore()
Request that the size and position of a minimized or maximized window be restored.
Definition SDL3pp_video.h:2146
void SetHitTest(HitTestCB callback)
Provide a callback that decides if a window region has special properties.
Definition SDL3pp_video.h:4299
WindowBase(PropertiesBase &props)
Create a window with the specified properties.
Definition SDL3pp_video.h:1123
void ShowSystemMenu(SDL_Point p)
Display the system-level window menu.
Definition SDL3pp_video.h:2607
void GetMaximumSize(int *w, int *h) const
Get the maximum size of a window's client area.
Definition SDL3pp_video.h:1944
void Hide()
Hide a window.
Definition SDL3pp_video.h:2041
Point GetPosition() const
Get the position of a window.
Definition SDL3pp_video.h:1590
bool GetMouseGrab() const
Get a window's mouse grab mode.
Definition SDL3pp_video.h:2443
void GetBordersSize(int *top, int *left, int *bottom, int *right) const
Get the size of a window's borders (decorations) around the client area.
Definition SDL3pp_video.h:1825
Point GetSizeInPixels() const
Get the size of a window's client area, in pixels.
Definition SDL3pp_video.h:1843
SurfaceRef GetSurface()
Get the SDL surface associated with the window.
Definition SDL3pp_video.h:2249
void GetSize(int *w, int *h) const
Get the size of a window's client area.
Definition SDL3pp_video.h:1702
void UpdateSurface()
Copy the window surface to the screen.
Definition SDL3pp_video.h:2314
WindowBase(StringParam title, SDL_Point size, WindowFlags flags=0)
Create a window with the specified dimensions and flags.
Definition SDL3pp_video.h:926
void GetAspectRatio(float *min_aspect, float *max_aspect) const
Get the size of a window's client area.
Definition SDL3pp_video.h:1788
const SDL_Rect * GetMouseRect() const
Get the mouse confinement rectangle of a window.
Definition SDL3pp_video.h:2482
void SetFullscreen(bool fullscreen)
Request that the window's fullscreen state be changed.
Definition SDL3pp_video.h:2176
void DestroySurface()
Destroy the surface associated with the window.
Definition SDL3pp_video.h:2358
void UpdateSurfaceRects(SpanRef< const SDL_Rect > rects)
Copy areas of the window surface to the screen.
Definition SDL3pp_video.h:2340
PixelFormat GetPixelFormat() const
Get the pixel format associated with the window.
Definition SDL3pp_video.h:1265
void SetAlwaysOnTop(bool on_top)
Set the window to always be above the others.
Definition SDL3pp_video.h:2010
void SetRect(Rect rect)
Request the window's position and size to be set.
Definition SDL3pp_video.h:1513
void SetHitTest(HitTest callback, void *callback_data)
Provide a callback that decides if a window region has special properties.
Definition SDL3pp_video.h:2695
void GetMinimumSize(int *w, int *h) const
Get the minimum size of a window's client area.
Definition SDL3pp_video.h:1905
WindowFlags GetFlags() const
Get the window flags.
Definition SDL3pp_video.h:1442
void SetBordered(bool bordered)
Set the border state of a window.
Definition SDL3pp_video.h:1967
float GetDisplayScale() const
Get the content display scale relative to a window's pixel size.
Definition SDL3pp_video.h:1183
void GetSizeInPixels(int *w, int *h) const
Get the size of a window's client area, in pixels.
Definition SDL3pp_video.h:1866
WindowID GetID() const
Get the numeric ID of a window.
Definition SDL3pp_video.h:1285
void Minimize()
Request that the window be minimized to an iconic representation.
Definition SDL3pp_video.h:2118
void SetTitle(StringParam title)
Set the title of a window.
Definition SDL3pp_video.h:1458
Point GetSize() const
Get the size of a window's client area.
Definition SDL3pp_video.h:1676
bool GetKeyboardGrab() const
Get a window's keyboard grab mode.
Definition SDL3pp_video.h:2427
void SetOpacity(float opacity)
Set the opacity for a window.
Definition SDL3pp_video.h:2501
WindowBase(WindowBase &parent, SDL_Point offset, SDL_Point size, WindowFlags flags=0)
Create a child popup window of the specified parent window.
Definition SDL3pp_video.h:989
void Flash(FlashOperation operation)
Request a window to demand attention from the user.
Definition SDL3pp_video.h:2739
void SetSize(SDL_Point p)
Request that the size of a window's client area be set.
Definition SDL3pp_video.h:1655
void SetParent(OptionalWindow parent)
Set the window as a child of a parent window.
Rect GetRect() const
Get the position and client size of a window.
Definition SDL3pp_video.h:1532
bool HasSurface() const
Return whether the window has a surface associated with it.
Definition SDL3pp_video.h:2221
Handle to a non owned window.
Definition SDL3pp_video.h:2778
constexpr WindowRef(const WindowRef &other)
Copy constructor.
Definition SDL3pp_video.h:2784
constexpr ~WindowRef()=default
Default constructor.
constexpr WindowRef(WindowRef &&other)
Move constructor.
Definition SDL3pp_video.h:2792
WindowRef & operator=(WindowRef other)
Assignment operator.
Definition SDL3pp_video.h:2805
void reset(SDL_Window *newResource={})
Destroy a window.
Definition SDL3pp_video.h:2825
Handle to an owned window.
Definition SDL3pp_video.h:2872
Window & operator=(Window other)
Assignment operator.
Definition SDL3pp_video.h:2898
constexpr Window(SDL_Window *resource={})
Constructs from the underlying resource.
Definition SDL3pp_video.h:2878
~Window()
Frees up resource when object goes out of scope.
Definition SDL3pp_video.h:2893
constexpr Window(Window &&other)=default
Move constructor.