“Sam Lantinga” wrote in message
news:mailman.1060209422.28856.sdl at libsdl.org…
Okay, here’s a proposed API for SDL 1.2.6 Pbuffer support:
<< Re: SDL_GL_CreatePbuffer >>
- Currently this function does not create a new OpenGL context.
- Set the pbuffer as the current OpenGL rendering context.
extern DECLSPEC void SDLCALL SDL_GL_LockPbuffer(SDL_Pbuffer *pbuffer);
I’m a little confused - does it or does it not create a new context?
extern DECLSPEC void SDLCALL SDL_GL_DestroyPbuffer(SDL_Pbuffer *pbuffer);
We currently have FreeSurface, FreeCursor, FreeYUVOverlay, FreeWAV,
DestroyMutex and RemoveTimer. I’d prefer to use FreePbuffer in an attempt
at consistency.
I’m not sure about the Lock/Unlock setup. It sounds like, if I have two
pbuffers, there will be an unnecessary switch to the main rendering context
between unlocking one and locking the second. I’m also not sure about the
texture data update being forced on each unlock… I could see that as a
potential performance issue beyond the programmer’s control.
I’ve always seen Pbuffers as a potential expansion to the ‘surface’ concept.
It seems they could be neatly implemented using an additional flag or two
and the existing API with the addition of a call to make the surface the
current rendering target. You would lock a pbuffer prior to using it as a
texture, unlock afterwards, create and destroy as applicable… This would
also introduce the API call necessary to switch between multiple ‘normal’
rendering contexts so multiple windows could be used easily.
Admittedly, I’m looking at SDL from the usage point of view, rather than an
under-the-hood implementation point of view. Perhaps tidying will have to
wait for 2.0…
If I had to settle for less, I’d like a separate call to make the context
current, allow me to switch directly to another pbuffer context instead of
hitting main, and only update texture data when locked.
If I had to settle for even less, I’d be happy with SDL just supporting the
things directly 
Thanks,
– Jeff