mirror of
https://github.com/panda3d/panda3d.git
synced 2025-09-29 08:15:18 -04:00
showbase: Add base.clock
alias for globalClock
Mirrors eefcae7b05aef7628b691d8601f8d7d9d0916cb3 on master
This commit is contained in:
parent
987f2f036b
commit
c38d582f8c
@ -383,18 +383,21 @@ class ShowBase(DirectObject.DirectObject):
|
|||||||
|
|
||||||
# Get a pointer to Panda's global ClockObject, used for
|
# Get a pointer to Panda's global ClockObject, used for
|
||||||
# synchronizing events between Python and C.
|
# synchronizing events between Python and C.
|
||||||
globalClock = ClockObject.getGlobalClock()
|
clock = ClockObject.getGlobalClock()
|
||||||
|
|
||||||
|
#: This is the global :class:`~panda3d.core.ClockObject`.
|
||||||
|
self.clock = clock
|
||||||
|
|
||||||
# Since we have already started up a TaskManager, and probably
|
# Since we have already started up a TaskManager, and probably
|
||||||
# a number of tasks; and since the TaskManager had to use the
|
# a number of tasks; and since the TaskManager had to use the
|
||||||
# TrueClock to tell time until this moment, make sure the
|
# TrueClock to tell time until this moment, make sure the
|
||||||
# globalClock object is exactly in sync with the TrueClock.
|
# globalClock object is exactly in sync with the TrueClock.
|
||||||
trueClock = TrueClock.getGlobalPtr()
|
trueClock = TrueClock.getGlobalPtr()
|
||||||
globalClock.setRealTime(trueClock.getShortTime())
|
clock.setRealTime(trueClock.getShortTime())
|
||||||
globalClock.tick()
|
clock.tick()
|
||||||
|
|
||||||
# Now we can make the TaskManager start using the new globalClock.
|
# Now we can make the TaskManager start using the new clock.
|
||||||
taskMgr.globalClock = globalClock
|
taskMgr.globalClock = clock
|
||||||
|
|
||||||
# client CPU affinity is determined by, in order:
|
# client CPU affinity is determined by, in order:
|
||||||
# - client-cpu-affinity-mask config
|
# - client-cpu-affinity-mask config
|
||||||
@ -443,7 +446,7 @@ class ShowBase(DirectObject.DirectObject):
|
|||||||
builtins.ostream = Notify.out()
|
builtins.ostream = Notify.out()
|
||||||
builtins.directNotify = directNotify
|
builtins.directNotify = directNotify
|
||||||
builtins.giveNotify = giveNotify
|
builtins.giveNotify = giveNotify
|
||||||
builtins.globalClock = globalClock
|
builtins.globalClock = clock
|
||||||
builtins.vfs = vfs
|
builtins.vfs = vfs
|
||||||
builtins.cpMgr = ConfigPageManager.getGlobalPtr()
|
builtins.cpMgr = ConfigPageManager.getGlobalPtr()
|
||||||
builtins.cvMgr = ConfigVariableManager.getGlobalPtr()
|
builtins.cvMgr = ConfigVariableManager.getGlobalPtr()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user