diff options
| author | bruvzg | 2018-03-06 15:53:30 +0200 |
|---|---|---|
| committer | Hein-Pieter van Braam | 2018-04-14 20:56:49 +0200 |
| commit | ce1b62a01f182ae2492ba6dc69aa4bebc29c90b6 (patch) | |
| tree | 32453760aa9e7d37d5530506b11312e99a178095 | |
| parent | 28d4271e3e8b482c565b8e2ce7b2336eb61538d6 (diff) | |
| download | godot-ce1b62a01f182ae2492ba6dc69aa4bebc29c90b6.tar.gz godot-ce1b62a01f182ae2492ba6dc69aa4bebc29c90b6.tar.zst godot-ce1b62a01f182ae2492ba6dc69aa4bebc29c90b6.zip | |
Explicitly set OpenGL profile to core (X11, Windows).
Enable GLES2 on Windows.
(cherry picked from commit ad67911f1a45370558f968cdc1540f707534c28f)
| -rw-r--r-- | platform/windows/context_gl_win.cpp | 3 | ||||
| -rw-r--r-- | platform/windows/os_windows.cpp | 1 | ||||
| -rw-r--r-- | platform/x11/context_gl_x11.cpp | 1 |
3 files changed, 4 insertions, 1 deletions
diff --git a/platform/windows/context_gl_win.cpp b/platform/windows/context_gl_win.cpp index 8b57fdd9c..d312fbcb1 100644 --- a/platform/windows/context_gl_win.cpp +++ b/platform/windows/context_gl_win.cpp @@ -38,6 +38,8 @@ #define WGL_CONTEXT_MINOR_VERSION_ARB 0x2092 #define WGL_CONTEXT_FLAGS_ARB 0x2094 #define WGL_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB 0x00000002 +#define WGL_CONTEXT_PROFILE_MASK_ARB 0x9126 +#define WGL_CONTEXT_CORE_PROFILE_BIT_ARB 0x00000001 typedef HGLRC(APIENTRY *PFNWGLCREATECONTEXTATTRIBSARBPROC)(HDC, HGLRC, const int *); @@ -153,6 +155,7 @@ Error ContextGL_Win::initialize() { WGL_CONTEXT_MAJOR_VERSION_ARB, 3, //we want a 3.3 context WGL_CONTEXT_MINOR_VERSION_ARB, 3, //and it shall be forward compatible so that we can only use up to date functionality + WGL_CONTEXT_PROFILE_MASK_ARB, WGL_CONTEXT_CORE_PROFILE_BIT_ARB, WGL_CONTEXT_FLAGS_ARB, WGL_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB /*| _WGL_CONTEXT_DEBUG_BIT_ARB*/, 0 }; //zero indicates the end of the array diff --git a/platform/windows/os_windows.cpp b/platform/windows/os_windows.cpp index 5770a67ba..7ac9d6e0e 100644 --- a/platform/windows/os_windows.cpp +++ b/platform/windows/os_windows.cpp @@ -1093,7 +1093,6 @@ Error OS_Windows::initialize(const VideoMode &p_desired, int p_video_driver, int gl_context->initialize(); RasterizerGLES3::register_config(); - RasterizerGLES3::make_current(); gl_context->set_use_vsync(video_mode.use_vsync); diff --git a/platform/x11/context_gl_x11.cpp b/platform/x11/context_gl_x11.cpp index 20f221286..0578c13b2 100644 --- a/platform/x11/context_gl_x11.cpp +++ b/platform/x11/context_gl_x11.cpp @@ -153,6 +153,7 @@ Error ContextGL_X11::initialize() { static int context_attribs[] = { GLX_CONTEXT_MAJOR_VERSION_ARB, 3, GLX_CONTEXT_MINOR_VERSION_ARB, 3, + GLX_CONTEXT_PROFILE_MASK_ARB, GLX_CONTEXT_CORE_PROFILE_BIT_ARB, GLX_CONTEXT_FLAGS_ARB, GLX_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB /*|GLX_CONTEXT_DEBUG_BIT_ARB*/, None }; |
