From 44f7c81567a224c0b2df422870871f3898d8caa0 Mon Sep 17 00:00:00 2001 From: "jul..om" Date: Tue, 5 Mar 2013 21:06:24 +0000 Subject: [PATCH] Fixes a bug in the support of vertical synchronization git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@10470 75d07b2b-3a1a-0410-a2c5-0572b91ccdca --- .../com/jme3/system/jogl/JoglAbstractDisplay.java | 15 ++++++--------- .../jme3/system/jogl/JoglNewtAbstractDisplay.java | 15 ++++++--------- 2 files changed, 12 insertions(+), 18 deletions(-) diff --git a/engine/src/jogl/com/jme3/system/jogl/JoglAbstractDisplay.java b/engine/src/jogl/com/jme3/system/jogl/JoglAbstractDisplay.java index cc3bd31cd..74525df7e 100644 --- a/engine/src/jogl/com/jme3/system/jogl/JoglAbstractDisplay.java +++ b/engine/src/jogl/com/jme3/system/jogl/JoglAbstractDisplay.java @@ -105,15 +105,12 @@ public abstract class JoglAbstractDisplay extends JoglContext implements GLEvent super.removeNotify(); } }; - if (settings.isVSync()) { - canvas.invoke(false, new GLRunnable() { - - public boolean run(GLAutoDrawable glad) { - canvas.getGL().setSwapInterval(1); - return true; - } - }); - } + canvas.invoke(false, new GLRunnable() { + public boolean run(GLAutoDrawable glad) { + canvas.getGL().setSwapInterval(settings.isVSync() ? 1 : 0); + return true; + } + }); canvas.setFocusable(true); canvas.requestFocus(); canvas.setSize(settings.getWidth(), settings.getHeight()); diff --git a/engine/src/jogl/com/jme3/system/jogl/JoglNewtAbstractDisplay.java b/engine/src/jogl/com/jme3/system/jogl/JoglNewtAbstractDisplay.java index 2df311df1..d17f47104 100644 --- a/engine/src/jogl/com/jme3/system/jogl/JoglNewtAbstractDisplay.java +++ b/engine/src/jogl/com/jme3/system/jogl/JoglNewtAbstractDisplay.java @@ -87,15 +87,12 @@ public abstract class JoglNewtAbstractDisplay extends JoglContext implements GLE caps.setNumSamples(settings.getSamples()); } canvas = GLWindow.create(caps); - if (settings.isVSync()) { - canvas.invoke(false, new GLRunnable() { - - public boolean run(GLAutoDrawable glad) { - canvas.getGL().setSwapInterval(1); - return true; - } - }); - } + canvas.invoke(false, new GLRunnable() { + public boolean run(GLAutoDrawable glad) { + canvas.getGL().setSwapInterval(settings.isVSync() ? 1 : 0); + return true; + } + }); canvas.requestFocus(); canvas.setSize(settings.getWidth(), settings.getHeight()); canvas.addGLEventListener(this);