diff --git a/direct/src/showbase/ShowBase.py b/direct/src/showbase/ShowBase.py index 60a8a0d84d..0e00bc6eaf 100644 --- a/direct/src/showbase/ShowBase.py +++ b/direct/src/showbase/ShowBase.py @@ -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)