Slowing Frame Rates and Display Lists

Sage
Posts: 1,066
Joined: 2004.07
Post: #1
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:
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)?
Quote this message in a reply
Member
Posts: 198
Joined: 2005.01
Post: #2
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...

Cryptic Allusion Games / Cryptic Allusion, LLC
http://www.cagames.com/
Quote this message in a reply
Member
Posts: 156
Joined: 2002.11
Post: #3
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.
Quote this message in a reply
Sage
Posts: 1,232
Joined: 2002.10
Post: #4
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.
Quote this message in a reply
Member
Posts: 116
Joined: 2002.04
Post: #5
But in the most broad terms, certainly display lists will show a dramatic speed improvement over immediate mode.
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Display Lists and Obj. File Loader Problems merrill541 0 1,941 Oct 17, 2008 06:42 PM
Last Post: merrill541
  Display Lists or Vertex Arrays with texturing seven 6 3,819 Oct 17, 2005 09:24 AM
Last Post: seven
  GLUT_ACCUM slowing down application 10x! WhatMeWorry 3 3,580 Jan 7, 2005 02:53 AM
Last Post: arekkusu
  More display lists not working... SOUR-Monkey 1 2,364 Dec 8, 2004 09:11 PM
Last Post: SOUR-Monkey
  Display Lists not working Jake 6 3,855 Dec 8, 2004 04:10 PM
Last Post: TomorrowPlusX