Skip to main content
GameDev.net gamedev.net
🔒 Locked

DisPlay List not working...

Started by corscaria Jun 27, 2004 at 12:27 AM 5 replies 1.2k views
Original Post
corscaria
corscaria
Ok, this is my first OpenGL project, and really i'm quite pleased with the results so far. it's an OpenGL renderer for Tiberian Sun and Red Alert 2 .vxl files. I was doing everything in immediate mode while i was debugging the code, and now i want to speed it up by using a Display List to store the Object after it's translated to polys, so i copied everything between glBegin and glEnd to a seperate function, added GLuint vxlObj; to the global variables, put vxlObj=glGenLists(1); glNewList(vxlObj, GL_COMPILE); before glBegin(GL_TRIANGLES);, put glEndList(); after glEnd(); and added glCallList(vxlObj); to DrawGLScene() inplace of the code i moved. the debugger shows it is iterating thru the code properly to create the polys but it appears the display list is empty. Anyone have anyclue what i'm doing wrong?
GamerSg
GamerSg
Quote:
Original post by Raduprv
Try to use Vertex Arrays instead of display lists. From my observations, the VA is faster (and gives you more freedom).


Not true, You can put anything in display lists(Vertex Arrays included). Display Lists perform as well as VBOs for static meshes(On newer drivers). Vertex Arrays requires sending geometry over the bus everyframe and is slower than having it stored on the gfx card.

The only time you should not use Display Lists is if you are using VBOs or your data is dynamic.
HellRaiZer
HellRaiZer
Try tracking OpenGL errors before and after the DL creation, and before and calling the list for rendering.

e.g.

void Init(void){  GLenum error = glGetError();  if(!error)     CreateDList();  else  {     // something wrong happened before the list creation.     // Or something didn't happened (no RC!!).  }  error = glGetError();  if(error)  {     // something wrong happened while creating the DL.     // Place more glGetError() in the CreateDList() func.  }}


Do the same for the rendering function.
If no errors appear, then try disabling/enabling textures, lights, etc.

Hope it helps.

HellRaiZer
HellRaiZer
_the_phantom_
_the_phantom_
Quote:
Original post by GamerSg
Not true, You can put anything in display lists(Vertex Arrays included). Display Lists perform as well as VBOs for static meshes(On newer drivers). Vertex Arrays requires sending geometry over the bus everyframe and is slower than having it stored on the gfx card.

The only time you should not use Display Lists is if you are using VBOs or your data is dynamic.


I'll second that, with the observation that for best speeds you shouldnt mix state changes with vertex data in a DL, it allows the driver to do a much better job at optermising it.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.