From 4fcca6a0abb4bc19854c0a41c00725954345248d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Foucault?= Date: Tue, 14 Aug 2018 20:28:18 +0200 Subject: [PATCH] GHOST: Make win32 errors more readable on some drivers --- intern/ghost/intern/GHOST_Context.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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;