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

Re: [pygame] Pygame and OpenGL



On Mon, 5 Nov 2001, Pete Shinners wrote:

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

Apparently it's doable, but not worth the hassle (see the other message). 

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

No, glGetPixels()/glDrawPixels() is to be avoided if possible.

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

I'll try to do mys simple tests as 3D-only as a first step. :) If it works
out (read: my skills suffice) I'll try adding the needed 2D components
somehow. Either as above or as textures.

-- 
               "Stercus, stercus, stercus, moriturus sum."
                                       -- Terry Pratchett, Interesting Times

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