nngxValidateState Function

Syntax

NNGX_APICALL void NNGX_APIENTRY nngxValidateState(
     GLbitfield statemask,
     GLboolean drawelements
);

Arguments

Name Description
in statemask State flag to check (specified as a bitwise OR).
in drawelements Function that performs actual rendering (either glDrawElements or glDrawArrays).

Return Values

There is no return value.

Description

Checks the state and generates commands.

Checks 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 glDrawElements and glDrawArrays. DMPGL functions check the state and, if it is updated, generate the relevant commands. This is called validation. With the glDrawElements and glDrawArrays functions, most of the states are all validated at once. With this function, on the other hand, you can validate certain combinations of states.

Set statemask equal to a bitwise OR of the state flags to validate. Set drawelements to GL_TRUE when glDrawElements is called and to GL_FALSE when glDrawArrays is called for actual rendering. To validate certain states, it is sometimes necessary to know whether glDrawElements or glDrawArrays is used for rendering.

This function generates commands when the specified states have been updated. You can use this function in combination with nngxUpdateState, which updates states, to generate complete commands related to certain states.

When 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 glDrawElements and glDrawArrays. 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.

If the current program object is not set (such as when 0 is specified in a call to glUseProgram), then no commands will be generated even when the states for the program and shader are validated.

Validation may result in various DMPGL errors being generated.

Revision History

2010/07/07
Added description of behavior when the current program object is not set.
2010/03/12
Initial version.

CONFIDENTIAL