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 2 of 2

Thread: Loaded texture parameters?

  1. #1
    Intern Contributor
    Join Date
    Aug 2002
    Posts
    95

    Loaded texture parameters?

    If I load a 2D texture with these parameters.
    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);

    Then later on in the code I wish to change to these parameters for the same texture.
    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);

    Is that a valid call, and will it actualy change the rendering of that texture? Or will the first values always be used?

  2. #2
    Junior Member Regular Contributor
    Join Date
    Apr 2001
    Location
    U.S.
    Posts
    149

    Re: Loaded texture parameters?

    Just be sure to bind (make active) the texture that you want to change the parameter for.
    Code :
    DrawCb()
    {
       ...
       glBindTexture(GL_TEXTURE_2D, textureName);
       if(usingLinear == true))
          glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
       else
          glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
       ...
    }

Posting Permissions

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