Cogs.Core
Extensions
Gui
Source
GuiSystem.h
1
#pragma once
2
3
#include "GuiComponent.h"
4
5
#include "Systems/ComponentSystem.h"
6
7
#include "GuiDocument.h"
8
#include "GuiContainer.h"
9
10
namespace
Cogs
11
{
12
namespace
Core
13
{
14
struct
GuiData
15
{
16
~GuiData
();
17
18
litehtml::document::ptr htmlDocument;
19
std::string theme;
20
21
glm::vec2 size;
22
23
float
pointerX;
24
float
pointerY;
25
26
float
lastX = 0.0f;
27
float
lastY = 0.0f;
28
29
bool
pointerInside;
30
bool
pointerRelative;
31
32
bool
pointerState;
33
bool
pointerDown;
34
bool
pointerUp;
35
bool
invalidated;
36
};
37
38
class
GuiSystem
:
public
ComponentSystemWithDataPool
<GuiComponent, GuiData>
39
{
40
public
:
41
GuiSystem
(
Memory::Allocator
* allocator,
SizeType
capacity) :
ComponentSystemWithDataPool
(allocator, capacity) {}
42
~GuiSystem
();
43
44
virtual
void
update
(
Context
*
context
)
override
;
45
void
updateInputs(
const
GuiComponent
& guiComponent,
GuiData
& guiData);
46
47
private
:
48
using
ThemeMap = std::map<std::string, litehtml::css*>;
49
50
ThemeMap themes;
51
};
52
}
53
}
Cogs::Core::ComponentSystemBase::context
Context * context
Pointer to the Context instance the system lives in.
Definition:
ComponentSystem.h:136
Cogs::Core::ComponentSystemBase::update
void update()
Updates the system state to that of the current frame.
Definition:
ComponentSystem.h:65
Cogs::Core::ComponentSystemWithDataPool
Component system with parallel data per component stored in a pool similar to how the components them...
Definition:
ComponentSystem.h:365
Cogs::Core::Context
A Context instance contains all the services, systems and runtime components needed to use Cogs.
Definition:
Context.h:83
Cogs::Core::GuiSystem
Definition:
GuiSystem.h:39
Cogs::Memory::Allocator
Base allocator implementation.
Definition:
Allocator.h:30
Cogs
Contains all Cogs related functionality.
Definition:
FieldSetter.h:23
Cogs::SizeType
ComponentIndex SizeType
Type used to track the size of pools.
Definition:
Component.h:19
Cogs::Core::GuiComponent
Definition:
GuiComponent.h:25
Cogs::Core::GuiData
Definition:
GuiSystem.h:15
Generated by
1.9.6