#include <revolution/gx.h> void GXSetViewportv( const f32* vp );
| vp | Floating point value array. The minimum array size is GX_VIEWPORT_SZ. |
|---|
None.
This function 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 viewport depth parameters are normalized coordinates from 0.0f to 1.0f. The GX API will convert the depth range values to proper scale values depending on 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
2006/03/01 Initial version.
CONFIDENTIAL