Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 3 of 3

Thread: Binding Textures

Hybrid View

  1. #1
    Senior Member OpenGL Pro
    Join Date
    Jan 2012
    Location
    Australia
    Posts
    1,117

    Binding Textures

    Is this valid
    Code :
    glActiveTexture(GL_TEXTURE0);
    glBindTexture(GL_TEXTURE2D, TextureID_01);
    render
    glBindTexture(GL_TEXTURE2D, TextureID_02);
    render
    glBindTexture(GL_TEXTURE2D, TextureID_03);
    render
    glBindTexture(GL_TEXTURE2D, 0);

    Or do I have to unbind before I can bind a new texture?

  2. #2
    Senior Member OpenGL Guru
    Join Date
    May 2009
    Posts
    4,948
    Yes, it is legal to bind another object on top of an object. That unbinds the bound object and binds the other.

    Also, the wiki covers this.

  3. #3
    Senior Member OpenGL Pro
    Join Date
    Jan 2012
    Location
    Australia
    Posts
    1,117
    Thanks - I just had a lose of faith while trying to debug some code that is behaving strangely

Posting Permissions

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