Vertex State Program Problem

I’ve go a strange problem with VSP’s. Here’s the code:

//Load the Vertex state program
glEnable(GL_VERTEX_STATE_PROGRAM_NV);
glBindProgramNV(GL_VERTEX_STATE_PROGRAM_NV, m_BumpShader.StateProgramID);
glLoadProgramNV(GL_VERTEX_STATE_PROGRAM_NV, m_BumpShader.StateProgramID, 
					 strlen((char*) m_BumpShader.StateProgString), 
					 (unsigned char *)m_BumpShader.StateProgString);

//Load the Vertex Program
glEnable(GL_VERTEX_PROGRAM_NV);
glBindProgramNV(GL_VERTEX_PROGRAM_NV, m_BumpShader.programID);
CheckErrors();
glLoadProgramNV(GL_VERTEX_PROGRAM_NV, m_BumpShader.programID, 
				strlen((char * ) m_BumpShader.ProgString), 
				(unsigned char *)m_BumpShader.ProgString);

I checked this code with glGetError() and it returned GL_INVALID_ENUM at the call of glEnable(GL_VERTEX_STATE_PROGRAM_NV);

I own a GF3 with the 12.41 drivers…
When I debug nutty’s demo with VSP I got the same error, but his demo worked fine…
Any ideas?

Dont do glEnable(GL_VERTEX_STATE_PROGRAM_NV); or glBindProgramNV(GL_VERTEX_STATE_PROGRAM_NV, m_BumpShader.StateProgramID);

You dont do this. This is a mistake in my old demos, if you picked it up from there.

Checkout my latest per pixel diffuse demo for a much more proper way to initialize Vertex state programs.

I’ll address this error in my other code when I have some free time.

Nutty (www.nutty.org)

[This message has been edited by Nutty (edited 09-14-2001).]

Yes, I cheated…

Everything’s fine now. Thanks

qwert