1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49
|
@Override
public void display(GLAutoDrawable arg0) {
final GL gl = arg0.getGL();
gl.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT);
clearBackground(gl);
gl.glMatrixMode(gl.GL_MODELVIEW);
gl.glLoadIdentity();
gl.glTranslatef(0, 0, zoom);
switch (mode) {
default: {
gl.glLineWidth(this.getEdgesSize());
fps.draw();
System.out.println(fps.getString());
displayWorld(gl, false);
arg0.swapBuffers();
}
break;
case SELECT: {
gl.glDisable(gl.GL_DITHER);
displayWorld(gl, true);
if (mousePosition != null) {
if(this.selectedNodes.size()==0){
try{
checkFalseColor(gl);
}catch(NamekException ne){
JOptionPane.showMessageDialog(null,
ne.getMessage(), "Error",
JOptionPane.ERROR_MESSAGE);
ne.printStackTrace(System.err);
System.exit(ne.hashCode());
}
}
else{
moveObjects(gl);
}
gl.glEnable(gl.GL_DITHER);
mode = Render.NORMAL;
}
}
break;
}
GLUtil.manageError(gl);
gl.glFlush();
} |
Partager