![]() |
Lysa
0.0
Lysa 3D Engine
|
Operating system window that serve as rendering surface.
Notes:
Public Member Functions | |
| Window (WindowConfiguration &config, const std::shared_ptr< Node > &rootNode=nullptr) | |
| virtual void | onReady () |
| virtual void | onClose () |
| virtual void | onResize () |
| std::shared_ptr< Viewport > | addViewport (const std::shared_ptr< Viewport > &viewport) |
| auto | getAspectRatio () const |
| const auto & | getExtent () const |
| const auto & | getFramesInFlight () const |
| auto & | getViewports () const |
| auto & | getRenderer () const |
| auto & | getUIRenderer () |
| void | waitIdle () const |
| void | addPostprocessing (const std::string &fragShaderName, vireo::ImageFormat outputFormat, void *data=nullptr, uint32 dataSize=0) const |
| void | removePostprocessing (const std::string &fragShaderName) const |
| void | show () const |
| void | close () |
| void | setMouseMode (MouseMode mode) const |
| void | setMouseCursor (MouseCursor cursor) const |
| void | resetMousePosition () const |
| float2 | getMousePosition () const |
| void | setMousePosition (const float2 &position) const |
| std::shared_ptr< ui::Window > | add (const std::shared_ptr< ui::Window > &window) |
| void | remove (const std::shared_ptr< ui::Window > &window) |
| auto & | getFont () const |
| auto | getFontScale () const |
| const auto & | getConfiguration () const |
| void | updatePipelines (const std::unordered_map< pipeline_id, std::vector< std::shared_ptr< Material >>> &pipelineIds) const |
| virtual | ~Window () |
| Window (Window &) = delete | |
| Window & | operator= (Window &) = delete |
| Window | ( | WindowConfiguration & | config, |
| const std::shared_ptr< Node > & | rootNode = nullptr |
||
| ) |
|
virtual |
Destroys the window and releases owned resources.
|
delete |
| std::shared_ptr<ui::Window> add | ( | const std::shared_ptr< ui::Window > & | window | ) |
| void addPostprocessing | ( | const std::string & | fragShaderName, |
| vireo::ImageFormat | outputFormat, | ||
| void * | data = nullptr, |
||
| uint32 | dataSize = 0 |
||
| ) | const |
Adds a full‑screen post‑processing pass.
| fragShaderName | Fragment shader identifier/name. |
| outputFormat | Output image format. |
| data | Optional extra parameters blob. |
| dataSize | Size in bytes of the extra parameters. |
Attaches a viewport to this window and wires it to the renderer.
| viewport | Viewport to attach (must not be attached elsewhere). |
| void close | ( | ) |
Requests the window to close and releases resources.
|
inline |
Returns the opaque, os-specific, window handle
Returns the current aspect ratio (width/height) of the window.
|
inline |
Returns the immutable window configuration used to create this window.
|
inline |
Returns the current swap chain extent (width/height in pixels).
|
inline |
Returns the default font loaded at startup
|
inline |
Returns the scaling factor used for the default font.
|
inline |
Returns the number of frames processed in flight.
| float2 getMousePosition | ( | ) | const |
Returns the mouse position
|
inline |
Returns the main scene renderer associated with this window.
|
inline |
Returns the UI renderer (Dear ImGui or equivalent wrapper).
|
inline |
Returns the list of viewports attached to this window.
|
inlinevirtual |
Called when the window is about to close (release resources here).
|
inlinevirtual |
Called once the window is fully created and ready to display.
|
inlinevirtual |
Called after the window/swap chain has been resized.
|
delete |
| void remove | ( | const std::shared_ptr< ui::Window > & | window | ) |
| void removePostprocessing | ( | const std::string & | fragShaderName | ) | const |
Removes a previously added post‑processing pass by fragment name.
| void resetMousePosition | ( | ) | const |
Sets the mouse position to the center of the window
| void setMouseCursor | ( | MouseCursor | cursor | ) | const |
Sets the mouse cursor
| cursor | MouseCursor enum selecting the cursor shape. |
| void setMouseMode | ( | MouseMode | mode | ) | const |
Sets the mouse visibility and capture mode
| mode | MouseMode (visible, hidden, captured, etc.). |
| void setMousePosition | ( | const float2 & | position | ) | const |
Returns the mouse position
| position | Coordinates in pixels relative to the client area. |
| void show | ( | ) | const |
Makes the OS window visible.
| void updatePipelines | ( | const std::unordered_map< pipeline_id, std::vector< std::shared_ptr< Material >>> & | pipelineIds | ) | const |
Updates graphics pipelines following a materials/pipelines mapping. Typically called when Resources/Scene report material changes.
| pipelineIds | Map of pipeline family id to materials. |
| void waitIdle | ( | ) | const |
Blocks until the device/queues are idle for this window.
|
friend |
|
friend |