Re: glViewport with drawStats

New Message Reply Date view Thread view Subject view Author view

Allan Schaffer (allan++at++southpark.engr.sgi.com)
Mon, 19 Apr 1999 15:37:51 -0700 (PDT)


On Apr 9, 2:09pm, Scott Herod wrote:
> I've run into a curious problem with pfChannel::drawStats().
> Apparently it sets the viewport in order to draw but doesn't
> reset it when it is finished drawing. Is there someway to
> set it to not change the viewport or reset when it is done?
> I suppose that I could use pre and post draw functions but
> I don't really have access to those. This is with Irix 6.5
> and performer 2.2.3.

Hmm. Let me run through the possibilities here. First, the draw
process resets the viewport at the beginning of each frame, so there
shouldn't be anything left over from stats drawing at the end of the
previous frame that would still have an effect.

As I recall, a call to pfChannel::drawStats() in the draw callback
doesn't do anything immediately, it just sets a flag which is
processed in the interval between the channel draw callback and the
swapbuffers callback; so any code you have in your channel draw
callback should not be effected by stats drawing.

That leaves only the swapbuffers callback. I do see that the
viewport is not restored at the end of the frame (in preparation for
a possible swapbuffers callback), most likely because it's not
typically needed at that point, so it's ok to just restore it at the
beginning of the next frame. So, you're doing a bit of extra drawing
-after- the stats have displayed, but before the swapbuffers?

If that's the case (and the code must be there, rather than moving it
to the channel draw callback), I think you should be able to call
pfChannel::getViewport(..), ::getSize(..), ::getOrigin(..), etc. You
may need to make these calls (once) in the APP process and store the
values in shared memory, to be used by the DRAW.

If I'm mistaken and your extra code is not in the channel swap
callback, we'll have to revisit this.

Allan

-- 
Allan Schaffer                                            allan++at++sgi.com
Silicon Graphics                           http://reality.sgi.com/allan

New Message Reply Date view Thread view Subject view Author view

This archive was generated by hypermail 2.0b2 on Mon Apr 19 1999 - 15:38:09 PDT

This message has been cleansed for anti-spam protection. Replace '++at++' in any mail addresses with the '@' symbol.