Fling Engine  0.00.1
Fling Engine is a game engine written in Vulkan
SandboxGame.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include "Game.h"
4 
5 namespace Sandbox
6 {
10  class Game : public Fling::Game
11  {
16  void Init(entt::registry& t_Reg) override;
17 
18  /* Called when the engine is shutting down */
19  void Shutdown(entt::registry& t_Reg) override;
20 
24  void Update(entt::registry& t_Reg, float DeltaTime) override;
25 
29  void OnQuitPressed();
30 
31  /* Creates a 3D array of meshes */
32  void GenerateTestMeshes(entt::registry& t_Reg);
33 
34  void PrintFPS() const;
35 
36  void LightingTest(entt::registry& t_Reg);
37 
38  void ScriptingTest(entt::registry& t_Reg);
39 
40  /* Toggles the visibility of the cursor */
42 
43  /* Sets window mode of screen, for testing all possible transitions */
44  void SetWindowFullscreen();
46  void SetWindowWindowed();
47 
48  private:
49 
50  bool m_DoRotations = false;
51  bool m_MovePointLights = false;
52  bool m_RunLua = true;
53 
54  void ToggleRotation();
55 
56  void OnTestSpawn();
57 
58  void OnToggleMoveLights();
59 
60  void ToggleLua();
61 
62  void SetWindowIcon();
63 
65  glm::vec3 MoveDelta = {};
66 
67  };
68 } // namespace Sandbox
void ToggleRotation()
Definition: SandboxGame.cpp:300
void OnToggleMoveLights()
Definition: SandboxGame.cpp:281
void SetWindowFullscreen()
Definition: SandboxGame.cpp:326
void LightingTest(entt::registry &t_Reg)
Definition: SandboxGame.cpp:122
void SetWindowBorderlessWindowed()
Definition: SandboxGame.cpp:335
void GenerateTestMeshes(entt::registry &t_Reg)
void OnQuitPressed()
Callback for when the user has given input that shows they want to exit.
Definition: SandboxGame.cpp:74
glm::vec3 MoveDelta
Temp vector for keeping track of the movement of things.
Definition: SandboxGame.h:65
void ScriptingTest(entt::registry &t_Reg)
Definition: SandboxGame.cpp:252
void SetWindowIcon()
Definition: SandboxGame.cpp:291
void OnTestSpawn()
Definition: SandboxGame.cpp:305
The game class is mean to be overridden on a per-game instance.
Definition: Game.h:16
void SetWindowWindowed()
Definition: SandboxGame.cpp:344
Definition: SandboxEditor.h:5
virtual void Init(entt::registry &t_Reg)=0
Called before the first Update tick.
Definition: SandboxGame.cpp:25
void ToggleLua()
Definition: SandboxGame.cpp:286
bool m_DoRotations
Definition: SandboxGame.h:50
void ToggleCursorVisibility()
Definition: SandboxGame.cpp:271
virtual void Shutdown(entt::registry &t_Reg)=0
Definition: SandboxGame.cpp:69
bool m_MovePointLights
Definition: SandboxGame.h:51
bool m_RunLua
Definition: SandboxGame.h:52
void PrintFPS() const
Definition: SandboxGame.cpp:320
virtual void Update(entt::registry &t_Reg, float DeltaTime)=0
Update is called every frame.
Definition: SandboxGame.cpp:80