mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-03 02:15:43 -04:00
respect fbprops in WxPandaWindow
This commit is contained in:
parent
50e53a4d4e
commit
a2a8aacb7e
@ -571,7 +571,7 @@ class ShowBase(DirectObject.DirectObject):
|
|||||||
self.notify.info("Could not make graphics pipe %s." % (
|
self.notify.info("Could not make graphics pipe %s." % (
|
||||||
pipeType.getName()))
|
pipeType.getName()))
|
||||||
|
|
||||||
def openWindow(self, props = None, pipe = None, gsg = None,
|
def openWindow(self, props = None, fbprops = None, pipe = None, gsg = None,
|
||||||
type = None, name = None, size = None, aspectRatio = None,
|
type = None, name = None, size = None, aspectRatio = None,
|
||||||
makeCamera = True, keepCamera = False,
|
makeCamera = True, keepCamera = False,
|
||||||
scene = None, stereo = None,
|
scene = None, stereo = None,
|
||||||
@ -604,7 +604,7 @@ class ShowBase(DirectObject.DirectObject):
|
|||||||
# down to the underlying _doOpenWindow() with all of the above
|
# down to the underlying _doOpenWindow() with all of the above
|
||||||
# parameters.
|
# parameters.
|
||||||
func = lambda : self._doOpenWindow(
|
func = lambda : self._doOpenWindow(
|
||||||
props = props, pipe = pipe, gsg = gsg,
|
props = props, fbprops = fbprops, pipe = pipe, gsg = gsg,
|
||||||
type = type, name = name, size = size, aspectRatio = aspectRatio,
|
type = type, name = name, size = size, aspectRatio = aspectRatio,
|
||||||
makeCamera = makeCamera, keepCamera = keepCamera,
|
makeCamera = makeCamera, keepCamera = keepCamera,
|
||||||
scene = scene, stereo = stereo,
|
scene = scene, stereo = stereo,
|
||||||
@ -664,7 +664,7 @@ class ShowBase(DirectObject.DirectObject):
|
|||||||
|
|
||||||
return win
|
return win
|
||||||
|
|
||||||
def _doOpenWindow(self, props = None, pipe = None, gsg = None,
|
def _doOpenWindow(self, props = None, fbprops = None, pipe = None, gsg = None,
|
||||||
type = None, name = None, size = None, aspectRatio = None,
|
type = None, name = None, size = None, aspectRatio = None,
|
||||||
makeCamera = True, keepCamera = False,
|
makeCamera = True, keepCamera = False,
|
||||||
scene = None, stereo = None,
|
scene = None, stereo = None,
|
||||||
@ -699,6 +699,9 @@ class ShowBase(DirectObject.DirectObject):
|
|||||||
if props == None:
|
if props == None:
|
||||||
props = WindowProperties.getDefault()
|
props = WindowProperties.getDefault()
|
||||||
|
|
||||||
|
if fbprops == None:
|
||||||
|
fbprops = FrameBufferProperties.getDefault()
|
||||||
|
|
||||||
if size != None:
|
if size != None:
|
||||||
# If we were given an explicit size, use it; otherwise,
|
# If we were given an explicit size, use it; otherwise,
|
||||||
# the size from the properties is used.
|
# the size from the properties is used.
|
||||||
@ -711,8 +714,6 @@ class ShowBase(DirectObject.DirectObject):
|
|||||||
|
|
||||||
win = None
|
win = None
|
||||||
|
|
||||||
fbprops = FrameBufferProperties.getDefault()
|
|
||||||
|
|
||||||
flags = GraphicsPipe.BFFbPropsOptional
|
flags = GraphicsPipe.BFFbPropsOptional
|
||||||
if type == 'onscreen':
|
if type == 'onscreen':
|
||||||
flags = flags | GraphicsPipe.BFRequireWindow
|
flags = flags | GraphicsPipe.BFRequireWindow
|
||||||
|
@ -115,13 +115,23 @@ else:
|
|||||||
gsg = kw['gsg']
|
gsg = kw['gsg']
|
||||||
del kw['gsg']
|
del kw['gsg']
|
||||||
|
|
||||||
|
fbprops = kw.get('fbprops', None)
|
||||||
|
if fbprops == None:
|
||||||
|
fbprops = FrameBufferProperties.getDefault()
|
||||||
|
|
||||||
attribList = kw.get('attribList', None)
|
attribList = kw.get('attribList', None)
|
||||||
if attribList is None:
|
if attribList is None:
|
||||||
attribList = [
|
attribList = [
|
||||||
wxgl.WX_GL_RGBA, True,
|
wxgl.WX_GL_RGBA, True,
|
||||||
wxgl.WX_GL_LEVEL, 0,
|
wxgl.WX_GL_LEVEL, 0,
|
||||||
wxgl.WX_GL_DOUBLEBUFFER, True,
|
|
||||||
]
|
]
|
||||||
|
if not fbprops.isSingleBuffered():
|
||||||
|
attribList.append(wxgl.WX_GL_DOUBLEBUFFER)
|
||||||
|
attribList.append(True)
|
||||||
|
if fbprops.getDepthBits() > 0:
|
||||||
|
attribList.append(wxgl.WX_GL_DEPTH_SIZE)
|
||||||
|
attribList.append(fbprops.getDepthBits())
|
||||||
|
|
||||||
kw['attribList'] = attribList
|
kw['attribList'] = attribList
|
||||||
|
|
||||||
base.startWx()
|
base.startWx()
|
||||||
@ -284,6 +294,8 @@ else:
|
|||||||
wp.setSize(*self.GetClientSize())
|
wp.setSize(*self.GetClientSize())
|
||||||
self.win.requestProperties(wp)
|
self.win.requestProperties(wp)
|
||||||
|
|
||||||
|
event.Skip()
|
||||||
|
|
||||||
# Choose the best implementation of WxPandaWindow for the platform.
|
# Choose the best implementation of WxPandaWindow for the platform.
|
||||||
WxPandaWindow = None
|
WxPandaWindow = None
|
||||||
if platform.system() == 'Darwin' or platform.system() == 'Linux':
|
if platform.system() == 'Darwin' or platform.system() == 'Linux':
|
||||||
|
Loading…
x
Reference in New Issue
Block a user