Add GLES3 "support" to SOIL2, using the proper includes.

This commit is contained in:
Kai Blaschke
2021-11-05 17:56:04 +01:00
parent 1f2d081f99
commit afc2dd50f3
2 changed files with 21 additions and 2 deletions

View File

@ -30,6 +30,18 @@ target_link_libraries(SOIL2
PUBLIC
${PROJECTM_OPENGL_LIBRARIES}
)
if(USE_GLES)
target_compile_definitions(SOIL2
PRIVATE
SOIL_GLES3
SOIL_NO_EGL
)
target_link_libraries(SOIL2
PUBLIC
${CMAKE_DL_LIBS}
)
endif()
set_target_properties(SOIL2 PROPERTIES
FOLDER libprojectM

View File

@ -41,6 +41,13 @@
#include <EGL/egl.h>
#endif
#if defined( SOIL_GLES3 )
#include <GLES3/gl3.h>
#include <GLES3/gl3ext.h>
#define APIENTRY GL_APIENTRY
#endif
#if defined( SOIL_GLES2 )
#ifdef SOIL_PLATFORM_IOS
#include <OpenGLES/ES2/gl.h>
@ -216,12 +223,12 @@ void * SOIL_GL_GetProcAddress(const char *proc)
#if defined( SOIL_PLATFORM_IOS )
func = dlsym( RTLD_DEFAULT, proc );
#elif defined( SOIL_GLES2 ) || defined( SOIL_GLES1 )
#elif defined( SOIL_GLES2 ) || defined( SOIL_GLES1 ) || defined( SOIL_GLES3 )
#ifndef SOIL_NO_EGL
func = eglGetProcAddress( proc );
#else
func = NULL;
#endif
#endif
#elif defined( SOIL_PLATFORM_WIN32 )
func = wglGetProcAddress( proc );