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

Re: [pygame] [PyGame + PyOpenGL] Setting Target Surface



On 4/6/06, Mike Wyatt <mwyatt@xxxxxxxxx> wrote:
> By default, everything I draw with the gl***() methods is drawn directly
> onto the back buffer. Calling pygame.display.flip() then flips the new
> image to the screen. What I'd like to do is render multiple scenes to
> seperate pygame.Surface objects, then render all the surfaces together
> onto the back buffer, then flipping the final image to the screen. This
> will be used for fade in/out transitions between game screens.

You can't directly render to other pygame Surfaces. I _think_ the way
you are supposed to do this sort of thing is to render to the back
buffer and then read the pixel data with glReadPixels after which you
can transform it into a texture and render it in a quad.

Sorry to be so unspecific, but I haven't actually done this yet
either. I should write some code to test it I guess.

--
Sami Hangaslammi