[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [pygame] using opengl in pygame?



On Jun 18, 2004, at 6:08 PM, israel@uandmedance.com wrote:

What are the main benefits to using either SDL or OpenGL? In what circumstances would one be more advised to one over the other? I keep hearing lots of good stuff about OpenGL and lot's of mediocre stuff about SDL. It seems that OpenGL allows one to have a lot of nice flexibility and functionality in one's poly based sprites, but at what cost? If OpenGL is so nice, why would one want to use SDL? Is there a hardware barrier? I've heard that while OpenGL is great for a lot of things, It's performance really is dependent upon hardware capability. More so, apparently than SDL.
OpenGL is a display API only. It's common to use SDL for cross-platform input/audio and acquiring a display context, and OpenGL for the rest of it. OpenGL is not going to be available or perform acceptably on several classes of devices and accelerated hardware support is shoddy or non-existent on many operating systems. though it is great on Windows and OS X.

Is SDL kind of like and entry level grunt that'll handle most everything you need, but if you want to get fancy do you break out the OpenGL can of Whoopass?
OpenGL does one thing very well: accelerated 3D. SDL does not do that at all, but it does several other things moderately well on many platforms. SDL does simple 2D bitmap stuff, which OpenGL really isn't geared for... though on modern machines on some platforms OpenGL can be contorted to do 2D stuff in a MUCH more efficient way, but it requires a bit more effort from the programmer. Additionally, there is (supposedly, don't know from experience) an experimental backend for SDL that uses OpenGL for its display layer, which means that eventually you can get most of the OpenGL speed with the same SDL API.

In other words, it really depends on what your target platform is and what you want to do.

I haven't seen (though I've probably overlooked) extensive documentation on using OpenGL in Python. Should I look to the PyOpenGL folks for that documentation?
No, you should look to the OpenGL folks for that documentation. PyOpenGL exposes nearly the same API you get from C, with the obvious pythonification of arguments.

-bob

Attachment: smime.p7s
Description: application/pkcs7-signature