#include <revolution/gx.h> void GXSetViewportv( const f32* vp );
| vp | Floating-point value array. The minimum array size is GX_VIEWPORT_SZ. |
|---|
None.
Sets the viewport rectangle in screen coordinates using the array vp. The screen origin (xOrig = 0.0f, yOrig = 0.0f) is at the top left corner of the display. Floating point arguments allow the viewport to be adjusted by 1/2 line for interlaced field rendering modes. See the GXSetViewportJitter function for details. The GX API converts the viewport depth parameter to depth range values of the proper scale according to the type and format of the Z buffer.
The function GXGetViewportv returns the viewport in vector form. The order of parameters in vp corresponds to the order of parameters in GXSetViewport.
f32 vp[GX_VIEWPORT_SZ];
vp[0] = 0.0f; // xOrig
vp[1] = 0.0f; // yOrig
vp[2] = 640.0f; // width
vp[3] = 480.0f; // height
vp[4] = 0.0f; // near Z
vp[5] = 1.0f; // far Z
GXSetViewPortv( vp );
The viewport is typically set using parameters derived from the current render mode. See Render Modes.
GXSetScissor
MTXFrustum
Render Modes
2008/12/04 Revised the description of depth scale.
2006/03/01 Initial version.
CONFIDENTIAL