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

Thread: Where does variable "GL_version_4_3" come from?

  1. #1
    Junior Member Newbie
    Join Date
    May 2014
    Posts
    14

    Where does variable "GL_version_4_3" come from?

    The book "OpenGL programming guide: the official guide to learning opengl, version 4.3" says in page 837 that there is a variable named "GL_version_4_3" in GLEW library that can determine the OpenGL version available, like the image below shows:

    Click image for larger version. 

Name:	Untitled1.jpg 
Views:	33 
Size:	21.4 KB 
ID:	1331

    and in the next page the author even gives an example using this variable:

    Click image for larger version. 

Name:	Untitled2.png 
Views:	40 
Size:	10.9 KB 
ID:	1332

    But when I copy the same code and compile, the VS2012 report an error: error C2065: 'GL_version_4_3' : undeclared identifier. The available OpenGL version on my computer is 4.4 through nVidia's GT640 card and I'm using the GLEW 1.10.0 downloaded from https://sourceforge.net/projects/gle...2.zip/download. So, if the author isn't kidding me, where does the variable "GL_version_4_3", or "GL_version_4_4" come from (not macro defined by #define, but a variable that can be used in if (...))? Thank you.

  2. #2
    Senior Member OpenGL Pro Aleksandar's Avatar
    Join Date
    Jul 2009
    Posts
    1,136
    Why don't you use glGetString(GL_VERSION) instead?
    From the previous post I have concluded you want to handle extensions by yourself. In that case you don't need GLEW at all.

  3. #3
    Junior Member Newbie
    Join Date
    May 2014
    Posts
    14
    I'm self-studying OpenGL by reading that book because I think that book seems most up-to-date, so I was trying everything mentioned in that book. But now I can't help but to believe that the only update of the book is its title (and cover color). PS: I tried glGetString(GL_VERSION), it really works. Thank you.

  4. #4
    Senior Member OpenGL Pro Aleksandar's Avatar
    Join Date
    Jul 2009
    Posts
    1,136
    There is a proverb in my country that would sound on English like: "Read map but ask villagers!"
    So, read the book, but ask on the forum.

    It is very good way to systematically learn something by reading some good book.
    OpenGL Programming Guide was once the best (and only) resource for OpenGL. Nowadays it is not so. There is a proliferation of literature. Many of them are of questionable quality.
    I've started to read the Red book ver.8, but gave up after first two chapters. There are some errors that can make beginners some wrong assumption.
    When I (or better say "if I") have enough time it would be nice to make a short overview of current state of the books about OpenGL.

  5. #5
    Junior Member Newbie
    Join Date
    Sep 2012
    Posts
    28
    I think GL_VERSION_4_3 is a macro defined by glew. If it is defined it means that your glew version supports OpenGL 4.3. glGetString gets drivers' version.

Posting Permissions

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