Slowing Frame Rates and Display Lists

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:
        for(int i=0; i<numFaces; i++)
    glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
    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

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
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
Quote this message in a reply
Posts: 156
Joined: 2002.11
Post: #3

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
Posts: 1,234
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
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 2,846 Oct 17, 2008 06:42 PM
Last Post: merrill541
  Display Lists or Vertex Arrays with texturing seven 6 5,837 Oct 17, 2005 09:24 AM
Last Post: seven
  GLUT_ACCUM slowing down application 10x! WhatMeWorry 3 5,481 Jan 7, 2005 02:53 AM
Last Post: arekkusu
  More display lists not working... SOUR-Monkey 1 3,306 Dec 8, 2004 09:11 PM
Last Post: SOUR-Monkey
  Display Lists not working Jake 6 5,585 Dec 8, 2004 04:10 PM
Last Post: TomorrowPlusX