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

Thread: GenList and GenTextures

  1. #1
    Junior Member Newbie
    Join Date
    Nov 2007
    Posts
    22

    GenList and GenTextures

    Hi all

    I have problems with these funcs, I create a texture and than I bind the texture in more lists. But the texture are white, it's good for one list, why?
    How do I resolve it? Thanks

  2. #2
    Intern Contributor
    Join Date
    Aug 2004
    Posts
    52

    Re: GenList and GenTextures

    Have you enabled texturing?

    // Load the texture.
    GLuint texture = LoadTexture(...);

    // Compile list.
    GLuint list = glGenLists(1);
    glNewList(list, GL_COMPILE);
    glBindTexture(GL_TEXTURE_2D, texture);
    glEnable(GL_TEXTURE_2D);
    glEndList();

    // When rendering...
    glCallList(list);
    DrawGeometry();

    // When shutdown.
    glDeleteTextures(1, &texture);
    glDeleteLists(list, 1);

  3. #3
    Junior Member Newbie
    Join Date
    Nov 2007
    Posts
    22

    Re: GenList and GenTextures

    Yes the texturing is enabled, but I have this situation :

    GLuint list = glGenLists(1);
    glNewList(list, GL_COMPILE);
    glGenTextures(..);
    glEndList()

    GLuint list1 = glGenLists(1);
    glNewList(list1, GL_COMPILE);
    glBindTexture(Prevoius texture);
    glEndList()

    glCallList(list)
    glCallList(list1)



  4. #4
    Advanced Member Frequent Contributor
    Join Date
    May 2005
    Location
    Prague, Czech Republic
    Posts
    924

    Re: GenList and GenTextures

    The glGenTextures command is not recorded into the display list, it is executed immediatelly.

  5. #5
    Advanced Member Frequent Contributor
    Join Date
    Apr 2004
    Posts
    999

    Re: GenList and GenTextures

    You can't use glGenTextures in a display list.

    Certain commands, when called while compiling a display list, are not com-
    piled into the display list but are executed immediately. These commands fall in
    several categories including
    Display lists: GenLists and DeleteLists.
    Render modes: FeedbackBuffer, SelectBuffer, and RenderMode.
    Vertex arrays: ClientActiveTexture, ColorPointer, EdgeFlagPointer, Fog-
    CoordPointer, IndexPointer, InterleavedArrays, NormalPointer, Secondary-
    ColorPointer, TexCoordPointer, VertexAttribPointer, and VertexPointer.
    Client state: EnableClientState, DisableClientState, EnableVertexAttrib-
    Array, DisableVertexAttribArray, PushClientAttrib, and PopClientAttrib.
    Pixels and textures: PixelStore, ReadPixels, GenTextures, DeleteTextures,
    and AreTexturesResident.
    Occlusion queries: GenQueries and DeleteQueries.
    Vertex buffer objects: GenBuffers, DeleteBuffers, BindBuffer, BufferData,
    BufferSubData, MapBuffer, and UnmapBuffer.
    Program and shader objects: CreateProgram, CreateShader, DeletePro-
    gram, DeleteShader, AttachShader, DetachShader, BindAttribLocation,
    CompileShader, ShaderSource, LinkProgram, and ValidateProgram.
    GL command stream management: Finish and Flush.
    Other queries: All query commands whose names begin with Get and Is (see
    chapter 6).
    N.

  6. #6
    Junior Member Newbie
    Join Date
    Nov 2007
    Posts
    22

    Re: GenList and GenTextures

    Excuse me but does it fall? Or is it immediately executed?

  7. #7
    Advanced Member Frequent Contributor
    Join Date
    Apr 2004
    Posts
    999

    Re: GenList and GenTextures

    It's executed immediately, so in theory you can do it. It's just that the glGenTextures command won't be executed when you call the display list in the future using glCallList...

    N.

Posting Permissions

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