diff options
author | Nao Pross <naopross@thearcway.org> | 2019-01-21 15:26:43 +0100 |
---|---|---|
committer | Nao Pross <naopross@thearcway.org> | 2019-01-21 15:27:10 +0100 |
commit | 46a28a711fd730828ae5596f68ef3510a20b7b31 (patch) | |
tree | 95e1d89c6213fbb140e9b9c767eccdabab2eb369 /video.cpp | |
parent | Add window test (diff) | |
download | libwsdl2-46a28a711fd730828ae5596f68ef3510a20b7b31.tar.gz libwsdl2-46a28a711fd730828ae5596f68ef3510a20b7b31.zip |
Make window_test threaded
Diffstat (limited to 'video.cpp')
-rw-r--r-- | video.cpp | 12 |
1 files changed, 9 insertions, 3 deletions
@@ -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 |