Untitled 2D game engine pre-alpha
A 2D game engine made with Vulkan in C++
 
Loading...
Searching...
No Matches
game.cpp
Go to the documentation of this file.
1
4
5#include "game.h"
6#include "internal.h"
7
8namespace internal
9{
10 std::function<void()> UpdateFunction = nullptr;
11 bool isUpdateFunctionInitialised;
12}
13
14// PUBLIC
15namespace game
16{
17 void SetUpdateFunction(std::function<void()> UpdateFunction)
18 {
19 internal::UpdateFunction = UpdateFunction;
20 internal::isUpdateFunctionInitialised = true;
21 }
22 void Run()
23 {
24 // Code is handeled in window.cpp
25 // this is due because it requires variables that is better to keep local to just window.cpp
26 // and game::Run() is clearer than window::Run()
27 internal::UpdateLoop();
28 }
29}
Defines game namespace, can be found in game.cpp.
Handles game logic. Code can be found in game.cpp.
Definition game.cpp:16
void Run()
Starts the main loop.
Definition game.cpp:22