Crafter.Graphics
C++ graphics library using Wayland and Vulkan.
 
Loading...
Searching...
No Matches
Crafter::Window Class Referenceexport

Represents a GUI window handling input events, mouse states, keyboard states, and UI elements. More...

Inheritance diagram for Crafter::Window:
Crafter::WindowWayland Crafter::WindowWaylandVulkan Crafter::WindowWaylandWayland

Public Member Functions

 Window (std::string name, std::uint32_t width, std::uint32_t height)
 Constructs a Window with a given name and dimensions.
 
ScaleData ScaleElement (const UiElement &element)
 Calculates the real position and size of an UiElement.
 

Public Attributes

Event< MousePoint > onMouseRightClick
 
Event< MousePoint > onMouseLeftClick
 
Event< MousePoint > onMouseRightHold
 
Event< MousePoint > onMouseLeftHold
 
Event< MousePoint > onMouseRightRelease
 
Event< MousePoint > onMouseLeftRelease
 
Event< MouseMoveEvent > onMouseMove
 
Event< MouseMoveEvent > onMouseEnter
 
Event< MouseMoveEvent > onMouseLeave
 
Event< double > onMouseScroll
 
Event< void > onClose
 
MousePoint currentMousePos
 
MousePoint lastMousePos
 
MousePoint mouseDelta
 
bool mouseLeftHeld = false
 
bool mouseRightHeld = false
 
bool heldkeys [255] = {}
 
Event< void > onKeyDown [255]
 
Event< void > onKeyHold [255]
 
Event< void > onKeyUp [255]
 
Event< char > onAnyKeyDown
 
Event< char > onAnyKeyHold
 
Event< char > onAnyKeyUp
 
std::vector< UiElementelements
 
std::string name
 
std::uint32_t width
 
std::uint32_t height
 
float scale = 1
 
bool open = true
 

Detailed Description

Represents a GUI window handling input events, mouse states, keyboard states, and UI elements.

The Window class encapsulates event handling for mouse and keyboard interactions, manages the state of the mouse and keyboard, and stores UI elements contained within the window. It also holds window-specific properties such as name, dimensions, and scaling factor.


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