Actually I manage to create a working GL3.2 context a few minute ago
(test with simple GLSL 1.5 shader).
for any one who want to try this after calling glewInit(); to initialize all the function(the latest version of GLEW already support all GL3.2 function).
call this code to create OpenGL 3.2 context
this->currentContext = wglGetCurrentContext();
this->currentDC = wglGetCurrentDC();
int attribs[] =
{
WGL_CONTEXT_MAJOR_VERSION_ARB, 3,
WGL_CONTEXT_MINOR_VERSION_ARB, 2,
WGL_CONTEXT_FLAGS_ARB,WGL_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB,
WGL_CONTEXT_PROFILE_MASK_ARB,WGL_CONTEXT_CORE_PROFILE_BIT_ARB,
0
};
PFNWGLCREATECONTEXTATTRIBSARBPROC wglCreateContextAttribsARB = NULL;
wglCreateContextAttribsARB = (PFNWGLCREATECONTEXTATTRIBSARBPROC) wglGetProcAddress("wglCreateContextAttribsARB");
HGLRC ogl3Context;
if(wglCreateContextAttribsARB != NULL)
{
MessageBox(NULL,"Found the goddamn function
","noticed",MB_OK);
ogl3Context = wglCreateContextAttribsARB(this->currentDC,0, attribs);
}
wglMakeCurrent(NULL,NULL);
wglDeleteContext(this->currentContext);
this->currentContext = ogl3Context;
wglMakeCurrent(this->currentDC,this->currentContext);
currentContext and currentDC are declare as global/member to store current rendering context / HDC (I have to do this since I use GLFW)
The core profile work as expect , attemp to call deprecate function result in Invalid Operation error and GLSL compiler also refuse to compile GLSL 110/120 code.
The only thing still puzzle me is calling.
int major,minor;
glGetIntegerv(GL_MAJOR_VERSION, &major);
glGetIntegerv(GL_MINOR_VERSION, &minor);
return major = 3 , minor = 1 but the driver allow me to create GL3.2 context anyway.
May be this is a bug since Catalyst 9.12 suppose to be support GL3.2 ?