Results 1 to 2 of 2

Thread: BindTexture vs. ActiveTexture

  1. #1
    Junior Member
    Join Date
    Nov 2009
    Posts
    21

    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...)?

  2. #2
    Senior Member
    Join Date
    May 2006
    Posts
    353

    Re: BindTexture vs. ActiveTexture

    Quote Originally Posted by maximus-dev
    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...)?
    Typically that's a hardware limitation (unless it's a software OpenGL ES implementation, obviously).
    Georg Kolling, Imagination Technologies
    Please ask questions specific to PowerVR hardware or SDKs on the PowerVR Insider Forum
    DevTech@imgtec.com | http://www.powervrinsider.com

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •