Grindstone Game Engine
v0.2.0
An open source game engine and toolkit.
Toggle main menu visibility
Loading...
Searching...
No Matches
Interface.hpp
1
#pragma once
2
3
#include "../pch.hpp"
4
5
#include <cstdint>
6
#include <functional>
7
8
#include <Common/Display/Display.hpp>
9
#include <Common/Graphics/Core.hpp>
10
#include <Common/Logging.hpp>
11
#include <Common/ResourcePipeline/AssetType.hpp>
12
#include <Common/Window/Window.hpp>
13
#include <EngineCore/AssetRenderer/BaseAssetRenderer.hpp>
14
#include <EngineCore/Assets/AssetImporter.hpp>
15
#include <EngineCore/ECS/ComponentFunctions.hpp>
16
#include <EngineCore/ECS/ComponentRegistrar.hpp>
17
#include <EngineCore/ECS/SystemFactory.hpp>
18
#include <EngineCore/ECS/SystemRegistrar.hpp>
19
#include <EngineCore/Logger.hpp>
20
#include <EngineCore/WorldContext/WorldContext.hpp>
21
22
namespace
Grindstone
{
23
namespace
Memory::AllocatorCore
{
24
struct
AllocatorState
;
25
}
26
27
namespace
GraphicsAPI
{
28
class
Core;
29
}
30
31
namespace
ECS
{
32
class
SystemRegistrar
;
33
}
34
35
namespace
Rendering
{
36
class
RendererFeature;
37
}
38
39
class
CvarSystem
;
40
class
WindowManager
;
41
class
DisplayManager
;
42
class
BaseAssetRenderer
;
43
44
namespace
Plugins
{
45
class
Manager;
46
47
class
IEditorInterface
{
48
public
:
49
virtual
~IEditorInterface
() {}
50
};
51
52
namespace
Rendering
{
53
class
RendererFeature;
54
}
55
56
class
ENGINE_CORE_API
Interface
{
57
public
:
58
virtual
void
SetEditorInterface(
Grindstone::Plugins::IEditorInterface
* editorInterface);
59
virtual
Grindstone::Plugins::IEditorInterface
* GetEditorInterface()
const
;
60
61
virtual
EngineCore
* GetEngineCore();
62
virtual
GraphicsAPI::Core
* GetGraphicsCore();
63
virtual
void
RegisterGraphicsCore(
Grindstone::GraphicsAPI::Core
* core);
64
virtual
void
RegisterWindowManager(
Grindstone::WindowManager
*);
65
virtual
void
RegisterDisplayManager(
Grindstone::DisplayManager
*);
66
virtual
Window
* CreateDisplayWindow(
Window::CreateInfo
&);
67
virtual
Display
GetMainDisplay();
68
virtual
uint8_t CountDisplays();
69
virtual
void
EnumerateDisplays(
Display
* displays);
70
virtual
void
RegisterSystem(
const
char
* name, ECS::SystemFactory factory);
71
virtual
void
RegisterEditorSystem(
const
char
* name, ECS::SystemFactory factory);
72
virtual
void
UnregisterSystem(
const
char
* name);
73
virtual
void
UnregisterEditorSystem(
const
char
* name);
74
virtual
void
RegisterAssetRenderer(
BaseAssetRenderer
* assetRenderer);
75
virtual
void
UnregisterAssetRenderer(
BaseAssetRenderer
* assetRenderer);
76
virtual
void
RegisterAssetType(AssetType assetType,
const
char
* typeName,
AssetImporter
* assetImporter);
77
virtual
void
UnregisterAssetType(AssetType assetType);
78
virtual
Grindstone::HashedString::HashMap* GetHashedStringMap()
const
;
79
virtual
Grindstone::Logger::LoggerState
* GetLoggerState()
const
;
80
virtual
Grindstone::Memory::AllocatorCore::AllocatorState
* GetAllocatorState()
const
;
81
virtual
Grindstone::CvarSystem
* GetCvarSystem()
const
;
82
virtual
void
RegisterWorldContextFactory(
Grindstone::HashedString
contextName,
Grindstone::UniquePtr<Grindstone::WorldContext>
(*FactoryFn)());
83
virtual
void
UnregisterWorldContextFactory(
Grindstone::HashedString
contextName);
84
virtual
void
RegisterRendererFeature(
Grindstone::Rendering::RendererFeature
* feature);
85
virtual
void
UnregisterRendererFeature(
const
char
* name);
86
87
template
<
typename
ClassType>
88
void
RegisterWorldContextFactory(
Grindstone::HashedString
contextName) {
89
RegisterWorldContextFactory(contextName, Grindstone::WorldContext::Create<ClassType>);
90
}
91
92
template
<
typename
ClassType>
93
void
RegisterComponent() {
94
componentRegistrar->RegisterComponent<ClassType>();
95
}
96
97
template
<
typename
T>
98
void
UnregisterComponent() {
99
componentRegistrar->UnregisterComponent<T>();
100
}
101
102
template
<
typename
ClassType>
103
void
RegisterRendererFeature() {
104
RegisterRendererFeature(Grindstone::Memory::AllocatorCore::Allocate<ClassType>());
105
}
106
107
template
<
typename
ClassType>
108
void
UnregisterRendererFeature() {
109
UnregisterRendererFeature(ClassType::GetStaticFeatureName());
110
}
111
112
template
<
typename
Asset>
113
void
RegisterAssetType(
AssetImporter
* assetImporter) {
114
RegisterAssetType(Asset::GetStaticType(), Asset::GetStaticTypeName().c_str(), assetImporter);
115
}
116
117
template
<
typename
Asset>
118
void
UnregisterAssetType() {
119
UnregisterAssetType(Asset::GetStaticType());
120
}
121
122
ECS::ComponentRegistrar
* componentRegistrar =
nullptr
;
123
ECS::SystemRegistrar
* systemRegistrar =
nullptr
;
124
private
:
125
Grindstone::Plugins::IEditorInterface
* editorInterface =
nullptr
;
126
Grindstone::Window
* (*windowFactoryFn)(
Grindstone::Window::CreateInfo
&) =
nullptr
;
127
Grindstone::Display
(*getMainDisplayFn)() =
nullptr
;
128
uint8_t (*countDisplaysFn)() =
nullptr
;
129
void (*enumerateDisplaysFn)(
Grindstone::Display
*) =
nullptr
;
130
};
131
}
132
}
Grindstone::AssetImporter
Definition
AssetImporter.hpp:11
Grindstone::BaseAssetRenderer
Definition
BaseAssetRenderer.hpp:25
Grindstone::CvarSystem
Definition
Cvars.hpp:42
Grindstone::DisplayManager
Definition
DisplayManager.hpp:8
Grindstone::ECS::ComponentRegistrar
Definition
ComponentRegistrar.hpp:18
Grindstone::ECS::SystemRegistrar
Definition
SystemRegistrar.hpp:12
Grindstone::EngineCore
Definition
EngineCore.hpp:63
Grindstone::GraphicsAPI::Core
Definition
Core.hpp:41
Grindstone::HashedString
Definition
HashedString.hpp:9
Grindstone::Plugins::IEditorInterface
Definition
Interface.hpp:47
Grindstone::Plugins::Interface
Definition
Interface.hpp:56
Grindstone::Rendering::RendererFeature
Definition
RendererFeature.hpp:10
Grindstone.SystemRegistrar
Definition
SystemRegistrar.cs:4
Grindstone::UniquePtr
Definition
UniquePtr.hpp:7
Grindstone::WindowManager
Definition
WindowManager.hpp:7
Grindstone::Window
Definition
Window.hpp:12
Grindstone::ECS
Definition
ComponentInspector.hpp:11
Grindstone::GraphicsAPI
Definition
Buffer.hpp:9
Grindstone::Memory::AllocatorCore
Definition
Interface.hpp:23
Grindstone::Plugins::Rendering
Definition
Interface.hpp:52
Grindstone::Plugins
Definition
EditorPluginInterface.hpp:17
Grindstone::Rendering
Definition
AssetRendererFilter.hpp:6
Grindstone
Definition
Assert.hpp:16
Grindstone::Display
Definition
Display.hpp:6
Grindstone::Logger::LoggerState
Definition
Logger.hpp:14
Grindstone::Memory::AllocatorCore::AllocatorState
Definition
MemoryAllocator.hpp:9
Grindstone::Window::CreateInfo
Definition
Window.hpp:20
sources
code
EngineCore
PluginSystem
Interface.hpp
Generated by
1.17.0