[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
Re: [pygame] using opengl in pygame?
OpenGL is dependent on a card that supports it. The good news is that
there haven't been any cards made in a long, long time that don't. SDL
isn't too dependent on hardware because it does so much in software.
It'll run on those reeeeaaallly old cards that can't do OpenGL. But
it's a lot slower and less featureful. I'd recommend strongly that you
use OpenGL unless you know that you want to target platforms that don't
support it.
As far as performance, I'd wager that if you're considering it as a
plug-in replacement for SDL (only doing 2-d stuff with it), it's going
to be either no performance (the platform can't do OpenGL), or it'll be
so fast that you can consider your graphics operations to take zero
time. These cards are designed to render millions of polys per second.
At one poly (or is it two?) per sprite, your card's gonna spend 99% of
its time snoozing. Your bottleneck will be Python, never your graphics
card.
Documentation... there's not a lot of Python-specific stuff to it.
OpenGL is an API, and as such, you use it the same from C, Python, or
anything else.
Ease of use...I never spent much time mastering SDL's surface routines,
because I found out pretty early about pyopengl and never looked back.
I can tell you it's not hard using OpenGL, and oh boy is it ever worth it.
Good luck,
-Eric
israel@uandmedance.com wrote:
Hello wonderful pygame people.
I have a number of questions here about pygame since I'm quite new to
this cool project.
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.
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?
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?
I'll stop here for now and try to keep to this one subject. Thank you
for any information offered.
~Israel~