Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMitchell Stokes <mogurijin@gmail.com>2013-04-14 01:09:02 +0400
committerMitchell Stokes <mogurijin@gmail.com>2013-04-14 01:09:02 +0400
commitdbf4328f3fba5e1fbd39422d6a322f752e2e122e (patch)
treedc45fce6c38bdc9bf9ddb9a699a8c40a05a5e2f0 /source/gameengine/GamePlayer/ghost
parent81cfbaacb001ade11f52c3150b4aa6aaff965c64 (diff)
BGE: Adding a render.setFullScreen() and a render.getFullScreen() to allow fulscreening games via Python.
Diffstat (limited to 'source/gameengine/GamePlayer/ghost')
-rw-r--r--source/gameengine/GamePlayer/ghost/GPG_Canvas.cpp13
-rw-r--r--source/gameengine/GamePlayer/ghost/GPG_Canvas.h2
2 files changed, 15 insertions, 0 deletions
diff --git a/source/gameengine/GamePlayer/ghost/GPG_Canvas.cpp b/source/gameengine/GamePlayer/ghost/GPG_Canvas.cpp
index 9b01cb5786f..c438dcdd4a6 100644
--- a/source/gameengine/GamePlayer/ghost/GPG_Canvas.cpp
+++ b/source/gameengine/GamePlayer/ghost/GPG_Canvas.cpp
@@ -128,6 +128,19 @@ void GPG_Canvas::ResizeWindow(int width, int height)
Resize(width, height);
}
+void GPG_Canvas::SetFullScreen(bool enable)
+{
+ if (enable)
+ m_window->setState(GHOST_kWindowStateFullScreen);
+ else
+ m_window->setState(GHOST_kWindowStateNormal);
+}
+
+bool GPG_Canvas::GetFullScreen()
+{
+ return m_window->getState() == GHOST_kWindowStateFullScreen;
+}
+
float GPG_Canvas::GetMouseNormalizedX(int x)
{
return float(x)/this->GetWidth();
diff --git a/source/gameengine/GamePlayer/ghost/GPG_Canvas.h b/source/gameengine/GamePlayer/ghost/GPG_Canvas.h
index 440fd2bba27..6168d96b337 100644
--- a/source/gameengine/GamePlayer/ghost/GPG_Canvas.h
+++ b/source/gameengine/GamePlayer/ghost/GPG_Canvas.h
@@ -61,6 +61,8 @@ public:
virtual float GetMouseNormalizedY(int y);
virtual void ResizeWindow(int width, int height);
+ virtual void SetFullScreen(bool enable);
+ virtual bool GetFullScreen();
bool BeginDraw() { return true; }
void EndDraw() {};