]> Dogcows Code - chaz/yoink/blobdiff - src/Moof/Engine.cc
initial working frustum culling implementation
[chaz/yoink] / src / Moof / Engine.cc
index be8ca5fac61e184f0b54a0da244355e5b33e89a2..53fca73e9e883cfab1d18aced70cd125391f26d1 100644 (file)
@@ -103,7 +103,7 @@ public:
         * The main loop.  This just calls dispatchEvents(), update(), and draw()
         * over and over again.  The timing of the update and draw are decoupled.
         * The actual frame rate is also calculated here.  This function will return
-        * with a value of 0 if the member variable running becomes true.
+        * the exit code used to stop the loop.
         */
 
        int run()
@@ -141,6 +141,10 @@ public:
 
                                nextStep += timestep;
                        }
+                       if (ticksNow >= nextStep)
+                       {
+                               nextStep = ticksNow + timestep;
+                       }
 
                        if (ticksNow >= nextDraw)
                        {
@@ -179,7 +183,7 @@ public:
                }
                while (running);
 
-               return 0;
+               return exitCode;
        }
 
 
@@ -216,6 +220,7 @@ public:
        VideoPtr        video;
 
        bool            running;
+       int                     exitCode;
 
        Scalar          timestep;
        Scalar          drawRate;
@@ -238,9 +243,10 @@ int Engine::run()
        return impl_->run();
 }
 
-void Engine::stop()
+void Engine::stop(int exitCode)
 {
        impl_->running = false;
+       impl_->exitCode = exitCode;
 }
 
 
This page took 0.022948 seconds and 4 git commands to generate.