diff options
| author | Go Watanabe <[email protected]> | 2023-01-10 20:34:06 +0900 |
|---|---|---|
| committer | GitHub <[email protected]> | 2023-01-10 12:34:06 +0100 |
| commit | f549f67be9e1cc1256d35c86637ac807ec2e6823 (patch) | |
| tree | e9cfa4f4d213b6a7e49cae96186f12bee5f6c94c /src/rlgl.h | |
| parent | 6dd1d2d9316c2d665c02d45bd0677150352ed9d3 (diff) | |
| download | raylib-f549f67be9e1cc1256d35c86637ac807ec2e6823.tar.gz raylib-f549f67be9e1cc1256d35c86637ac807ec2e6823.zip | |
OpenGLES 2.0 support on PLATFORM_DESKTOP (#2840)
* OpenGLES 2.0 support on PLATFORM_DESKTOP
* exmples raylib_opengl_interop desktop GLES2 support
* rename gles2.h -> glad_gles2.h
Diffstat (limited to 'src/rlgl.h')
| -rw-r--r-- | src/rlgl.h | 12 |
1 files changed, 12 insertions, 0 deletions
@@ -789,10 +789,16 @@ RLAPI void rlLoadDrawQuad(void); // Load and draw a quad #endif #if defined(GRAPHICS_API_OPENGL_ES2) + + #if defined(PLATFORM_DESKTOP) + #define GLAD_GLES2_IMPLEMENTATION + #include "external/glad_gles2.h" + #else #define GL_GLEXT_PROTOTYPES //#include <EGL/egl.h> // EGL library -> not required, platform layer #include <GLES2/gl2.h> // OpenGL ES 2.0 library #include <GLES2/gl2ext.h> // OpenGL ES 2.0 extensions library + #endif // It seems OpenGL ES 2.0 instancing entry points are not defined on Raspberry Pi // provided headers (despite being defined in official Khronos GLES2 headers) @@ -2144,6 +2150,12 @@ void rlLoadExtensions(void *loader) #endif // GRAPHICS_API_OPENGL_33 #if defined(GRAPHICS_API_OPENGL_ES2) + + #if defined(PLATFORM_DESKTOP) + if (gladLoadGLES2((GLADloadfunc)loader) == 0) TRACELOG(RL_LOG_WARNING, "GLAD: Cannot load OpenGL ES2.0 functions"); + else TRACELOG(RL_LOG_INFO, "GLAD: OpenGL ES2.0 loaded successfully"); + #endif + // Get supported extensions list GLint numExt = 0; const char **extList = RL_MALLOC(512*sizeof(const char *)); // Allocate 512 strings pointers (2 KB) |
