How to find out whats the current active glsl shader

how to find out whats the current active glsl shader

glGetIntegerv( GL_CURRENT_PROGRAM, &shaderID ); // this seems to be more logical but gives an error
shaderID = GetHandleARB( GL_PROGRAM_OBJECT_ARB ); // this works

though Handles have been dropped from shaders when they became part of gl2.0 (strange idea to call them handles in the first place should of just been ints)
so im not 100% sure if this is the correct way even though it seems to work, the documentation is a bit messy, OBJECT being dropped etc

ta

Both are right.
The GetHandle is from ARB_shader_objects and the GL_CURRENT_PROGRAM is from OpenGL 2.0.
As long as you have no OpenGL 2.0 implementation running, this will give an error. You need to check your OpenGL version number before using it.

thanks, the gl2.0 shader interface looks better (more commonsense) than ARB_shader_objects, now we just need them to accept vec3 a(1,2,3) and we’re laughing

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