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
617 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>
#include <SDL.h>
#include <render/GameRenderer.hpp>
2016-09-09 22:13:20 +02:00
class GameWindow {
2018-05-19 23:55:27 +02:00
SDL_Window* window = nullptr;
SDL_Surface* icon = nullptr;
SDL_GLContext glcontext{nullptr};
public:
2018-05-19 23:55:27 +02:00
GameWindow() = default;
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