PDA

View Full Version : Vertex State Program Problem



qwert
09-14-2001, 02:41 AM
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?

Nutty
09-14-2001, 03:52 AM
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. http://www.opengl.org/discussion_boards/ubb/smile.gif

Nutty (www.nutty.org)



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

qwert
09-14-2001, 04:24 AM
Yes, I cheated... http://www.opengl.org/discussion_boards/ubb/smile.gif

Everything's fine now. Thanks

qwert