2016-06-22 12:29:39 +02:00
|
|
|
#ifndef GAMEWINDOW_HPP
|
|
|
|
#define GAMEWINDOW_HPP
|
|
|
|
|
2016-09-09 22:13:20 +02:00
|
|
|
#include <glm/vec2.hpp>
|
2016-06-22 12:29:39 +02:00
|
|
|
#include <string>
|
2017-10-26 00:44:45 +02:00
|
|
|
#include <SDL.h>
|
2016-06-22 12:29:39 +02:00
|
|
|
|
|
|
|
#include <render/GameRenderer.hpp>
|
|
|
|
|
2016-09-09 22:13:20 +02:00
|
|
|
class GameWindow {
|
|
|
|
SDL_Window* window;
|
|
|
|
SDL_GLContext glcontext;
|
2016-06-22 12:29:39 +02:00
|
|
|
|
|
|
|
public:
|
2016-09-09 22:13:20 +02:00
|
|
|
GameWindow();
|
2016-06-22 12:29:39 +02:00
|
|
|
|
2016-09-09 22:13:20 +02:00
|
|
|
void create(const std::string& title, size_t w, size_t h, bool fullscreen);
|
|
|
|
void close();
|
2016-06-22 12:29:39 +02:00
|
|
|
|
2016-09-09 22:13:20 +02:00
|
|
|
void showCursor();
|
|
|
|
void hideCursor();
|
2016-06-22 12:29:39 +02:00
|
|
|
|
2016-09-09 22:13:20 +02:00
|
|
|
glm::ivec2 getSize() const;
|
2016-06-22 12:29:39 +02:00
|
|
|
|
2016-09-09 22:13:20 +02:00
|
|
|
void swap() const {
|
|
|
|
SDL_GL_SwapWindow(window);
|
|
|
|
}
|
2016-06-22 12:29:39 +02:00
|
|
|
|
2016-09-09 22:13:20 +02:00
|
|
|
bool isOpen() const {
|
|
|
|
return !!window;
|
|
|
|
}
|
2016-06-22 12:29:39 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|