Gorgon Game Engine
Main.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <string>
4 
5 #include "Event.h"
6 
9 
11 namespace Gorgon {
12 
14  namespace internal {
15  extern std::string systemname;
16  }
18 
21  class Runner {
22  public:
24  virtual void Run() = 0;
25 
27  virtual void Step() = 0;
28 
30  virtual void Quit() = 0;
31  };
32 
35  void Initialize(const std::string &systemname);
36 
38  inline std::string GetSystemName() { return internal::systemname; }
39 
44  void Tick();
45 
48  void Render();
49 
55  void NextFrame();
56 
59  inline void UpdateFrame();
60 
62  void RegisterOnce(std::function<void()> fn);
63 
64  extern Event<> BeforeFrameEvent;
65 }
Gorgon::Audio::Initialize
void Initialize()
Starts audio subsystem with the default device.
Definition: Filesystem.cpp:14
Gorgon::Animation::Animate
void Animate()
Definition: Animation.cpp:31
Gorgon::WindowManager::Initialize
void Initialize()
Initializes window manager system.
Definition: WindowManager.cpp:40
Gorgon::Resource::Initialize
void Initialize()
Definition: Resource.cpp:18
Filesystem.h
contains filesystem functions.
Scripting.h
Gorgon::Time::internal::framestart
unsigned long framestart
Definition: Time.cpp:406
Gorgon::Time::GetTime
unsigned long GetTime()
Returns current time in milliseconds.
Definition: Linux.cpp:34
Gorgon::Event
This class provides event mechanism.
Definition: Event.h:134
OS.h
contains operating system functionality.
Gorgon::Render
void Render()
This function calls the starts the rendering pipeline.
Definition: Main.cpp:109
Gorgon::Initialize
void Initialize(const std::string &systemname)
Initializes the entire system except for graphics and UI.
Definition: Main.cpp:72
Gorgon::internal::systemname
std::string systemname
Definition: Main.cpp:65
Gorgon::BeforeFrameEvent
Event BeforeFrameEvent
Definition: Main.cpp:58
Gorgon::Time::internal::deltatime
unsigned long deltatime
Definition: Time.cpp:407
Window.h
Gorgon::NextFrame
void NextFrame()
This function marks the end of current frame and starts the next one.
Definition: Main.cpp:115
UI.h
Resource.h
Gorgon::Runner
Defines the abstract class of Runner.
Definition: Main.h:21
Gorgon::Scripting::Initialize
void Initialize()
Initializes the scripting system.
Definition: Scripting.h:85
Gorgon
Root namespace for Gorgon Game Engine.
Definition: Any.h:19
Gorgon::Runner::Run
virtual void Run()=0
Takes the control of the execution until Quit is called.
Audio.h
WindowManager.h
contains window manager dependent functionality.
Gorgon::GetSystemName
std::string GetSystemName()
Returns the name of the current system.
Definition: Main.h:38
Gorgon::Runner::Quit
virtual void Quit()=0
Should quit after the current frame is completed for a graceful exit.
Gorgon::Resource::GID::Animation
constexpr Type Animation
Definition: GID.h:187
Graphics.h
Event.h
contains event distribution mechanism
Gorgon::Window::Windows
static const Containers::Collection< Window > & Windows
List of currently created windows.
Definition: Window.h:401
Gorgon::Tick
void Tick()
Performs various operations that are vital to system execution.
Definition: Main.cpp:87
Gorgon::UpdateFrame
void UpdateFrame()
This method works similar to next frame, however, no delay is done.
Definition: Main.cpp:132
Gorgon::OS::processmessages
void processmessages()
This method will notify the system should process any messages that coming from the operating system.
Definition: Linux.cpp:281
Time.h
contains time related functions and classes
Main.h
Gorgon::exiting
bool exiting
Definition: Main.cpp:62
Gorgon::Filesystem::Initialize
void Initialize()
Initializes the filesystem module.
Definition: Filesystem.cpp:14
Gorgon::RegisterOnce
void RegisterOnce(std::function< void()> fn)
Registers a function to be run at the start of the next frame.
Definition: Main.cpp:142
Gorgon::Time::FrameStart
unsigned long FrameStart()
Returns start time of the current frame in milliseconds.
Definition: Time.h:252
Gorgon::once
std::vector< std::function< void()> > once
Definition: Main.cpp:60
Animation.h
Gorgon::Runner::Step
virtual void Step()=0
Runs a single frame.