How I used glTexStorage
#define GL_GLEXT_PROTOTYPES
#include <gl2ext.h>
So glTexStorage2DEXT
is direct symbol.
However I also checked eglGetProcAddress()
, they are the same address.
Code snippet :
glGenTextures(1, &tex);
glBindTexture(GL_TEXTURE_2D, tex);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
Then this gives GL_INVALID_OPERATION
on glTexSubImage2D
:
glTexStorage2DEXT(GL_TEXTURE_2D, 1, GL_RGBA8_OES, w, h);
glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, w, h, GL_RGBA, GL_UNSIGNED_BYTE, data);
But this doesn't give error:
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, w, h, 0, GL_RGBA, GL_UNSIGNED_BYTE, data);
glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, w, h, GL_RGBA, GL_UNSIGNED_BYTE, data);
What's wrong with my use of glTexStorage2DEXT
?