Page 58 OpenGL Super (Web server application) Bible! be centered vertically,
Page 58 OpenGL Super Bible! be centered vertically, far left of center. If you make the window tall vertically, the square will be centered horizontally, closer to the bottom of the window. Note that the rectangle always remains square. To see a square scaled as the window resizes, see Figure 3-7a and Figure 3-7b. Figure 3-7a Image scaled to match window size Figure 3-7b Square scaled as the window resizes Defining the Viewport To understand how the viewport definition is achieved, let s look more carefully at the ChangeSize() function. It first calls glViewport() with the new width and height of the window. The glViewport function is defined as void glViewport(GLint x, GLint y, GLsizei width, GLsizei height); The x and y parameters specify the lower-right corner of the viewport within the window, and the width and height parameters specify these dimensions in pixels. Usually x and y will both be zero, but you can use viewports to render more than one drawing in different areas of a window. The viewport defines the area within the window in actual screen coordinates that OpenGL can use to draw in (see Figure 3-8). The current clipping volume is then mapped to the new viewport. If you specify a viewport that is smaller than the window coordinates, the rendering will be scaled smaller, as you see in Figure 3-8.
Note: If you are looking for best quality webspace to host and run your tomcat application check Vision shared web hosting services