PDA

View Full Version : glGetError return GL_INVALID_VALUE.



GL Starter
07-06-2010, 05:36 PM
Hi Experts,

In a cg code, i found a cgResetPassState call cause error in opengl
calls.
Here is my code


// Some Cg shader calls.
char lpczPassName[MAX_PASS_NAME_SIZE] = "MyPass"
CGpass pass = cgGetNamedPass( m_cgBRPTechnique, lpczPassName );
cgSetPassState( pass );


// Render code.


int nErrorValue = glGetError();
if( GL_NO_ERROR != nErrorValue )
{
OutputDebugString( _T( "Find an Error Before
cgResetPassState" ));
}}
cgResetPassState( pass );
nErrorValue = glGetError();
if( GL_NO_ERROR != nErrorValue )
{
OutputDebugString( _T( "Find an Error after
cgResetPassState" ));
}


Is there any possibility to set opengl error flag after a call to
cgResetPassState.
From its documentation, it is found that


cgResetPassState resets all of the graphics state defined in a pass by
calling the state resetting callbacks for all of the state assignments
in the pass.


But my doubt why this call cause error flag to set.