Minimum requirements: extensions support

I have two questions regarding OpenGL extensions:

  1. Let’s say I’m developing a piece of software that uses some more or less advanced OpenGL features. Is there a way to find out exactly what GL extensions my software requires to run? Some analysing tool? Empirical testing is not possible since it will be run on many different systems.

  2. To make it easy, I could say that it requires OpenGL 2.0. Saying that, is there a site / document that clearly states what features / extensions that are covered by OpenGL 2.0?

Thanks in advance!

1: You should know if you use an extension or not really. You know you use an extension if you use function names or constants that ends with some of the extension postfixes (ARB, EXT, NV, ATI for example).

I don’t know of anything to automatically detect this when you’ve already writtent the program. But on the other hand, if you search for the usual extension postfixes to see what symbols you use, you can always look up the symbol in glext.h. They are sorted by extension in there, so you will easily find which extension they belong to.

2: That would be the API specification. Clicky .

I am really sorry, but your question IS funny

a) it uses the extensions you use in your code
b) the specification?

:rolleyes:

Ok, It’s a funny question. I know the extensions that I use explicitly, but for 3rd party components they don’t always specify the requirements (not detailed enough). Actually in this case there is no problem since the source code is provided, but in general it would be ‘nice’ with some kind of analysing tool.

For the 2.0 specification, I see the chapter now. Thanks. Sorry, the spec can be a bit overwhelming sometimes.

Now that we’re on it… a good 3rd question would be:

  1. Is there a site / doc where I can see what version of OpenGL is supported by a certain graphics adapter/driver?

Thank you for the fast reply. It’s beyond my expectations.

Sorry, I’m asking too early. The answer to my question 3 is here: http://www.delphi3d.net/hardware/listreports.php

This bit of code i plucked fron one of the NeHe tutorials will alow you to check if the current system supports a given extension.

 
// checks if a extentionn is supported, we need to do this since not all harware or drivers support this
bool IsExtensionSupported( char* szTargetExtension )
{
	const unsigned char *pszExtensions = NULL;
	const unsigned char *pszStart;
	unsigned char *pszWhere, *pszTerminator;

	// Extension names should not have spaces
	pszWhere = (unsigned char *) strchr( szTargetExtension, ' ' );
	if( pszWhere || *szTargetExtension == '\0' )
		return false;

	// Get Extensions String
	pszExtensions = glGetString( GL_EXTENSIONS );

	// Search The Extensions String For An Exact Copy
	pszStart = pszExtensions;
	for(;;)
	{
		pszWhere = (unsigned char *) strstr( (const char *) pszStart, szTargetExtension );
		if( !pszWhere )
			break;
		pszTerminator = pszWhere + strlen( szTargetExtension );
		if( pszWhere == pszStart || *( pszWhere - 1 ) == ' ' )
			if( *pszTerminator == ' ' || *pszTerminator == '\0' )
				return true;
		pszStart = pszTerminator;
	}
	return false;
} 

In response to question 1, you can “kindof” find what OpenGL extensions are used via GLIntercept. ( http://glintercept.nutty.org/ )

Simply use the “XMLFrame” profile (or just turn logging off) and add:

FunctionStats = (“GLFuncStats\GLFuncStats.dll”);

To the “Plugins” section of the gliConfig.ini file.

Then, after you have run your program with GLIntercept, you will get a summary in the gliLog.txt file of all OpenGL calls made and how many times it was called.

From this you can see what extensions are being used.

NOTE: If the extension being used does not involve any entry points, this will obviously not find it.