Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Erwin <significant.bit@gmail.com>2017-04-25 05:30:17 +0300
committerMike Erwin <significant.bit@gmail.com>2017-04-25 05:30:17 +0300
commit75a759ea5e9a4b4a52900e6383d67c81b7cbdabe (patch)
treec967541d8a11be094c96a77c7e6da1c07ea50371 /intern/ghost/intern/GHOST_ContextWGL.cpp
parent9c87bb124a57e84abe60a75ba68002a6cc2a68ac (diff)
OpenGL: better context creation on Windows
Compatibility profile was working fine, this is mostly to get the highest GL core profile version available. Our minimum requirement is 3.3 core profile. When we request a specific GL version: - AMD and Intel give us exactly this version - NVIDIA gives at least this version <-- desired behavior so we ask for 4.5, 4.4 ... 3.3 in descending order to get the best version on the user's system. Accept OpenGL 3.0 on Mesa instead of 3.3+ compatibility profile. (requested by @LazyDodo) This will be removed after we finish moving to core profile. Part of T49012 and T51164
Diffstat (limited to 'intern/ghost/intern/GHOST_ContextWGL.cpp')
-rw-r--r--intern/ghost/intern/GHOST_ContextWGL.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/intern/ghost/intern/GHOST_ContextWGL.cpp b/intern/ghost/intern/GHOST_ContextWGL.cpp
index f861631a94e..3538632ce40 100644
--- a/intern/ghost/intern/GHOST_ContextWGL.cpp
+++ b/intern/ghost/intern/GHOST_ContextWGL.cpp
@@ -878,6 +878,7 @@ GHOST_TSuccess GHOST_ContextWGL::initializeDrawingContext()
else
m_hGLRC = s_sharedHGLRC;
}
+#ifdef WITH_LEGACY_OPENGL
else {
if (m_contextProfileMask != 0)
fprintf(stderr, "Warning! Legacy WGL is unable to select between OpenGL profiles.");
@@ -893,6 +894,7 @@ GHOST_TSuccess GHOST_ContextWGL::initializeDrawingContext()
else
m_hGLRC = s_sharedHGLRC;
}
+#endif // WITH_LEGACY_OPENGL
if (!WIN32_CHK(m_hGLRC != NULL)) {
::wglMakeCurrent(prevHDC, prevHGLRC);
@@ -944,7 +946,13 @@ GHOST_TSuccess GHOST_ContextWGL::initializeDrawingContext()
MB_OK | MB_ICONERROR);
exit(0);
}
+#if defined(WITH_LEGACY_OPENGL)
+ else if (version[0] < '3') {
+ // relax requirements for Mesa, which uses GL 3.0
+ // while other drivers use GL 3.3+ compatibility profile
+#else
else if (version[0] < '3' || (version[0] == '3' && version[2] < '3')) {
+#endif
MessageBox(m_hWnd, "Blender requires a graphics driver with OpenGL 3.3 support.\n\n"
"The program will now close.",
"Blender - Unsupported Graphics Driver!",