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

Re: [pygame] Re: pygame + pyopengl



> Now, SDL_VideoInit defaults video->gl_config.double_buffer to be 1
> (look in video/SDL_video.c).  Presumably this is because people 
> usually need double buffering, so SDL defaults to it.

ahh, this would be the root of all my testing problems :]



> Pete, putting the flip in pygame.display.flip does sound cool.
> Perhaps SDL would be more the place to do this though?  The GL
> stuff seems to be deliberately separate in SDL, perhaps it's just
> historical accident.

hmm, this is true. perhaps it would be best to wrap all of
SDL's opengl functions into a separate module. this module
would also include it's own set_mode() that would clearly
be creating an opengl display. making it pretty clear you
should not mix with the pygame.display module

the only real functions here are

SDL_GL_LoadLibrary
    this is used to bind SDL to the appropriate GL library
    at runtime. we might need to doublecheck and ensure that
    SDL is using the same opengl that pyopengl is. this should
    happen automatically, and not need called by the python user

SDL_GL_GetProcAddress
    this is used for getting at opengl extensions. this should
    be all handled through pyopengl, not here in pygame. (i think
    pyopengl handles this? haven't looked)

SDL_GL_(G/S)setAttribute
    this must be called before setting the display mode. i'll
    likely want to break this down into more specific functions
    like pygame.gl.set_accum(r,g,b,a)

SDL_GL_SwapBuffers
    we'll need pygame to handle this function, since there is
    no support in pyopengl (aside from GLUT?) for flipping.
    opengl leaves flipping to the window/display manager, so
    doesn't actually flip by itself.

if there is a pygame.gl module, and it has its own set_mode()
function, at first i was thinking it shouldn't even bother
returning a Surface object, since you can't really do anything
with it. unless you create the opengl display with SDL_OPENGLBLIT,
in which case SDL emulates blits to the display with textured quads
i'm not exactly what can and cannot be done with these types
of displays.


what you can and cannot do with SDL and an opengl display seems
to be pretty undocumented. digging through the SDL source is probably
the best answer, but takes a bit more time. thanks for the info
francis.


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