GL/Context: Use GL_OES_draw_elements_base_vertex if GLES3.2 is missing

This commit is contained in:
Connor McLaughlin
2022-10-04 01:40:13 +10:00
parent 2231af2dfc
commit 564a9bdeb4
2 changed files with 17 additions and 0 deletions

View File

@ -106,6 +106,8 @@
// GL includes
#include "common/gl/loader.h"
#include "common/gl/texture.h"
#include "common/log.h"
Log_SetChannel(ImGui_ImplOpenGL3);
// OpenGL Data
struct ImGui_ImplOpenGL3_Data
@ -168,6 +170,13 @@ bool ImGui_ImplOpenGL3_Init(const char* glsl_version)
IM_ASSERT((int)strlen(glsl_version) + 2 < IM_ARRAYSIZE(bd->GlslVersionString));
strcpy(bd->GlslVersionString, glsl_version);
strcat(bd->GlslVersionString, "\n");
if (!glDrawElementsBaseVertex)
{
Log_ErrorPrintf("Missing glDrawElementsBaseVertex()");
return false;
}
return ImGui_ImplOpenGL3_CreateDeviceObjects();
}