PDA

View Full Version : Getting the viewport



SurGL
04-18-2001, 02:14 AM
I understand that
glGEtIntegerv(GL_VIEWPORT,viewport) will
return the current viewport cordinates.

Question: What will happen if I mention more than one viewports while drawing.
say,
Setviewport ( left half)
draw object 1
Setviewport ( Right half)
draw object 2

In this case which value will
glGEtIntegerv(GL_VIEWPORT,viewport) function
returns.

I am trying to use selection buffer in a split screen.

DaViper
04-18-2001, 02:19 AM
glGetIntergerv (GL_VIEWPORT, viewport) gives you the last viewport specified. <I am not sure what exactly will happen if you just change your viewport, the only thing I know is that nothing outside the viewport will be randered to backbuffer but calls like glClear are going to clear the complete buffer, no matter how your viewport is set.

hope that helps
Chris

SurGL
04-18-2001, 02:29 AM
Chris, I agree, But as I said, i am working with selection buffers.
So When I do a mouse click on the left screen, I should get the viewport set for left screen. right?
How do I get this?
thanks
sur

DaViper
04-18-2001, 03:20 AM
oops didn't read your last sentence http://www.opengl.org/discussion_boards/ubb/frown.gif
I'm not sure how to handle the selection buffer, sorry can't help you there

Chris