score::gfx::Graph Struct Reference

Represents a graph of renderers. More...

Detailed Description

Represents a graph of renderers.

Public Member Functions

 Graph ()
 Create a render graph.
 
void addNode (score::gfx::Node *n)
 Add a node to the graph.
 
void removeNode (score::gfx::Node *n)
 Remove a node from the graph.
 
void addEdge (Port *source, Port *sink)
 Add an edge between two nodes.
 
void removeEdge (Port *source, Port *sink)
 Remove an edge between two nodes.
 
void addAndLinkEdge (Port *source, Port *sink)
 Add an edge between two nodes and creates relevant pipelines.
 
void unlinkAndRemoveEdge (Port *source, Port *sink)
 Remove an edge between two nodes and free the pipelines.
 
void clearEdges ()
 Remove all edges.
 
void createAllRenderLists (GraphicsApi graphicsApi)
 For each output node, create the sequence of render events that will be called.
 
void createSingleRenderList (score::gfx::OutputNode &node, GraphicsApi graphicsApi)
 Create a sequence of render events for a single output node.
 
void destroyOutputRenderList (score::gfx::OutputNode &node)
 Free the render list of an output node if any.
 
void relinkGraph ()
 Recreate the connections between renderers when edges changed.
 
void setVSyncCallback (std::function< void()>)
 Set a callback to drive rendering when there is a single output. More...
 
bool canDoVSync () const noexcept
 True if the graph supports being driven by the screen vertical synchronization.
 
const std::vector< std::shared_ptr< RenderList > > & renderLists () const noexcept
 

Member Function Documentation

◆ setVSyncCallback()

void score::gfx::Graph::setVSyncCallback ( std::function< void()>  cb)

Set a callback to drive rendering when there is a single output.

If we render to a single window, we can use the GPU V-Sync mechanism. Otherwise the implementation will create timers to keep things in sync.


The documentation for this struct was generated from the following files: