NDEVR
API Documentation
GraphicsSessionabstract

A GraphicsPipeline that is responsible for setting up and rendering the resources of a DesignObjectLookup. More...

Inheritance diagram for GraphicsSession:
[legend]
Collaboration diagram for GraphicsSession:
[legend]

Classes

struct  GeometryUpdateObject
 Tracks a geometry and its last modification time for incremental updates. More...

Public Types

enum  AddObjectMode { e_add_object , e_ensure_pipeline , e_ensure_pipeline_and_add }
 Modes for adding objects to the session. More...

Public Member Functions

virtual ~GraphicsSession ()
 Destructor.
virtual void addCamera (const UUID &object)
 Adds a camera to this session.
virtual bool addRenderGeometry (const Geometry &geo)=0
 Adds a geometry for rendering.
virtual DynamicPointer< GraphicsPipelinecreateRenderPipeline ()=0
 Creates a new render pipeline for a viewport.
bool isActive () const
 Checks whether this session is active.
virtual void postClearAll ()
 Called after all scene objects have been cleared.
virtual void readShader (const StringView &shader)=0
 Reads and compiles a shader for use in rendering.
virtual void removeCamera (const UUID &camera)
 Removes a camera from this session.
virtual void removeRenderGeometry (const Geometry &geo)=0
 Removes a geometry from rendering.
void setActive (bool active)
 Sets whether this session is active.
virtual UUID uuid ()=0
 Returns the unique identifier for this session.
Public Member Functions inherited from GraphicsPipeline
virtual ~GraphicsPipeline ()
 Destructor.
virtual void cleanResources ()=0
 Cleans up stale or unused GPU resources.
virtual void cleanup ()=0
 Releases all GPU resources.
virtual void commit (GraphicsUpdateArguments &args)=0
 Commits pending changes to the GPU.
virtual bool createPipeline (GraphicsUpdateArguments &args)=0
 Creates or recreates the rendering pipeline.
virtual const ConstPointer< GraphicsDevice > & device () const =0
 Returns the graphics device (const).
virtual const DynamicPointer< GraphicsDevice > & device ()=0
 Returns the graphics device.
virtual void drawFrame (GraphicsUpdateArguments &args)=0
 Renders a single frame.
virtual void ensureLastRenderComplete ()=0
 Blocks until the last submitted render is complete.
virtual bool hasCommand () const =0
 Checks whether there are pending commands to execute.
virtual void init (GraphicsUpdateArguments &args)=0
 Initializes the pipeline with the given arguments.
virtual bool runCommand (GraphicsUpdateArguments &args)=0
 Executes a queued rendering command.
virtual void setWindowInstance (WindowInstance *instance)=0
 Associates a window instance with this pipeline.
virtual void updateUniformBuffer (GraphicsUpdateArguments &args)=0
 Updates the camera uniform buffer on the GPU.

Protected Attributes

Buffer< UUIDm_added_cameras
 Cameras registered with this session.
bool m_is_active = false
 Whether this session is currently active.
bool m_needs_clear_all = false
 Whether a full clear is pending.
bool m_needs_command_refresh = false
 Whether command buffers need refreshing.

Detailed Description

A GraphicsPipeline that is responsible for setting up and rendering the resources of a DesignObjectLookup.


Definition at line 21 of file GraphicsSession.h.

Member Enumeration Documentation

◆ AddObjectMode

Modes for adding objects to the session.

Enumerator
e_add_object 

Add the object only.

e_ensure_pipeline 

Ensure the pipeline exists for the object.

e_ensure_pipeline_and_add 

Ensure the pipeline and add the object.

Definition at line 25 of file GraphicsSession.h.

Member Function Documentation

◆ addCamera()

virtual void GraphicsSession::addCamera ( const UUID & object)
virtual

Adds a camera to this session.

Parameters
[in]objectThe camera UUID.

◆ addRenderGeometry()

virtual bool GraphicsSession::addRenderGeometry ( const Geometry & geo)
pure virtual

Adds a geometry for rendering.

Parameters
[in]geoThe geometry to add.
Returns
True if the geometry was added.

Implemented in GLESGraphicsSession, and VulkanSession.

◆ createRenderPipeline()

virtual DynamicPointer< GraphicsPipeline > GraphicsSession::createRenderPipeline ( )
pure virtual

Creates a new render pipeline for a viewport.

Returns
The created pipeline.

Implemented in GLESGraphicsSession, and VulkanSession.

◆ isActive()

bool GraphicsSession::isActive ( ) const
inline

Checks whether this session is active.

Returns
True if active.

Definition at line 71 of file GraphicsSession.h.

References m_is_active.

◆ readShader()

virtual void GraphicsSession::readShader ( const StringView & shader)
pure virtual

Reads and compiles a shader for use in rendering.

Parameters
[in]shaderThe shader name or path.

Implemented in GLESGraphicsSession, and QtVulkanSession.

◆ removeCamera()

virtual void GraphicsSession::removeCamera ( const UUID & camera)
virtual

Removes a camera from this session.

Parameters
[in]cameraThe camera UUID.

◆ removeRenderGeometry()

virtual void GraphicsSession::removeRenderGeometry ( const Geometry & geo)
pure virtual

Removes a geometry from rendering.

Parameters
[in]geoThe geometry to remove.

Implemented in GLESGraphicsSession, and VulkanSession.

◆ setActive()

void GraphicsSession::setActive ( bool active)
inline

Sets whether this session is active.

Parameters
[in]activeWhether to activate the session.

Definition at line 74 of file GraphicsSession.h.

References m_is_active.

◆ uuid()

virtual UUID GraphicsSession::uuid ( )
pure virtual

Returns the unique identifier for this session.

Returns
The session UUID.

Implemented in GLESGraphicsSession, and VulkanSession.


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