Allow passing old gsg again (pass gsg = None instead).

Restore stencil clear states for recreated window.
This commit is contained in:
aignacio_sf 2007-01-03 20:53:10 +00:00
parent 7896127dfd
commit baf81ca972

View File

@ -471,7 +471,7 @@ class ShowBase(DirectObject.DirectObject):
if gsg: if gsg:
win = self.graphicsEngine.makeOutput(pipe, name, 0, fbprops, win = self.graphicsEngine.makeOutput(pipe, name, 0, fbprops,
props, flags) props, flags, gsg)
else: else:
win = self.graphicsEngine.makeOutput(pipe, name, 0, fbprops, win = self.graphicsEngine.makeOutput(pipe, name, 0, fbprops,
props, flags) props, flags)
@ -507,6 +507,7 @@ class ShowBase(DirectObject.DirectObject):
for i in range(numRegions): for i in range(numRegions):
dr = win.getDisplayRegion(i) dr = win.getDisplayRegion(i)
cam = NodePath(dr.getCamera()) cam = NodePath(dr.getCamera())
dr.setCamera(NodePath()) dr.setCamera(NodePath())
if not cam.isEmpty() and cam.node().getNumDisplayRegions() == 0: if not cam.isEmpty() and cam.node().getNumDisplayRegions() == 0:
@ -605,6 +606,8 @@ class ShowBase(DirectObject.DirectObject):
oldClearColor = VBase4(self.win.getClearColor()) oldClearColor = VBase4(self.win.getClearColor())
oldClearDepthActive = self.win.getClearDepthActive() oldClearDepthActive = self.win.getClearDepthActive()
oldClearDepth = self.win.getClearDepth() oldClearDepth = self.win.getClearDepth()
oldClearStencilActive = self.win.getClearStencilActive()
oldClearStencil = self.win.getClearStencil()
self.closeWindow(self.win) self.closeWindow(self.win)
# Open a new window. # Open a new window.
@ -631,6 +634,8 @@ class ShowBase(DirectObject.DirectObject):
self.win.setClearColor(oldClearColor) self.win.setClearColor(oldClearColor)
self.win.setClearDepthActive(oldClearDepthActive) self.win.setClearDepthActive(oldClearDepthActive)
self.win.setClearDepth(oldClearDepth) self.win.setClearDepth(oldClearDepth)
self.win.setClearStencilActive(oldClearStencilActive)
self.win.setClearStencil(oldClearStencil)
self.setFrameRateMeter(self.config.GetBool( self.setFrameRateMeter(self.config.GetBool(
'show-frame-rate-meter', 0)) 'show-frame-rate-meter', 0))