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>2012-08-19 03:46:37 +0400
committerMitchell Stokes <mogurijin@gmail.com>2012-08-19 03:46:37 +0400
commite4a6602a9ac9c7d43a882770f19323b6d5616a4b (patch)
tree9963ab4f020db422d92671f7a6c5544c9bf5ca1d /source/gameengine/GamePlayer/ghost/GPG_Application.cpp
parent4120c18c47d111b6988297a3d6d4daaa7624fb43 (diff)
Fix for [#32361] "Blenderplayer quad-buffer maximum 100Hz Fps" reported by HG1.
Allowing the Blenderplayer to break 100fps by making it less dependent on Ghost's messages.
Diffstat (limited to 'source/gameengine/GamePlayer/ghost/GPG_Application.cpp')
-rw-r--r--source/gameengine/GamePlayer/ghost/GPG_Application.cpp75
1 files changed, 50 insertions, 25 deletions
diff --git a/source/gameengine/GamePlayer/ghost/GPG_Application.cpp b/source/gameengine/GamePlayer/ghost/GPG_Application.cpp
index eccb83fe80c..21de7011eda 100644
--- a/source/gameengine/GamePlayer/ghost/GPG_Application.cpp
+++ b/source/gameengine/GamePlayer/ghost/GPG_Application.cpp
@@ -464,31 +464,34 @@ bool GPG_Application::processEvent(GHOST_IEvent* event)
handled = false;
break;
- case GHOST_kEventWindowUpdate:
- {
- GHOST_IWindow* window = event->getWindow();
- if (!m_system->validWindow(window)) break;
- // Update the state of the game engine
- if (m_kxsystem && !m_exitRequested)
- {
- // Proceed to next frame
- window->activateDrawingContext();
-
- // first check if we want to exit
- m_exitRequested = m_ketsjiengine->GetExitCode();
-
- // kick the engine
- bool renderFrame = m_ketsjiengine->NextFrame();
- if (renderFrame)
- {
- // render the frame
- m_ketsjiengine->Render();
- }
- }
- m_exitString = m_ketsjiengine->GetExitString();
- }
- break;
-
+ // The player now runs as often as it can (repsecting vsync and fixedtime).
+ // This allows the player to break 100fps, but this code is being left here
+ // as reference. (see EngineNextFrame)
+ //case GHOST_kEventWindowUpdate:
+ // {
+ // GHOST_IWindow* window = event->getWindow();
+ // if (!m_system->validWindow(window)) break;
+ // // Update the state of the game engine
+ // if (m_kxsystem && !m_exitRequested)
+ // {
+ // // Proceed to next frame
+ // window->activateDrawingContext();
+
+ // // first check if we want to exit
+ // m_exitRequested = m_ketsjiengine->GetExitCode();
+ //
+ // // kick the engine
+ // bool renderFrame = m_ketsjiengine->NextFrame();
+ // if (renderFrame)
+ // {
+ // // render the frame
+ // m_ketsjiengine->Render();
+ // }
+ // }
+ // m_exitString = m_ketsjiengine->GetExitString();
+ // }
+ // break;
+ //
case GHOST_kEventWindowSize:
{
GHOST_IWindow* window = event->getWindow();
@@ -789,6 +792,28 @@ void GPG_Application::stopEngine()
m_engineRunning = false;
}
+void GPG_Application::EngineNextFrame()
+{
+ // Update the state of the game engine
+ if (m_kxsystem && !m_exitRequested)
+ {
+ // Proceed to next frame
+ if (m_mainWindow)
+ m_mainWindow->activateDrawingContext();
+
+ // first check if we want to exit
+ m_exitRequested = m_ketsjiengine->GetExitCode();
+
+ // kick the engine
+ bool renderFrame = m_ketsjiengine->NextFrame();
+ if (renderFrame && m_mainWindow)
+ {
+ // render the frame
+ m_ketsjiengine->Render();
+ }
+ }
+ m_exitString = m_ketsjiengine->GetExitString();
+}
void GPG_Application::exitEngine()
{