2020-07-03 03:48:58 +00:00
|
|
|
//
|
|
|
|
// Created by SeanOMik on 7/2/2020.
|
|
|
|
// Github: https://github.com/SeanOMik
|
|
|
|
//
|
|
|
|
|
|
|
|
#ifndef SIMPLEENGINE_GAME_H
|
|
|
|
#define SIMPLEENGINE_GAME_H
|
|
|
|
|
2021-11-20 05:48:47 +00:00
|
|
|
#include <string>
|
|
|
|
#include <memory>
|
2020-07-03 03:48:58 +00:00
|
|
|
|
2021-11-20 05:48:47 +00:00
|
|
|
#include <gl/glew.h>
|
|
|
|
#include <GLFW/glfw3.h>
|
2020-07-03 20:26:44 +00:00
|
|
|
|
2020-07-03 03:48:58 +00:00
|
|
|
namespace simpleengine {
|
|
|
|
class Game {
|
|
|
|
public:
|
2021-04-04 03:27:44 +00:00
|
|
|
friend class CollisionHandler;
|
|
|
|
|
2021-11-20 05:48:47 +00:00
|
|
|
/**
|
|
|
|
* @brief Construct a new Game object. Initializes GLEW and OpenGL
|
|
|
|
*
|
|
|
|
* @param w Width of viewport
|
|
|
|
* @param h Height of viewport
|
|
|
|
* @param window_name The name of the window
|
|
|
|
*/
|
|
|
|
Game(int w, int h, const std::string& window_name, const bool& resizeable = false);
|
2020-07-03 03:48:58 +00:00
|
|
|
virtual ~Game();
|
|
|
|
|
2021-11-20 05:48:47 +00:00
|
|
|
void update();
|
|
|
|
void render_window();
|
|
|
|
void render_items();
|
|
|
|
void exit();
|
|
|
|
int run();
|
2021-03-13 03:01:33 +00:00
|
|
|
|
2021-11-20 05:48:47 +00:00
|
|
|
//void AddEvent(Event* event);
|
|
|
|
std::shared_ptr<GLFWwindow> get_window();
|
2020-07-03 03:48:58 +00:00
|
|
|
private:
|
2021-11-20 05:48:47 +00:00
|
|
|
static void framebuffer_resize_callback(GLFWwindow*, int fbW, int fbH);
|
2020-07-03 03:48:58 +00:00
|
|
|
|
2021-11-20 05:48:47 +00:00
|
|
|
std::shared_ptr<GLFWwindow> window;
|
2020-07-03 03:48:58 +00:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif //GAMEENGINE_GAME_H
|