Fixes a bug in the support of vertical synchronization
git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@10470 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user