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

Re: [pygame] Using PyOpenGL for 2D graphics



Right.  Read the entire thing; I had an older computer where that was true, but my new one's record fps is over 600 (nothing on the screen).

On 7/8/07, Greg Ewing <greg.ewing@xxxxxxxxxxxxxxxx> wrote:
Ian Mallett wrote:
> Don't tell Silicon Graphics, but I've found pygame is much much faster
> at 2D.

That's rather surprising, assuming you have hardware acceleration.

It probably has to do with how you're sending the coordinates
to OpenGL. Making lots of calls to glVertex() from Python will
be inefficient, even more so than it would in C, due to the
slowness of Python function calls.

Putting your coordinates into an array and using one of the
array-oriented calls ought to be a lot better.

Another useful technique is to put frequently-used sequences
of operations into display lists, then you can invoke them
with just a single Python call.

--
Greg