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