hi tom, list,
On 5/3/03 4:43 PM, "Tom Schouten" doelie@zzz.kotnet.org wrote:
i was wondering if it is possible (and how) to change the rendering context in gem, with respect to interfacing it to pdp (or something else) without gem using it's own display window.
what i am interested in is having gem render to an offscreen area (pbuffer) and output this as a pdp packet.
Multiple rendering contexts and pbuffer support would be very handy features in GEM. This has been on the to-do list for a long time, I think, so perhaps the momentum of the pdp project can make it happen!
it is possible to use pbuffers and disable the window context entirely, but it seems it requires rather a large cut in gem. maybe i'm not seeing this correctly but i think it would involve something like this:
- GemWinCreateXWin needs to be replaced by something that constructs a
pbuffer instead of a window.
- the place where the buffers are swapped: glutSwapBuffers() in GemMan.cpp
a glReadPixels should be inserted that converts the data in the pbuffer to a pdp packet.
- the glXMakeCurrent(constInfo.dpy, constInfo.win, constInfo.context) in
GemMan.cpp should be replaced by a glXMakeContextCurrent(dpy, pbuffer, pbuffer, context_pbuffer) call.
Should we try to get a system that can easily get a pbuffer back into a pix_ object and then just use the pdp<->gem bridge?
How about this: - you can name a rendering context in each gemhead and have that rendering chain render to the context (be it a window, pbuffer or whatever).
-Each gemwin can also be named.
-A new gembuffer object which manages pbuffer rendering and takes a name argument also...?. It outputs a bitmap in pix_ compatible form that may be connected to pix_ object or the pdp bridge.
Daniel