File include/brisk/window/Window.hpp
¶
FrameStat
class¶
FrameStat
RenderStat
class¶
RenderStat
Canvas
class¶
Canvas
WindowApplication
class¶
WindowApplication
Window
class¶
Window
DisplaySyncPoint
class (Internal::DisplaySyncPoint
)¶
DisplaySyncPoint
FrameTimePredictor
class (Internal::FrameTimePredictor
)¶
FrameTimePredictor
currentWindow
variable (Internal::currentWindow
)¶
extern Window *currentWindow
Current window instance. Available in UI thread. Set in uiThreadBody
bufferedRendering
variable (Internal::bufferedRendering
)¶
extern constinit bool bufferedRendering
Default value for Window::bufferedRendering
PlatformWindow
class¶
PlatformWindow
HiDPIMode
enum¶
enum class HiDPIMode
HiDPIModeDefines modes for handling high-DPI display scaling in window systems.
This enum categorizes how window systems manage position, size, and content scaling for displays with varying DPI (dots per inch).
ApplicationScaling
enumerator (HiDPIMode::ApplicationScaling
)¶
Application-driven scaling using physical pixels.
Window position and size are specified in physical pixels. Applications must scale their content to match the display's DPI. The window scaling factor may be 1, 2, or any value in between. Examples include Windows (DPI-aware) and X11.
FramebufferScaling
enumerator (HiDPIMode::FramebufferScaling
)¶
System-driven scaling using logical units.
Window position and size are specified in logical units. A logical unit maps to 1x1 physical pixel (standard DPI) or 2x2 physical pixels (Retina, HiDPI). Applications render content at a 1x or 2x scale. The system scales the framebuffer to match the display's DPI. The window scaling factor is typically 1 or 2 (macOS), with other integers possible in Wayland. Examples include macOS and Wayland.
Window
class¶
Window
getPosition
function (Window::getPosition
)¶
Point getPosition() const
Get the position of window in Screen coordinates
Details If the window is not visible, returns the most recent value.
Returns Point The window's top-left position in screen coordinates.
getSize
function (Window::getSize
)¶
Size getSize() const
Get the size of window in Screen coordinates
Details If the window is not visible, returns the most recent value.
Returns Size The window's width and height in screen coordinates.
getBounds
function (Window::getBounds
)¶
Rectangle getBounds() const
Get the bounds of window in Screen coordinates
Equals to Rectangle(Point(0,0),getSize())
Details If the window is not visible, returns the most recent value.
Returns Rectangle The window's bounds, with origin at (0,0) and size from getSize().
getRectangle
function (Window::getRectangle
)¶
Rectangle getRectangle() const
Get the position and size of window in Screen coordinates
Equals to Rectangle(getPosition(),getSize())
Details If the window is not visible, returns the most recent value.
Returns Rectangle The window's position and size as a rectangle in screen coordinates.
getFramebufferBounds
function (Window::getFramebufferBounds
)¶
Rectangle getFramebufferBounds() const
Get the bounds of window in Framebuffer coordinates
Returns the window's bounds scaled to the framebuffer's pixel dimensions, accounting for the display's
backing scale factor or DPI.
Details If the window is not visible, returns the most recent value.
Returns Rectangle The window's bounds in framebuffer coordinates.
getFramebufferSize
function (Window::getFramebufferSize
)¶
Size getFramebufferSize() const
Get the size of window in Framebuffer coordinates
Returns the window's size scaled to the framebuffer's pixel dimensions, accounting for the display's
backing scale factor or DPI.
Details If the window is not visible, returns the most recent value.
Returns Size The window's width and height in framebuffer coordinates.
display
function (Window::display
)¶
RC<Display> display() const
Retrieve the display containing the window
Returns a reference-counted pointer to the display containing the window.
Returns RC<Display> The display associated with the window.
Screen
enumerator (Window::Unit::Screen
)¶
Screen coordinates (logical units or pixels, depending on platform).
Framebuffer
enumerator (Window::Unit::Framebuffer
)¶
Framebuffer coordinates (physical pixels).
Content
enumerator (Window::Unit::Content
)¶
Content coordinates.
convertUnit
function (Window::convertUnit
)¶
float convertUnit(Unit destUnit, float value,
Unit sourceUnit) const noexcept
Convert a scalar value between coordinate units
Converts a value from the source unit to the destination unit, accounting for scaling factors such as
DPI or backing scale.
Param destUnit
The target unit (Screen, Framebuffer, or Content).
Param value
The value to convert.
Param sourceUnit
The source unit (Screen, Framebuffer, or Content).
Returns float The converted value.
PointF convertUnit(Unit destUnit, PointF value,
Unit sourceUnit) const noexcept
Convert a 2D point between coordinate units
Converts a point from the source unit to the destination unit, accounting for scaling factors such as
DPI or backing scale.
Param destUnit
The target unit (Screen, Framebuffer, or Content).
Param value
The point to convert.
Param sourceUnit
The source unit (Screen, Framebuffer, or Content).
Returns PointF The converted point.
SizeF convertUnit(Unit destUnit, SizeF value,
Unit sourceUnit) const noexcept
Convert a 2D size between coordinate units
Converts a size from the source unit to the destination unit, accounting for scaling factors such as
DPI or backing scale.
Param destUnit
The target unit (Screen, Framebuffer, or Content).
Param value
The size to convert.
Param sourceUnit
The source unit (Screen, Framebuffer, or Content).
Returns SizeF The converted size.
RectangleF convertUnit(Unit destUnit, RectangleF value,
Unit sourceUnit) const noexcept
Convert a rectangle between coordinate units
Converts a rectangle from the source unit to the destination unit, accounting for scaling factors such
as DPI or backing scale.
Param destUnit
The target unit (Screen, Framebuffer, or Content).
Param value
The rectangle to convert.
Param sourceUnit
The source unit (Screen, Framebuffer, or Content).
Returns RectangleF The converted rectangle.
setRectangle
function (Window::setRectangle
)¶
void setRectangle(Rectangle rect)
Set the window's position and size in Screen coordinates
Updates the window's position and size to match the specified rectangle.
Param rect
The rectangle defining the new position and size in screen coordinates.
setPosition
function (Window::setPosition
)¶
void setPosition(Point pos)
Set the window's position in Screen coordinates
Updates the window's top-left position to the specified point, keeping the size unchanged.
Param pos
The new position in screen coordinates.
setSize
function (Window::setSize
)¶
void setSize(Size size)
Set the window's size in Screen coordinates
Updates the window's width and height to the specified size, keeping the position unchanged.
Param size
The new size in screen coordinates.
setMinimumSize
function (Window::setMinimumSize
)¶
void setMinimumSize(Size size)
Set the window's minimum size in Screen coordinates
Specifies the minimum allowable size for the window, constraining resizing operations.
Param size
The minimum size in screen coordinates.
setMaximumSize
function (Window::setMaximumSize
)¶
void setMaximumSize(Size size)
Set the window's maximum size in Screen coordinates
Specifies the maximum allowable size for the window, constraining resizing operations.
Param size
The maximum size in screen coordinates.
setMinimumMaximumSize
function (Window::setMinimumMaximumSize
)¶
void setMinimumMaximumSize(Size minSize, Size maxSize)
Set the window's minimum and maximum size in Screen coordinates
Specifies both the minimum and maximum allowable sizes for the window, constraining resizing
operations.
Param minSize
The minimum size in screen coordinates.
Param maxSize
The maximum size in screen coordinates.
m_title
variable (Window::m_title
)¶
std::string m_title
UI-thread
m_minimumSize
variable (Window::m_minimumSize
)¶
Size m_minimumSize
UI-thread
m_maximumSize
variable (Window::m_maximumSize
)¶
Size m_maximumSize
UI-thread
m_windowSize
variable (Window::m_windowSize
)¶
Size m_windowSize
UI-thread
m_framebufferSize
variable (Window::m_framebufferSize
)¶
Size m_framebufferSize
UI-thread
m_position
variable (Window::m_position
)¶
Point m_position
UI-thread
m_cursor
variable (Window::m_cursor
)¶
Cursor m_cursor = Cursor::Arrow
UI-thread
m_closing
variable (Window::m_closing
)¶
std::atomic_bool m_closing
Desired value. Will be applied to OS window when open
setVisible
function (Window::setVisible
)¶
void setVisible(bool newVisible)
If true, application will remove this window from windows list
m_bufferedRendering
variable (Window::m_bufferedRendering
)¶
std::atomic_bool m_bufferedRendering
true if rendering is active
m_contentScale
variable (Window::m_contentScale
)¶
std::atomic<float> m_contentScale
Content scaling factor for rendering, depending on HiDPI mode.
For ApplicationScaling mode, this represents the display's DPI divided by the standard DPI (typically 96 DPI), indicating the scaling factor applications should use to adjust content. For FramebufferScaling mode, this represents the backing scale factor, an integer (e.g., 1 for standard displays, 2 for Retina/HiDPI displays) used by the system to map logical units to physical pixels.
m_canvasScale
variable (Window::m_canvasScale
)¶
std::atomic<float> m_canvasScale
Additional scaling factor applied to the UI and canvas.
This represents a user-defined scale applied to the UI and canvas drawing.
Default value is 1.0 (no additional scaling).
ModalMode
class¶
ModalMode
Auto-generated from sources, Revision , https://github.com/brisklib/brisk/blob//include/brisk/