I am working with OpenGL and for some classes I wrote I would have to pass a shader, although the class is only used, when a shader is already active. Is there a way to get the currently active program from OpenGL, so a function like glGetActiveProgram()?
glGetIntegerv() with GL_CURRENT_PROGRAM:
GLint prog = 0;
glGetIntegerv(GL_CURRENT_PROGRAM, &prog);
Standard "querying OpenGL state isn't guaranteed to be performant" disclaimer applies.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With