Game Development Reference
In-Depth Information
Viewports
Every view has a viewport associated with it. A viewport is the area of the window in
which the view is displayed. The area is represented by a rectangle, which uses normalized
coordinates [0…1]. By default, the viewport is equal to the size of the view (0, 0, 1, 1). We
can change this by calling View::setViewport() . Let's say that we want to render
our scene only in the top-left quadrant of the screen. The following code will do it:
Here is the result of the preceding code in a widescreen window:
Search WWH ::




Custom Search