public synchronized void init(GLAutoDrawable gld) {
GL gl = glcanvas.getGL();//gld.getGL();
+
+ gl.glEnable(gl.GL_DOUBLEBUFFER);
+
gl.glClearColor(0.0f, 0.0f, 0.0f, 1.0f);
gl.glViewport(0, 0, 500, 300);
gl.glEnable(GL.GL_DEPTH_TEST);
GL gl = glcanvas.getGL();//drawable.getGL();
GLU glu = new GLU();
+ gl.glDrawBuffer(GL.GL_BACK);
+
+ if (updateVisibilities) {
+ updateVisibilities = false;
+ // update vertex visibilities
+ updateVisibility(gl);
+ }
+ gl.glDrawBuffer(GL.GL_BACK);
if (!mouseInside) gl.glClearColor(0.1f, 0.1f, 0.1f, 1.0f);
else gl.glClearColor(0.0f, 0.0f, 0.0f, 1.0f);
projection = Matrix.getProjectionMatrix(gl);
- if (updateVisibilities) {
- updateVisibilities = false;
- // update vertex visibilities
- updateVisibility(gl);
- }
-
if (updateClosest) {
updateClosest = false;
double dist = Double.MAX_VALUE;
}
}
}
+ gl.glFlush();
+ glcanvas.setAutoSwapBufferMode(false);
+ glcanvas.swapBuffers();
}
protected synchronized void updateVisibility(GL gl) {