summaryrefslogtreecommitdiffstats
path: root/video.cpp
diff options
context:
space:
mode:
authorNao Pross <naopross@thearcway.org>2019-01-21 15:26:43 +0100
committerNao Pross <naopross@thearcway.org>2019-01-21 15:27:10 +0100
commit46a28a711fd730828ae5596f68ef3510a20b7b31 (patch)
tree95e1d89c6213fbb140e9b9c767eccdabab2eb369 /video.cpp
parentAdd window test (diff)
downloadlibwsdl2-46a28a711fd730828ae5596f68ef3510a20b7b31.tar.gz
libwsdl2-46a28a711fd730828ae5596f68ef3510a20b7b31.zip
Make window_test threaded
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