How can I find which of the extensions of OpenGL that differ from two machines is missing on the second machine?

1

I know this question may sound a little bit silly but I'd like to know if there is a way to do what I pretend without "Brute forcing".

I am developing a quit big application that uses some OpenGL Stuff, for GUI purposes. I've been using a lot of extensions of OpenGL. Everything was done in a machine with a good Graphical Card, so everything always worked fine.

Now I tested my application in a machine with weaker graphical card - The first one supports a lot of opengl 4 features, the second one only up to a few from version 3 - and, unfortunately, a couple of things are not being displayed.

I'd say the reason is that, somehow, I am using an extension which is not supported on the weaker machine, however I've got no single clue which extension or feature may be not supported.

So, the question is is there any way that I can find out which extension it is by, for example, disabling one extension somehow and checking if it still works on the good machine. My problem is that the code is quite big to start commenting line by line on the good machine until I experience the same problem.

filipehd

Posted 2012-10-02T13:15:48.347

Reputation: 111

1You forgot to mention the OS :) There are system dependent tools doing that. – count0 – 2012-10-02T13:18:05.113

I'd use the OpenGL Extensions Viewer. If memory serves, it can produce lists in CSV files (or something similar), which should make comparison fairly simple (e.g., with diff).

– Jerry Coffin – 2012-10-02T13:20:19.297

Answers

2

You can enumerate the available OpenGL extensions using the call

glGetString(GL_EXTENSIONS);

Testing for a extension in particular requires a bit care. This function can be found on the OpenGL wiki:

// Helper to check for extension string presence.  Adapted from:
//   http://www.opengl.org/resources/features/OGLextensions/
static int isExtensionSupported(const char *extList, const char *extension)
{

  const char *start;
  const char *where, *terminator;

  /* Extension names should not have spaces. */
  where = strchr(extension, ' ');
  if ( where || *extension == '\0' )
    return 0;

  /* It takes a bit of care to be fool-proof about parsing the
     OpenGL extensions string. Don't be fooled by sub-strings,
     etc. */
  for ( start = extList; ; ) {
    where = strstr( start, extension );

    if ( !where )
      break;

    terminator = where + strlen( extension );

    if ( where == start || *(where - 1) == ' ' )
      if ( *terminator == ' ' || *terminator == '\0' )
        return 1;

    start = terminator;
  }

  return 0;
}

datenwolf

Posted 2012-10-02T13:15:48.347

Reputation: 276

Note that if you're using a core GL context, you need to be using glGetStringi(GL_EXTENSIONS). – Nicol Bolas – 2012-10-02T17:25:33.503

0

You usually can get a list of the extensions via calls to the OpenGL api. E.g. on linux use glxinfo to see a list of the extensions.

count0

Posted 2012-10-02T13:15:48.347

Reputation: 181