I was trying to use WGL_ARB_pbuffer for offscreen rendering with OpenGL,
but I was failed during initialization. Here is my code.wglGetExtensionsStringARB = (PFNWGLGETEXTENSIONSSTRINGARBPROC) wglGetProcAddress("wglGetExtensionsStringARB");
if(!wglGetExtensionsStringARB) return;
const GLubyte* extensions = (const GLubyte*) wglGetExtensionsStringARB(wglGetCurrentDC());
So actually this ends at 2nd line because wglGetExtensionsStringARB got NULL.
I have no idea why wglGetProcAddress doesn't work. I included "wglext.h" and also I defined as below at the header.PFNWGLGETEXTENSIONSSTRINGARBPROC pwglGetExtensionsStringARB = 0;
#define wglGetExtensionsStringARB pwglGetExtensionsStringARB
Why can't I use wglGetProcAddress as I intended??
ARB
indicates it to be a function that's not necessarily supported on all hardware. Quoting from opengl.org/registry/specs/ARB/wgl_extensions_string.txt - "Applications should call wglGetProcAddress to see whether or not wglGetExtensionsStringARB is supported. If it is supported then it can be used to determine which WGL extensions are supported by the device." – EhuddwglGetProcAddress
call returns NULL, its not supported - this is how you check for card/driver support. You apparently dont have it. :( Have you triedwglGetExtensionString
, as is mentioned in an answer here: #11315553 ? – Ehudd