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: precompiled objects

  1. #1
    Junior Member Newbie
    Join Date
    Jul 2002
    Location
    Denmark
    Posts
    14

    precompiled objects

    How do one precompiled objects ?

    Jakob

  2. #2
    Member Regular Contributor
    Join Date
    Jul 2001
    Posts
    352

    Re: precompiled objects

    You mean, display lists ?
    Here's how :

    //first, get an id for our display list
    unsigned int list_id;
    glGenLists (1, &list_id);

    //begin compiling
    glNewList (list_id, GL_COMPILE);

    //all what you draw here will be compiled, and will have no immediate effect on the screen

    DrawMyObject ();

    //stop compiling
    glEndList

    Later in your code, if you want to draw your object, instead of calling

    DrawMyObject ();

    just call

    glCallList (list_id);

  3. #3
    Junior Member Newbie
    Join Date
    Jul 2002
    Location
    Denmark
    Posts
    14

    Re: precompiled objects

    Thanks a lot Jakob

    Originally posted by Morglum:
    You mean, display lists ?
    Here's how :

    //first, get an id for our display list
    unsigned int list_id;
    glGenLists (1, &list_id);

    //begin compiling
    glNewList (list_id, GL_COMPILE);

    //all what you draw here will be compiled, and will have no immediate effect on the screen

    DrawMyObject ();

    //stop compiling
    glEndList

    Later in your code, if you want to draw your object, instead of calling

    DrawMyObject ();

    just call

    glCallList (list_id);

Posting Permissions

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