1<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 2<html xml:lang="en-US" lang="en-US" xmlns="http://www.w3.org/1999/xhtml"> 3 <head> 4 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 5 <meta http-equiv="Content-Style-Type" content="text/css" /> 6 <link rel="stylesheet" href="../css/manpage.css" type="text/css" /> 7<title>glViewport</title> 8 </head> 9 <body> 10<h1><CODE>glViewport</CODE> Function</h1> 11<h2>Syntax</h2> 12 <div class="section"> 13 <pre class="definition"> 14GL_APICALL void GL_APIENTRY glViewport( 15 GLint x, 16 GLint y, 17 GLsizei width, 18 GLsizei height 19); 20</pre> 21 </div> 22<h2>Arguments</h2> 23 <div class="section"> 24 <table class="arguments"> 25 <thead> 26 <tr> 27 <td width="15" /> 28<th>Name</th> 29<td>Description</td> 30 </tr> 31 </thead> 32 <tr> 33<td>in</td> 34<th>x</th> 35<td>X coordinate of the viewport's lower-left corner</td> 36 </tr> 37 <tr> 38<td>in</td> 39<th>y</th> 40<td>Y coordinate of the viewport's lower-left corner</td> 41 </tr> 42 <tr> 43<td>in</td> 44<th>width</th> 45<td>Viewport width</td> 46 </tr> 47 <tr> 48<td>in</td> 49<th>height</th> 50<td>Viewport height</td> 51 </tr> </table> 52 </div> 53<h2>Return Values</h2> 54<div class="section">No values are returned. </div> 55<h2>Description</h2> 56 <div class="section"> 57<p>Configures the viewport.</p><P> 58Set <span class="argument">x</span> to the x coordinate of the viewport's lower-left corner. Set <span class="argument">y</span> to the y coordinate of the viewport's lower-left corner. Unlike in the OpenGL ES 2.0 standard, <span class="argument">x</span> and <span class="argument">y</span> must be no less than 0. The values of <span class="argument">x</span> and <span class="argument">y</span> affect rendering performance. Performance degrades when <span class="argument">x</span> and <span class="argument">y</span> are not multiples of 4. Specifically, performance drops to approximately one-half for any multiple of 2 that is not a multiple of 4, and drops to approximately one-third for odd numbers. We recommend that you adjust for this using the frustum for perspective projection transformations and that you exclude unnecessary areas via scissoring in order to set <span class="argument">x</span> and <span class="argument">y</span> to multiples of 4 and thus avoid performance degradation. 59 </P><P> 60Set <span class="argument">width</span> to the viewport width. 61 </P><P> 62Set <span class="argument">height</span> to the viewport height. 63 </P><P> 64This function generates the following errors. 65<TABLE><TR><TH>GL_INVALID_VALUE</TH><TD>The <span class="argument">x</span>, <span class="argument">y</span>, <span class="argument">width</span>, or <span class="argument">height</span> argument was set to a negative value.</TD></TR><TR><TH>GL_INVALID_OPERATION</TH><TD>This function was called without any command-list objects bound.</TD></TR></TABLE><!-- source x、y、width、heightに負の値を指定した場合エラーGL_INVALID_VALUEを生成します。 コマンドリストオブジェクトをバインドしていない状態で呼び出すとエラーGL_INVALID_OPERATIONを生成します。 --></P></div> 66<h2>Revision History</h2> 67 <div class="section"> 68 <dl class="history"> 69 <dt>2010/01/07</dt> 70<dd>Initial version.<br /> 71 </dd> 72 </dl> 73 </div> 74 <hr><p>CONFIDENTIAL</p></body> 75</html>