Slowing Frame Rates and Display Lists
I'm using display lists to try and raise my framerate (currently hovering between 20-24 fps with only four objects on screen). I'm wondering if it's my display lists. They should increase fps a little, right?
My code looks like this:
It's only making one display list (i.e. it's not remaking it each time because of my if statements) so I'm not sure if this has anything to do with my framerate. Does this look alright or should I have fewer nested functions (and manually do the normal, t.c., and vertex without those functions)?
My code looks like this:
Code:
...
(Mesh::Update())
glNewList(list,GL_COMPILE);
for(int i=0; i<numFaces; i++)
{
f[i].Draw();
}
glEndList();
....
(Face::Draw())
texture.Bind();
glEnable(GL_TEXTURE_2D);
glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
if(textureLevel==NO_TEXTURE)
{
glDisable(GL_TEXTURE_2D);
glColor4f(.7,.7,.7,1);
}
if(numVertices==3) { glBegin(GL_TRIANGLES); }
if(numVertices==4) { glBegin(GL_QUADS); }
for(int i=0; i<numVertices; i++)
{
vn[i].MakeGLN(); //make a normal
tc[i].MakeGLT(); //make the texture coordinates
v[i].MakeGLV(); //make the vertex
}
glEnd();
...It's only making one display list (i.e. it's not remaking it each time because of my if statements) so I'm not sure if this has anything to do with my framerate. Does this look alright or should I have fewer nested functions (and manually do the normal, t.c., and vertex without those functions)?
This may or may not be related to what you're doing, but a member of our local IGDA group was telling me that Apple has some issues with display lists and speed. Something about how using certain types of objects with them will cause it to manually resubmit the primitives instead of DMAing them directly.
Wish I could remember exactly what he said now...
Wish I could remember exactly what he said now...
http://developer.apple.com/graphicsimagi...index.html
On that page, there are a few "must read" tips on how to use display lists and how to order the elements you are drawing with OpenGL.
On that page, there are a few "must read" tips on how to use display lists and how to order the elements you are drawing with OpenGL.
If your bottleneck is submission, display lists will help. If your bottleneck is fill rate, display lists won't help at all.
You need to profile your app to figure out what part to spend time optimizing.
You need to profile your app to figure out what part to spend time optimizing.
But in the most broad terms, certainly display lists will show a dramatic speed improvement over immediate mode.
Possibly Related Threads...
| Thread: | Author | Replies: | Views: | Last Post | |
| Display Lists and Obj. File Loader Problems | merrill541 | 0 | 1,661 |
Oct 17, 2008 06:42 PM Last Post: merrill541 |
|
| Display Lists or Vertex Arrays with texturing | seven | 6 | 3,322 |
Oct 17, 2005 09:24 AM Last Post: seven |
|
| GLUT_ACCUM slowing down application 10x! | WhatMeWorry | 3 | 3,210 |
Jan 7, 2005 02:53 AM Last Post: arekkusu |
|
| More display lists not working... | SOUR-Monkey | 1 | 2,143 |
Dec 8, 2004 09:11 PM Last Post: SOUR-Monkey |
|
| Display Lists not working | Jake | 6 | 3,523 |
Dec 8, 2004 04:10 PM Last Post: TomorrowPlusX |
|

