From 9c9e2bbe2779457de2740b9d5f5e680e72ee8da1 Mon Sep 17 00:00:00 2001 From: Connor McLaughlin Date: Thu, 19 Nov 2020 01:02:42 +1000 Subject: [PATCH] GL/ContextWGL: Check for ES2 context extension before creating --- src/common/gl/context_wgl.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/common/gl/context_wgl.cpp b/src/common/gl/context_wgl.cpp index 7dcde8f5e..857084e78 100644 --- a/src/common/gl/context_wgl.cpp +++ b/src/common/gl/context_wgl.cpp @@ -298,6 +298,13 @@ bool ContextWGL::CreateVersionContext(const Version& version, HGLRC share_contex } else if (version.profile == Profile::ES) { + if ((version.major_version >= 2 && !GLAD_WGL_EXT_create_context_es2_profile) || + (version.major_version < 2 && !GLAD_WGL_EXT_create_context_es_profile)) + { + Log_ErrorPrint("WGL_EXT_create_context_es_profile not supported"); + return false; + } + const int attribs[] = { WGL_CONTEXT_PROFILE_MASK_ARB, ((version.major_version >= 2) ? WGL_CONTEXT_ES2_PROFILE_BIT_EXT : WGL_CONTEXT_ES_PROFILE_BIT_EXT),