From 82ccd850d23b6d615d2641671b11bc34e4d44217 Mon Sep 17 00:00:00 2001 From: Julien Gouesse Date: Sat, 15 Feb 2014 14:48:24 +0100 Subject: glFlush() shouldn't be called just before swapBuffers() in the JOGL renderer --- .../src/main/java/com/ardor3d/renderer/jogl/JoglRenderer.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'ardor3d-jogl/src/main/java') diff --git a/ardor3d-jogl/src/main/java/com/ardor3d/renderer/jogl/JoglRenderer.java b/ardor3d-jogl/src/main/java/com/ardor3d/renderer/jogl/JoglRenderer.java index 1e15e65..e11ce4e 100644 --- a/ardor3d-jogl/src/main/java/com/ardor3d/renderer/jogl/JoglRenderer.java +++ b/ardor3d-jogl/src/main/java/com/ardor3d/renderer/jogl/JoglRenderer.java @@ -223,11 +223,8 @@ public class JoglRenderer extends AbstractRenderer { @Override public void flushFrame(final boolean doSwap) { - final GL gl = GLContext.getCurrentGL(); - renderBuckets(); - gl.glFlush(); if (doSwap) { doApplyState(defaultStateList.get(RenderState.StateType.ColorMask)); @@ -241,6 +238,11 @@ public class JoglRenderer extends AbstractRenderer { if (Constants.stats) { StatCollector.endStat(StatType.STAT_DISPLAYSWAP_TIMER); } + } else { + // this call is not necessary just before swapBuffers(), see: + // http://www.opengl.org/wiki/Common_Mistakes#glFinish_and_glFlush + final GL gl = GLContext.getCurrentGL(); + gl.glFlush(); } if (Constants.stats) { -- cgit v1.2.3