Francois Sillion (Francois.Sillion++at++imag.fr)
Fri, 20 Nov 1998 17:38:48 +0100
In my application I have two pipeWindows, one rendering to a window on screen
and one rendering to an (offscreen) P-buffer. This works fine on an O2.
I have the following problem running it on an iR:
- If I create my P-buffer with the GLX_PRESERVED_CONTENTS_SGIX attribute,
rendering in the main (on-screen) window is slowed down terribly,
even
if the offscreen pipewindow is doing nothing (i.e. has no channel
attached to it).
SGI support identified this as the source of the performance problem
(thanks a lot to them!), but
- if I do not specify the GLX_PRESERVED_CONTENTS_SGIX attribute,
performance
is as expected, but the image I extract from my Pbuffer is garbage.
Looking at the Pbuffer doc, I found that when contents are not preserved, the
Pbuffer can be trashed at any time, but with an (asynchronous) notification by
means of a clobber event. The man page also suggests grabbing the X Server.
- I tried grabbing the X server: the draw callback on my offscreen channel
looks then like:
=============================
static void
DrawOffScreenChannelCB ( pfChannel * pChannel , void * )
{
pfEnable(PFEN_LIGHTING);
pChannel -> clear ();
XGrabServer( pfGetCurWSConnection() );
pfDraw();
GatherOffscreenData(); // this function simply calls glReadPixels to get
the
// image from the Pbuffer into memory
XUngrabServer( pfGetCurWSConnection() );
}
=============================
but the contents of my image is still garbage...
- I also wanted to try reacting to CLOBBER events, but could not find
any examples. the man page says I can use glXSelectEventSGIX to register
for this type of event, but then what? I only know how to set an
event
handler for an Xt Widget using XtAddEventHandler.. but my pbuffer is
not
a widget! how do I specify how to react to a clobber event?
- One final note: on the iR my program allocates a DOUBLE-BUFFERED pbuffer,
because the (single) FB config found for single buffer pbuffers is
refused by glXCreateGLXPbufferSGIX (BadAlloc (insufficient resources
for
operation). Could this have to do with my problem? in case you
wonder,
I HAVE tried reading pixels from the front and the back buffers, I
have
garbage in both!
Could someone help me really understand how I can ensure I get a correct image
of what I have drawn? example code would greatly help.
Thanks a lot!
This archive was generated by hypermail 2.0b2 on Fri Nov 20 1998 - 08:39:01 PST