Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view
In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv14960/src/net/sourceforge/bprocessor/gl/view
Modified Files:
View.java
Log Message:
Introduced a global flag controlling the usage of display-lists
Index: View.java
===================================================================
RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/View.java,v
retrieving revision 1.206
retrieving revision 1.207
diff -C2 -d -r1.206 -r1.207
*** View.java 8 May 2007 08:16:40 -0000 1.206
--- View.java 8 May 2007 08:26:15 -0000 1.207
***************
*** 85,88 ****
--- 85,89 ----
private static final boolean FALSE = false;
+ private static final boolean DISP = false;
/** OBJECTS flag */
***************
*** 1650,1656 ****
Integer list = displayLists.get(s);
if (list == null) {
! list = gl.glGenLists(1);
! displayLists.put(s, list);
! gl.glNewList(list, GL.GL_COMPILE);
glu.gluTessBeginPolygon(tess, null);
Vertex norm = s.normal();
--- 1651,1659 ----
Integer list = displayLists.get(s);
if (list == null) {
! if (DISP) {
! list = gl.glGenLists(1);
! displayLists.put(s, list);
! gl.glNewList(list, GL.GL_COMPILE);
! }
glu.gluTessBeginPolygon(tess, null);
Vertex norm = s.normal();
***************
*** 1679,1685 ****
}
glu.gluTessEndPolygon(tess);
! gl.glEndList();
}
- gl.glCallList(list);
}
--- 1682,1692 ----
}
glu.gluTessEndPolygon(tess);
! if (DISP) {
! gl.glEndList();
! }
! }
! if (DISP) {
! gl.glCallList(list);
}
}
***************
*** 3371,3396 ****
if (entity instanceof Space) {
for (Surface s : ((Space)entity).getSurfaces()) {
! Integer which = displayLists.remove(s);
! if (which != null) {
! deletedLists.add(which);
}
}
} else if (entity instanceof Surface) {
! Integer which = displayLists.remove((Surface)entity);
! if (which != null) {
! deletedLists.add(which);
! }
! } else if (entity instanceof Geometric) {
! Geometric g = (Geometric)entity;
! Space sp = g.getOwner();
! for (Surface s : sp.getSurfaces()) {
! Integer which = displayLists.remove(s);
if (which != null) {
deletedLists.add(which);
}
}
} else if (entity instanceof Project) {
! deletedLists.addAll(displayLists.values());
! displayLists.clear();
} else if (entity instanceof Selection) {
/*for (Geometric g : (Selection)entity) {
--- 3378,3411 ----
if (entity instanceof Space) {
for (Surface s : ((Space)entity).getSurfaces()) {
! if (DISP) {
! Integer which = displayLists.remove(s);
! if (which != null) {
! deletedLists.add(which);
! }
}
}
} else if (entity instanceof Surface) {
! if (DISP) {
! Integer which = displayLists.remove((Surface)entity);
if (which != null) {
deletedLists.add(which);
}
}
+ } else if (entity instanceof Geometric) {
+ if (DISP) {
+ Geometric g = (Geometric)entity;
+ Space sp = g.getOwner();
+ for (Surface s : sp.getSurfaces()) {
+ Integer which = displayLists.remove(s);
+ if (which != null) {
+ deletedLists.add(which);
+ }
+ }
+ }
} else if (entity instanceof Project) {
! if (DISP) {
! deletedLists.addAll(displayLists.values());
! displayLists.clear();
! }
} else if (entity instanceof Selection) {
/*for (Geometric g : (Selection)entity) {
|