![]() |
Lysa
0.0
Lysa 3D Engine
|
Viewport orchestrates a self‑contained rendering context.
Notes:
Public Member Functions | |
| Viewport (ViewportConfiguration &config) | |
| void | setRootNode (const std::shared_ptr< Node > &node) |
| auto | isPaused () const |
| void | setPaused (bool pause) |
| void | activateCamera (const std::shared_ptr< Camera > &camera) |
| void | addNode (const std::shared_ptr< Node > &node, bool async, bool attachToViewport) |
| void | removeNode (const std::shared_ptr< Node > &node, bool async) |
| auto | getAspectRatio () const |
| const auto & | getViewport () const |
| void | setViewport (const vireo::Viewport &viewport) |
| const auto & | getScissors () const |
| void | setScissors (const vireo::Rect &scissors) |
| auto & | getWindow () const |
| void | lockDeferredUpdate () |
| void | unlockDeferredUpdate () |
| auto & | getPhysicsScene () const |
| auto | getDebugRenderer () const |
| auto | getVectorRenderer () |
| void | update (const vireo::CommandList &commandList, uint32 frameIndex) const |
| void | draw (vireo::CommandList &commandList, const Scene &scene, const std::shared_ptr< vireo::RenderTarget > &colorAttachment, const std::shared_ptr< vireo::RenderTarget > &depthAttachment, uint32 frameIndex) const |
| const auto & | getConfiguration () const |
| auto | getDisplayDebug () const |
| void | setDisplayDebug (const bool displayDebug) |
| virtual | ~Viewport () |
| Viewport (Viewport &) = delete | |
| Viewport & | operator= (Viewport &) = delete |
| Viewport | ( | ViewportConfiguration & | config | ) |
Constructs a viewport with the provided configuration.
| config | Viewport configuration (dimensions, buffers, features). |
|
virtual |
|
delete |
| void activateCamera | ( | const std::shared_ptr< Camera > & | camera | ) |
Schedules activation of the specified camera for the next frame. The camera must belong to the current scene.
| camera | Camera to activate. |
| void addNode | ( | const std::shared_ptr< Node > & | node, |
| bool | async, | ||
| bool | attachToViewport | ||
| ) |
Adds a node to the current scene.
| node | Node to add. |
| async | If true, queues the add for the next frame. |
| attachToViewport | If true, attaches the node under the viewport root. |
| void draw | ( | vireo::CommandList & | commandList, |
| const Scene & | scene, | ||
| const std::shared_ptr< vireo::RenderTarget > & | colorAttachment, | ||
| const std::shared_ptr< vireo::RenderTarget > & | depthAttachment, | ||
| uint32 | frameIndex | ||
| ) | const |
Renders the provided Scene into the given color and depth attachments.
| commandList | Command buffer to record draw calls. |
| scene | Scene to draw (camera, lights, instances). |
| colorAttachment | Target color render surface. |
| depthAttachment | Target depth render surface. |
| frameIndex | Index of the in‑flight frame. |
|
inline |
Returns the aspect ratio (width/height) of the viewport.
|
inline |
Returns the immutable configuration used to create this viewport.
|
inline |
Returns the debug renderer (may be null).
|
inline |
Returns true when debug overlays are enabled.
|
inline |
Returns the physics scene associated with this viewport.
|
inline |
Returns the scissors rectangle applied to rendering.
|
inline |
Returns the vector renderer (may be null).
|
inline |
Returns the low‑level viewport definition (x, y, width, height, depth).
|
inline |
Returns the Window this viewport is attached to. Asserts if not attached.
|
inline |
Returns whether the scene is currently paused. This controls Node processing with respect to ProcessMode.
|
inline |
Prevents processing of deferred add/remove updates for the next frames.
|
delete |
| void removeNode | ( | const std::shared_ptr< Node > & | node, |
| bool | async | ||
| ) |
Removes a node from the current scene.
| node | Node to remove. |
| async | If true, queues the removal for the next frame. |
|
inline |
Enables or disables debug overlays rendering.
| void setPaused | ( | bool | pause | ) |
Pauses or resumes the current scene.
| pause | New state (true pauses, false resumes). |
| void setRootNode | ( | const std::shared_ptr< Node > & | node | ) |
Changes the current scene root node.
The provided node must not have a parent; ownership is shared.
| node | New root node of the scene graph. |
|
inline |
Sets the scissors rectangle applied to rendering.
|
inline |
Sets the low‑level viewport definition.
|
inline |
Allows processing of deferred add/remove updates again.
| void update | ( | const vireo::CommandList & | commandList, |
| uint32 | frameIndex | ||
| ) | const |
Updates the current frame (game state and scene) prior to rendering.
|
friend |