Michael T. Jones (mtj++at++babar.asd.sgi.com)
Tue, 19 Nov 1996 11:06:14 -0800
From: mjk++at++hoot (Mark Kilgard)
Subject: Re: can you answer this...
To: mtj (Michael T. Jones)
Date: Tue, 19 Nov 1996 07:48:41 -0800 (PST)
Cc: Morten.Eriksen++at++due.unit.no
Morten,
> I hope you can forgive me that I'm about to use the mailing list to
> ask a OpenGL-specific question (the comp.graphics.api.opengl newsgroup
> is all cluttered up with religious wars at the moment...).
>
> I've been fiddling with glReadPixels() to make it read from a
> GLwMDrawingArea widget and put the captured data into my allocated
> memory area. My problem is that pixels which are obscured by other
> windows overlapping the drawingarea widget becomes filled with
> garbage. I thought this was due to some silly bug on my behalf; like
> not setting the viewport correctly, forgetting to set the "saveUnder"
> flag or the buffer needing a flush or XSync or something, but nothing
> seemed to help. Then I checked with perfly - and the same behavior
> appeared when saving snapshots of the simulation.
>
> So.. is it impossible to extract all the areas of pixeldata from a
> drawingarea widget when it's window is partly obscured?
Yes, the pixels outside the drawable region of the window are undefined.
Indeed when your window is overlapped by another window, pixels (really
fragments in OpenGL lingo) destined for that window are simply discarded.
> Do I need to
> use an off-screen pixmap or something? Or is there some simpler
> solution (or even a quick hack :) )?
Yes, you need to use an off-screen pixmap or a pbuffer.
I hope this helps.
- Mark
---End of forwarded mail from mjk++at++hoot (Mark Kilgard)
=======================================================================
List Archives, FAQ, FTP: http://www.sgi.com/Technology/Performer/
Submissions: info-performer++at++sgi.com
Admin. requests: info-performer-request++at++sgi.com
This archive was generated by hypermail 2.0b2 on Mon Aug 10 1998 - 17:53:58 PDT