Browse Source

Merge branch 'master' of github.com:edubart/otclient

Henrique Santiago 10 years ago
parent
commit
e107daf5dd
1 changed files with 6 additions and 4 deletions
  1. 6
    4
      src/framework/engine.cpp

+ 6
- 4
src/framework/engine.cpp View File

@@ -75,11 +75,13 @@ void Engine::run()
75 75
         update(ticks - lastFrameTicks);
76 76
         lastFrameTicks = ticks;
77 77
 
78
-        // render
79
-        render();
78
+        // render only when visible
79
+        if(Platform::isWindowVisible()) {
80
+            render();
80 81
 
81
-        // swap buffers
82
-        Platform::swapBuffers();
82
+            // swap buffers
83
+            Platform::swapBuffers();
84
+        }
83 85
     }
84 86
 
85 87
     lastFrameTicks = 0;

Loading…
Cancel
Save