On 3/10/08, selsine <[EMAIL PROTECTED]> wrote: > > Hi Alex, > > Thanks for the reply. > > <snip> > > > > I can create a GL Context in a PyGTK window, and according to one post > > > that I read what I need to do is "trick" PyGlet into using this GL > > > context. > > > Just to be clear I'm using GtkGLExt: http://www.k-3d.org/gtkglext/Main_Page > to create my GL context. > > > > > So my questions are: > > > > > 1) How would I trick PyGlet into using the GL context that I have > > > already created > > > > There's actually no trick... OpenGL has only one active context at a > > time. In pyglet you can switch contexts with Window.switch_to(). > > When you create a new window the context will switch to that window > > automatically. If you never call switch_to() or create a new window, > > the context never changes; so the PyGTK one remains active. > > > > The situation could get a lot more complicated if you're using more > > than one PyGTK window (context), or trying to mix pyglet windows with > > PyGTK windows. > > > > In pyglet 1.1 you should also set pyglet.options['shadow_window'] to False. > > > Thanks for the information Alex, I've been able to try this out and it > feels as though I almost have it going. The only problem now is that > my sprites are not drawing properly. Instead of seeing the actual > image what I'm getting are white squares (the size of the image) where > the sprites should be. This happens if I use a batch draw or just an > Image.blit().
Sounds like the texture's missing, which suggests to me that it was loaded into the wrong context. Make sure you only load images (and get .texture / call get_texture) after setting up the GTK context. 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 -~----------~----~----~----~------~----~------~--~---
