Results 1 to 3 of 3

Thread: glCallList() probelem

  1. #1
    Join Date
    Feb 2009
    Posts
    189
    Thanks
    2

    Default glCallList() probelem

    Friends
    This is an opengl question.
    I am trying to call opengl items using
    glCallList(index)
    While i was creating many objects I was holding their indices in an array and while I am trying to display one at a time by calling
    glCallList(index); passing the index.
    But its displaying the most recent object created.
    While the index value is correct but its not displaying previousobjects.

    Can anyone help me undertsnad whats going on !
    Any help would be appraciated.

    Thanks
    sujan

  2. #2
    Join Date
    Sep 2009
    Posts
    36
    Thanks
    4
    Thanked 5 Times in 5 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: glCallList() probelem

    Give me some code and I "may" be able to help you.

  3. #3
    Join Date
    Feb 2007
    Location
    Karlsruhe, Germany
    Posts
    469
    Thanks
    17
    Thanked 90 Times in 88 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: glCallList() probelem

    Some code would be great, yes.

    It sounds though, as your displaylist compilation is screwed up.

    did you do it roughly along these lines:

    Qt Code:
    1. Rendering:
    2.  
    3. int baseidx = glGenLists(itemcount);
    4. for (int i=0;i < itemcount;++i)
    5. {
    6. glNewList(baseidx+i, GL_COMPILE);
    7. // Render the item
    8. glEndList();
    9. }
    10. ...
    11. Drawing:
    12.  
    13. for (int i=0;i < itemcount;++i)
    14. {
    15. glCallList(baseidx+i);
    16. }
    To copy to clipboard, switch view to plain text mode 
    You can of course also generate the list for each item separately. But you would need to save each index then.

    Cheers

    Johannes

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.