1
0
mirror of https://github.com/rwengine/openrw.git synced 2024-11-09 12:22:34 +01:00
openrw/rwgame/GameWindow.hpp

35 lines
556 B
C++
Raw Normal View History

#ifndef GAMEWINDOW_HPP
#define GAMEWINDOW_HPP
2016-09-09 22:13:20 +02:00
#include <glm/vec2.hpp>
#include <string>
2016-08-08 17:27:17 +02:00
#include "SDL.h"
#include <render/GameRenderer.hpp>
2016-09-09 22:13:20 +02:00
class GameWindow {
SDL_Window* window;
SDL_GLContext glcontext;
public:
2016-09-09 22:13:20 +02:00
GameWindow();
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-09-09 22:13:20 +02:00
void showCursor();
void hideCursor();
2016-09-09 22:13:20 +02:00
glm::ivec2 getSize() const;
2016-09-09 22:13:20 +02:00
void swap() const {
SDL_GL_SwapWindow(window);
}
2016-09-09 22:13:20 +02:00
bool isOpen() const {
return !!window;
}
};
#endif