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>C Specification</h2>
17
18<dl>
19<dd><pre><CODE>#include &lt;revolution/gx.h&gt;</CODE></pre>
20  </dd>
21<dd><pre><CODE>void GXSetViewportv( const f32* vp );</CODE></pre>
22  </dd>
23</dl>
24
25<h2>Arguments</h2>
26<TABLE border="1" cellpadding="3" cellspacing="0.1">
27  <tr>
28<TD width="120" bgcolor="#ffffe8"><em><strong><CODE>vp</font></strong></em></TD>
29<TD width="520">Floating point value array. The minimum array size is <code>GX_VIEWPORT_SZ</code>.</TD>
30    </tr>
31</TABLE>
32<h2>Return Values</h2>
33
34<p>None.</p>
35<H2>Description</H2>
36<P>This function sets the viewport rectangle in screen coordinates using the array <code><em><strong>vp</strong></em></code>.&nbsp;The screen origin (<code><em>xOrig</em>=</code>0.0f, <code><em>yOrig</em>=</code>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 <a href="GXSetViewportJitter.html"><code>GXSetViewportJitter</code></a>. The viewport depth parameters are normalized coordinates from 0.0f - 1.0f.&nbsp;The <code>GX API</code> will convert the depth range values to proper scale values depending on the type and format of the Z buffer.</P>
37<P>The function <a href="GXGetViewportv.html"><code>GXGetViewportv</code></a> returns the viewport in vector form.&nbsp;The order of parameters in <em><strong><code>vp</code></strong></em> corresponds to the order of parameters in <a href="GXSetViewport.html"><code>GXSetViewport</code></a>.</P>
38<H3>Example</H3>
39<BLOCKQUOTE><CODE>f32 vp[GX_VIEWPORT_SZ];</CODE></BLOCKQUOTE>
40<BLOCKQUOTE><code>vp[0] = 0.0f;&nbsp;&nbsp; // xOrig<br> vp[1] = 0.0f;&nbsp;&nbsp; // yOrig<br> vp[2] = 640.0f; // width<br> vp[3] = 480.0f; // height<br> vp[4] = 0.0f;&nbsp;&nbsp; // near Z<br> vp[5] = 1.0f;&nbsp;&nbsp; // 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>. &nbsp;</P>
42
43<h2>See Also</h2>
44
45<p><a href="../Culling/GXSetScissor.html">GXSetScissor</a><br> <a href="../../mtx/Projection/MTXFrustum.html">MTXFrustum</a><br> <a href="../Framebuffer/RenderMode.html">Render Modes</a></p>
46<H2>Revision History</H2>
47<P>03/01/2006 Initial version.</P>
48</BODY>
49</HTML>