| Fling Engine 0.00.1 Fling Engine is a game engine written in Vulkan

Game.h
Go to the documentation of this file.
1 #pragma once
2
3 #include "NonCopyable.hpp"
4 #include <string>
5 #include <entt/entity/registry.hpp>
6 //#include "World.h"
7
8 namespace Fling
9 {
16 class Game : public NonCopyable
17 {
18 // Friend class to the engine so that we can ensure the proper world is setup
19 friend class Engine;
20
21 public:
22
26 virtual void Init(entt::registry& t_Reg) = 0;
27
28 /* Called when the engine is shutting down */
29 virtual void Shutdown(entt::registry& t_Reg) = 0;
30
34 virtual void Update(entt::registry& t_Reg, float DeltaTime) = 0;
35
42 FORCEINLINE class World* GetWorld() const { assert(m_OwningWorld); return m_OwningWorld; }
43
49 FORCEINLINE bool WantsToQuit() const { return m_WantsToQuit; }
50
51 protected:
52
53 // You really should not be implementing the game's ctor
54 Game() = default;
55 virtual ~Game() = default;
56
58 class World* m_OwningWorld = nullptr;
59
61 bool m_WantsToQuit = false;
62 };
63 } // namespace Fling
Fling::Game::m_WantsToQuit
bool m_WantsToQuit
Change this value to true when the game is ready to exit the application entirely.
Definition: Game.h:61
Fling::Game::GetWorld
FORCEINLINE class World * GetWorld() const
Gets the owning world of this game.
Definition: Game.h:42
Fling::Engine
Core engine class of Fling.
Definition: Engine.h:35
Fling::Game
The game class is mean to be overridden on a per-game instance.
Definition: Game.h:16
Fling::Game::WantsToQuit
FORCEINLINE bool WantsToQuit() const
If true then this game wants to texit the application entirely.
Definition: Game.h:49
Fling::Game::~Game
virtual ~Game()=default
NonCopyable.hpp
Fling::World
The world holds all active levels in the game.
Definition: World.h:21
Fling::Game::Init
virtual void Init(entt::registry &t_Reg)=0
Called before the first Update tick.
Definition: SandboxGame.cpp:25
Fling::Game::Game
Game()=default
Fling::Game::m_OwningWorld
class World * m_OwningWorld
The world that updates this game.
Definition: Game.h:58
Fling::Game::Shutdown
virtual void Shutdown(entt::registry &t_Reg)=0
Definition: SandboxGame.cpp:69
Fling::NonCopyable
Class that removes the copy operator and constructor.
Definition: NonCopyable.hpp:10
Fling
Definition: Engine.h:29
Fling::Game::Update
virtual void Update(entt::registry &t_Reg, float DeltaTime)=0
Update is called every frame.
Definition: SandboxGame.cpp:80