Results 1 to 3 of 3

Thread: Binding Textures

  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 Lord
    Join Date
    Mar 2015
    Posts
    6,674
    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

Similar Threads

  1. Binding Index Buffer Before Binding Vertex Array Causes Black Screen.
    By babaliaris in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 05-14-2018, 04:14 PM
  2. textures : re-binding vs keep to different units
    By babis in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 07-26-2008, 05:27 AM
  3. Binding textures
    By enmaniac in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 11-30-2005, 12:19 AM
  4. I take it binding a lot of small textures is bad...
    By ToolChest in forum OpenGL: Advanced Coding
    Replies: 22
    Last Post: 03-09-2003, 10:29 AM
  5. Ways to avoid binding textures
    By imported_Theo in forum OpenGL: Advanced Coding
    Replies: 1
    Last Post: 01-17-2001, 03:52 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Proudly hosted by Digital Ocean