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>glStencilFunc</title> 8 </head> 9 <body> 10<h1><CODE>glStencilFunc</CODE> Function</h1> 11<h2>Syntax</h2> 12 <div class="section"> 13 <pre class="definition"> 14GL_APICALL void GL_APIENTRY glStencilFunc( 15 GLenum func, 16 GLint ref, 17 GLuint mask 18); 19</pre> 20 </div> 21<h2>Arguments</h2> 22 <div class="section"> 23 <table class="arguments"> 24 <thead> 25 <tr> 26 <td width="15" /> 27<th>Name</th> 28<td>Description</td> 29 </tr> 30 </thead> 31 <tr> 32<td>in</td> 33<th>func</th> 34<td>Comparison function</td> 35 </tr> 36 <tr> 37<td>in</td> 38<th>ref</th> 39<td>Reference value</td> 40 </tr> 41 <tr> 42<td>in</td> 43<th>mask</th> 44<td>Mask value</td> 45 </tr> </table> 46 </div> 47<h2>Return Values</h2> 48<div class="section">No values are returned. </div> 49<h2>Description</h2> 50 <div class="section"> 51<p>Configures the comparison function, reference value, and mask value used by the stencil test.</p><P> 52You can set <span class="argument">func</span> to <CODE>GL_NEVER</CODE>, <CODE>GL_ALWAYS</CODE>, <CODE>GL_LESS</CODE>, <CODE>GL_LEQUAL</CODE>, <CODE>GL_EQUAL</CODE>, <CODE>GL_GREATER</CODE>, <CODE>GL_GEQUAL</CODE>, or <CODE>GL_NOTEQUAL</CODE>. Set <span class="argument">ref</span> to the reference value. Set <span class="argument">mask</span> to the mask value. 53 </P><P> 54Given a stencil buffer value of <CODE>stencil</CODE>, the stencil test passes or fails according to the following conditions specified by <span class="argument">func</span>. 55<TABLE><TR><TH>GL_NEVER</TH><TD>The stencil test always fails.</TD></TR><TR><TH>GL_ALWAYS</TH><TD>The stencil test always passes.</TD></TR><TR><TH>GL_LESS</TH><TD>Passes when <CODE>(ref & mask) < (stencil & mask)</CODE>.</TD></TR><TR><TH>GL_LEQUAL</TH><TD>Passes when <CODE>(ref & mask) <= (stencil & mask)</CODE>.</TD></TR><TR><TH>GL_EQUAL</TH><TD>Passes when <CODE>(ref & mask) == (stencil & mask)</CODE>.</TD></TR><TR><TH>GL_GREATER</TH><TD>Passes when <CODE>(ref & mask) > (stencil & mask)</CODE>.</TD></TR><TR><TH>GL_GEQUAL</TH><TD>Passes when <CODE>(ref & mask) >= (stencil & mask)</CODE>.</TD></TR><TR><TH>GL_NOTEQUAL</TH><TD>Passes when <CODE>(ref & mask) != (stencil & mask)</CODE>.</TD></TR></TABLE><!-- source GL_NEVERを指定した場合、ステンシルテストは常にフェイルします。 GL_ALWAYSを指定した場合、ステンシルテストは常にパスします。 GL_LESSを指定した場合、(ref & mask) < (stencil & mask)の場合にパスします。 GL_LEQUALを指定した場合、(ref & mask) <= (stencil & mask)の場合にパスします。 GL_EQUALを指定した場合、(ref & mask) == (stencil & mask)の場合にパスします。 GL_GREATERを指定した場合、(ref & mask) > (stencil & mask)の場合にパスします。 GL_GEQUALを指定した場合、(ref & mask) >= (stencil & mask)の場合にパスします。 GL_NOTEQUALを指定した場合、(ref & mask) != (stencil & mask)の場合にパスします。 --></P><P> 56This function generates the following errors. 57<TABLE><TR><TH>GL_INVALID_ENUM</TH><TD>The <span class="argument">func</span> argument was set to an invalid value.</TD></TR><TR><TH>GL_INVALID_OPERATION</TH><TD>This function was called without any command-list objects bound.</TD></TR></TABLE><!-- source funcに不正な値を指定した場合エラーGL_INVALID_ENUMを生成します。 コマンドリストオブジェクトをバインドしていない状態で呼び出すとエラーGL_INVALID_OPERATIONを生成します。 --></P></div> 58<h2>Revision History</h2> 59 <div class="section"> 60 <dl class="history"> 61 <dt>2010/01/07</dt> 62<dd>Initial version.<br /> 63 </dd> 64 </dl> 65 </div> 66 <hr><p>CONFIDENTIAL</p></body> 67</html>