Matt Sealey wrote:

What is the relation of glViewport(x,y coordinates in relation to
the "physical" window?

I am assuming they are ACTUAL PIXEL LOCATIONS relative to window edges
(this is what the GL book says, chapter 3, Viewport Transformation) in
which case, why do I need to ask the window system for anything? I was
just passed two values by the application.. x and y.. and a width and
height of the maximum size of the "rectangular region of the window
where the image is drawn"

If the window was 100 x 100 and the user drags the window to be 200 x 200 you need to reallocate / resize / whatever the back-buffer, depth-buffer, etc. This doesn't have any *direct* connection to glViewport.

Right. But the user will have detected this in his application (in my case) via the event handling loop, or glut will have done the same, and they can simply call

glViewport(0,0,200,200);

.. right? I don't see the big difference between the values passed to
glViewport() and the coordinates we're supposed to get from the
window system.

If the application developers requests that the GL view be 10 pixels
from the bottom, 50 pixels from the left, and 300 pixels wide and
high, surely they are the coordinates we're doing the viewport
transformation into?

If I have a window that is 640x480, and I can set my view port to (0,0)-(319,239), do some drawing, set it to (320,0)-(639,239), do some drawing, etc. to get several views within a window. This is what every CAD program that gives the user multiple views of the scene does. Unless the app sets clip planes when it changes the viewport drawing that goes outside the viewport will still be draw (but drawing that goes outside the window will not). The center of projection will (modulo changing other settings) be the center of whatever the current viewport is.


Does that clarify things?

Like various people have said before, it's just a common coincidence that apps call glViewport when the window size chages. If they didn't the center of projection would be "wrong" for the new window dimensions.



-------------------------------------------------------
This SF.net email is sponsored by:  Etnus, makers of TotalView, The best
thread debugger on the planet. Designed with thread debugging features
you've never dreamed of, try TotalView 6 free at www.etnus.com.
_______________________________________________
Dri-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/dri-devel

Reply via email to