summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorraysan5 <[email protected]>2021-03-31 18:41:03 +0200
committerraysan5 <[email protected]>2021-03-31 18:41:03 +0200
commit434a3a276df2f0a3dfe48b522a9e20abe8562fef (patch)
tree23960c24aaf6740c042921ca1259916551eef14b
parent8e51e6d1dff309f9fa51bfd6cf45dee2da1b89b4 (diff)
downloadraylib-434a3a276df2f0a3dfe48b522a9e20abe8562fef.tar.gz
raylib-434a3a276df2f0a3dfe48b522a9e20abe8562fef.zip
REVIEWED: Define instancing API entry points for RPI
-rw-r--r--src/rlgl.h12
1 files 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/egl.h> // EGL library
#include <GLES2/gl2.h> // OpenGL ES 2.0 library
#include <GLES2/gl2ext.h> // 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