PDA

View Full Version : how to find out whats the current active glsl shader



zed
01-31-2005, 11:16 PM
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

Relic
02-01-2005, 11:11 PM
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.

zed
02-02-2005, 12:00 AM
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