SDL3pp
A slim C++ wrapper for SDL3
Loading...
Searching...
No Matches
Public Member Functions | List of all members
SDL::WindowRef Struct Reference

Semi-safe reference for Window.

Inheritance diagram for SDL::WindowRef:
Inheritance graph
[legend]
Collaboration diagram for SDL::WindowRef:
Collaboration graph
[legend]

Public Member Functions

 WindowRef (WindowParam resource)
 Constructs from WindowParam. More...
 
 WindowRef (const WindowRef &other)
 Copy constructor.
 
 ~WindowRef ()
 Destructor.
 
- Public Member Functions inherited from SDL::Window
constexpr Window ()=default
 Default ctor.
 
constexpr Window (const WindowRaw resource)
 Constructs from WindowParam. More...
 
constexpr Window (const Window &other)=delete
 Copy constructor.
 
constexpr Window (Window &&other)
 Move constructor.
 
constexpr Window (const WindowRef &other)=delete
 
constexpr Window (WindowRef &&other)=delete
 
 Window (StringParam title, const PointRaw &size, WindowFlags flags=0)
 Create a window with the specified dimensions and flags. More...
 
 Window (WindowParam parent, const PointRaw &offset, const PointRaw &size, WindowFlags flags=0)
 Create a child popup window of the specified parent window. More...
 
 Window (PropertiesParam props)
 Create a window with the specified properties. More...
 
 ~Window ()
 Destructor.
 
Windowoperator= (Window other)
 Assignment operator.
 
constexpr WindowRaw get () const
 Retrieves underlying WindowRaw.
 
constexpr WindowRaw release ()
 Retrieves underlying WindowRaw and clear this.
 
constexpr auto operator<=> (const Window &other) const =default
 Comparison.
 
constexpr bool operator== (std::nullptr_t _) const
 Comparison.
 
constexpr operator bool () const
 Converts to bool.
 
constexpr operator WindowParam () const
 Converts to WindowParam.
 
void Destroy ()
 Destroy a window. More...
 
Display GetDisplay () const
 Get the display associated with a window. More...
 
float GetPixelDensity () const
 Get the pixel density of a window. More...
 
float GetDisplayScale () const
 Get the content display scale relative to a window's pixel size. More...
 
void SetFullscreenMode (OptionalRef< const DisplayMode > mode)
 Set the display mode to use when a window is visible and fullscreen. More...
 
const DisplayModeGetFullscreenMode () const
 Query the display mode to use when a window is visible at fullscreen. More...
 
OwnPtr< void > GetICCProfile () const
 Get the raw ICC profile data for the screen the window is currently on. More...
 
PixelFormat GetPixelFormat () const
 Get the pixel format associated with the window. More...
 
WindowID GetID () const
 Get the numeric ID of a window. More...
 
WindowRef GetParent () const
 Get parent of a window. More...
 
PropertiesRef GetProperties () const
 Get the properties associated with a window. More...
 
WindowFlags GetFlags () const
 Get the window flags. More...
 
void SetTitle (StringParam title)
 Set the title of a window. More...
 
const char * GetTitle () const
 Get the title of a window. More...
 
void SetIcon (SurfaceParam icon)
 Set the icon for a window. More...
 
void SetPosition (const PointRaw &p)
 Request that the window's position be set. More...
 
void GetPosition (int *x, int *y) const
 Get the position of a window. More...
 
Point GetPosition () const
 Get the position of a window. More...
 
void SetSize (const PointRaw &size)
 Request that the size of a window's client area be set. More...
 
void GetSize (int *w, int *h) const
 Get the size of a window's client area. More...
 
Point GetSize () const
 Get the size of a window's client area. More...
 
void SetRect (Rect rect)
 Request the window's position and size to be set. More...
 
Rect GetRect () const
 Get the position and client size of a window. More...
 
Rect GetSafeArea () const
 Get the safe area for this window. More...
 
void SetAspectRatio (float min_aspect, float max_aspect)
 Request that the aspect ratio of a window's client area be set. More...
 
void GetAspectRatio (float *min_aspect, float *max_aspect) const
 Get the size of a window's client area. More...
 
void GetBordersSize (int *top, int *left, int *bottom, int *right) const
 Get the size of a window's borders (decorations) around the client area. More...
 
void GetSizeInPixels (int *w, int *h) const
 Get the size of a window's client area, in pixels. More...
 
Point GetSizeInPixels () const
 Get the size of a window's client area, in pixels. More...
 
void SetMinimumSize (const PointRaw &p)
 Set the minimum size of a window's client area. More...
 
void GetMinimumSize (int *w, int *h) const
 Get the minimum size of a window's client area. More...
 
void SetMaximumSize (const PointRaw &p)
 Set the maximum size of a window's client area. More...
 
void GetMaximumSize (int *w, int *h) const
 Get the maximum size of a window's client area. More...
 
void SetBordered (bool bordered)
 Set the border state of a window. More...
 
void SetResizable (bool resizable)
 Set the user-resizable state of a window. More...
 
void SetAlwaysOnTop (bool on_top)
 Set the window to always be above the others. More...
 
void Show ()
 Show a window. More...
 
void Hide ()
 Hide a window. More...
 
void Raise ()
 Request that a window be raised above other windows and gain the input focus. More...
 
void Maximize ()
 Request that the window be made as large as possible. More...
 
void Minimize ()
 Request that the window be minimized to an iconic representation. More...
 
void Restore ()
 Request that the size and position of a minimized or maximized window be restored. More...
 
void SetFullscreen (bool fullscreen)
 Request that the window's fullscreen state be changed. More...
 
void Sync ()
 Block until any pending window state is finalized. More...
 
bool HasSurface () const
 Return whether the window has a surface associated with it. More...
 
Surface GetSurface ()
 Get the SDL surface associated with the window. More...
 
void SetSurfaceVSync (int vsync)
 Toggle VSync for the window surface. More...
 
int GetSurfaceVSync () const
 Get VSync for the window surface. More...
 
void UpdateSurface ()
 Copy the window surface to the screen. More...
 
void UpdateSurfaceRects (SpanRef< const RectRaw > rects)
 Copy areas of the window surface to the screen. More...
 
void DestroySurface ()
 Destroy the surface associated with the window. More...
 
void SetKeyboardGrab (bool grabbed)
 Set a window's keyboard grab mode. More...
 
void SetMouseGrab (bool grabbed)
 Set a window's mouse grab mode. More...
 
bool GetKeyboardGrab () const
 Get a window's keyboard grab mode. More...
 
bool GetMouseGrab () const
 Get a window's mouse grab mode. More...
 
void SetMouseRect (const RectRaw &rect)
 Confines the cursor to the specified area of a window. More...
 
const RectRawGetMouseRect () const
 Get the mouse confinement rectangle of a window. More...
 
void SetOpacity (float opacity)
 Set the opacity for a window. More...
 
float GetOpacity () const
 Get the opacity of a window. More...
 
void SetParent (WindowParam parent)
 Set the window as a child of a parent window. More...
 
void SetModal (bool modal)
 Toggle the state of the window as modal. More...
 
void SetFocusable (bool focusable)
 Set whether the window may have input focus. More...
 
void ShowSystemMenu (const PointRaw &p)
 Display the system-level window menu. More...
 
void SetHitTest (HitTest callback, void *callback_data)
 Provide a callback that decides if a window region has special properties. More...
 
void SetHitTest (HitTestCB callback)
 Provide a callback that decides if a window region has special properties. More...
 
void SetShape (SurfaceParam shape)
 Set the shape of a transparent window. More...
 
void Flash (FlashOperation operation)
 Request a window to demand attention from the user. More...
 
GLContext CreateGLContext ()
 Create an OpenGL context for an OpenGL window, and make it current. More...
 
void MakeCurrent (GLContext context)
 Set up an OpenGL context for rendering into an OpenGL window. More...
 
EGLSurface GetEGLSurface ()
 Get the EGL surface associated with the window. More...
 
void GL_Swap ()
 Update a window with OpenGL rendering. More...
 
void StartTextInput ()
 Start accepting Unicode text input events in a window. More...
 
void StartTextInput (PropertiesParam props)
 Start accepting Unicode text input events in a window, with properties describing the input. More...
 
bool IsTextInputActive () const
 Check whether or not Unicode text input events are enabled for a window. More...
 
void StopTextInput ()
 Stop receiving any text input events in a window. More...
 
void ClearComposition ()
 Dismiss the composition window/IME without disabling the subsystem. More...
 
void SetTextInputArea (const RectRaw &rect, int cursor)
 Set the area used to type Unicode text input. More...
 
void GetTextInputArea (RectRaw *rect, int *cursor)
 Get the area used to type Unicode text input. More...
 
bool IsScreenKeyboardShown () const
 Check whether the screen keyboard is shown for given window. More...
 
void WarpMouse (const FPointRaw &p)
 Move the mouse cursor to the given position within the window. More...
 
void SetRelativeMouseMode (bool enabled)
 Set relative mouse mode for a window. More...
 
bool GetRelativeMouseMode () const
 Query whether relative mouse mode is enabled for a window. More...
 
RendererRef GetRenderer () const
 Get the renderer associated with a window. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from SDL::Window
static WindowRef FromID (WindowID id)
 Get a window from a stored ID. More...
 
static WindowRef GetGrabbed ()
 Get the window that currently has an input grab enabled. More...
 

Constructor & Destructor Documentation

◆ WindowRef()

SDL::WindowRef::WindowRef ( WindowParam  resource)
inline
Parameters
resourcea WindowRaw or Window.

This does not takes ownership!


The documentation for this struct was generated from the following file: