mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-03 02:15:43 -04:00
enforce a single ShowBase
This commit is contained in:
parent
5588210e22
commit
303b51198e
@ -303,6 +303,10 @@ class ShowBase(DirectObject.DirectObject):
|
|||||||
# Windows XP supports a 32-bit affinity mask
|
# Windows XP supports a 32-bit affinity mask
|
||||||
TrueClock.getGlobalPtr().setCpuAffinity(1 << (affinity % 32))
|
TrueClock.getGlobalPtr().setCpuAffinity(1 << (affinity % 32))
|
||||||
|
|
||||||
|
# Make sure we're not making more than one ShowBase.
|
||||||
|
if hasattr(__builtin__, 'base'):
|
||||||
|
raise StandardError, "Attempt to spawn multiple ShowBase instances!"
|
||||||
|
|
||||||
__builtin__.base = self
|
__builtin__.base = self
|
||||||
__builtin__.render2d = self.render2d
|
__builtin__.render2d = self.render2d
|
||||||
__builtin__.aspect2d = self.aspect2d
|
__builtin__.aspect2d = self.aspect2d
|
||||||
|
Loading…
x
Reference in New Issue
Block a user