Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 3 of 3

Thread: how to find out whats the current active glsl shader

  1. #1
    Senior Member OpenGL Guru zed's Avatar
    Join Date
    Jul 2000
    Location
    S41.16.25 E173.16.21
    Posts
    2,609

    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

  2. #2
    Senior Member OpenGL Guru Relic's Avatar
    Join Date
    Apr 2000
    Posts
    2,527

    Re: how to find out whats the current active glsl shader

    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.

  3. #3
    Senior Member OpenGL Guru zed's Avatar
    Join Date
    Jul 2000
    Location
    S41.16.25 E173.16.21
    Posts
    2,609

    Re: how to find out whats the current active glsl shader

    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •