Fixes a bug in the support of vertical synchronization

git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@10470 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
3.0
jul..om 12 years ago
parent a5c19f54c3
commit 44f7c81567
  1. 15
      engine/src/jogl/com/jme3/system/jogl/JoglAbstractDisplay.java
  2. 15
      engine/src/jogl/com/jme3/system/jogl/JoglNewtAbstractDisplay.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());

@ -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);

Loading…
Cancel
Save