Loading...
Searching...
No Matches
OutputNode.hpp
1#pragma once
2#include <Gfx/Graph/Node.hpp>
3#include <Gfx/Graph/NodeRenderer.hpp>
4#include <Gfx/Graph/RenderState.hpp>
5#include <Gfx/Graph/Uniforms.hpp>
6
7#include <score_plugin_gfx_export.h>
8namespace score::gfx
9{
10class SCORE_PLUGIN_GFX_EXPORT OutputNodeRenderer : public score::gfx::NodeRenderer
11{
12public:
13 using score::gfx::NodeRenderer::NodeRenderer;
14 virtual ~OutputNodeRenderer();
15 virtual void
16 finishFrame(RenderList&, QRhiCommandBuffer& commands, QRhiResourceUpdateBatch*& res);
17};
18
19class Window;
23class SCORE_PLUGIN_GFX_EXPORT OutputNode : public score::gfx::Node
24{
25public:
26 virtual ~OutputNode();
27
28 virtual void setRenderer(std::shared_ptr<RenderList>) = 0;
29 virtual RenderList* renderer() const = 0;
30
31 OutputNodeRenderer* createRenderer(RenderList& r) const noexcept override = 0;
32
33 virtual void startRendering() = 0;
34 virtual void render() = 0;
35 virtual void stopRendering() = 0;
36 virtual bool canRender() const = 0;
37 virtual void onRendererChange() = 0;
38
39 virtual void createOutput(
40 GraphicsApi graphicsApi, std::function<void()> onReady,
41 std::function<void()> onUpdate, std::function<void()> onResize)
42 = 0;
43
44 virtual void updateGraphicsAPI(GraphicsApi);
45 virtual void destroyOutput() = 0;
46 virtual std::shared_ptr<RenderState> renderState() const = 0;
47
49 {
50 // If set, the host is responsible for calling render() at this
51 // rate (given in milliseconds)
52 std::optional<double> manualRenderingRate;
53 bool outputNeedsRenderPass{};
54 OutputNode* parent{};
55 };
56
57 virtual Configuration configuration() const noexcept = 0;
58
59protected:
60 explicit OutputNode();
61};
62}
Root data model for visual nodes.
Definition score-plugin-gfx/Gfx/Graph/Node.hpp:75
Renderer for a given node.
Definition NodeRenderer.hpp:11
Base class for sink nodes (QWindow, spout, syphon, NDI output, ...)
Definition OutputNode.hpp:24
OutputNodeRenderer * createRenderer(RenderList &r) const noexcept override=0
Create a renderer in a given context for this node.
Definition OutputNode.hpp:11
List of nodes to be rendered to an output.
Definition RenderList.hpp:19
A platform window in which the content is going to be rendered.
Definition plugins/score-plugin-gfx/Gfx/Graph/Window.hpp:19
Graphics rendering pipeline for ossia score.
Definition Filter/PreviewWidget.hpp:12
GraphicsApi
Available graphics APIs to use.
Definition RenderState.hpp:17
Definition OutputNode.hpp:49