DemoGL::Reference::Functions::DEMOGL_ExtensionCheckIfAvailable

DEMOGL_ExtensionCheckIfAvailable

DEMOGL_ExtensionCheckIfAvailable comes in two versions: one for checking directly with the DemoGL extension database internally, which is faster, and a string version that checks directly with the extension string reported by the OpenGL driver.


Variant 1:

bool
DEMOGL_ExtensionCheckIfAvailable(
	const int iExtension
);
	
Parameters.
iExtension
Constant defined in DemoGL_Extensions.h. Use the defined constant to check if the corresponding OpenGL extension is available and recognized.


Variant 2:

bool
DEMOGL_ExtensionCheckIfAvailable(
	const char *pszExtensionName
);
	
Parameters.
pszExtensionName
Pointer to a zero-terminated string which represents the exact name of the OpenGL extension as it would be reported by the OpenGL driver.



Return values.
If the OpenGL extension is available, it returns true.
If the OpenGL extension is not available or an error occured, it returns false.

Remarks.
The iExtension variant of DEMOGL_ExtensionCheckIfAvailable checks the internal database of known extensions. Because OpenGL extensions are added with every new videochip set released, it can happen DEMOGL_ExtensionCheckIfAvailable will report false while the driver reports the extension. However DemoGL recognizes most extensions of all populair videocards up till the ATI Radeon and the Geforce2 GTS. This database will be extended on a regular basis. When you want to check for a new, rarely used extension, use the pszExtensionName variant. When you want to check for a common well supported extension, use the iExtension variant. The pszExtensionName variant is slightly slower due to the string compare code.

NOTE:. DEMOGL_ExtensionCheckIfAvailable will only work after DemoGL has opened the main window plus when the holder of that window, the main thread, executes DEMOGL_ExtensionCheckIfAvailable. Therefor it's not recommended to place DEMOGL_ExtensionCheckIfAvailable(const char *pszExtensionName) calls in Init() methods of a CEffect derived effect class, nor call this function before you call DEMOGL_AppRun. When you have to check for extensions in the Init() method, use the integer variant of DEMOGL_ExtensionCheckIfAvailable.

Example.

Requirements.
DemoGL v1.3 (build 0112 or higher)

See also.
DEMOGL_AppRun, CEffect

Last changed on 01-jun-2001

©1999-2001 Solutions Design