What for can be used GL_COMPILE_AND_EXECUTE in glNewList() ? A good example?

anything that can be used for one can be used for the other

the difference
compile just compiles
compile and execute compiles and then executes

so if you use compile you have to call the list before anything will be rendered

in compile and execute the first time it will be executed automatically

I always use compile
Some people say that compile provides better performance than compile and execute also

W-e-l-l… compile & executes is not necessarily compile and THEN execute, it could jsut as easily be compile as you execute. The difference is the pipline… h/w can easily dup the primitive and send one copy to the rasteriser and another to the thing that compiles the data.

Why is this important, or–indeed–different depends on what you want to use it for. From my own exerience, I used compile and execute when I did something dynamic for one frame, but knew I would be doing the same thing for a couple of frames in the future… so I’d compile the geometry AS I WAS DRAWING IT for the first frame.

oh, and it helped that it was on an SGI Onyx2, and compile and executing seemed to be about the same speed as just executing (COMPILE FOR FREE! lamost

hope this helps.

Just a remark here for you guys :

I discovered when I received my ELSA Erazor X2 (GeForce DDR 32Mb) that using GL_COMPILE +glCallList was a lot faster (factor 10 at least !) than using GL_COMPILE_AND_EXECUTE. Even the display list produced by the two tokens does not execute at the same speed : the first one is a lot (A LOT !) faster to call !

You might think I had done something wrong but NO : I mentioned it on this very web site (I think it was in the old forum but I am not sure) and other people tried and SAW the difference !

So be aware : prefer GL_COMPILE and then call your list than GL_COMPILE_AND_EXECUTE !



P.S. : if you use the Find All Posts option on me, you might be able to locate the thread (if it is still here…)

Yes, yes, but like everything it’s implementation dependent. Want to bet that my SGI has problems doing compile and execute?

the moral of this story, as always is: profile first.


if(!use_compile_and_execute) {
} else {