[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [pygame] Pygame and OpenGL



On Tue, 6 Nov 2001 06:15, Jan Ekholm wrote:
> On Mon, 5 Nov 2001, Michael Robin wrote:
> >>sounds like you already got it started, but don't overlook the "glcube"
> >>sample the comes in the pygame examples directory :]
> >
> >Ok, I don't know much about opengl, so I thought I give
> >this demo a try - it works fine.
> >But I was suprised at the draw loop, that DrawCube had to
> >be called every time. I thougt one advantage of OpenGL would be
> >that I'd be able to describe each object class only once
> >(using glVertex, or whatever) and then tell OpenGL to place
> >it with a particular scale/rotation, etc.
> >Doesn't OpenGL have a retained mode?
>
> Nope. You paint what you want each frame. Of course you don't need to
> clear the scene between frames, so you can achieve nice effects by
> painting similar stuff twice. Motion blur, advanced lighting effects etc.

Have a look at Display Lists on page 117 of the Red Book. Relevant API calls 
are glNewList, glEndList and glCallList. Display lists can store any gl 
commands, and so they can be used to hold a large number of scene setup 
commands, or the complete glColor/glBegin/glVertex/glEnd commands to draw a 
complex object. The lists are stored on the server, hopefully in memory on 
the actual graphics card. At a minimum, you're not constructing the object in 
Python, which is ... slow.


     Richard
____________________________________
pygame mailing list
pygame-users@seul.org
http://pygame.seul.org