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

Re: [pygame] Pygame and OpenGL



On Mon, Nov 05, 2001 at 09:56:47AM +0200, Jan Ekholm wrote:
> 
> Hi all,
> 
> Played some with the PyOpenGL package, and it even has some context for
> use with pygame. What I'd like to do, however, is just use pygame as
> normally and use a small surface for all OpenGL. Is it possible to combine
> those two? I don't want to do normal pygame rendering on the OpenGL
> surface, but would like to eventually blit the OpenGL surface onto the
> screen, on top of the normal pygame "toplevel" surface. 
> 
> Not that this really is important, I'm just curious to see how it works if
> at all. :)

I have used pygame and pyopengl together. Its entirely doable, but the speed slug will kill your game. My advice would be to use OpenGL as your whole graphics system. Its faster when accelerated than SDL. If you want to do 2D gfx with it then use OpenGL with Ortho projection. You can switch between ortho and perspective projection matricies if you need to.

You can also do texture weighting and other cool gfx memory management in OpenGL 1.1

I have used the pygame routines to render things to a SDL surface, then used the Image's tostring() to turn it to a raw string to be imported into a GL texture.

This would be the way AFAIKS of blitting the GL ontop of SDL. You'll have to render, then convert to a string the convert back, etc... Very slow.

OpenGL rocks for gfx. I use pygame for joystick, sound, IO, cdrom, processing, etc. etc.

Kind Regards

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