user717572
user717572

Reputation: 3652

parameters of glGenTexture?

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

Answers (2)

Steve K.
Steve K.

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

Brett Hale
Brett Hale

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

Related Questions