From 10702928aeca457505f29e1c6d92578c41be1709 Mon Sep 17 00:00:00 2001 From: Magnus Norddahl Date: Thu, 2 Jan 2020 20:21:38 +0100 Subject: [PATCH] Only call seterror if the context creation fails --- Source/Native/OpenGL/OpenGLContext.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Source/Native/OpenGL/OpenGLContext.cpp b/Source/Native/OpenGL/OpenGLContext.cpp index 4106b108..a3a4a173 100644 --- a/Source/Native/OpenGL/OpenGLContext.cpp +++ b/Source/Native/OpenGL/OpenGLContext.cpp @@ -303,8 +303,12 @@ HGLRC OpenGLCreationHelper::CreateContext(HDC hdc, HGLRC share_context) break; } - GLenum error = glGetError(); - SetError("No OpenGL 3.2 support found: %d", error); + // Grab the error from the last create attempt + if (!opengl3_context) + { + GLenum error = glGetError(); + SetError("No OpenGL 3.2 support found: %d", error); + } } else {