From 46a28a711fd730828ae5596f68ef3510a20b7b31 Mon Sep 17 00:00:00 2001 From: Nao Pross Date: Mon, 21 Jan 2019 15:26:43 +0100 Subject: Make window_test threaded --- video.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'video.cpp') 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 +#include + extern "C" { #include } -#include - - 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 -- cgit v1.2.1