AuxiliaryWindow class
#include <nCine/Graphics/AuxiliaryWindow.h>
Window of the application besides the main one, as a panel dragged out of it.
Made by IGfxDevice::
Input over it goes to the input handler of the application as input over the main window would, with the position relative to the main window and MouseState::
The platform backend makes the window, AuxiliaryWindowPresenter shows the contents with the graphics backend.
Derived classes
- class GlfwAuxiliaryWindow
- Window besides the main one made with GLFW, see AuxiliaryWindow.
- class SdlAuxiliaryWindow
- Window besides the main one made with SDL, see AuxiliaryWindow.
Public static functions
-
static auto GetAll() -> Death::
Containers:: ArrayView<AuxiliaryWindow* const> - Returns all windows besides the main one.
-
static auto FindById(std::
uint32_t id) -> AuxiliaryWindow* - Returns the window of an identifier,
nullptrif there's none. - static auto IsAnyFocused() -> bool
- Returns
trueif any window besides the main one has the keyboard focus.
Constructors, destructors, conversion operators
- ~AuxiliaryWindow() virtual
- AuxiliaryWindow(const AuxiliaryWindow&) deleted
- AuxiliaryWindow() protected
Public functions
- auto operator=(const AuxiliaryWindow&) -> AuxiliaryWindow& deleted
-
auto GetId() const -> std::
uint32_t - Returns its identifier in input events, never 0.
- void SetBounds(const Recti& bounds) pure virtual
- Moves and resizes it, in units of the desktop.
- auto GetBounds() const -> Recti pure virtual
- Returns where it is and its size, in units of the desktop, which may be larger than pixels on a scaled display.
- auto GetPixelSize() const -> Vector2i pure virtual
- Returns the size of what is drawn into it in pixels.
- auto IsFocused() const -> bool pure virtual
- Returns
trueif it has the keyboard focus. - void Raise() pure virtual
- Brings it in front of other windows and gives it the focus.
-
void SetTitle(Death::
Containers:: StringView title) pure virtual - Sets its title, the system shows it on the taskbar.
- auto GetContentScale() const -> float virtual
- Returns the scale of the display it's on, 1 for 100 %.
- void SetInputScale(float scale)
- Sets how many units of the main window a unit of this window takes, 1 by default.
- auto GetInputScale() const -> float
- Returns how many units of the main window a unit of this window takes, see SetInputScale().
- auto HasRoundedCorners() const -> bool
- Returns
trueif the system rounds its corners, what is drawn into it should have the same corners. - void Show(bool activate)
- Shows it,
activategives it the focus too. - void Hide()
- Hides it.
- auto IsShown() const -> bool
- Returns
trueif it's shown or will be once its contents are, see Show(). - void SetContents(Texture* texture)
- Sets the texture with what it shows, it's shown after the frame is drawn.
- auto GetContents() const -> Texture*
- Returns the texture with what it shows.
- void Present()
- Shows the contents in the window, called once a frame after it's drawn, see IGfxDevice::
PresentAuxiliaryWindows().
Protected functions
- void SetVisible(bool visible, bool activate) pure virtual
- Makes the window seen, or hides it.
Protected variables
-
std::
uint32_t _id - Texture* _contents
- bool _roundedCorners
- Whether the system rounds its corners, see HasRoundedCorners().
- float _inputScale
-
std::
unique_ptr<AuxiliaryWindowPresenter> _presenter - Shows the contents with the graphics backend, set by the platform backend once the window is made.
Function documentation
float nCine:: AuxiliaryWindow:: GetContentScale() const virtual
Returns the scale of the display it's on, 1 for 100 %.
The ratio to the scale of the main window (see IGfxDevice::
void nCine:: AuxiliaryWindow:: SetInputScale(float scale)
Sets how many units of the main window a unit of this window takes, 1 by default.
Positions of the pointer over it are made relative to the main window with it, what it shows may be drawn at another scale than the main window, on a display with another scale.
void nCine:: AuxiliaryWindow:: SetContents(Texture* texture)
Sets the texture with what it shows, it's shown after the frame is drawn.
The texture has to stay until the next call or until the window is destroyed, and should be as large as the window in pixels, a larger one is cut and a smaller one leaves the rest black. Nothing is shown with nullptr.