Results 1 to 4 of 4

Thread: Display lists and textues... Something I should know?

  1. #1
    Guest

    Display lists and textues... Something I should know?

    Hi!

    Is it possible to bind a texture inside a display list... My code works if I bind it just before calling the display list, but not in the display list...

    Cheers...

  2. #2
    Member Contributor
    Join Date
    Feb 2000
    Location
    Brisbane,QLD, Australia
    Posts
    99

    Re: Display lists and textues... Something I should know?

    Yes this should work

    Here is some sample code..


    myDisplayListList = glGenLists(1); // start generation of the list
    glNewList(myDisplayList, GL_COMPILE);
    glBindTexture(GL_TEXTURE_2D, tList[myTextureObject]);
    glBegin (GL_TRIANGLES);

    ...
    ...
    ...

    glEnd ();
    glDisable(GL_TEXTURE_2D);
    glEndList();

  3. #3
    Senior Member OpenGL Guru
    Join Date
    Feb 2000
    Location
    Sweden
    Posts
    2,978

    Re: Display lists and textues... Something I should know?

    Hello

    Can the problem be that you bind new textures INSIDE glBegin() and glEnd()? Not sure you can do that. To change texture, this might work.

    glNewList()
    glBindTexture() bind texture one
    glBegin() draw first part
    .
    .
    .
    glEnd()
    glBindTexture() bind texture two
    glBegin() draw second part
    .
    .
    .
    glEnd()
    glEndList()

    Bob

  4. #4
    Senior Member Frequent Contributor
    Join Date
    Feb 2000
    Posts
    569

    Re: Display lists and textues... Something I should know?

    You can actually do it like they said, but from experience puting glBindtexture in the display list gave me a big performance hit.

Similar Threads

  1. Web GL and display lists
    By kavi in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 11-02-2011, 12:44 PM
  2. display lists
    By in forum OpenGL: Basic Coding
    Replies: 7
    Last Post: 12-01-2003, 06:01 AM
  3. regarding textues and lightening
    By karteek in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 03-13-2003, 01:29 AM
  4. Display Lists
    By 1000_Monkeys_Typing in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 10-29-2002, 02:59 PM
  5. display lists inside display lists...
    By architekt in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 05-22-2002, 08:55 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