OpenShaderDesigner
0.0.1
Loading...
Searching...
No Matches
Include
Graph
Nodes
Math.h
1
// =====================================================================================================================
2
// Copyright 2024 Medusa Slockbower
3
// Licensed under the Apache License, Version 2.0 (the "License");
4
// you may not use this file except in compliance with the License.
5
// You may obtain a copy of the License at
6
//
7
// http://www.apache.org/licenses/LICENSE-2.0
8
//
9
// Unless required by applicable law or agreed to in writing, software
10
// distributed under the License is distributed on an "AS IS" BASIS,
11
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
// See the License for the specific language governing permissions and
13
// limitations under the License.
14
// =====================================================================================================================
15
16
#ifndef MATH_H
17
#define MATH_H
18
19
#include <glm/vec4.hpp>
20
#include <Graph/ShaderGraph.h>
21
#include <open-cpp-utils/any.h>
22
23
namespace
ocu = open_cpp_utils;
24
25
namespace
OpenShaderDesigner::Nodes::Math
26
{
27
inline
static
constexpr
ImColor HeaderColor = ImColor(0x92, 0x16, 0x16);
28
29
struct
Constant
:
public
Node
30
{
31
using
ValueType = ocu::any<int, unsigned int, float, glm::vec4>;
32
33
Constant
(
ShaderGraph
& graph, ImVec2 pos);
34
virtual
~Constant
() =
default
;
35
36
[[nodiscard]]
Node
* Copy(
ShaderGraph
& graph)
const override
;
37
void
Inspect()
override
;
38
39
ValueType Value;
40
};
41
42
RegisterNode(
"Math/Constant"
,
Constant
);
43
44
struct
Add
:
public
Node
45
{
46
Add
(
ShaderGraph
& graph, ImVec2 pos);
47
virtual
~Add
() =
default
;
48
49
[[nodiscard]]
Node
* Copy(
ShaderGraph
& graph)
const override
;
50
void
Inspect()
override
;
51
};
52
53
RegisterNode(
"Math/Add"
,
Add
);
54
}
55
56
#endif
//MATH_H
OpenShaderDesigner::ShaderGraph
Definition
ShaderGraph.h:141
OpenShaderDesigner::Node
Definition
ShaderGraph.h:104
OpenShaderDesigner::Nodes::Math::Add
Definition
Math.h:45
OpenShaderDesigner::Nodes::Math::Constant
Definition
Math.h:30
Generated by
1.11.0