Hymn to Beauty
C++ 3D Engine
Engine.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <Video/Renderer.hpp>
4
5#if ANDROID
6#include <game-activity/native_app_glue/android_native_app_glue.h>
7#endif
8
10class Engine {
11 public:
13
18 bool Start();
19
21
25
27
30 bool ShouldClose() const;
31
33
36 void Update();
37
39
42 double GetDeltaTime() const;
43
45 void Render();
46
48 void Present();
49
51 void Shutdown();
52
55#if ANDROID
57 ANativeWindow* androidWindow;
58#else
60 int width = 1024;
61
63 int height = 768;
64
66 bool fullscreen = false;
67
69 bool borderless = false;
70#endif
71
73 bool debug = false;
74
76 double targetFPS = 60.0;
77
79
82 bool paused = false;
83
87
88 private:
89 Utility::Window* window = nullptr;
90
91 double deltaTime = 0.0;
92 double lastTime;
93 double lastTimeRender;
94};
An instance of the engine.
Definition: Engine.hpp:10
void Shutdown()
Shut down the engine.
Definition: Engine.cpp:122
bool Start()
Start the engine based on the Configuration.
Definition: Engine.cpp:19
Utility::Window * GetWindow()
Get the window.
Definition: Engine.cpp:47
void Present()
Swap buffers and wait for next frame.
Definition: Engine.cpp:98
bool ShouldClose() const
Get whether the application should close.
Definition: Engine.cpp:51
void Update()
Update the engine.
Definition: Engine.cpp:55
double GetDeltaTime() const
Get time between frames.
Definition: Engine.cpp:87
void Render()
Render a frame.
Definition: Engine.cpp:91
struct Engine::Configuration configuration
Definition: Window.hpp:14
GraphicsAPI
The supported graphics APIs.
Definition: Renderer.hpp:35
Engine configuration.
Definition: Engine.hpp:54
int width
Window width.
Definition: Engine.hpp:60
bool paused
Whether the hymn is paused.
Definition: Engine.hpp:82
int height
Window height.
Definition: Engine.hpp:63
bool fullscreen
Whether to run in fullscreen mode.
Definition: Engine.hpp:66
Video::Renderer::GraphicsAPI graphicsAPI
Which graphics API to use for rendering.
Definition: Engine.hpp:85
double targetFPS
The target FPS.
Definition: Engine.hpp:76
bool borderless
Whether to run in borderless window mode.
Definition: Engine.hpp:69
bool debug
Whether to run in debug context.
Definition: Engine.hpp:73