Loading...
Searching...
No Matches
TextNode.hpp
1#pragma once
2
3#include <Gfx/Graph/Node.hpp>
4
5#include <QFont>
6#include <QPen>
7
8namespace score::gfx
9{
14{
15public:
16 explicit TextNode();
17 virtual ~TextNode();
18
19 score::gfx::NodeRenderer* createRenderer(RenderList& r) const noexcept override;
20
21 void process(Message&& msg) override;
22 class Renderer;
23
24#pragma pack(push, 1)
25 struct UBO
26 {
27 float opacity{1.};
28 float padding_std140_0{};
29 // Clip-space offset (added to the text quad in the vertex shader). {0,0} is
30 // screen centre; the previous {0.5,0.5} default shifted an unconfigured Text
31 // process ~half a screen up+right — off the top edge — so default text was
32 // invisible until Position was touched. (video/text render validation)
33 float position[2]{0.0, 0.0};
34 float scale[2]{1., 1.};
35 } ubo;
36#pragma pack(pop)
37
38 QString text;
39 QFont font;
40 QPen pen;
41
42 std::atomic_int64_t mustRerender{0};
43
44private:
45};
46
47}
Common base class for most single-pass, simple nodes.
Definition score-plugin-gfx/Gfx/Graph/Node.hpp:228
Renderer for a given node.
Definition NodeRenderer.hpp:11
List of nodes to be rendered to an output.
Definition RenderList.hpp:30
Definition TextNode.cpp:84
Graphics rendering pipeline for ossia score.
Definition Filter/PreviewWidget.hpp:11
Definition score-plugin-gfx/Gfx/Graph/Node.hpp:49
Definition TextNode.hpp:26
A node that renders text to screen.
Definition TextNode.hpp:14
score::gfx::NodeRenderer * createRenderer(RenderList &r) const noexcept override
Create a renderer in a given context for this node.
Definition TextNode.cpp:223
void process(Message &&msg) override
Process a message from the execution engine.
Definition TextNode.cpp:228