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>This function sets the viewport rectangle in screen coordinates using the array <SPAN class="argument">vp</SPAN>. The screen origin (<SPAN class="argument">xOrig</SPAN> = 0.0f, <SPAN class="argument">yOrig</SPAN> = 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 <A href="GXSetViewportJitter.html"><CODE>GXSetViewportJitter</CODE></A> 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.</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 class="reference"> 45<a href="../Culling/GXSetScissor.html">GXSetScissor</a>, 46<a href="../../mtx/Projection/MTXFrustum.html">MTXFrustum</a>, 47<a href="../Framebuffer/RenderMode.html">Render Modes</a> 48</p> 49 50<H2>Revision History</H2> 51<P> 522006/03/01 Initial version.<br> 53</P> 54 55<hr><p>CONFIDENTIAL</p></body> 56</HTML>