I found it interesting that glGetString(GL_EXTENSIONS) returns just one WGL extension. The reason is unknown :), but if you need to query WGL extensions, it is much better idea to use wglGetExtensionStringARB.
The following code snippet does it for you:
DECLARE FUNCTION wglGetExtensionStringARB_Prototype(BYVAL hDc AS DWORD) AS DWORD
...
LOCAL WGLInfoPTR AS ASCIIZ PTR
LOCAL WGLExtensions AS STRING
DIM wglGetExtensionStringARB_Address AS DWORD
wglGetExtensionStringARB_Address = wglGetProcAddress("wglGetExtensionsStringARB")
IF wglGetExtensionStringARB_Address THEN
CALL DWORD wglGetExtensionStringARB_Address USING wglGetExtensionStringARB_Prototype(hDC) TO WGLInfoPTR
WGLExtensions = UCASE$(@WGLInfoPTR)+" "
END IF
Maybe this could be useful addition to the headers, as WGL extensions have big power (query of each GPU memory on ATi hardware and so on).
Petr
The headers include the CWGLEXT class (in CWGLEXT.inc), that wraps all the GWLEXT functions. The prototypes for the functions are in WGLEXT.inc.
You create an instance of the class with:
LOCAL pWglExt AS IWGLEXT
pWglExt = CLASS "CWGLEXT"
Then you call the method that has the same name and parameters that the WGLEXT functions, e.g.
LOCAL WGLExtensions AS STRING
WGLExtensions = pWglExt.wglGetExtensionsStringARB(hdc)
If the address of the WGL function isn't found, OBJRESULT returns the error &H8007007F&, which is the HRESULT equivalent to the system error code ERROR_PROC_NOT_FOUND.
The code of the method for wglGetExtensionsStringARB is as follows:
' =====================================================================================
' const char * wglGetExtensionsStringARB (HDC hdc);
' =====================================================================================
METHOD wglGetExtensionsStringARB (BYVAL hdc AS DWORD) AS STRING
LOCAL pRes AS ASCIIZ PTR
LOCAL pProc AS DWORD
pProc = wglGetProcAddress("wglGetExtensionsStringARB")
IF pProc = 0 THEN METHOD OBJRESULT = &H8007007F& : EXIT METHOD
CALL DWORD pProc USING wglGetExtensionsStringARB(hdc) TO pRes
IF pRes THEN METHOD = @pRes
END METHOD
' =====================================================================================
Thanks José,
I did not notice this class, very useful!
Petr