GL/ContextWGL: Check for ES2 context extension before creating

This commit is contained in:
Connor McLaughlin 2020-11-19 01:02:42 +10:00
parent aeee649700
commit 9c9e2bbe27

View file

@ -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),