Using the same handle for vertex and fragment programs

Hi there.

Quick question: Is it allowed to do this:

glGenProgramsARB (1, uiOpenGLHandle);
glEnable (GL_VERTEX_PROGRAM_ARB);
glEnable (GL_FRAGMENT_PROGRAM_ARB);

glProgramStringARB (GL_VERTEX_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB, …);

glProgramStringARB (GL_FRAGMENT_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB, …);

Or is the handle unique per program (vertex/fragment) ?

Jan.

Should be legal because the default vp/fp has the id of 0, so you would set both the default vertex fragment program because you didn’t bind another vp/fp.

This will only work with a zero id and only if you didn’t call glBindProgramARB before because in the other cases you have to call glBindProgramARB(GL_VERTEX_PROGRAM_ARB, id) and glBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, id) to set the id.

Oh, sorry, i forgot the BindShader-stuff.

Anyway, i am quite certain it is not legal. On my ATI card it worked very well, until i used more than one shader. I then got very weird results together with blending.
I use two handles now and it works as expected.

Thanks though,
Jan.

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.