Lugdunum
0.1.0
include
lug
Core
Application.hpp
Go to the documentation of this file.
1
#pragma once
2
3
#include <cstdint>
4
5
#include <
lug/Core/Export.hpp
>
6
#include <
lug/Core/Version.hpp
>
7
#include <
lug/Graphics/Graphics.hpp
>
8
#include <
lug/Graphics/Render/Window.hpp
>
9
#include <
lug/System/Time.hpp
>
10
11
namespace
lug
{
12
namespace
Core {
13
20
class
LUG_CORE_API
Application
{
21
public
:
22
struct
Info
{
23
std::string
name
;
24
Version
version
;
25
};
26
27
public
:
28
explicit
Application
(
const
Info
& info);
29
30
Application
(
const
Application
&) =
delete
;
31
Application
(
Application
&&) =
delete
;
32
33
Application
& operator=(
const
Application
&) =
delete
;
34
Application
& operator=(
Application
&&) =
delete
;
35
36
virtual
~
Application
() =
default
;
37
43
const
Application::Info
& getInfo()
const
;
44
50
lug::Graphics::Graphics
& getGraphics();
51
const
lug::Graphics::Graphics
& getGraphics()
const
;
52
58
lug::Graphics::Render::Window
* getWindow();
59
const
lug::Graphics::Render::Window
* getWindow()
const
;
60
66
void
setRenderWindowInfo(
lug::Graphics::Render::Window::InitInfo
& initInfo);
67
73
const
lug::Graphics::Render::Window::InitInfo
& getRenderWindowInfo()
const
;
74
lug::Graphics::Render::Window::InitInfo
& getRenderWindowInfo();
75
81
void
setGraphicsInfo(
const
lug::Graphics::Graphics::InitInfo
& initInfo);
82
88
const
lug::Graphics::Graphics::InitInfo
& getGraphicsInfo()
const
;
89
lug::Graphics::Graphics::InitInfo
& getGraphicsInfo();
90
103
bool
init(
int
argc,
char
* argv[]);
104
116
bool
beginInit(
int
argc,
char
* argv[]);
117
126
bool
finishInit();
127
135
bool
run();
136
142
void
close
();
143
151
virtual
void
onEvent(
const
lug::Window::Event
& event) = 0;
152
158
virtual
void
onFrame(
const
System::Time
& elapsedTime) = 0;
159
160
private
:
161
bool
beginFrame(
const
lug::System::Time
& elapsedTime);
162
bool
endFrame();
163
164
private
:
165
Info
_info
;
166
bool
_closed{
false
};
167
168
169
lug::Graphics::Graphics::InitInfo
_graphicsInitInfo{
170
lug::Graphics::Renderer::Type::Vulkan
,
// type
171
{
// rendererInitInfo
172
"shaders/"
,
// shaders root
173
lug::Graphics::Render::Technique::Type::Forward
,
// renderTechnique
174
lug::Graphics::Renderer::DisplayMode::Full
// displayMode
175
},
176
{
// mandatoryModules
177
lug::Graphics::Module::Type::Core
178
},
179
{},
// optionalModules
180
};
181
182
lug::Graphics::Render::Window::InitInfo
_renderWindowInitInfo{
183
{
// windowInitInfo
184
800,
// width
185
600,
// height
186
"Lugdunum - Default title"
,
// title
187
lug::Window::Style::Default
// style
188
},
189
190
{}
// renderViewsInitInfo
191
};
192
193
lug::Graphics::Render::Window
* _window{
nullptr
};
194
195
protected
:
196
lug::Graphics::Graphics
_graphics
;
197
};
198
199
200
#include <
lug/Core/Application.inl
>
201
202
}
// Core
203
}
// lug
lug::Core::Version
Stores the version of the Application.
Definition:
Version.hpp:9
Application.inl
lug::Graphics::Render::Window::InitInfo
Definition:
Window.hpp:16
lug::Window::Event
Represents an event.
Definition:
Event.hpp:89
Export.hpp
lug::Core::Application::Info::name
std::string name
Definition:
Application.hpp:23
lug::Core::Application::_graphics
lug::Graphics::Graphics _graphics
Definition:
Application.hpp:196
lug::Graphics::Graphics::InitInfo
Utility structure used to initialize the Graphics component.
Definition:
Graphics.hpp:30
lug::Core::Application::Info::version
Version version
Definition:
Application.hpp:24
Time.hpp
lug::Graphics::Render::Technique::Type::Forward
lug::Core::Application::_info
Info _info
Definition:
Application.hpp:165
Graphics.hpp
lug::Core::Application::Info
Definition:
Application.hpp:22
lug::Core::Application
Class for application.
Definition:
Application.hpp:20
lug::Graphics::Render::Window
Definition:
Window.hpp:14
close
void close(Handle handle)
Definition:
Library.inl:48
lug::System::Time
Definition:
Time.hpp:9
Version.hpp
lug
Definition:
Application.hpp:11
lug::Graphics::Renderer::Type::Vulkan
LUG_CORE_API
#define LUG_CORE_API
Definition:
Export.hpp:11
lug::Graphics::Graphics
Class for graphics.
Definition:
Graphics.hpp:25
lug::Graphics::Renderer::DisplayMode::Full
Window.hpp
lug::Window::Style::Default
Generated by
1.8.13