Initial commit
This commit is contained in:
commit
edfc5298e1
252 changed files with 93965 additions and 0 deletions
63
include/Spectre/Game.h
Normal file
63
include/Spectre/Game.h
Normal file
|
|
@ -0,0 +1,63 @@
|
|||
|
||||
#ifndef SPECTRE_GAME_H
|
||||
#define SPECTRE_GAME_H
|
||||
|
||||
#include <Spectre/Graphics.h>
|
||||
#include <Spectre/Input/InputEvent.h>
|
||||
#include <Spectre/Game/FPSCounter.h>
|
||||
|
||||
class InputModule;
|
||||
class MessageQueue;
|
||||
class MessageHandler;
|
||||
class PlatformApplication;
|
||||
|
||||
class Game
|
||||
{
|
||||
public :
|
||||
Game();
|
||||
virtual ~Game();
|
||||
|
||||
void run();
|
||||
|
||||
void exit();
|
||||
|
||||
protected :
|
||||
|
||||
virtual void init() = 0;
|
||||
|
||||
virtual void update(double dt) = 0;
|
||||
|
||||
virtual void render() = 0;
|
||||
|
||||
Graphics* getGraphics() const;
|
||||
|
||||
InputModule* getInput() const;
|
||||
|
||||
FPSCounter& getFpsCounter();
|
||||
|
||||
private :
|
||||
|
||||
void setup();
|
||||
|
||||
void gameLoop();
|
||||
|
||||
void processEvents();
|
||||
|
||||
private :
|
||||
|
||||
PlatformApplication *m_platform;
|
||||
|
||||
Graphics *m_graphics;
|
||||
|
||||
InputModule* m_input;
|
||||
|
||||
MessageHandler* m_messageHandler;
|
||||
|
||||
FPSCounter m_fpsCounter;
|
||||
|
||||
double m_timestep;
|
||||
|
||||
bool m_running;
|
||||
};
|
||||
|
||||
#endif /* SPECTRE_GAME_H */
|
||||
Loading…
Add table
Add a link
Reference in a new issue