pyglet in Sage

10 views
Skip to first unread message

Ondrej Certik

unread,
Dec 11, 2007, 3:33:57 PM12/11/07
to pyglet-users
Hi Alex and others,

there is a discussion on sage-devel about pyglet vs pygame:

http://groups.google.com/group/sage-devel/browse_thread/thread/8c844fcde307a0

do you think you could please correct/add some information in there
please?

Thanks a lot,
Ondrej

P.S. Pyglet is in SymPy which is in Sage. Currently the SymPy in Sage
doesn't contain the newest pyglet, that fixes some bugs. But the
pyglet in the newest SymPy is fresh.

Sage: http://sagemath.org/

Nathan

unread,
Dec 11, 2007, 3:43:56 PM12/11/07
to pyglet...@googlegroups.com
Interesting. I've never heard of sage before.

~ Nathan

Alex Holkner

unread,
Dec 11, 2007, 4:47:49 PM12/11/07
to pyglet...@googlegroups.com
On 12/12/07, Ondrej Certik <ond...@certik.cz> wrote:
>
> Hi Alex and others,
>
> there is a discussion on sage-devel about pyglet vs pygame:
>
> http://groups.google.com/group/sage-devel/browse_thread/thread/8c844fcde307a0
>
> do you think you could please correct/add some information in there
> please?

Rather than join in your list, I'll just post some quick
clarifications which you can repost there. If your members have more
questions about pyglet etc, they are of course welcome to join this
list or email me.

Re: "No conforming visual": this looks like a 16-bit depth issue that
was fixed quite a while ago, but please make sure the author checks
with a newer version and opens an issue if not.

Re: "OpenGL/SDL/PyOpenGL":
For your requirements, only OpenGL will suffice (accelerated 3D
graphics on Mac/Windows/Linux). OpenGL is a graphics API that is
exposed on Windows, Linux and Mac. To use OpenGL from Python, you can
use either pyglet or PyOpenGL.

Regardless of whether pyglet or PyOpenGL is used to call the OpenGL
functions, you still need an OpenGL "context" -- a window into which
the graphics can be drawn. pyglet can provide you with such a
context, as can PyGame (PyOpenGL can too, with GLUT, but this has
limitations). Most other GUI toolkits, such as wxPython, PyGtk and
Tkinter can also create OpenGL contexts.

So, you should choose your context creator first: say, pyglet, if you
like its event and windowing system; or PyGame, if you prefer SDL's
event and windowing system (PyGame uses SDL, a C library, internally).
You may decide to go with PyGtk or wxPython etc instead, if you want
to use their GUI components.

Having chosen a context, you can then proceed to use OpenGL via pyglet
or PyOpenGL.

Re: "DirectX/OpenGL":
pyglet only uses DirectX for audio -- graphics are still done using
OpenGL on Windows. There are no DirectX bindings for Python that I'm
aware of (though you could use the COM interfaces directly, if you
were suitably masochistic).

Hope that clears up some things
Alex.

Ondrej Certik

unread,
Dec 12, 2007, 6:20:44 AM12/12/07
to pyglet-users
Hi Alex,

> Hope that clears up some things
> Alex.

Thanks for your reply. So pygame+pyopengl is more or less equivalent
to pyglet? I.e. it runs on win, linux, mac and it allows you to do
basically the same things?

I am interested in reasons you stared pyglet, instead of improving
pygame+pyopengl - pyglet must have some advantages. For example being
a small, pure python library.

Ondrej

Alex Holkner

unread,
Dec 12, 2007, 7:17:30 AM12/12/07
to pyglet...@googlegroups.com
On Dec 12, 2007 10:20 PM, Ondrej Certik <ond...@certik.cz> wrote:

> Thanks for your reply. So pygame+pyopengl is more or less equivalent
> to pyglet? I.e. it runs on win, linux, mac and it allows you to do
> basically the same things?

Well, see the respective feature lists for the differences; they are
equivalent if _all_ you want to do is render to a single opengl
context.

>
> I am interested in reasons you stared pyglet, instead of improving
> pygame+pyopengl - pyglet must have some advantages. For example being
> a small, pure python library.

PyGame is fundamentally limited by SDL; a feature addition (such as
adding support for multiple windows) would require a modification to
SDL, to the PyGame DLL and to the PyGame Python modules.
Incidentally, the PyGame DLL is not required now that ctypes is
available; I rewrote PyGame to use ctypes last year but the then
maintainers were not interested in making the switch.

Because pyglet doesn't use SDL it can have include many features that
PyGame cannot (yet).

Alex.

Reply all
Reply to author
Forward
0 new messages