preserve background color when changing windows
This commit is contained in:
parent
ddeb0bc305
commit
bf79792b6b
|
|
@ -321,9 +321,13 @@ class ShowBase(DirectObject.DirectObject):
|
|||
properties in base.camLens.
|
||||
"""
|
||||
oldLens = self.camLens
|
||||
oldClearColorActive = None
|
||||
if self.win != None:
|
||||
# Close the previous window.
|
||||
oldLens = self.camLens
|
||||
oldClearColorActive = self.win.getClearColorActive()
|
||||
oldClearColor = VBase4(self.win.getClearColor())
|
||||
oldClearDepthActive = self.win.getClearDepthActive()
|
||||
oldClearDepth = self.win.getClearDepth()
|
||||
self.closeWindow(self.win)
|
||||
|
||||
# Open a new window.
|
||||
|
|
@ -336,6 +340,13 @@ class ShowBase(DirectObject.DirectObject):
|
|||
self.camNode.setLens(oldLens)
|
||||
self.camLens = oldLens
|
||||
|
||||
if oldClearColorActive != None:
|
||||
# Restore the previous clear properties.
|
||||
self.win.setClearColorActive(oldClearColorActive)
|
||||
self.win.setClearColor(oldClearColor)
|
||||
self.win.setClearDepthActive(oldClearDepthActive)
|
||||
self.win.setClearDepth(oldClearDepth)
|
||||
|
||||
def setupRender(self):
|
||||
"""setupRender(self)
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue