1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> 2<html> 3 4<head> 5<META http-equiv="Content-Type" content="text/html; charset=windows-1252"> 6<META name="GENERATOR" content="Microsoft FrontPage 5.0"> 7<META http-equiv="Content-Style-Type" content="text/css"> 8<LINK rel="stylesheet" type="text/css" href="../../CSS/revolution.css"> 9<title>GXSetViewportv</title> 10</head> 11 12<body> 13 14<h1 align="left">GXSetViewportv</h1> 15 16<h2>Syntax</h2> 17<dl><dd><pre class="construction"> 18#include <revolution/gx.h> 19 20void GXSetViewportv( const f32* vp ); 21</pre></dd></dl> 22 23<h2>Arguments</h2> 24<TABLE class="arguments" border="1" > 25 <tr> 26<TH>vp</TH> 27<TD>Floating-point value array. The minimum array size is <code>GX_VIEWPORT_SZ</code>.</TD> 28 </tr> 29</TABLE> 30 31<h2>Return Values</h2> 32<p>None.</p> 33 34<H2>Description</H2> 35<P>Sets the viewport rectangle in screen coordinates using the array <SPAN class="argument">vp</SPAN>. The screen origin (<SPAN class="argument">xOrig</SPAN> = <CODE>0.0f</CODE>, <SPAN class="argument">yOrig</SPAN> = <CODE>0.0f</CODE>) 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 <A href="GXSetViewportJitter.html"><CODE>GXSetViewportJitter</CODE></A> 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.</P> 36<P>The function <a href="GXGetViewportv.html"><code>GXGetViewportv</code></a> returns the viewport in vector form. The order of parameters in <SPAN class="argument">vp</SPAN> corresponds to the order of parameters in <a href="GXSetViewport.html"><code>GXSetViewport</code></a>.</P> 37 38<H3>Examples</H3> 39<BLOCKQUOTE><CODE>f32 vp[GX_VIEWPORT_SZ];</CODE></BLOCKQUOTE> 40<BLOCKQUOTE><code>vp[0] = 0.0f; // xOrig<br> vp[1] = 0.0f; // yOrig<br> vp[2] = 640.0f; // width<br> vp[3] = 480.0f; // height<br> vp[4] = 0.0f; // near Z<br> vp[5] = 1.0f; // far Z<br> <br> <a href="GXSetViewportv.html">GXSetViewPortv</a>( vp );</code></BLOCKQUOTE> 41<P>The viewport is typically set using parameters derived from the current render mode. See <a href="../Framebuffer/RenderMode.html">Render Modes</a>. </P> 42 43<h2>See Also</h2> 44<P> 45<A href="../Culling/GXSetScissor.html"><CODE>GXSetScissor</CODE></A><BR> <A href="../../mtx/Projection/MTXFrustum.html"><CODE>MTXFrustum</CODE></A><BR> <a href="../Framebuffer/RenderMode.html">Render Modes</a> 46</p> 47 48<H2>Revision History</H2> 49<P> 502008/12/04 Revised the description of depth scale.<br>2006/03/01 Initial version. 51</P> 52 53<hr><p>CONFIDENTIAL</p></body> 54</HTML>