|
|
@ -2472,25 +2472,37 @@ void rlLoadExtensions(void *loader) |
|
|
|
} |
|
|
|
|
|
|
|
// Check instanced rendering support |
|
|
|
if (strcmp(extList[i], (const char *)"GL_ANGLE_instanced_arrays") == 0) // Web ANGLE |
|
|
|
{ |
|
|
|
glDrawArraysInstanced = (PFNGLDRAWARRAYSINSTANCEDEXTPROC)((rlglLoadProc)loader)("glDrawArraysInstancedANGLE"); |
|
|
|
glDrawElementsInstanced = (PFNGLDRAWELEMENTSINSTANCEDEXTPROC)((rlglLoadProc)loader)("glDrawElementsInstancedANGLE"); |
|
|
|
glVertexAttribDivisor = (PFNGLVERTEXATTRIBDIVISOREXTPROC)((rlglLoadProc)loader)("glVertexAttribDivisorANGLE"); |
|
|
|
|
|
|
|
if ((glDrawArraysInstanced != NULL) && (glDrawElementsInstanced != NULL) && (glVertexAttribDivisor != NULL)) RLGL.ExtSupported.instancing = true; |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
if ((strcmp(extList[i], (const char *)"GL_EXT_draw_instanced") == 0) && // Standard EXT |
|
|
|
(strcmp(extList[i], (const char *)"GL_EXT_instanced_arrays") == 0)) |
|
|
|
{ |
|
|
|
if (strstr(extList[i], (const char*)"instanced_arrays") != NULL) { //Broad check for instanced_arrays |
|
|
|
//Specific check |
|
|
|
if (strcmp(extList[i], (const char*)"GL_ANGLE_instanced_arrays") == 0) { //ANGLE |
|
|
|
glDrawArraysInstanced = (PFNGLDRAWARRAYSINSTANCEDEXTPROC)((rlglLoadProc)loader)("glDrawArraysInstancedANGLE"); |
|
|
|
glDrawElementsInstanced = (PFNGLDRAWELEMENTSINSTANCEDEXTPROC)((rlglLoadProc)loader)("glDrawElementsInstancedANGLE"); |
|
|
|
glVertexAttribDivisor = (PFNGLVERTEXATTRIBDIVISOREXTPROC)((rlglLoadProc)loader)("glVertexAttribDivisorANGLE"); |
|
|
|
} |
|
|
|
else if (strcmp(extList[i], (const char*)"GL_EXT_instanced_arrays") == 0) { //EXT |
|
|
|
glDrawArraysInstanced = (PFNGLDRAWARRAYSINSTANCEDEXTPROC)((rlglLoadProc)loader)("glDrawArraysInstancedEXT"); |
|
|
|
glDrawElementsInstanced = (PFNGLDRAWELEMENTSINSTANCEDEXTPROC)((rlglLoadProc)loader)("glDrawElementsInstancedEXT"); |
|
|
|
glVertexAttribDivisor = (PFNGLVERTEXATTRIBDIVISOREXTPROC)((rlglLoadProc)loader)("glVertexAttribDivisorEXT"); |
|
|
|
|
|
|
|
if ((glDrawArraysInstanced != NULL) && (glDrawElementsInstanced != NULL) && (glVertexAttribDivisor != NULL)) RLGL.ExtSupported.instancing = true; |
|
|
|
} else if (strcmp(extList[i], (const char*)"GL_NV_instanced_arrays") == 0) { //NVIDIA GLES |
|
|
|
glDrawArraysInstanced = (PFNGLDRAWARRAYSINSTANCEDEXTPROC)((rlglLoadProc)loader)("glDrawArraysInstancedNV"); |
|
|
|
glDrawElementsInstanced = (PFNGLDRAWELEMENTSINSTANCEDEXTPROC)((rlglLoadProc)loader)("glDrawElementsInstancedNV"); |
|
|
|
glVertexAttribDivisor = (PFNGLVERTEXATTRIBDIVISOREXTPROC)((rlglLoadProc)loader)("glVertexAttribDivisorNV"); |
|
|
|
} |
|
|
|
//The feature will only be marked as supported if the elements from GL_XXX_instanced_arrays are present |
|
|
|
if ((glDrawArraysInstanced != NULL) && (glDrawElementsInstanced != NULL) && (glVertexAttribDivisor != NULL)) RLGL.ExtSupported.instancing = true; |
|
|
|
} else if (strstr(extList[i], (const char*)"draw_instanced") != NULL) { |
|
|
|
|
|
|
|
//GL_ANGLE_draw_instanced doesn't exist |
|
|
|
if (strcmp(extList[i], (const char*)"GL_EXT_draw_instanced") == 0) { |
|
|
|
glDrawArraysInstanced = (PFNGLDRAWARRAYSINSTANCEDEXTPROC)((rlglLoadProc)loader)("glDrawArraysInstancedEXT"); |
|
|
|
glDrawElementsInstanced = (PFNGLDRAWELEMENTSINSTANCEDEXTPROC)((rlglLoadProc)loader)("glDrawElementsInstancedEXT"); |
|
|
|
} else if (strcmp(extList[i], (const char*)"GL_NV_draw_instanced") == 0) { |
|
|
|
glDrawArraysInstanced = (PFNGLDRAWARRAYSINSTANCEDEXTPROC)((rlglLoadProc)loader)("glDrawArraysInstancedNV"); |
|
|
|
glDrawElementsInstanced = (PFNGLDRAWELEMENTSINSTANCEDEXTPROC)((rlglLoadProc)loader)("glDrawElementsInstancedNV"); |
|
|
|
} |
|
|
|
|
|
|
|
//But the functions will at least be loaded if only GL_XX_EXT_draw_instanced exist |
|
|
|
if ((glDrawArraysInstanced != NULL) && (glDrawElementsInstanced != NULL) && (glVertexAttribDivisor != NULL)) RLGL.ExtSupported.instancing = true; |
|
|
|
} |
|
|
|
|
|
|
|
// Check NPOT textures support |
|
|
|