Abe Stephens wrote:
Hi, What is the right way to use GLCanvasWithContext to share a single GL context between two classes that inherit from GLCanvas? (Maybe via self.PostCreate? What does the constructor of the class look like?) I haven't gotten it working on my own and I don't seem to find any examples via google.
Try something like this:
context = wx.glcanvas.GLContext(parent)
canvas1 = wx.glcanvas.GLCanvasWithContext(parent, context)
canvas2 = wx.glcanvas.GLCanvasWithContext(parent, context)
The when you want to direct the GL functions to a particular window, use:
context.SetCurrent(canvas1)
NOTE: I just gleaned that from looking at the headers, I don't have very much experience with OpenGL at all so take this with a grain of salt...
···
--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!