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 8 of 8

Thread: getting versions

  1. #1
    Intern Contributor
    Join Date
    Oct 2007
    Location
    persia,tabriz
    Posts
    71

    getting versions

    hi

    i can get OpenGL version name by

    Code :
    glGetString(GL_VERSION);

    and i can get OpenGL major and minor version by:

    Code :
    glGetIntegerv(GL_MAJOR_VERSION, &major); 
    glGetIntegerv(GL_MINOR_VERSION, &minor);

    but how can i get GLSL version? (with out using glGetString)
    and how can i get shader model??

  2. #2
    Senior Member OpenGL Guru
    Join Date
    May 2009
    Posts
    4,732

    Re: getting versions

    but how can i get GLSL version? (with out using glGetString)
    You can't.

    and how can i get shader model??
    Wiki Page

  3. #3
    Senior Member OpenGL Guru Dark Photon's Avatar
    Join Date
    Oct 2004
    Location
    Druidia
    Posts
    2,882

    Re: getting versions

    but how can i get GLSL version? (with out using glGetString)
    You can't.
    Though integer major/minor queries would be nice to have, since the GLSL version string format is standard, just sscanf it. Not ideal but should be guaranteed to work:

    Quote Originally Posted by glGetString
    The GL_VERSION and GL_SHADING_LANGUAGE_VERSION strings begin with a version number. The version number uses one of these forms:

    major_number.minor_number
    major_number.minor_number.release_number

  4. #4
    Super Moderator Frequent Contributor Groovounet's Avatar
    Join Date
    Jul 2004
    Posts
    936

    Re: getting versions

    However glGetString is deprecated. I guest the GLSL version depend on the OpenGL version. That's actually what I assume but am I right to do that?

  5. #5
    Junior Member Regular Contributor
    Join Date
    Mar 2007
    Location
    Latvia
    Posts
    225

    Re: getting versions

    glGetString is not deprecated.
    Only GL_EXTENSIONS enum value for its argument is deprecated.

  6. #6
    Super Moderator Frequent Contributor Groovounet's Avatar
    Join Date
    Jul 2004
    Posts
    936

    Re: getting versions

    I feel it is going to take a while until I figure out all details about what is deprecated or not ...

  7. #7
    Senior Member OpenGL Pro
    Join Date
    Sep 2004
    Location
    Prombaatu
    Posts
    1,401

    Re: getting versions

    I know that feeling.

  8. #8
    Senior Member OpenGL Guru
    Join Date
    May 2009
    Posts
    4,732

    Re: getting versions

    I feel it is going to take a while until I figure out all details about what is deprecated or not ...
    It's as simple as reading the quick reference. glGetString is black, hence not deprecated. Indeed, it specifically says under it that using GL_EXTENSIONS in it is deprecated.

Posting Permissions

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