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>nngxValidateState</title> 8 </head> 9 <body> 10<h1><CODE>nngxValidateState</CODE> Function</h1> 11<h2>Syntax</h2> 12 <div class="section"> 13 <pre class="definition"> 14NNGX_APICALL void NNGX_APIENTRY nngxValidateState( 15 GLbitfield statemask, 16 GLboolean drawelements 17); 18</pre> 19 </div> 20<h2>Arguments</h2> 21 <div class="section"> 22 <table class="arguments"> 23 <thead> 24 <tr> 25 <td width="15" /> 26<th>Name</th> 27<td>Description</td> 28 </tr> 29 </thead> 30 <tr> 31<td>in</td> 32<th>statemask</th> 33<td>State flag to check (specified as a bitwise OR).</td> 34 </tr> 35 <tr> 36<td>in</td> 37<th>drawelements</th> 38<td>Function that performs actual rendering (either <CODE>glDrawElements</CODE> or <CODE>glDrawArrays</CODE>).</td> 39 </tr> </table> 40 </div> 41<h2>Return Values</h2> 42<div class="section">There is no return value. </div> 43<h2>Description</h2> 44 <div class="section"> 45<p>Checks the state and generates commands.</p><P> 46Checks the DMPGL state and generates commands. Commands are normally accumulated in the 3D command buffer when certain DMPGL 2.0 functions are called. Most of these commands are generated by <CODE>glDrawElements</CODE> and <CODE>glDrawArrays</CODE>. DMPGL functions check the state and, if it is updated, generate the relevant commands. This is called validation. With the <CODE>glDrawElements</CODE> and <CODE>glDrawArrays</CODE> functions, most of the states are all validated at once. With this function, on the other hand, you can validate certain combinations of states. 47 </P><P> 48Set <SPAN class="argument">statemask</SPAN> equal to a bitwise OR of the state flags to validate. Set <SPAN class="argument">drawelements</SPAN> to <CODE>GL_TRUE</CODE> when <SPAN class="argument">glDrawElements</SPAN> is called and to <CODE>GL_FALSE</CODE> when <CODE>glDrawArrays</CODE> is called for actual rendering. To validate certain states, it is sometimes necessary to know whether <CODE>glDrawElements</CODE> or <CODE>glDrawArrays</CODE> is used for rendering. 49 </P><P> 50This function generates commands when the specified states have been updated. You can use this function in combination with <CODE>nngxUpdateState</CODE>, which updates states, to generate complete commands related to certain states. 51 </P><P> 52When you use this function to generate commands for individual states, the commands may not be generated in the same order as they originally would have been using <CODE>glDrawElements</CODE> and <CODE>glDrawArrays</CODE>. Several state flags are dependent on other state flags in various ways, including the order in which the flags are specified. Behavior is undefined when there is a conflict with these dependency restrictions. 53<UL><LI>The state flag <CODE>NN_GX_STATE_FBACCESS</CODE> or <CODE>NN_GX_STATE_TRIOFFSET</CODE> must be specified before or at the same time as this function is called with the state flag <CODE>NN_GX_STATE_FSUNIFORM</CODE>.</LI><LI>The state flag <CODE>NN_GX_STATE_SHADERMODE</CODE> must be specified before or at the same time this function is called with the state flags <CODE>NN_GX_STATE_SHADERBINARY</CODE>, <CODE>NN_GX_STATE_SHADERPROGRAM</CODE>, <CODE>NN_GX_STATE_SHADERFLOAT</CODE>, and <CODE>NN_GX_STATE_VSUNIFORM</CODE>.</LI><LI>The state flags <CODE>NN_GX_STATE_FRAMEBUFFER</CODE> and <CODE>NN_GX_STATE_OTHERS</CODE> must be specified before or at the same time this function is called with the state flag <CODE>NN_GX_STATE_FBACCESS</CODE>.</LI></UL></P><P> 54If the current program object is not set (such as when <CODE>0</CODE> is specified in a call to <CODE>glUseProgram</CODE>), then no commands will be generated even when the states for the program and shader are validated. 55 </P><P> 56Validation may result in various DMPGL errors being generated. 57 </P></div> 58<h2>Revision History</h2> 59 <div class="section"> 60 <dl class="history"> 61 <dt>2010/07/07</dt> 62<dd>Added description of behavior when the current program object is not set. 63 </dd> 64 <dt>2010/03/12</dt> 65<dd>Initial version.<br /> 66 </dd> 67 </dl> 68 </div> 69 <hr><p>CONFIDENTIAL</p></body> 70</html>