[Bf-blender-cvs] [4fcca6a0abb] blender2.8: GHOST: Make win32 errors more readable on some drivers

Clément Foucault noreply at git.blender.org
Tue Aug 14 21:46:49 CEST 2018


Commit: 4fcca6a0abb4bc19854c0a41c00725954345248d
Author: Clément Foucault
Date:   Tue Aug 14 20:28:18 2018 +0200
Branches: blender2.8
https://developer.blender.org/rB4fcca6a0abb4bc19854c0a41c00725954345248d

GHOST: Make win32 errors more readable on some drivers

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

M	intern/ghost/intern/GHOST_Context.cpp

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

diff --git a/intern/ghost/intern/GHOST_Context.cpp b/intern/ghost/intern/GHOST_Context.cpp
index 823a476d244..e02f73ad12a 100644
--- a/intern/ghost/intern/GHOST_Context.cpp
+++ b/intern/ghost/intern/GHOST_Context.cpp
@@ -59,7 +59,10 @@ bool win32_chk(bool result, const char *file, int line, const char *text)
 
 		DWORD count = 0;
 
-		switch (error) {
+		/* Some drivers returns a HRESULT instead of a standard error message.
+		 * i.e: 0xC0072095 instead of 0x2095 for ERROR_INVALID_VERSION_ARB
+		 * So strip down the error to the valid error code range. */
+		switch (error & 0x0000FFFF) {
 			case ERROR_INVALID_VERSION_ARB:
 				msg = "The specified OpenGL version and feature set are either invalid or not supported.\n";
 				break;



More information about the Bf-blender-cvs mailing list