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

Re: [pygame] is fast opengl a possibility in pygame?



On 8/25/05, Matt Bailey <mattb@xxxxxxxxxx> wrote:
> On Wednesday 24 August 2005 22:35, Rene Dudfield fired a shotgun at the
> keyboard and the following appeared:
> > Hey,
> >
> > one good trick for displaying lots of the same thing is to use display
> > lists of display lists.
> >
> > So if you are going to draw 50 BOBs you make one display list of the
> > BOB and then another display list of them all together.
> 
>         Interesting, never tried calling displaylists from within displaylists. How
> does this help? Usually I just have a bunch of displaylists and call them by
> iterating over a list (or iterate over a list and call the same list each
> time).
> 

It helps by reducing the amount of memory needed to store the object. 
It also reduces function calls.  It reduces the time swapping between
the cpu and the gpu.

There is also the create and draw mode to creating display lists.

Another thing which is faster... believe it or not...  is to use
translate/rotate calls instead of pushing and popping the matrix.

glTranslatef(gx,gy,gz)
glRotatef(grot, grx ,gry ,grz)
drawBOB();
glRotatef(grot, -grx ,-gry ,-grz)
glTranslatef(-gx,-gy,-gz)



Chairs,