Cogs.Core
GuiComponent.h
1#pragma once
2
3#include "EntityPtr.h"
4#include "Types.h"
5#include "Resources/Resources.h"
6
7#include "Foundation/ComponentModel/Component.h"
8
9#include <glm/vec2.hpp>
10
11namespace Cogs
12{
13 namespace Core
14 {
15 enum class GuiPointerSource
16 {
17 Auto = 0,
18 Mouse,
19 ProjectedMouse,
20 ProjectedCenter,
21 Projector,
22 };
23
25 {
26 GuiDocumentHandle document;
27 std::string theme;
28 uint32_t listenerID = 0;
29
30 glm::vec2 planeSize = { 1, 1 };
31
32 GuiPointerSource pointerSource = GuiPointerSource::Auto;
33 std::string pointerAction = "LeftMouse";
34
35 EntityPtr projector;
36
37 bool alwaysInvalidate = false;
38
39 static void registerType();
40 };
41 }
42}
43
44template<> inline Cogs::StringView getName<Cogs::Core::GuiPointerSource>() { return "GuiPointerSource"; }
45template<> inline Cogs::StringView getName<Cogs::Core::GuiComponent>() { return "GuiComponent"; }
Base class for Component instances.
Definition: Component.h:143
Provides a weakly referenced view over the contents of a string.
Definition: StringView.h:24
std::shared_ptr< ComponentModel::Entity > EntityPtr
Smart pointer for Entity access.
Definition: EntityPtr.h:12
Contains all Cogs related functionality.
Definition: FieldSetter.h:23