summaryrefslogtreecommitdiffstats
path: root/video.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'video.cpp')
-rw-r--r--video.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/video.cpp b/video.cpp
index 8413cb4..d6ae6cb 100644
--- a/video.cpp
+++ b/video.cpp
@@ -1,13 +1,13 @@
#include "video.hpp"
#include "debug.hpp"
+#include <exception>
+#include <cstdint>
+
extern "C" {
#include <SDL2/SDL.h>
}
-#include <exception>
-
-
using namespace wrapsdl2;
window::window(const std::string& title, std::size_t width, std::size_t height) {
@@ -39,6 +39,12 @@ void window::show() { SDL_ShowWindow(m_window); }
void window::hide() { SDL_HideWindow(m_window); }
void window::raise() { SDL_RaiseWindow(m_window); }
+bool window::visible() {
+ std::uint32_t flags = SDL_GetWindowFlags(m_window);
+
+ return flags & SDL_WINDOW_SHOWN;
+}
+
void window::update() {
SDL_UpdateWindowSurface(m_window);
} \ No newline at end of file