Re: Pyglet error (ValueError: NULL pointer access) on linux

81 views
Skip to first unread message

Andre D

unread,
Dec 12, 2012, 5:46:22 PM12/12/12
to pyglet...@googlegroups.com
Looks like an OpenGL context is failing to be created (And we are not
detecting it correctly). Do other opengl applications work? (Even if
not, we are detecting the failure incorrectly)

On Wed, Dec 12, 2012 at 9:23 AM, EvilGoatee <evil....@gmail.com> wrote:
> I'm trying to get up and running with pyglet but kewp getting and error.
>
> Here's the code:
>
> import pyglet
> from pyglet.gl import *
> window = pyglet.window.Window()
> glClearColor(0.2, 0.4, 0.5, 1.0)
> @window.event
> def on_draw():
> glClear(GL_COLOR_BUFFER_BIT)
> glColor3f(0, 0, 0)
> glBegin(GL_TRIANGLES)
> glVertex2f(200, 100)
> glVertex2f(200, 200)
> glVertex2f(100, 200)
> glVertex2f(300, 100)
> glVertex2f(300, 300)
> glVertex2f(100, 300)
> glEnd()
> pyglet.app.run()
>
>
> and here's the error:
>
>> Traceback (most recent call last):
>> File "test.py", line 2, in <module>
>> from pyglet.gl import *
>> File
>> "/usr/local/lib/python2.7/dist-packages/pyglet-1.2alpha1-py2.7.egg/pyglet/gl/__init__.py",
>> line 235, in <module>
>> import pyglet.window
>> File
>> "/usr/local/lib/python2.7/dist-packages/pyglet-1.2alpha1-py2.7.egg/pyglet/window/__init__.py",
>> line 1811, in <module>
>> gl._create_shadow_window()
>> File
>> "/usr/local/lib/python2.7/dist-packages/pyglet-1.2alpha1-py2.7.egg/pyglet/gl/__init__.py",
>> line 205, in _create_shadow_window
>> _shadow_window = Window(width=1, height=1, visible=False)
>> File
>> "/usr/local/lib/python2.7/dist-packages/pyglet-1.2alpha1-py2.7.egg/pyglet/window/xlib/__init__.py",
>> line 160, in __init__
>> super(XlibWindow, self).__init__(*args, **kwargs)
>> File
>> "/usr/local/lib/python2.7/dist-packages/pyglet-1.2alpha1-py2.7.egg/pyglet/window/__init__.py",
>> line 516, in __init__
>> context = config.create_context(gl.current_context)
>> File
>> "/usr/local/lib/python2.7/dist-packages/pyglet-1.2alpha1-py2.7.egg/pyglet/gl/xlib.py",
>> line 186, in create_context
>> return XlibContextARB(self, share)
>> File
>> "/usr/local/lib/python2.7/dist-packages/pyglet-1.2alpha1-py2.7.egg/pyglet/gl/xlib.py",
>> line 300, in __init__
>> super(XlibContext13, self).__init__(config, share)
>> File
>> "/usr/local/lib/python2.7/dist-packages/pyglet-1.2alpha1-py2.7.egg/pyglet/gl/xlib.py",
>> line 197, in __init__
>> glx_context_id = self.glx_context.contents._opaque_struct
>> ValueError: NULL pointer access
>>
>> ------------------
>> (program exited with code: 1)
>> Press return to continue
>
>
> I'm on linuxmint 14 32bits
>
> thanks.
>
> --
> You received this message because you are subscribed to the Google Groups
> "pyglet-users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/pyglet-users/-/AHsLBCNtjrYJ.
> To post to this group, send email to pyglet...@googlegroups.com.
> To unsubscribe from this group, send email to
> pyglet-users...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/pyglet-users?hl=en.

Andre D

unread,
Dec 12, 2012, 5:52:17 PM12/12/12
to pyglet...@googlegroups.com
I suspect we should be saying

glx_context_id = self.glx_context.contents._opaque_struct if
self.glx_context.contents else -1

or something....

Adam Bark

unread,
Dec 12, 2012, 6:14:22 PM12/12/12
to pyglet...@googlegroups.com
Anybody care to open an issue on this? It might be a problem with an
open-source video driver not supporting OpenGL.

EvilGoatee

unread,
Dec 13, 2012, 7:24:02 PM12/13/12
to pyglet...@googlegroups.com
Hi, thanks for responding.

Yes, other OpenGL programs seem to run fine.

I forgot to mention my graphics chipset, I think its Intel GMA950.

Thanks, I hope this can be fixed!
Reply all
Reply to author
Forward
0 new messages