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

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



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.

Psyco is really nice for speeding up heaps of function calls to gl in
loops.  I often get speeds as fast or faster than the C versions of
demos.

Also storing things in lists or arrays instead of objects can be quicker.

Often reducing gl function calls, states, and using the faster paths
of opengl is good enough.

Chairs,


On 8/25/05, Matt Bailey <mattb@xxxxxxxxxx> wrote:
> On Wednesday 24 August 2005 18:15, Jasper fired a shotgun at the keyboard and
> the following appeared:
> >
> > I use Display Lists for just about everything, and they greatly speed
> > drawing; without them my game would be infeasible in pygame.  I'm doing
> > something fairly similar to what you describe, using a textured quad for
> > each hex in a gameboard, all of which are drawn in one display list.
> > The soldiers are drawn in their own display lists, so they can move
> > indpendently of the board.
> > http://img374.imageshack.us/img374/4086/0824160601screen0mc.jpg
> 
> Hey, that's pretty kewl looking. Got a web page with more info?
> 
> Btw..........do you know if there are any memory or other resource problems
> that arise from infinitely creating displaylists? I was doing this on a sort
> of particle generator....each new particle generated a new displaylist (yes,
> horribly slow, this was early code). Now I just build one list and pass it to
> each particle instance at run-time.........basically I'm calling the same
> list for every instance of the particle (actually, smoke puff). I'm just
> wondering if my previous use of infinite displaylists may have been causing
> some of my performance issues over time.
> 
> This is it: http://x-plane.org/home/mattb/pics/x-smoke_8-08-05.html
> It's a plug-in for the commercial flight sim X-Plane. The sim is not
> mine....the colored smoke is what the plug-in is drawing, everything else is
> X-Plane. I'm using PyOpenGL and still having some performance issues, but I
> think I've got things on the right track. It does seem PyOpenGL/Python is not
> suitable for very intensive graphical applications/environments, but it's
> still faster than I thought it might be.
> 
>         -Matt Bailey
> 
>