Corrected web issue
This commit is contained in:
parent
7eb488a350
commit
3f7b14aeed
1 changed files with 1 additions and 13 deletions
14
src/rlgl.h
14
src/rlgl.h
|
@ -1559,8 +1559,6 @@ void rlglInit(int width, int height)
|
|||
// NOTE: Only check on OpenGL ES, OpenGL 3.3 has VAO support as core feature
|
||||
if (strcmp(extList[i], (const char *)"GL_OES_vertex_array_object") == 0)
|
||||
{
|
||||
vaoSupported = true;
|
||||
|
||||
// The extension is supported by our hardware and driver, try to get related functions pointers
|
||||
// NOTE: emscripten does not support VAOs natively, it uses emulation and it reduces overall performance...
|
||||
glGenVertexArrays = (PFNGLGENVERTEXARRAYSOESPROC)eglGetProcAddress("glGenVertexArraysOES");
|
||||
|
@ -1568,19 +1566,9 @@ void rlglInit(int width, int height)
|
|||
glDeleteVertexArrays = (PFNGLDELETEVERTEXARRAYSOESPROC)eglGetProcAddress("glDeleteVertexArraysOES");
|
||||
//glIsVertexArray = (PFNGLISVERTEXARRAYOESPROC)eglGetProcAddress("glIsVertexArrayOES"); // NOTE: Fails in WebGL, omitted
|
||||
|
||||
if (glGenVertexArrays == NULL) printf("glGenVertexArrays is NULL.\n"); // WEB: ISSUE FOUND! ...but why?
|
||||
if (glBindVertexArray == NULL) printf("glBindVertexArray is NULL.\n"); // WEB: ISSUE FOUND! ...but why?
|
||||
if ((glGenVertexArrays != NULL) && (glBindVertexArray != NULL) && (glDeleteVertexArrays != NULL)) vaoSupported = true;
|
||||
}
|
||||
|
||||
// TODO: HACK REVIEW!
|
||||
// For some reason on raylib 2.5, VAO usage breaks the build
|
||||
// error seems related to function pointers but I can not get detailed info...
|
||||
// Avoiding VAO usage is the only solution for now... :(
|
||||
// Ref: https://emscripten.org/docs/porting/guidelines/function_pointer_issues.html
|
||||
#if defined(PLATFORM_WEB)
|
||||
vaoSupported = false;
|
||||
#endif
|
||||
|
||||
// Check NPOT textures support
|
||||
// NOTE: Only check on OpenGL ES, OpenGL 3.3 has NPOT textures full support as core feature
|
||||
if (strcmp(extList[i], (const char *)"GL_OES_texture_npot") == 0) texNPOTSupported = true;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue