OPENGL: Fix OpenGL ES v1 builds without GLAD
This commit is contained in:
parent
b3f98810a2
commit
460bc32cd9
3 changed files with 21 additions and 1 deletions
|
@ -204,8 +204,10 @@ void OpenGLGraphicsManager::initializeGLContext() {
|
|||
}
|
||||
|
||||
// Log features supported by GL context.
|
||||
#if !USE_FORCED_GLES
|
||||
if (g_context.shadersSupported)
|
||||
debug(5, "GLSL version: %s", glGetString(GL_SHADING_LANGUAGE_VERSION));
|
||||
#endif
|
||||
debug(5, "OpenGL vendor: %s", glGetString(GL_VENDOR));
|
||||
debug(5, "OpenGL renderer: %s", glGetString(GL_RENDERER));
|
||||
debug(5, "OpenGL: NPOT texture support: %d", g_context.NPOTSupported);
|
||||
|
|
8
configure
vendored
8
configure
vendored
|
@ -5400,8 +5400,9 @@ if test "$_opengl_glad" = "no" -a "$_opengl_mode" != "none"; then
|
|||
# 1) GL/gl.h This is usually used on POSIX and Windows systems
|
||||
# 2) OpenGL/gl.h This is used on macOS
|
||||
# 3) GLES2/gl2.h This is used for OpenGL ES 2.x
|
||||
# 3) GLES/gl.h This is used for OpenGL ES 1.x
|
||||
_opengl_can_compile=no
|
||||
for i in "GL/gl.h" "OpenGL/gl.h" "GLES2/gl2.h"; do
|
||||
for i in "GL/gl.h" "OpenGL/gl.h" "GLES2/gl2.h" "GLES/gl.h"; do
|
||||
# Test the current header for OpenGL
|
||||
if test "$_opengl_mode" = "gl" -o "$_opengl_mode" = "any" ; then
|
||||
cat > $TMPC << EOF
|
||||
|
@ -5449,6 +5450,11 @@ EOF
|
|||
break
|
||||
fi
|
||||
done
|
||||
elif test "$_opengl_mode" = "gles" ; then
|
||||
OPENGL_LIBS="-lGLESv1_CM"
|
||||
if cc_check_no_clean $DEFINES $OPENGL_CFLAGS $OPENGL_LIBS; then
|
||||
_opengl_can_compile=yes
|
||||
fi
|
||||
else
|
||||
case $_host_os in
|
||||
darwin*)
|
||||
|
|
|
@ -84,6 +84,18 @@
|
|||
#define GL_MAX_SAMPLES 0x8D57
|
||||
#endif
|
||||
|
||||
#elif USE_FORCED_GLES
|
||||
|
||||
#define GL_GLEXT_PROTOTYPES
|
||||
#if defined(IPHONE)
|
||||
#include <OpenGLES/ES1/gl.h>
|
||||
#include <OpenGLES/ES1/glext.h>
|
||||
#else
|
||||
#include <GLES/gl.h>
|
||||
#include <GLES/glext.h>
|
||||
#endif
|
||||
#undef GL_GLEXT_PROTOTYPES
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue