[PATCH] Fix GLX info in tools/gl_info.py

32 views
Skip to first unread message

anatoly techtonik

unread,
Nov 9, 2011, 6:04:44 PM11/9/11
to pyglet...@googlegroups.com

Andreas Schiefer

unread,
Nov 21, 2011, 1:35:45 PM11/21/11
to pyglet...@googlegroups.com
Thanks for the error report/patch!

Unfortunatly your patch breaks on Windows (xlib is not imported there). 
I've just commited a similar fix, and also patched the Windows part to work with ARB contexts.


anatoly techtonik

unread,
Nov 21, 2011, 4:52:57 PM11/21/11
to pyglet...@googlegroups.com
Hmm. The API that forces you to do stuff like:

from pyglet.gl import *

doesn't look good to me. Shouldn't pyglet provide cross-platform API?

Richard Jones

unread,
Nov 21, 2011, 5:43:01 PM11/21/11
to pyglet...@googlegroups.com
On 22 November 2011 08:52, anatoly techtonik <tech...@gmail.com> wrote:
> Hmm. The API that forces you to do stuff like:
> from pyglet.gl import *
> doesn't look good to me.

You're welcome to use "from pyglet import gl" and prefix all the
module names with "gl.", or just import the names you need.


> Shouldn't pyglet provide cross-platform API?

Could you be more specific about what you mean here? I thought that
the API exposed by pyglet was cross-platform.


Richard

anatoly techtonik

unread,
Nov 22, 2011, 2:42:34 AM11/22/11
to pyglet...@googlegroups.com
Specifically this check doesn't look good to me:

This extension API doesn't seem to be abstracted too: 
http://pyglet.org/doc/programming_guide/agl_glx_and_wgl.html
-- 
anatoly t.
 

Andreas Schiefer

unread,
Nov 22, 2011, 7:53:04 AM11/22/11
to pyglet...@googlegroups.com
On Tue, Nov 22, 2011 at 08:42:34 UTC+1 anatoly techtonik wrote:
On Tue, Nov 22, 2011 at 1:43 AM, Richard Jones <r1char...@gmail.com> wrote:
On 22 November 2011 08:52, anatoly techtonik <tech...@gmail.com> wrote:
> Shouldn't pyglet provide cross-platform API?

Could you be more specific about what you mean here? I thought that
the API exposed by pyglet was cross-platform.

Specifically this check doesn't look good to me:
 
Yeah, it's a bit ugly. But this script is not part of the public pyglet API, more something like a low level debugging tool. So I think it's not a big deal to make this somewhat ugly check there (for such low level code you have to somewhere decide which API to use).

Regarding the cross-platform API, the high level API of pyglet is of course cross-platform. In normal code you don't have to fiddle with GLX or WGL directly, pyglet provides the Window, Context and Config classes for that. If you want to, you can of course use the low level API to GLX or WGL, but then you have to use basically the same API as if you were coding in C.

If you want to use some GLX or WGL extensions, then you already have to know the platform you use, because the extensions are specific to a platform and cannot be abstracted away.


Andy
Reply all
Reply to author
Forward
0 new messages