diff options
author | Mitchell Stokes <mogurijin@gmail.com> | 2012-01-23 00:25:25 +0400 |
---|---|---|
committer | Mitchell Stokes <mogurijin@gmail.com> | 2012-01-23 00:25:25 +0400 |
commit | 686ce92fe88d166f0fa1658363c4de8c1b5009b2 (patch) | |
tree | b811169ce9e199a4da77f503ae9a3bed9f61683d /intern | |
parent | 359e961a12e5c2f6432b8d65a543d2d6e389ba17 (diff) |
Committing patch "[#27676] Change window size/resolution in realtime" by me.
Description:
This patch allows the user to change the size of the window (or the resolution in fullscreen mode) using the new bge.render.setWindowSize() method. This only works in the Blenderplayer since it doesn't make a whole lot of sense for the embedded player.
Diffstat (limited to 'intern')
-rw-r--r-- | intern/ghost/GHOST_ISystem.h | 9 | ||||
-rw-r--r-- | intern/ghost/intern/GHOST_System.cpp | 13 | ||||
-rw-r--r-- | intern/ghost/intern/GHOST_System.h | 9 |
3 files changed, 31 insertions, 0 deletions
diff --git a/intern/ghost/GHOST_ISystem.h b/intern/ghost/GHOST_ISystem.h index 3ec8d3d2fbf..ee67694760b 100644 --- a/intern/ghost/GHOST_ISystem.h +++ b/intern/ghost/GHOST_ISystem.h @@ -271,6 +271,15 @@ public: */ virtual GHOST_TSuccess beginFullScreen(const GHOST_DisplaySetting& setting, GHOST_IWindow** window, const bool stereoVisual, const GHOST_TUns16 numOfAASamples=0) = 0; + + /** + * Updates the resolution while in fullscreen mode. + * @param setting The new setting of the display. + * @param window Window displayed in full screen. + * + * @return Indication of success. + */ + virtual GHOST_TSuccess updateFullScreen(const GHOST_DisplaySetting& setting, GHOST_IWindow** window) = 0; /** * Ends full screen mode. diff --git a/intern/ghost/intern/GHOST_System.cpp b/intern/ghost/intern/GHOST_System.cpp index 4efdcbc6519..944ade3f22b 100644 --- a/intern/ghost/intern/GHOST_System.cpp +++ b/intern/ghost/intern/GHOST_System.cpp @@ -168,6 +168,19 @@ GHOST_TSuccess GHOST_System::beginFullScreen(const GHOST_DisplaySetting& setting } +GHOST_TSuccess GHOST_System::updateFullScreen(const GHOST_DisplaySetting& setting, GHOST_IWindow** window) +{ + GHOST_TSuccess success = GHOST_kFailure; + GHOST_ASSERT(m_windowManager, "GHOST_System::updateFullScreen(): invalid window manager"); + if(m_displayManager) { + if (m_windowManager->getFullScreen()) { + success = m_displayManager->setCurrentDisplaySetting(GHOST_DisplayManager::kMainDisplay, setting); + } + } + + return success; +} + GHOST_TSuccess GHOST_System::endFullScreen(void) { GHOST_TSuccess success = GHOST_kFailure; diff --git a/intern/ghost/intern/GHOST_System.h b/intern/ghost/intern/GHOST_System.h index 6286121719d..0bb0387a287 100644 --- a/intern/ghost/intern/GHOST_System.h +++ b/intern/ghost/intern/GHOST_System.h @@ -145,6 +145,15 @@ public: */ virtual GHOST_TSuccess beginFullScreen(const GHOST_DisplaySetting& setting, GHOST_IWindow** window, const bool stereoVisual, const GHOST_TUns16 numOfAASamples=0); + + /** + * Updates the resolution while in fullscreen mode. + * @param setting The new setting of the display. + * @param window Window displayed in full screen. + * + * @return Indication of success. + */ + virtual GHOST_TSuccess updateFullScreen(const GHOST_DisplaySetting& setting, GHOST_IWindow** window); /** * Ends full screen mode. |