diff options
Diffstat (limited to 'src/com/mbien/opencl/demos/joglinterop/GLCLInteroperabilityDemo.java')
-rw-r--r-- | src/com/mbien/opencl/demos/joglinterop/GLCLInteroperabilityDemo.java | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/com/mbien/opencl/demos/joglinterop/GLCLInteroperabilityDemo.java b/src/com/mbien/opencl/demos/joglinterop/GLCLInteroperabilityDemo.java index 8c53dd2..067e113 100644 --- a/src/com/mbien/opencl/demos/joglinterop/GLCLInteroperabilityDemo.java +++ b/src/com/mbien/opencl/demos/joglinterop/GLCLInteroperabilityDemo.java @@ -179,10 +179,13 @@ public class GLCLInteroperabilityDemo implements GLEventListener { public void display(GLAutoDrawable drawable) { - computeHeightfield(); - GL2 gl = drawable.getGL().getGL2(); + // ensure pipeline is clean before doing cl work + gl.glFinish(); + + computeHeightfield(); + gl.glClear(GL2.GL_COLOR_BUFFER_BIT | GL2.GL_DEPTH_BUFFER_BIT); gl.glLoadIdentity(); @@ -199,8 +202,6 @@ public class GLCLInteroperabilityDemo implements GLEventListener { gl.glDisableClientState(GL2.GL_VERTEX_ARRAY); // gl.glBindBuffer(GL2.GL_ARRAY_BUFFER, 0); - - gl.glFinish(); } |