neoGFX
Cross-platform C++ app/game engine
Loading...
Searching...
No Matches
outline.hpp
Go to the documentation of this file.
1
// outline.hpp
2
/*
3
neogfx C++ App/Game Engine
4
Copyright (c) 2018, 2020 Leigh Johnston. All Rights Reserved.
5
6
This program is free software: you can redistribute it and / or modify
7
it under the terms of the GNU General Public License as published by
8
the Free Software Foundation, either version 3 of the License, or
9
(at your option) any later version.
10
11
This program is distributed in the hope that it will be useful,
12
but WITHOUT ANY WARRANTY; without even the implied warranty of
13
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
GNU General Public License for more details.
15
16
You should have received a copy of the GNU General Public License
17
along with this program. If not, see <http://www.gnu.org/licenses/>.
18
*/
19
20
#pragma once
21
22
#include <
neogfx/neogfx.hpp
>
23
#include <
neolib/core/uuid.hpp
>
24
#include <
neolib/core/string.hpp
>
25
#include <
neogfx/gfx/color.hpp
>
26
#include <
neogfx/game/ecs_ids.hpp
>
27
#include <
neogfx/game/component.hpp
>
28
#include <
neogfx/game/color.hpp
>
29
#include <
neogfx/game/gradient.hpp
>
30
#include <
neogfx/game/texture.hpp
>
31
32
namespace
neogfx::game
33
{
34
struct
outline
35
{
36
scalar
width
;
37
bool
antiAliased
;
38
std::optional<color>
color
;
39
std::optional<gradient>
gradient
;
40
41
struct
meta
:
i_component_data::meta
42
{
43
static
const
neolib::uuid
&
id
()
44
{
45
static
const
neolib::uuid
sId = { 0xcf2bbde0, 0xc7be, 0x48a1, 0xb9dd, { 0x1, 0xc7, 0x6, 0xfb, 0x7b, 0x8d } };
46
return
sId;
47
}
48
static
const
i_string
&
name
()
49
{
50
static
const
string
sName =
"Outline"
;
51
return
sName;
52
}
53
static
uint32_t
field_count
()
54
{
55
return
4;
56
}
57
static
component_data_field_type
field_type
(uint32_t aFieldIndex)
58
{
59
switch
(aFieldIndex)
60
{
61
case
0:
62
return
component_data_field_type::Scalar;
63
case
1:
64
return
component_data_field_type::Bool;
65
case
2:
66
case
3:
67
return
component_data_field_type::ComponentData | component_data_field_type::Optional;
68
default
:
69
throw
invalid_field_index
();
70
}
71
}
72
static
neolib::uuid
field_type_id
(uint32_t aFieldIndex)
73
{
74
switch
(aFieldIndex)
75
{
76
case
2:
77
return
color::meta::id();
78
case
3:
79
return
gradient::meta::id
();
80
default
:
81
throw
invalid_field_index
();
82
}
83
}
84
static
const
i_string
&
field_name
(uint32_t aFieldIndex)
85
{
86
static
const
string
sFieldNames[] =
87
{
88
"Width"
,
89
"Antialiased"
90
"Color"
,
91
"Gradient"
92
};
93
return
sFieldNames[aFieldIndex];
94
}
95
};
96
};
97
}
neogfx::basic_gradient::id
gradient_id id() const override
neolib::i_string
Definition
i_string.hpp:49
color.hpp
gradient.hpp
texture.hpp
color.hpp
neogfx::game
Definition
aabb_octree.hpp:31
neolib::ecs::component_data_field_type
component_data_field_type
Definition
i_component_data.hpp:52
neolib::math::scalar
double scalar
Definition
numerical.hpp:63
component.hpp
ecs_ids.hpp
neogfx.hpp
string.hpp
neogfx::game::outline::meta
Definition
outline.hpp:42
neogfx::game::outline::meta::field_count
static uint32_t field_count()
Definition
outline.hpp:53
neogfx::game::outline::meta::field_type
static component_data_field_type field_type(uint32_t aFieldIndex)
Definition
outline.hpp:57
neogfx::game::outline::meta::name
static const i_string & name()
Definition
outline.hpp:48
neogfx::game::outline::meta::id
static const neolib::uuid & id()
Definition
outline.hpp:43
neogfx::game::outline::meta::field_type_id
static neolib::uuid field_type_id(uint32_t aFieldIndex)
Definition
outline.hpp:72
neogfx::game::outline::meta::field_name
static const i_string & field_name(uint32_t aFieldIndex)
Definition
outline.hpp:84
neogfx::game::outline
Definition
outline.hpp:35
neogfx::game::outline::width
scalar width
Definition
outline.hpp:36
neogfx::game::outline::antiAliased
bool antiAliased
Definition
outline.hpp:37
neogfx::game::outline::gradient
std::optional< gradient > gradient
Definition
outline.hpp:39
neogfx::game::outline::color
std::optional< color > color
Definition
outline.hpp:38
neolib::ecs::i_component_data::meta::invalid_field_index
Definition
i_component_data.hpp:134
neolib::ecs::i_component_data::meta
Definition
i_component_data.hpp:133
neolib::uuid
Definition
uuid.hpp:51
uuid.hpp
include
neogfx
game
outline.hpp
Generated by
1.9.8