derbachii

12-05-2008, 07:46 AM

Hi,

I'm trying to diplay a really big triangular mesh 4000000+ triangles using OpenGL (windows) with display lists.

creating the display list as follows:

GLuint createLT(CDT* cdt,GLint num)

{

GLuint dl1 = glGenLists(num);

int error = glGetError();

if (error != GL_NO_ERROR) {

std::cout << "An OpenGL error has occured: " << gluErrorString(error) << std::endl;

}

cout<<"Creating DisplayLists "<<"...";

CDT_Finite_faces_iterator fit = cdt->finite_faces_begin();

int counter = 0;

glNewList(num,GL_COMPILE);

glBegin(GL_TRIANGLES);

for ( ;fit!=cdt->finite_faces_end();++fit)

{

if (fit->is_in_domain())

{

glColor3f(1.0f,1.0f,1.0f);

glVertex3f(fit->vertex(0)->point().x(),fit->vertex(0)->point().y(),0.0f);

glVertex3f(fit->vertex(1)->point().x(),fit->vertex(1)->point().y(),0.0f);

glVertex3f(fit->vertex(2)->point().x(),fit->vertex(2)->point().y(),0.0f);

}

}

glEnd();

glEndList();

cout<<"done"<<endl;

return dl1;

}

After calling this function, glGetError() returns "out of memory". Why?

4Million triangles each with 3x3 float values -> 137 Megabytes (if i'm calculating correctly).

My System: nvidia 8800 GTS (512 Mb), Q6600, 4Gb ram, windows xp (32bit)

Now my question:

Is there a certain size-limit for display lists?

or is this the wrong way to display this amount of data?

thanks in advance.

Daniel.

I'm trying to diplay a really big triangular mesh 4000000+ triangles using OpenGL (windows) with display lists.

creating the display list as follows:

GLuint createLT(CDT* cdt,GLint num)

{

GLuint dl1 = glGenLists(num);

int error = glGetError();

if (error != GL_NO_ERROR) {

std::cout << "An OpenGL error has occured: " << gluErrorString(error) << std::endl;

}

cout<<"Creating DisplayLists "<<"...";

CDT_Finite_faces_iterator fit = cdt->finite_faces_begin();

int counter = 0;

glNewList(num,GL_COMPILE);

glBegin(GL_TRIANGLES);

for ( ;fit!=cdt->finite_faces_end();++fit)

{

if (fit->is_in_domain())

{

glColor3f(1.0f,1.0f,1.0f);

glVertex3f(fit->vertex(0)->point().x(),fit->vertex(0)->point().y(),0.0f);

glVertex3f(fit->vertex(1)->point().x(),fit->vertex(1)->point().y(),0.0f);

glVertex3f(fit->vertex(2)->point().x(),fit->vertex(2)->point().y(),0.0f);

}

}

glEnd();

glEndList();

cout<<"done"<<endl;

return dl1;

}

After calling this function, glGetError() returns "out of memory". Why?

4Million triangles each with 3x3 float values -> 137 Megabytes (if i'm calculating correctly).

My System: nvidia 8800 GTS (512 Mb), Q6600, 4Gb ram, windows xp (32bit)

Now my question:

Is there a certain size-limit for display lists?

or is this the wrong way to display this amount of data?

thanks in advance.

Daniel.