rolmodl
C++ API for the Simple Directmedia Library 2 (SDL2)
Public Member Functions | List of all members
rolmodl::Win Class Reference

Window class for use with accelerated rendering (rolmodl::Ren). More...

#include <Win.hpp>

Inheritance diagram for rolmodl::Win:
rolmodl::Win_Base

Public Member Functions

 Win_Base (const char *title, const geom::Pos p, const geom::Size s, const win::Flags flags)
 Initialize a window with title title, at the screen position p, of size s, with configuration flags. More...
 
 Win_Base (const char *title, const geom::Size s, const win::Flags flags)
 Initialize a window with title title, at the center of the screen, of size s, with configuration flags. More...
 
 Win_Base (const char *title, const geom::Pos p, const geom::Size s)
 Initialize a window with title title, at the screen position p, of size s, with the default configuration. More...
 
 Win_Base (const char *title, const geom::Size s)
 Initialize a window with title title, at the center of the screen, of size s, with the default configuration. More...
 
 Win_Base (const Win_Base &that)=delete
 Copying rolmodl windows is not allowed because their lifetime is tied to the underlying SDL_Window's. Use references or some other pointer type instead.
 
 Win_Base (Win_Base &&that) noexcept
 Take over the underlying SDL_Window of that.
 
- Public Member Functions inherited from rolmodl::Win_Base
 Win_Base (const char *title, const geom::Pos p, const geom::Size s, const win::Flags flags)
 Initialize a window with title title, at the screen position p, of size s, with configuration flags. More...
 
 Win_Base (const char *title, const geom::Size s, const win::Flags flags)
 Initialize a window with title title, at the center of the screen, of size s, with configuration flags. More...
 
 Win_Base (const char *title, const geom::Pos p, const geom::Size s)
 Initialize a window with title title, at the screen position p, of size s, with the default configuration. More...
 
 Win_Base (const char *title, const geom::Size s)
 Initialize a window with title title, at the center of the screen, of size s, with the default configuration. More...
 
 ~Win_Base () noexcept
 Free the underlying SDL_Window. More...
 
 Win_Base (const Win_Base &that)=delete
 Copying rolmodl windows is not allowed because their lifetime is tied to the underlying SDL_Window's. Use references or some other pointer type instead.
 
 Win_Base (Win_Base &&that) noexcept
 Take over the underlying SDL_Window of that.
 
Win_Baseoperator= (const Win_Base &that)=delete
 Copying rolmodl windows is not allowed because their lifetime is tied to the underlying SDL_Window's. Use references or some other pointer type instead.
 
Win_Baseoperator= (Win_Base &&that) noexcept
 Take over the underlying SDL_Window of that.
 
SDL_Window * unsafeRaw () noexcept
 Get the underlying SDL_Window*. Unsafe because this value might be nullptr and using it with some SDL functions can lead to rolmodl invariant violation.
 
const SDL_Window * unsafeRaw () const noexcept
 Get the underlying SDL_Window* in a const context. Unsafe because this value might be nullptr and using it with some SDL functions can lead to rolmodl invariant violation.
 
void hide () noexcept
 Hide the window. More...
 
void show () noexcept
 Show the window. More...
 
void raise () noexcept
 Place this window above all other windows and grab input focus. More...
 
void maximize () noexcept
 Maximize the window setting its size to the largest that will fit on screen. More...
 
void minimize () noexcept
 Minimize the window hiding it in the start menu or dock or an equivalent. More...
 
void restore () noexcept
 Restore the window to the size and screen position it had before being maximized or minimized. More...
 
unsigned int unsafeDisplayIndex ()
 Get the index of the display that contains this window's center. Unsafe because storing this index can lead to an out-of-bounds error if the display is later disconnected. More...
 
sys::Display display ()
 Get the display information snapshot for the display that contains this window's center. More...
 
float opacity ()
 Get the window opacity. More...
 
void setOpacity (const float v)
 Set the window opacity. More...
 
geom::Pos pos () noexcept
 Get the window screen position. More...
 
void setPos (const geom::Pos p) noexcept
 Set the window screen position. More...
 
const char * title () noexcept
 Get the window title in UTF-8. Will be an empty string if there is no title. More...
 
void setTitle (const char *str) noexcept
 Set the window title. str is in UTF-8. More...
 
geom::Size size () noexcept
 Get the current window size. More...
 
void setSize (const geom::Size s) noexcept
 Set the window size. More...
 
geom::Size maxSize () noexcept
 Get the current maximum window size. More...
 
void setMaxSize (const geom::Size s) noexcept
 Set the maximum window size. More...
 
geom::Size minSize () noexcept
 Get the current minimum window size. More...
 
void setMinSize (const geom::Size s) noexcept
 Set the minimum window size. More...
 
uint32_t unsafeId ()
 Get the underlying SDL window id. Unsafe because this can be used to make a pointer to the underlying window that escapes the window's lifetime. More...
 
pixelfmt::Id pixelFmt ()
 Get the window pixel format. More...
 
void moveMouseIn (const geom::Pos p) noexcept
 Move the mouse pointer to a position relative to this window. More...
 

Detailed Description

Window class for use with accelerated rendering (rolmodl::Ren).

Definition at line 337 of file Win.hpp.

Member Function Documentation

◆ Win_Base() [1/4]

rolmodl::Win_Base::Win_Base

Initialize a window with title title, at the screen position p, of size s, with configuration flags.

See also
https://wiki.libsdl.org/SDL_CreateWindow

Definition at line 37 of file Win.cpp.

◆ Win_Base() [2/4]

rolmodl::Win_Base::Win_Base

Initialize a window with title title, at the center of the screen, of size s, with configuration flags.

See also
https://wiki.libsdl.org/SDL_CreateWindow

Definition at line 45 of file Win.cpp.

◆ Win_Base() [3/4]

rolmodl::Win_Base::Win_Base

Initialize a window with title title, at the screen position p, of size s, with the default configuration.

See also
https://wiki.libsdl.org/SDL_CreateWindow

Definition at line 47 of file Win.cpp.

◆ Win_Base() [4/4]

rolmodl::Win_Base::Win_Base

Initialize a window with title title, at the center of the screen, of size s, with the default configuration.

See also
https://wiki.libsdl.org/SDL_CreateWindow

Definition at line 49 of file Win.cpp.


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