On Sun, Mar 9, 2008 at 2:16 PM, Ian <[EMAIL PROTECTED]> wrote:
>
>  Does anyone have a working code example for a working wxPython app
>  with a wx.GLCanvas window that has opengl calls made for rendering by
>  pyglet?

I haven't used wxPython, so the following is just theoretical...

>
>  I basically just want to use pyglet as a drop in replacement for
>  PyOpenGL (obviously with the requisite argument type and function name
>  changes) to implement the wx.EVT_PAINT event of wx.GLCanvas.
>
>  I found an example from last year on the group, but it fails on
>  windows (with invalid operation) errors. I've hacked together an
>  example myself, but it claims there's no context when using ARB
>  extensions (though it seems to work with regular gl calls when I
>  disable debug mode). And I've tried several permutations of pyglet and
>  wx.Python's contexts.

Ok, on Windows pyglet goes through WGL to get the extension function
pointers (this is the only way to get > 1.1 OpenGL functionality); and
needs a (pyglet) context of certain capabilities.  Some hacks that
come to mind:

* Let pyglet create its context first (create dummy window if using
pyglet 1.0), then create and switch to the wxPython context.
* I can't think why that wouldn't work, but if it doesn't, start
hacking pyglet/gl/lib_wgl.py to bypass pyglet's context checks.

If a simple hack is all that's needed I'll consider adding it as a
pyglet.option ("assume a context is always available") in pyglet 1.1
or later.

Alex.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"pyglet-users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/pyglet-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to