R Fritz
unread,Nov 14, 2009, 7:21:48 PM11/14/09Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to wxPython-users
Thank you. I wrote the following for use with my OSG code, following
the model of OSG's viewerWX:
@staticmethod
def gen_OpenGL_attributes():
return [
wx.glcanvas.WX_GL_DOUBLEBUFFER,
wx.glcanvas.WX_GL_RGBA,
wx.glcanvas.WX_GL_DEPTH_SIZE, 8,
wx.glcanvas.WX_GL_STENCIL_SIZE, 8]
For the interested, I found that WxWidgets maps those constants to the
local OpenGL environment's constants in the appropriate glcanvas.cpp.
So, for instance, in the Mac Carbon environment, those attributes are
translated to AGL_DOUBLEBUFFER, AGL_RGBA, AGL_DEPTH_SIZE, and
AGL_STENCIL_SIZE.
However, my problem turned out to be somewhat different; it turns out
that the OpenGL canvas width and height are initially returned as
(0,0) on the Mac, and passing those values to
osgViewer::Viewer::setUpViewerAsEmbeddedInWindow confused the OSG
camera it in a way that later resizes would not reset. Hacking the
code to pass an initial (1,1) as the width and height made it work...I
hope.