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{
11{
12 GraphicsApi graphicsApi{};
13 std::function<void()> onReady;
14 std::function<void()> onResize;
15};
16
17class SCORE_PLUGIN_GFX_EXPORT OutputNodeRenderer : public score::gfx::NodeRenderer
18{
19public:
20 using score::gfx::NodeRenderer::NodeRenderer;
21 virtual ~OutputNodeRenderer();
22 virtual void
23 finishFrame(RenderList&, QRhiCommandBuffer& commands, QRhiResourceUpdateBatch*& res);
24};
25
26class Window;
30class SCORE_PLUGIN_GFX_EXPORT OutputNode : public score::gfx::Node
31{
32public:
33 virtual ~OutputNode();
34
35 virtual void setRenderer(std::shared_ptr<RenderList>) = 0;
36 virtual RenderList* renderer() const = 0;
37
38 OutputNodeRenderer* createRenderer(RenderList& r) const noexcept override = 0;
39
40 virtual void startRendering() = 0;
41 virtual void render() = 0;
42 virtual void stopRendering() = 0;
43 virtual bool canRender() const = 0;
44 virtual void onRendererChange() = 0;
45
52 virtual void setVSyncCallback(std::function<void()>);
53
54 virtual void createOutput(OutputConfiguration conf) = 0;
55
56 virtual void updateGraphicsAPI(GraphicsApi);
57 virtual void destroyOutput() = 0;
58 virtual std::shared_ptr<RenderState> renderState() const = 0;
59
61 {
62 // If set, the host is responsible for calling render() at this
63 // rate (given in milliseconds)
64 std::optional<double> manualRenderingRate;
65 bool outputNeedsRenderPass{};
66 bool supportsVSync{};
67 OutputNode* parent{};
68 };
69
70 virtual Configuration configuration() const noexcept = 0;
71
72protected:
73 explicit OutputNode();
74};
75}
Root data model for visual nodes.
Definition score-plugin-gfx/Gfx/Graph/Node.hpp:71
Renderer for a given node.
Definition NodeRenderer.hpp:11
Base class for sink nodes (QWindow, spout, syphon, NDI output, ...)
Definition OutputNode.hpp:31
OutputNodeRenderer * createRenderer(RenderList &r) const noexcept override=0
Create a renderer in a given context for this node.
Definition OutputNode.hpp:18
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:22
Graphics rendering pipeline for ossia score.
Definition Filter/PreviewWidget.hpp:12
GraphicsApi
Available graphics APIs to use.
Definition RenderState.hpp:20
Definition OutputNode.hpp:11
Definition OutputNode.hpp:61