Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: avaibility of opengl extension

  1. #1
    Member Newbie
    Join Date
    Mar 2003
    Posts
    38

    avaibility of opengl extension

    How can I test if an opengl extension is available on the video card ?

  2. #2
    Senior Member Regular Contributor
    Join Date
    Jun 2002
    Posts
    365

    Re: avaibility of opengl extension


  3. #3
    Member Newbie
    Join Date
    Mar 2003
    Posts
    38

    Re: avaibility of opengl extension

    I've already read this, but I didn't find what I want : I know how to use extensions, but I want a fonction to test if a particular extension is available, to prevent for use it if it isn't supported by the hardware...

  4. #4
    Senior Member Regular Contributor
    Join Date
    Jun 2002
    Posts
    365

    Re: avaibility of opengl extension

    Originally posted by Acheum:
    I know how to use extensions, but I want a fonction to test if a particular extension is available
    Is this a joke? You say you know how to use extensions, but you don't know how to check if an extension is supported. The link I gave you points to source code for extension checking.

  5. #5
    Senior Member OpenGL Guru
    Join Date
    Dec 2000
    Location
    Reutlingen, Germany
    Posts
    2,042

    Re: avaibility of opengl extension

    nehe.gamedev.net has a tutorial on how to do that (Lesson 24).

    Jan.
    GLIM - Immediate Mode Emulation for GL3

  6. #6
    Senior Member Regular Contributor
    Join Date
    Apr 2003
    Location
    Toulouse, France
    Posts
    133

    Re: avaibility of opengl extension

    to kwow if a particular extension is supported (for example GL_ARB_fragment_program), do:
    Code :
    char *ext_string = glGetString(EXTENSIONS);
    if (strstr(ext_string, "GL_ARB_fragment_program") != NULL)
    {
        // the extension is supported
    }
    else
    {
        // the extension is not supported
    }

  7. #7
    Member Newbie
    Join Date
    Mar 2003
    Posts
    38

    Re: avaibility of opengl extension

    Oups sorry, I didn't read very well...

    Code :
    #include <GL/gl.h>
    #include <string.h>
     
    int
    isExtensionSupported(const char *extension)
    {
      const GLubyte *extensions = NULL;
      const GLubyte *start;
      GLubyte *where, *terminator;
     
      /* Extension names should not have spaces. */
      where = (GLubyte *) strchr(extension, ' ');
      if (where &amp;#0124; &amp;#0124; *extension == '\0')
        return 0;
      extensions = glGetString(GL_EXTENSIONS);
      /* It takes a bit of care to be fool-proof about parsing the
         OpenGL extensions string. Don't be fooled by sub-strings,
         etc. */
      start = extensions;
      for (; [img]http://www.opengl.org/discussion_boards/ubb/wink.gif[/img] {
        where = (GLubyte *) strstr((const char *) start, extension);
        if (!where)
          break;
        terminator = where + strlen(extension);
        if (where == start &amp;#0124; &amp;#0124; *(where - 1) == ' ')
          if (*terminator == ' ' &amp;#0124; &amp;#0124; *terminator == '\0')
            return 1;
        start = terminator;
      }
      return 0;
    }

  8. #8
    Senior Member Regular Contributor
    Join Date
    Feb 2000
    Posts
    211

    Re: avaibility of opengl extension

    @yoyo:

    >>strstr
    ext_string, "GL_ARB_fragment_program")

    *AARRGHH*, there is a paper of nvidia, somewhere out there, where is told that a developer should "avoid the use of strstr(...) because it results in som inexplicably bugs.
    DJSnow

  9. #9
    Member Newbie
    Join Date
    Jun 2001
    Location
    Shizuoka, Japan
    Posts
    30

    Re: avaibility of opengl extension

    There is also a tool.
    Check this site!! http://www.realtech-vr.com/glview/

  10. #10
    Senior Member Regular Contributor
    Join Date
    Sep 2002
    Location
    Poland
    Posts
    196

    Re: avaibility of opengl extension

    But some drivers don't "refresh" extensions string always. For example there is no VBO extension in ext. string with nVidia detonator < 44.03. Best way is to call wglGetProcAddress and check whether it is NULL or not...

Page 1 of 2 12 LastLast

Similar Threads

  1. #extension mechanism, query if extension is available?
    By eodabash in forum OpenGL: GLSL
    Replies: 3
    Last Post: 03-20-2013, 03:23 PM
  2. OpenGL extension
    By setsuna in forum OpenGL: Windows
    Replies: 6
    Last Post: 09-04-2012, 09:53 AM
  3. New OpenGL extension
    By HellKnight in forum OpenGL: General
    Replies: 19
    Last Post: 07-12-2005, 02:58 PM
  4. OpenGL Extension
    By mishuk in forum OpenGL: Advanced Coding
    Replies: 1
    Last Post: 10-03-2002, 11:33 PM
  5. OpenGl Extension in RCW
    By in forum OpenGL: User Software
    Replies: 0
    Last Post: 12-26-2001, 12:52 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Proudly hosted by Digital Ocean