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

RE: [pygame] Pygame and OpenGL



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.

>Why does the demo move the camera rather than the object?

You can do either. You move the camera away from the scene or the scene
away from the camera (reverse transformations though).

>Basically, I'd like to experiment by taking the beginnings of my 2d vector
>game to opengl, just for speedup (seeing it'll do the rotations, etc.)
>later add some camera work, and maybe really take advantage of the z-asis,
>etc., later on. If I have to call glVectex, et al, in the draw loop for
>each part of my shapes, it'll be slower than my current solution.

Well, a OpenGL solution does so much more per vertex than a pure 2D, but
you also probably have some kind of hardware support for the 3D drawing,
so the difference may not be that big.

-- 
  "You can't trample infidels when you're a tortoise. I mean, all you could
                  do is give them a meaningful look."
                                              -- Terry Pratchett, Small Gods

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