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

Re: [pygame] Pygame and OpenGL



Jan Ekholm wrote:

> 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. :)

hmm, it should be doable, but you're definitely going off onto your own 
territory. SDL does not support offscreen surfaces for opengl. but since 
it sounds like you want to do just create the gl context for your own 
offscreen surface and never change it from that, you might be ok.

thinking about it, you will definitely need a to do a bit of work. i'm 
not sure what kind of options pyopengl gives you for creating an 
offscreen surface. i'm guessing opengl will create the offscreen area 
somewhere in video ram. perhaps the only way to fetch the pixel data is 
then with glGetPixels or something (doesn't seem fast)

hmm, well anyways, i wouldn't do anything that 'depends' on this 
behaviour without a lot of prior testing :] it will be a bumpy road, 
that's for sure.

still, if you manage to clear a path and find there's something that 
could be done in C to really speedup this kind of behavior, let me know. 
i'd be interested in adding this to pygame.


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