[Bf-blender-cvs] [1858823] master: OpenGL: request version 2.1 when creating context on Windows

Mike Erwin noreply at git.blender.org
Mon Dec 7 00:59:10 CET 2015


Commit: 1858823d3b9d7488ada8400393cb97efe2468efd
Author: Mike Erwin
Date:   Sun Dec 6 14:29:23 2015 -0500
Branches: master
https://developer.blender.org/rB1858823d3b9d7488ada8400393cb97efe2468efd

OpenGL: request version 2.1 when creating context on Windows

In practice this gives us a context that is *compatible* with GL 2.1. On
my machine it gives a GL 3.3 or 4.3 compatibility profile context,
depending on graphics card installed.

Also fixed enum for core profile (not used yet).

Also added option for GL 3.2 compatibility profile. This will be useful
during Blender 2.8 development, until we are able to use the core
profile. On my machine this gives exactly a GL 3.2 compatibility profile
context, not 3.3 or 4.

===================================================================

M	intern/ghost/intern/GHOST_WindowWin32.cpp

===================================================================

diff --git a/intern/ghost/intern/GHOST_WindowWin32.cpp b/intern/ghost/intern/GHOST_WindowWin32.cpp
index 54ac9d2..7247753 100644
--- a/intern/ghost/intern/GHOST_WindowWin32.cpp
+++ b/intern/ghost/intern/GHOST_WindowWin32.cpp
@@ -626,7 +626,7 @@ GHOST_Context *GHOST_WindowWin32::newDrawingContext(GHOST_TDrawingContextType ty
 		        m_wantNumOfAASamples,
 		        m_hWnd,
 		        m_hDC,
-		        WGL_CONTEXT_OPENGL_CORE_PROFILE_BIT,
+		        WGL_CONTEXT_CORE_PROFILE_BIT_ARB,
 		        3, 2,
 		        GHOST_OPENGL_WGL_CONTEXT_FLAGS,
 		        GHOST_OPENGL_WGL_RESET_NOTIFICATION_STRATEGY);
@@ -646,8 +646,14 @@ GHOST_Context *GHOST_WindowWin32::newDrawingContext(GHOST_TDrawingContextType ty
 		        m_wantNumOfAASamples,
 		        m_hWnd,
 		        m_hDC,
+#if 1
 		        0, // profile bit
-		        0, 0,
+		        2, 1, // GL version requested
+#else
+		        // switch to this for Blender 2.8 development
+		        WGL_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB,
+		        3, 2,
+#endif
 		        GHOST_OPENGL_WGL_CONTEXT_FLAGS,
 		        GHOST_OPENGL_WGL_RESET_NOTIFICATION_STRATEGY);
 #else
@@ -684,8 +690,14 @@ GHOST_Context *GHOST_WindowWin32::newDrawingContext(GHOST_TDrawingContextType ty
 		        m_wantNumOfAASamples,
 		        m_hWnd,
 		        m_hDC,
+#if 1
 		        0, // profile bit
-		        0, 0,
+		        2, 1, // GL version requested
+#else
+		        // switch to this for Blender 2.8 development
+		        EGL_CONTEXT_OPENGL_COMPATIBILITY_PROFILE_BIT,
+		        3, 2,
+#endif
 		        GHOST_OPENGL_EGL_CONTEXT_FLAGS,
 		        GHOST_OPENGL_EGL_RESET_NOTIFICATION_STRATEGY,
 		        EGL_OPENGL_API);




More information about the Bf-blender-cvs mailing list