zdebel
10-27-2007, 12:39 PM
Hello, first of all, to make things clear, I'm using GNU/Linux, with hardware acceleration (nvidia geforce 7300), and allegro-gl to make the setting up of opengl more simple. I'm learning opengl and already know a few things, but I stumbled upon a problem, which stops me from continuing my learning process. The problem is perfomance. Take a look at this piece of code, which is my displaying function:
while(1){
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glLoadIdentity();
glTranslatef(0.0f,0.0f,-20.0f);
glRotatef(anglex,0.0f,1.0f,0.0f);
glRotatef(angley,1.0f,0.0f,0.0f);
glCallList(whoa);
allegro_gl_flip();
glFinish();
if(key[KEY_ESC]) quit();
anglex++;
angley++;
}
I have a model loaded into a call list, as I've read that's the best way to speed things up. Sadly, the model is rotating pretty slow, let alone having 5 rotating models. So I'd like to ask you, what's the best approach for a drawing function, as I find the clear, add vertexes, add faces, add textures, etc. approach pretty slow. Isn't there a way that I have the model loaded up, and modify (rotate for example) the model IN the memory of the graphics card?
while(1){
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glLoadIdentity();
glTranslatef(0.0f,0.0f,-20.0f);
glRotatef(anglex,0.0f,1.0f,0.0f);
glRotatef(angley,1.0f,0.0f,0.0f);
glCallList(whoa);
allegro_gl_flip();
glFinish();
if(key[KEY_ESC]) quit();
anglex++;
angley++;
}
I have a model loaded into a call list, as I've read that's the best way to speed things up. Sadly, the model is rotating pretty slow, let alone having 5 rotating models. So I'd like to ask you, what's the best approach for a drawing function, as I find the clear, add vertexes, add faces, add textures, etc. approach pretty slow. Isn't there a way that I have the model loaded up, and modify (rotate for example) the model IN the memory of the graphics card?