passing Vertex +Face list to opengl

I have a Vertex List(consisting of x,y,z values for every Vertex) and a Face List(consisting of A,B C,specifieing 3 Vertices from Vertex List).Now the pseudo code for my pogram to Draw these Faces looks like this:
glBegin(GL_TRIANGLES);

for(i=0;i<=Number of faces;i++ {
glVertex3f(coords of A from Face[i]);
glVertex3f(coords of B from Face[i]);
glVertex3f(coords of C from Face[i]);
}
I there another,faster possibility to send such a Face List to OpenGl,than using this “not very smart” loop?
Perhaps there is a Function like glFaceList() or something like this?

I think you should use vertex arrays. Try looking info on glVertexPointer, glArrayElement.

Thanks Hude!
Abother question: can I expect better performance if I change to VertexArrays?

What perormance to expect if the scene consists of 500 Triangles one Texture without lightmap?(no matter how it is programmed).

My program runs with about 100FPS on a p2 450
+TNT 1.(64048032).
I don´t know if this is a good result.
Any suggestions would be nice.

Abother question: can I expect better performance if I change to VertexArrays?

Using vertex arrays saves a lot of OpenGL function calls. With just a few triangles you won’t notice it, but with a larger amount you’ll get remarkable better performance.

Strange thing:
After I had changed to VertexArrays,my program ran with 5 FPS lower
than with my old code.
For this benchmark I used a scene consisting of 8000 Triangles.
With my old code I got 25FPS and with the VertexArray only 20.
How is this possible?

My old code was replaced with:

glVertexPointer(3,GL_FLOAT,0,v_array);
glEnableClientState(GL_VERTEX_ARRAY);
glDrawarrays(GL_TRIANGLES,0,Num_Vertex);

//v_array is an array of floats storing the x,y,z,x,y,z,…(declared as float*v_array)
//Num_Vert is the number of vertices in the Scene(int Num_Vertex)

Any suggestions,please!!!

Hi!
Why doesnt´t anyone answer to my previos question???
I know nobody has to answer it.
I know so far you have answered a lot of my questions. (And are very thankful for you using your time to help me)

So I only want to know:
Does nobody know the answer or is the question formulated too bad or what else did I do wrong?

no no, i (and the others, i believe) have understood your problem

i usually don’t reply if a have nothing to say, or if i’m not sure about the answer.

about your problem, i had the same experience.
i don’t know exactly why vertex arrays behave this way, and that’s why i test various techniques on various systems.

i’m waiting someone with clues to post

Dolo//\ightY

I’m just guessing but it might be just a driver / implementation problem. At least with my updated GeForce drivers things boosted quite a lot…

I’m just guessing but it might be just a driver / implementation problem. At least with my updated GeForce drivers things boosted quite a lot…

This might be a possible solution but I cannot believe that 3D-Card Manufacturers write drivers in which the glDrawarrays Function is slower than the drawing of the same primitives with a “for{…}” loop.
This would mean programmers have to use Simple “for{…}” loops instead of pass arrays in one run to the 3DCard.
But,by the complexity of Hard- and Software today,nobody knows!

glDrawElements is faster than glDrawArrays, simply because the driver were optimised for that. There is also less repetitions of vertices using glDrawElements.

John Carmack talked about it(glDrawElements) in one of his old .plan and I guess the drivers writers listenned to him, because with glDrawElements, my programs are much faster than with for-loop or with glDrawArrays.

Looks like a good answer Gorg.
Do you know if there is an Archive with Carmack´s Plan Files somewhere on then net???
P.s.:Thank you for taking time to answer my questions guys!

the document by Carmack which you seek is available here: http://www.quake3arena.com/news/glopt.html

Thanks Bobtree!