File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed
RenderSystems/GLSupport/src/win32 Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change 36
36
#include " OgreWin32Window.h"
37
37
#include " OgreGLUtil.h"
38
38
39
+ #include < GL/gl.h>
39
40
#include < GL/wglext.h>
40
41
41
42
static PFNWGLCREATECONTEXTATTRIBSARBPROC _wglCreateContextAttribsARB = 0 ;
42
43
44
+ static int glMajorMax = 0 ;
45
+ static int glMinorMax = 0 ;
46
+
43
47
namespace Ogre {
44
48
GLNativeSupport* getGLSupport (int profile)
45
49
{
@@ -303,6 +307,11 @@ namespace Ogre {
303
307
// if wglMakeCurrent fails, wglGetProcAddress will return null
304
308
wglMakeCurrent (hdc, hrc);
305
309
310
+ // the default context is created with maximum version
311
+ // use GL3 query type, as it is the only consumer
312
+ glGetIntegerv (0x821B , &glMajorMax);
313
+ glGetIntegerv (0x821C , &glMinorMax);
314
+
306
315
_wglCreateContextAttribsARB = (PFNWGLCREATECONTEXTATTRIBSARBPROC)
307
316
wglGetProcAddress (" wglCreateContextAttribsARB" );
308
317
@@ -473,8 +482,8 @@ namespace Ogre {
473
482
break ;
474
483
default :
475
484
profile = WGL_CONTEXT_CORE_PROFILE_BIT_ARB;
476
- majorVersion = 3 ;
477
- minorVersion = 3 ; // 3.1 would be sufficient per spec, but we need 3.3 anyway..
485
+ majorVersion = std::max (glMajorMax, 3 ) ;
486
+ minorVersion = std::max (glMinorMax, 3 ) ; // 3.1 would be sufficient per spec, but we need 3.3 anyway..
478
487
break ;
479
488
}
480
489
You can’t perform that action at this time.
0 commit comments