What is exactly the difference between calling a command in a display list and calling a function (or method in Java) that calls the OpenGL command?
Is it faster to call it from a display list?
What is exactly the difference between calling a command in a display list and calling a function (or method in Java) that calls the OpenGL command?
Is it faster to call it from a display list?
Think of display lists to OpenGL the way you think of a C++ compiler to C++ code.
This is like calling OpenGL directly:
cc -o exec src.cxx
exec
cc -o exec src.cxx
exec
cc -o exec src.cxx
exec
…
and this is like calling it indirectly via a display list:
cc -o exec src.cxx
exec
exec
exec
exec
It depends on the command. If you have vertices, normals, texcoords, the driver can generate a VBO which would be faster for rendering.
For all other GL commands, no, it won’t be faster.
Ah, ok! Thanks for your answers. It made it more clear.