EMSCRIPTEN: OPENGL: Disable GLAD

This commit is contained in:
Christian Kündig 2024-01-27 22:33:40 +01:00 committed by Eugene Sandulenko
parent 65bdafa0a0
commit 7aa72a1633
3 changed files with 19 additions and 2 deletions

4
configure vendored
View File

@ -6351,6 +6351,7 @@ if test "$_opengl_mode" != none ; then
sdl)
# This case is for pure SDL backend. Many platforms overload it and create a new backend
# They still make use of SDL but it's handled below in the default case
_opengl_glad=yes
case $_sdlversion in
1.2.*)
# Stock SDL 1.2 only supports OpenGL contexts.
@ -6367,7 +6368,7 @@ if test "$_opengl_mode" != none ; then
;;
emscripten)
_opengl_mode=gles2
_opengl_glad=no
_opengl_glad=no # https://github.com/Dav1dde/glad-web/issues/12
append_var OPENGL_LIBS "-s FULL_ES2=1 -s MAX_WEBGL_VERSION=1"
;;
*)
@ -6377,7 +6378,6 @@ if test "$_opengl_mode" != none ; then
esac
;;
esac
_opengl_glad=yes
;;
switch)
_opengl_mode=gles2

View File

@ -39,10 +39,19 @@ Common::String getGLErrStr(GLenum error) {
return "GL_INVALID_VALUE";
case GL_INVALID_OPERATION:
return "GL_INVALID_OPERATION";
// OpenGL ES 2.0 doesn't have GL_STACK_OVERFLOW and GL_STACK_UNDERFLOW
// see https://registry.khronos.org/OpenGL/api/GLES2/gl2.h and https://registry.khronos.org/OpenGL/api/GLES2/gl2ext.h
#ifdef USE_FORCED_GLES2
case GL_STACK_OVERFLOW_KHR:
return "GL_STACK_OVERFLOW_KHR";
case GL_STACK_UNDERFLOW_KHR:
return "GL_STACK_UNDERFLOW_KHR";
#else
case GL_STACK_OVERFLOW:
return "GL_STACK_OVERFLOW";
case GL_STACK_UNDERFLOW:
return "GL_STACK_UNDERFLOW";
#endif
case GL_OUT_OF_MEMORY:
return "GL_OUT_OF_MEMORY";
default:

View File

@ -84,6 +84,14 @@
#define GL_MAX_SAMPLES 0x8D57
#endif
#if !defined(GL_STACK_OVERFLOW_KHR)
#define GL_STACK_OVERFLOW_KHR 0x0503
#endif
#if !defined(GL_STACK_UNDERFLOW_KHR)
#define GL_STACK_UNDERFLOW_KHR 0x0504
#endif
#elif USE_FORCED_GLES
#define GL_GLEXT_PROTOTYPES