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

Re: [pygame] using opengl in pygame?



Thanks Bob and Eric.

Great feedback.
So are there any examples you can point me to that successfully use OpenGL within a pyGame context? From the various bits I've read, it sounds like people are pretty pleased with how easy it is to use the two without any major contortions or limitations.

In my day job (and night job, and early early morning job), I'm the artist for a small games developer, and in the past we tried to use SDL and ran into an image size barrier. Turns out that SDL didn't like full screen (or close to that) images that moved so we ended up having to patch a big grid of many images together to reach decent performance. Is that something you've heard about, or is there a better approach fullscreen animated goodness?


Thanks again.

~Israel~





On Friday, June 18, 2004, at 03:24 PM, Bob Ippolito wrote:

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
<smime.p7s>



~Israel~