The Khronos Group - a non-profit industry consortium to develop, publish and promote open standard, royalty-free media authoring and acceleration standards for desktop and handheld devices, combined with conformance qualification programs for platform and device interoperability.

If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

BindTexture vs. ActiveTexture

I'm a bit fuzzy on the usage of these. I understand that when setting up textures, you generate them, then bind to one and set parameters and load in graphic data.

When in the main rendering loop, though, can you simply call glActiveTexture() between calls to glDrawElements() or do you have to Bind as well?

If I can through another quick question in as well... I'm calling glGetIntegerv(GL_MAX_TEXTURE_UNITS, &maxtu); and when checking the value of maxtu, it's only 2. I'm testing this on an Android emulator... What I'm not totally clear on is if what determines what is set here. Is it the Android implementation of OpenGL ES (Which is 1.0 and very little 1.1 functionality) or the hardware (different phones, cpus, etc...)?

Re: BindTexture vs. ActiveTexture

I'm a bit fuzzy on the usage of these. I understand that when setting up textures, you generate them, then bind to one and set parameters and load in graphic data.

When in the main rendering loop, though, can you simply call glActiveTexture() between calls to glDrawElements() or do you have to Bind as well?

glActiveTexture simply selects the texture unit that will be affected by subsequent calls to other calls such as glBindTexture, glTexEnv*, gl*Tex*Image*, glTexParameter*, glGetTexEnv*, glGetTexParameter*, glEnable/Disable(GL_TEXTURE_2D), glMatrixMode(GL_TEXTURE).

You can imagine glActiveTexture simply specifying a hidden parameter to all these functions. On its own, it does nothing.

Note there is also glClientActiveTexture, which affects only the calls setting up texture coordinates:
glTexCoordPointer, glClientEnable/Disable(GL_TEXCOORD_ARRAY), glMultiTexCoord4*.

If I can through another quick question in as well... I'm calling glGetIntegerv(GL_MAX_TEXTURE_UNITS, &maxtu); and when checking the value of maxtu, it's only 2. I'm testing this on an Android emulator... What I'm not totally clear on is if what determines what is set here. Is it the Android implementation of OpenGL ES (Which is 1.0 and very little 1.1 functionality) or the hardware (different phones, cpus, etc...)?