On Fri, Apr 4, 2008 at 11:55 AM, Gary Herron <[EMAIL PROTECTED]> wrote:
>
>  I've got a Windows C++ app that creates its own window (via
>  CreateWindow) and an OpenGL context (via wglCreateContext), then calls
>  an embedded Python interpreter which intends to draw on that window
>  using OpenGL calls exposed by pyglet.gl.   My C++ code carefully makes
>  the context current (via wglMakeCurrent) before any of the Pyglet code
>  is called.  However, pyglet does not know that the context is set and
>  complains immediately if I make any OpenGL through pyglet.gl
>
>  I'm fairly certain that the C++/Windows/wgl... code is correct, because
>  the application worked just fine when I used PyOpenGL for OpenGL
>  interactions with the window.  I'd like to use Pyglet instead of
>  PyOpenGL now, but I need a way to tell Pyglet that I *do* have a context
>  set.  (Apparently PyOpenGL trusted that the context was set, and allowed
>  me to crash and burn if it wasn't.)  I don't fault Pyglet for being more
>  careful, but how do I make it accept my context?

There's no public API for this, but you'll see the relevant flags in
pyglet/gl/__init__.py which you can hack.

I really don't recommend creating your own context on Windows, as any
non-OpenGL 1.1 functions will be inaccessible (the function pointers
need a valid context via WGL).  There is a test program in SVN
trunk/experimental/wxtest.py that creates a GL context for a wxPython
window, this might be a useful starting point.

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