Reputation: 3652
It sounds simple, but I looked on various sites and it gives me only two parameters :
void glGenTextures(GLsizei n, GLuint * textures)
.. with explaination.
However when using OpenGL ES with android, that method doesn't exist, and I also saw multiple websites, source codes and tutorials using this method with three parameters, which for me doesn't give me a compiler error :
gl.glGenTextures(amountOfTexturesToMake, pointerToArray, 0);
.. what's that zero for? What is that third parameter ? Even tough I saw various people using it, I couldn't find a explaination of it .
Upvotes: 4
Views: 2875
Reputation: 66
The offset parameter specifies the starting index in the int array. It's a way to 'emulate' pointer arithemic.
the following
glGenTextures(n, (texture + offset))
could be "translated" to
gl.glGenTextures(n, textureArray, offset)
Upvotes: 5
Reputation: 22318
I'm pretty sure it's the array offset, i.e., the index where the first texture name (ID) is stored.
Upvotes: 2