From 434a3a276df2f0a3dfe48b522a9e20abe8562fef Mon Sep 17 00:00:00 2001 From: raysan5 Date: Wed, 31 Mar 2021 18:41:03 +0200 Subject: [PATCH] REVIEWED: Define instancing API entry points for RPI --- src/rlgl.h | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/rlgl.h b/src/rlgl.h index 14daca3c..7010c433 100644 --- a/src/rlgl.h +++ b/src/rlgl.h @@ -731,6 +731,14 @@ RLAPI Texture2D rlGenTextureBRDF(Shader shader, int size); // Gener #include // EGL library #include // OpenGL ES 2.0 library #include // OpenGL ES 2.0 extensions library + + // 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) + #if defined(PLATFORM_RPI) || defined(PLATFORM_DRM) + typedef void (GL_APIENTRYP PFNGLDRAWARRAYSINSTANCEDEXTPROC) (GLenum mode, GLint start, GLsizei count, GLsizei primcount); + typedef void (GL_APIENTRYP PFNGLDRAWELEMENTSINSTANCEDEXTPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei primcount); + typedef void (GL_APIENTRYP PFNGLVERTEXATTRIBDIVISOREXTPROC) (GLuint index, GLuint divisor); + #endif #endif //---------------------------------------------------------------------------------- @@ -892,15 +900,11 @@ static PFNGLGENVERTEXARRAYSOESPROC glGenVertexArrays = NULL; static PFNGLBINDVERTEXARRAYOESPROC glBindVertexArray = NULL; static PFNGLDELETEVERTEXARRAYSOESPROC glDeleteVertexArrays = NULL; -// It seems OpenGL ES 2.0 instancing entry points are not defined -// in Raspberry Pi provided headers (despite being defined in official Khronos GLES2 headers) -#if !defined(PLATFORM_RPI) && !defined(PLATFORM_DRM) // NOTE: Instancing functionality could also be available through extension static PFNGLDRAWARRAYSINSTANCEDEXTPROC glDrawArraysInstanced = NULL; static PFNGLDRAWELEMENTSINSTANCEDEXTPROC glDrawElementsInstanced = NULL; static PFNGLVERTEXATTRIBDIVISOREXTPROC glVertexAttribDivisor = NULL; #endif -#endif //---------------------------------------------------------------------------------- // Module specific Functions Declaration