55 lines
No EOL
990 B
C++
55 lines
No EOL
990 B
C++
#ifndef _H_GAME_H
|
|
#define _H_GAME_H
|
|
|
|
#include <memory>
|
|
#include <SDL_events.h>
|
|
#include <utility/events.h>
|
|
|
|
class InputHandler;
|
|
class Scene;
|
|
class Text;
|
|
class ResourceManager;
|
|
class Renderer;
|
|
class GLWindow;
|
|
|
|
enum {
|
|
GAME_QUITTING = 0,
|
|
GAME_RUNNING = 1,
|
|
GAME_MENU = 2,
|
|
GAME_PLAYING = 4
|
|
};
|
|
|
|
class Game
|
|
{
|
|
public:
|
|
Game() {}
|
|
bool init();
|
|
|
|
bool loadDebugScene();
|
|
|
|
void handleInput(SDL_Event& e);
|
|
|
|
void update(double deltaTime);
|
|
void render();
|
|
|
|
const unsigned getGameState() const { return game_state; }
|
|
|
|
const unsigned getWindowWidth() const;
|
|
const unsigned getWindowHeight() const;
|
|
|
|
void quit() { game_state = GAME_QUITTING; }
|
|
|
|
private:
|
|
unsigned game_state = GAME_QUITTING;
|
|
|
|
std::shared_ptr<GLWindow> window;
|
|
|
|
std::shared_ptr<Scene> currentScene;
|
|
std::shared_ptr<InputHandler> inputHandler;
|
|
std::shared_ptr<ResourceManager> resourceManager;
|
|
std::shared_ptr<Renderer> renderer;
|
|
std::shared_ptr<Text> textHandler;
|
|
std::shared_ptr<EventManager> globalEventManager;
|
|
};
|
|
|
|
#endif |