preserve background color when changing windows

This commit is contained in:
David Rose 2003-01-14 17:11:48 +00:00
parent ddeb0bc305
commit bf79792b6b
1 changed files with 12 additions and 1 deletions

View File

@ -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)