Skip to content
Snippets Groups Projects
Commit 9e0a9803 authored by Christophe Geuzaine's avatar Christophe Geuzaine
Browse files

Use COMPILE_AND_EXECUTE and fix the if test.
parent fb1ef18c
No related branches found
No related tags found
No related merge requests found
// $Id: Mesh.cpp,v 1.54 2002-11-08 18:56:21 geuzaine Exp $ // $Id: Mesh.cpp,v 1.55 2002-11-08 23:35:41 geuzaine Exp $
// //
// Copyright (C) 1997 - 2002 C. Geuzaine, J.-F. Remacle // Copyright (C) 1997 - 2002 C. Geuzaine, J.-F. Remacle
// //
...@@ -122,13 +122,18 @@ void Draw_Mesh (Mesh *M) { ...@@ -122,13 +122,18 @@ void Draw_Mesh (Mesh *M) {
if(CTX.mesh.draw && CTX.render_mode != GMSH_SELECT){ if(CTX.mesh.draw && CTX.render_mode != GMSH_SELECT){
static int first = 1, listnum; static int first = 1, listnum;
if(CTX.mesh.display_lists && CTX.mesh.changed){ if(CTX.mesh.display_lists && CTX.mesh.changed){
if(first) listnum = glGenLists(1); if(first) listnum = glGenLists(1);
first = 0; first = 0;
printf("new list!\n"); //printf("new mesh display list\n");
glNewList(listnum, GL_COMPILE); glNewList(listnum, GL_COMPILE_AND_EXECUTE);
} }
if(!CTX.mesh.display_lists || (CTX.mesh.display_lists && CTX.mesh.changed)){
//printf("normal mesh drawing\n");
if(M->status >= 3 && (CTX.mesh.volumes || CTX.mesh.volumes_num)){ if(M->status >= 3 && (CTX.mesh.volumes || CTX.mesh.volumes_num)){
Tree_Action(M->Volumes, Draw_Mesh_Volumes); Tree_Action(M->Volumes, Draw_Mesh_Volumes);
} }
...@@ -150,12 +155,19 @@ void Draw_Mesh (Mesh *M) { ...@@ -150,12 +155,19 @@ void Draw_Mesh (Mesh *M) {
Tree_Action(M->Vertices, Draw_Mesh_Points); Tree_Action(M->Vertices, Draw_Mesh_Points);
} }
}
else{
//printf("calling mesh display list\n");
glCallList(listnum);
}
if(CTX.mesh.display_lists){ if(CTX.mesh.display_lists){
if(CTX.mesh.changed){ if(CTX.mesh.changed){
glEndList(); glEndList();
CTX.mesh.changed=0; CTX.mesh.changed=0;
} }
glCallList(listnum);
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment