mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-05 03:15:07 -04:00
asyncLoad task
This commit is contained in:
parent
bbf8d832b0
commit
900cc46683
@ -1572,6 +1572,17 @@ class ShowBase(DirectObject.DirectObject):
|
|||||||
self.taskMgr.add(self.__audioLoop, 'audioLoop', priority = 60)
|
self.taskMgr.add(self.__audioLoop, 'audioLoop', priority = 60)
|
||||||
self.eventMgr.restart()
|
self.eventMgr.restart()
|
||||||
|
|
||||||
|
if not hasattr(taskMgr, 'mgr'):
|
||||||
|
# If we're using the old task manager, we need to have an
|
||||||
|
# explicit task to manage the async load requests. (On
|
||||||
|
# the new task manager, this is built-in.)
|
||||||
|
def asyncLoad(task):
|
||||||
|
task.mgr.poll()
|
||||||
|
return task.cont
|
||||||
|
task = Task.Task(asyncLoad)
|
||||||
|
task.mgr = AsyncTaskManager.getGlobalPtr()
|
||||||
|
taskMgr.add(task, 'asyncLoad')
|
||||||
|
|
||||||
def shutdown(self):
|
def shutdown(self):
|
||||||
self.taskMgr.remove('audioLoop')
|
self.taskMgr.remove('audioLoop')
|
||||||
self.taskMgr.remove('igLoop')
|
self.taskMgr.remove('igLoop')
|
||||||
@ -1582,6 +1593,12 @@ class ShowBase(DirectObject.DirectObject):
|
|||||||
self.taskMgr.remove('ivalLoop')
|
self.taskMgr.remove('ivalLoop')
|
||||||
self.eventMgr.shutdown()
|
self.eventMgr.shutdown()
|
||||||
|
|
||||||
|
if not hasattr(taskMgr, 'mgr'):
|
||||||
|
# If we're using the old task manager, we need to have an
|
||||||
|
# explicit task to manage the async load requests. (On
|
||||||
|
# the new task manager, this is built-in.)
|
||||||
|
taskMgr.remove('asyncLoad')
|
||||||
|
|
||||||
def getBackgroundColor(self, win = None):
|
def getBackgroundColor(self, win = None):
|
||||||
"""
|
"""
|
||||||
Returns the current window background color. This assumes
|
Returns the current window background color. This assumes
|
||||||
|
Loading…
x
Reference in New Issue
Block a user