On Sunday, 8 February 2015 22:40:28 UTC+11, Daniel Gillet wrote:
>
> Hello,
>
> On my laptop when trying to launch this minimal code
> import pyglet
>
> pic = pyglet.image.load('image1.png', 
> file=pyglet.resource.file('image1.png'))
> texture = pic.get_texture()
>
> window = pyglet.window.Window()
>
> @window.event
> def on_draw():
>       window.clear()
>
> pyglet.app.run()
>
> I get this error message: pyglet.gl.ContextException: Unable to share 
> contexts with this stack trace:
>
> Traceback (most recent call last):
>   File "test.py", line 9, in <module>
>     window = pyglet.window.Window()
>   File 
> "C:\Python27\lib\site-packages\pyglet-1.2.0rc3-py2.7.egg\pyglet\window\win32\__init__.py",
>  
> line 131, in __init__
>     super(Win32Window, self).__init__(*args, **kwargs)
>   File 
> "C:\Python27\lib\site-packages\pyglet-1.2.0rc3-py2.7.egg\pyglet\window\__init__.py",
>  
> line 559, in __init__
>     self._create()
>   File 
> "C:\Python27\lib\site-packages\pyglet-1.2.0rc3-py2.7.egg\pyglet\window\win32\__init__.py",
>  
> line 261, in _create
>     self.context.attach(self.canvas)
>   File 
> "C:\Python27\lib\site-packages\pyglet-1.2.0rc3-py2.7.egg\pyglet\gl\win32.py", 
> line 263, in attach
>     super(Win32ARBContext, self).attach(canvas)
>   File 
> "C:\Python27\lib\site-packages\pyglet-1.2.0rc3-py2.7.egg\pyglet\gl\win32.py", 
> line 208, in attach
>     raise gl.ContextException('Unable to share contexts')
> pyglet.gl.ContextException: Unable to share contexts
>
> If I create the window before the texture = pic.get_texture(), it works 
> correctly. I cannot reproduce this error on my desktop.
>
> I believe this comes from 
> pyglet\image\__init__.py(1502)create() 
> id = GLuint()
> which (I'm guessing here) is creating a context. So when trying to create 
> the window, we have more than one OpenGL context and it throws an exception 
> with my video card driver.
>

Hi, you later post that you're using an Intel HD 4000 system. We've 
historically noticed that Intel systems don't support shared opengl 
contexts.

You can disable the automatic creation of a shadow context by setting the 
environment variable

    PYGLET_SHADOW_WINDOW=0

Note that if you do this then you must alter your application to always 
open its window first - if you don't and load images first you'll get all 
sorts of brokenness (and possibly segfaults).


      Richard

-- 
You received this message because you are subscribed to the Google Groups 
"pyglet-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/pyglet-users.
For more options, visit https://groups.google.com/d/optout.

Reply via email to