Quote Originally Posted by wmelgaard View Post
My model() function is very efficient in terms of memory, but not speed. That was not a problem until I tried to rotate it. if I generate a Vertex Buffer Object as malexander suggests, that would probably cure my problem. I can even create the VBO in background. However, I have never created a VBO before, and the example in the Red Book is rather cryptic.
The question is why do you generate stuff every frame if there are no animated deformations applied to geometry? As malexander already said - pre-generate it once at startup, store the data and then draw each frame using that data. You can draw from the same data via ram arrays or VBO arrays or even in immediate mode. If you continue to generate the data each frame, no VBOs will help you. In fact they'll make things worse as you'll need additional frame-time to upload the data to VRAM.

VBO code is very similar to ram arrays code. So get ram arrays working first (glDrawElements() etc.). Switching to VBOs from there is rather trivial. Same data just needs to be uploaded to the gpu memory.