From d85f74e64d700dd6d2a9022e72a3e83065797cda Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Boldizs=C3=A1r=20Lipka?= Date: Sun, 8 Jun 2014 10:54:54 +0200 Subject: [PATCH] Make the global twindow object globally available. Note: This is a quick an not really elegant change. I'll fix this as soon as I'll have figured how CVideo and twindow should relate to eachother. --- src/video.cpp | 6 ++++++ src/video.hpp | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/src/video.cpp b/src/video.cpp index 2d1b6ac29f1c..cbe1ee6aa94f 100644 --- a/src/video.cpp +++ b/src/video.cpp @@ -551,6 +551,12 @@ void CVideo::set_window_icon(surface& icon) assert(window); window->set_icon(icon); } + +sdl::twindow *CVideo::get_window() +{ + return window; +} + #endif #if SDL_VERSION_ATLEAST(2, 0, 0) diff --git a/src/video.hpp b/src/video.hpp index 34a4c2f5005a..7f53bd9658bc 100644 --- a/src/video.hpp +++ b/src/video.hpp @@ -20,6 +20,10 @@ #include +#if SDL_VERSION_ATLEAST(2,0,0) +#include "sdl/window.hpp" +#endif + struct surface; //possible flags when setting video modes @@ -143,6 +147,8 @@ class CVideo : private boost::noncopyable { * @param icon The new icon for the window. */ static void set_window_icon(surface& icon); + + static sdl::twindow *get_window(); #endif /**