summaryrefslogtreecommitdiffstats
path: root/video.cpp
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--video.cpp12
1 files changed, 5 insertions, 7 deletions
diff --git a/video.cpp b/video.cpp
index f58b171..71544fe 100644
--- a/video.cpp
+++ b/video.cpp
@@ -39,9 +39,13 @@ window::window(const std::string& title, std::size_t width, std::size_t height)
window::~window() {
if (m_renderer != NULL)
SDL_DestroyRenderer(m_renderer);
+ else
+ npdebug("warning: m_renderer is NULL")
if (m_window != NULL)
SDL_DestroyWindow(m_window);
+ else
+ npdebug("warning: m_window is NULL")
}
@@ -55,18 +59,12 @@ void window::close() {
m_open = false;
}
-void window::show() { SDL_ShowWindow(m_window); }
-void window::hide() { SDL_HideWindow(m_window); }
-void window::raise() { SDL_RaiseWindow(m_window); }
-
bool window::is_open() {
return m_open;
}
bool window::is_visible() {
- std::uint32_t flags = SDL_GetWindowFlags(m_window);
-
- return flags & SDL_WINDOW_SHOWN;
+ return SDL_WINDOW_SHOWN & SDL_GetWindowFlags(m_window);
}
void window::update() {