#104 GLEW_VERSION_2_1 and GLEW_VERSION_3_0 == 0?

closed
None
7
2012-09-15
2009-02-25
No

For some reasons GLEW_VERSION_2_1 and GLEW_VERSION_3_0 are null even if I have a GeForce 8 and drivers 182.05 when I create a OpenGL 2.1 context. GL_VERSION returns "3.0.0" which let me expect GLEW_VERSION_2_1 to be true and maybe GLEW_VERSION_3_0 too.

Discussion

  • Nigel Stewart

    Nigel Stewart - 2009-02-27

    Could you attached the output of glewinfo to this bug report?
    Also trying a previous driver version might be interesting.

     
  • Robert Seiler

    Robert Seiler - 2009-03-08

    I can confirm this bug.
    Yesterday I've installed the newest driver for my GeForce 8800GTS (182.05) and now this line of code
    glewIsSupported("GL_VERSION_2_1")
    returns 0.

    Before I've used driver version 181.22 and all worked fine.
    One feature of the new driver is the full openGL 3.0 support for GeForce series 8,9 and 200, think there is a connection ;)

     
  • Benjamin

    Benjamin - 2009-03-17

    Hello,

    I have checked out the Subversion repository and found the file "glew_init_gl.c" where the OpenGL version is checked. I think the problem is that the program flow takes the first branch (s[major] >= '2' because s[major] is '3') and then the check (s[minor] >= '1') fails because s[minor] is '0'. Therefore GLEW_VERSION_2_1 will not be set.
    Maybe the easiest way to fix this is to introduce a branch for (s[major] >= '3').

    Kind regards,
    Benjamin Eikel

     
  • Benjamin

    Benjamin - 2009-03-22

    Hello again,

    I wrote a patch that works for me against the current Subversion revision. With the library compiled with that patch I can start an application checking glewIsSupported("GL_VERSION_2_1") again. My OpenGL version string is "3.0.0 NVIDIA 180.41" and I am using Debian GNU/Linux amd64. I cannot find an option to post a file here therefore I am posting it this way:

    Index: auto/src/glew_init_gl.c

    --- auto/src/glew_init_gl.c (revision 547)
    +++ auto/src/glew_init_gl.c (working copy)
    @@ -46,8 +46,17 @@
    else
    {
    CONST_CAST(GLEW_VERSION_1_1) = GL_TRUE;
    - if (s[major] >= '2')
    + if (s[major] >= '3')
    {
    + CONST_CAST(GLEW_VERSION_1_2) = GL_TRUE;
    + CONST_CAST(GLEW_VERSION_1_3) = GL_TRUE;
    + CONST_CAST(GLEW_VERSION_1_4) = GL_TRUE;
    + CONST_CAST(GLEW_VERSION_1_5) = GL_TRUE;
    + CONST_CAST(GLEW_VERSION_2_0) = GL_TRUE;
    + CONST_CAST(GLEW_VERSION_2_1) = GL_TRUE;
    + }
    + else if (s[major] == '2')
    + {
    CONST_CAST(GLEW_VERSION_1_2) = GL_TRUE;
    CONST_CAST(GLEW_VERSION_1_3) = GL_TRUE;
    CONST_CAST(GLEW_VERSION_1_4) = GL_TRUE;

    Kind regards,
    Benjamin Eikel

     
  • Nobody/Anonymous

    I think you need to add:

    CONST_CAST(GLEW_VERSION_3_0) = GL_TRUE;

    to the:

    if (s[major] >= '3')

    block. Otherwise, GLEW_VERSION_3_0 is still null when you have version 3 or higher.

     
  • Nobody/Anonymous

    I think you need to add:

    CONST_CAST(GLEW_VERSION_3_0) = GL_TRUE;

    to the:

    if (s[major] >= '3')

    block. Otherwise, GLEW_VERSION_3_0 is still null when you have version 3 or higher.

     
  • Nigel Stewart

    Nigel Stewart - 2009-03-24

    Proposed patch for glewContextInit version detection

     
  • Nigel Stewart

    Nigel Stewart - 2009-03-24

    Confirming this problem.

    Attached a proposed patch for this with the intention of simplifying the logic.
    I'll see if the long lines are acceptable... :-)

    • CONST_CAST(GLEW_VERSION_3_0) = ( major >= 3 ) ? GL_TRUE : GL_FALSE;
    • CONST_CAST(GLEW_VERSION_2_1) = GLEW_VERSION_3_0 == GL_TRUE || ( major == 2 && minor >= 1 ) ? GL_TRUE : GL_FALSE;
    • CONST_CAST(GLEW_VERSION_2_0) = GLEW_VERSION_2_1 == GL_TRUE || ( major == 2 ) ? GL_TRUE : GL_FALSE;
    • CONST_CAST(GLEW_VERSION_1_5) = GLEW_VERSION_2_0 == GL_TRUE || ( major == 1 && minor >= 5 ) ? GL_TRUE : GL_FALSE;
    • CONST_CAST(GLEW_VERSION_1_4) = GLEW_VERSION_1_5 == GL_TRUE || ( major == 1 && minor >= 4 ) ? GL_TRUE : GL_FALSE;
    • CONST_CAST(GLEW_VERSION_1_3) = GLEW_VERSION_1_4 == GL_TRUE || ( major == 1 && minor >= 3 ) ? GL_TRUE : GL_FALSE;
    • CONST_CAST(GLEW_VERSION_1_2) = GLEW_VERSION_1_3 == GL_TRUE || ( major == 1 && minor >= 2 ) ? GL_TRUE : GL_FALSE;
    • CONST_CAST(GLEW_VERSION_1_1) = GLEW_VERSION_1_2 == GL_TRUE || ( major == 1 && minor >= 1 ) ? GL_TRUE : GL_FALSE;
     
  • Benjamin

    Benjamin - 2009-03-25

    Hello Nigel,

    your patch works for me. I wrote a short test application and it detects OpenGL 2.1 and 3.0 now.

    Kind regards,
    Benjamin

     
  • Nigel Stewart

    Nigel Stewart - 2009-03-31

    The patch has been applied to SVN as Rev 549. Marking this bug as pending.
    I didn't add anything for OpenGL 3.1 detection in particular.

     
  • Nobody/Anonymous

    i get this bug too under both windows and mac os 10.5.6 using a geforce 8 series, it wouldn't seem it is a driver problem considering it happens on both platforms.

     
  • SourceForge Robot

    This Tracker item was closed automatically by the system. It was
    previously set to a Pending status, and the original submitter
    did not respond within 14 days (the time period specified by
    the administrator of this Tracker).

     

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks