From bf79792b6b10e59e0656016d224e739b6ec651ca Mon Sep 17 00:00:00 2001 From: David Rose Date: Tue, 14 Jan 2003 17:11:48 +0000 Subject: [PATCH] preserve background color when changing windows --- direct/src/showbase/ShowBase.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) 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)