I’m not 100% sure, since I never tested it myself. On Windows all OpenGL functions are provided via the wgl context functions. I think the one used in JUCE loads one of the oldest GL versions (2.1?) possible. This call is used:
Now isn’t it necessary to explicitly request a higher GL version (e.g. 3.1) to actually load the newer GL functions?
It seems for this purpose the WGL_ARB_create_context extension is provided. Similar to the pixel format extension, you have to query/load the extension first. Read more about it here:
https://www.khronos.org/opengl/wiki/Creating_an_OpenGL_Context_(WGL)#Create_Context_with_Attributes
And here an example:
https://www.khronos.org/opengl/wiki/Tutorial:OpenGL_3.1_The_First_Triangle(C%2B%2B/Win)#Rendering_Context_Creation
Especially this part:
...
int attribs[] =
{
WGL_CONTEXT_MAJOR_VERSION_ARB, 3,
WGL_CONTEXT_MINOR_VERSION_ARB, 1,
WGL_CONTEXT_FLAGS_ARB, 0,
0
};
if(wglewIsSupported("WGL_ARB_create_context") == 1)
{
m_hrc = wglCreateContextAttribsARB(pDC->m_hDC,0, attribs);
...