How do one precompiled objects ?
Jakob
How do one precompiled objects ?
Jakob
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);
Thanks a lot Jakob
Originally posted by Morglum:
[b]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);[/b]