GA::kit v0.3
G&A's in-house C++ application framework
Loading...
Searching...
No Matches
tint_component.h
Go to the documentation of this file.
1#pragma once
2#include "ga/color.h"
3#include "ga/render.h"
5
6namespace ga {
7
8class Tint : public Component
9{
10public:
11 Color color { 1.f };
12
13protected:
14 friend class Node;
15 void setNode( std::shared_ptr<Node> node ) override
16 {
17 Component::setNode( node );
18 // hook into node's draw cycle
19 if ( node ) {
20 m_connWillDraw = node->onWillDraw.connect( [this]() {
23 } );
24
25 m_connDidDraw = node->onDidDraw.connect( [this]() {
27 } );
28 } else {
31 }
32 }
35};
36
37} // namespace ga
Definition: component.h:11
virtual void setNode(std::shared_ptr< Node > node)
Definition: component.h:38
Node represents a basic "node" (or view) in the scenegraph.
Definition: node.h:46
const ga::Color & getGlobalColor()
Definition: render.cpp:127
void setGlobalColor(const ga::Color &color)
Definition: render.cpp:119
Definition: tint_component.h:9
ScopedConnection m_connDidDraw
Definition: tint_component.h:33
Color color
Definition: tint_component.h:11
Color m_pGlobalColor
Definition: tint_component.h:34
void setNode(std::shared_ptr< Node > node) override
Definition: tint_component.h:15
ScopedConnection m_connWillDraw
Definition: tint_component.h:33
bool disconnect() noexcept
Definition: sigslot.hpp:648
Definition: sigslot.hpp:688
Definition: color.h:9
ga::vec4 Color
Definition: color.h:12
Renderer & getRenderer()
Definition: render.h:50