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

Thread: glIsList(),glGenLists()...arg!

  1. #1
    Junior Member Newbie
    Join Date
    Feb 2000
    Posts
    7

    glIsList(),glGenLists()...arg!

    Hi there. I'm having a problem with glGenLists and glIsList. I have a program that creates a grid with a user defined x and y. It generates a list to display the grid. That works fine the first time, but it fails if I try to delete the first list and create a new one. It simply displays the original list.

    I have a GLuint defined as a global. I get a list id using "grid=glGenLists(1)" and then create it with "glNewList(grid,GL_COMPILE)". This works fine and I get a display list id of "1". The next time I initiate the grid, I try to do a "if(glIsList(grid)) glDeleteLists(grid,1)". First of all, the glIsList never returns a value other than 0 (if I set it equal to a GLuint or '' if I set it equal to a GLboolean). Second, since the glDeleteLists is skipped, I get successive glGenLists(1) calls. So it should return something other than 1 since that's what I used the previous time, right? Nope, I get 1 every time... :P

    Am I missing something here?

    Thanks,
    Tad

  2. #2
    Advanced Member Frequent Contributor
    Join Date
    Feb 2000
    Location
    France
    Posts
    880

    Re: glIsList(),glGenLists()...arg!

    Hi !

    According to what you describe, there shouldn't be any problem...

    So you should post your code in the forum so that we can have a closer look : there must be a mistake somewhere !

    Just a question : are you sure your rendering context is current (wglMakeCurrent) when you call glIsList and glDeleteLists ?

    Eric

  3. #3
    Junior Member Newbie
    Join Date
    Feb 2000
    Posts
    7

    Re: glIsList(),glGenLists()...arg!

    Ah-ha! Thank you Eric, you hit the nail on the head.

    Since I have a dialog to enter the new map coordinates, I have to do a glutSetWindow() before calling glIsList and recreating the display list...

    Thanks!

    Tad

Posting Permissions

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