Results 1 to 2 of 2

Thread: glbindtexture

  1. #1
    Junior Member Newbie
    Join Date
    Feb 2000
    Preston, lancs, Uk


    How do I use glBindTexture? - all the source code I can find is hopelessly unreadable and the OpenGL help file I have skips over most of it conveniantly. Simple examples preferred with some doc. if poss

  2. #2
    Senior Member Frequent Contributor
    Join Date
    Feb 2000

    Re: glbindtexture

    After you first loaded a texture in opengl and assigned a number to it(using glGenTextures or else) you call glBindTexture(GL_TEXTURE_*, NUMBER_OF_YOUR_TEXTURE).
    (the * stand for 1D, 2D, 3D

    This will make your texture object active or "waiting to be called".

    example :

    GLuint texnum;
    //other texture info
    } texture;

    texture texobj[MAX_TEX_OBJECT]

    //create texture one
    //Set color in filter and etc.

    //create the other textures with the same template.

    After, when you get to the actual scene rendering and want to render using the first texture you call glBindTexture again(this time it will says to opengl use that texture for the next textures mapping if the number you pass to glBindTexture is one that has an active texture(that mean you already called glBind for it)).

    glBindTexture(GL_TEXTURE_*, texobj[0]);
    //render stuff that use the first texture

    glBindTexture(GL_TEXTURE_*, texobj[1];
    //render stuff using the second texture.

Similar Threads

  1. GlBindTexture?
    By Bagoj in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 02-09-2004, 10:19 PM
  2. Problem with glBindTexture
    By Caran Elmoth in forum OpenGL: Basic Coding
    Replies: 5
    Last Post: 06-20-2003, 06:35 AM
  3. Need help with glBindTexture
    By in forum OpenGL: Basic Coding
    Replies: 3
    Last Post: 12-01-2002, 01:31 PM
  4. problem with glBindTexture()
    By MickeyMouse in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 04-08-2002, 08:34 AM
  5. glBindTexture...
    By RandyU in forum OpenGL: Basic Coding
    Replies: 3
    Last Post: 01-17-2001, 01:12 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