2020-07-03 03:48:58 +00:00
|
|
|
//
|
|
|
|
// Created by SeanOMik on 7/2/2020.
|
|
|
|
// Github: https://github.com/SeanOMik
|
|
|
|
// Email: seanomik@gmail.com
|
|
|
|
//
|
|
|
|
|
|
|
|
#ifndef SIMPLEENGINE_GAME_H
|
|
|
|
#define SIMPLEENGINE_GAME_H
|
|
|
|
|
|
|
|
#include <SFML/Graphics.hpp>
|
|
|
|
#include <SFML/System.hpp>
|
|
|
|
#include <SFML/Audio.hpp>
|
|
|
|
|
|
|
|
#include <stack>
|
2020-07-03 20:26:44 +00:00
|
|
|
#include "entity.h"
|
|
|
|
|
2020-07-03 03:48:58 +00:00
|
|
|
namespace simpleengine {
|
|
|
|
class Event;
|
|
|
|
|
|
|
|
class Game {
|
|
|
|
public:
|
|
|
|
Game(int w, int h, const std::string& window_name);
|
2021-03-02 04:08:10 +00:00
|
|
|
Game(const sf::Vector2u& window_size, const std::string& window_name);
|
2020-07-03 03:48:58 +00:00
|
|
|
virtual ~Game();
|
|
|
|
|
|
|
|
void UpdateSFMLEvents();
|
|
|
|
void Update();
|
|
|
|
void RenderWindow();
|
|
|
|
void RenderItems();
|
|
|
|
void ExitGame();
|
|
|
|
int Run();
|
|
|
|
|
|
|
|
void AddEvent(Event* event);
|
|
|
|
sf::RenderWindow* GetWindow();
|
|
|
|
private:
|
|
|
|
sf::RenderWindow* window;
|
|
|
|
|
|
|
|
sf::Clock delta_time_clock; // Delta time clock
|
|
|
|
float delta_time; // Delta time
|
|
|
|
|
2021-03-02 04:08:10 +00:00
|
|
|
//std::stack<Event*> events;
|
|
|
|
std::vector<Event*> events;
|
2020-07-03 03:48:58 +00:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif //GAMEENGINE_GAME_H
|