mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-01 01:07:51 -04:00
*** empty log message ***
This commit is contained in:
parent
9a80bf5ea2
commit
bd33b97651
@ -25,9 +25,6 @@ class ShowBase:
|
||||
self.wantDIRECT = self.config.GetBool('want-directtools', 0)
|
||||
self.wantStats = self.config.GetBool('want-stats', 0)
|
||||
|
||||
# Set a maximum frame rate on the render loop (0 means do not limit)
|
||||
Task.maxFps = self.config.GetInt('max-fps', 120)
|
||||
|
||||
import Loader
|
||||
|
||||
self.initialState = NodeAttributes()
|
||||
|
@ -8,10 +8,6 @@ exit = -1
|
||||
done = 0
|
||||
cont = 1
|
||||
|
||||
# Note: this is dconfig'ed in ShowBase.py, but Tasks want to be independent
|
||||
# of ShowBase and panda, so we have to set an initial value here
|
||||
maxFps = 120
|
||||
|
||||
# Store the global clock
|
||||
globalClock = ClockObject.getGlobalClock()
|
||||
|
||||
@ -269,15 +265,7 @@ class TaskManager:
|
||||
self.running = 1
|
||||
while self.running:
|
||||
try:
|
||||
startTime = globalClock.getRealTime()
|
||||
self.step()
|
||||
finishTime = globalClock.getRealTime()
|
||||
# Max out the frame rate so we do not starve the cpu
|
||||
if (maxFps > 0):
|
||||
dt = finishTime - startTime
|
||||
length = (1.0/maxFps)-dt
|
||||
if (length > 0):
|
||||
time.sleep(length)
|
||||
except KeyboardInterrupt:
|
||||
self.stop()
|
||||
except:
|
||||
|
Loading…
x
Reference in New Issue
Block a user