- if (wglewIsSupported("WGL_ARB_create_context") == 1) { // If the OpenGL 3.x context creation extension is available
- hrc = wglCreateContextAttribsARB(hdc, NULL, attributes); // Create and OpenGL 3.x context based on the given attributes
- wglMakeCurrent(NULL, NULL); // Remove the temporary context from being active
- wglDeleteContext(Temp_hrc); // Delete the temporary OpenGL 2.1 context
- wglMakeCurrent(hdc, hrc); // Make our OpenGL 3.0 context current
- }
- else
- {
- hrc = Temp_hrc; // If we didn't have support for OpenGL 3.x and up, use the OpenGL 2.1 context
- }