Window.isVSyncEnabled();
Since that method doesn’t check if vsync is enabled, it shouldn’t called that way imo, because that results only in confusion.
wasVSyncEnabled() would be a better name… and why not keep track of that flag on the java side?
JNIEXPORT jboolean JNICALL Java_org_lwjgl_opengl_Window_nSetVSyncEnabled
(JNIEnv * env, jclass clazz, jboolean sync)
{
if (extgl_Extensions.WGL_EXT_swap_control) {
if (sync == JNI_TRUE) {
wglSwapIntervalEXT(1);
return JNI_TRUE;
} else {
wglSwapIntervalEXT(0);
}
}
return JNI_FALSE;
}
And then just keep the flag on the java side. I mean… it’s no big deal and it’s one jni thing less.
And² there is also this method:
int wglGetSwapIntervalEXT(void) // gets the update frequency
It would be interesting to know what that method returns if vsync is set to “always off” and wglSwapIntervalEXT(int) was called before (with something >0). Because that “always off” case is the thing wich makes the isVSyncEnabled() call pretty useless.
I already tried finding that out by myself…
Ok. Tried it again (*) ;D
(* only with a nvidia board so far)
And wglGetSwapIntervalEXT() actually returns always 0 if vsync was set to “always off”. Sweet ;D
So… just a little change to the method, I posted above… like:
JNIEXPORT jboolean JNICALL Java_org_lwjgl_opengl_Window_nSetVSyncEnabled
(JNIEnv * env, jclass clazz, jboolean sync)
{
if (extgl_Extensions.WGL_EXT_swap_control) {
if (sync == JNI_TRUE) {
wglSwapIntervalEXT(1);
if (wglGetSwapIntervalEXT()>0) {
return JNI_TRUE;
}
} else {
wglSwapIntervalEXT(0);
}
}
return JNI_FALSE;
}
And the vsync stuff should be actually relyable then 
[sorry for the lack of structure/gramar/spellchecking - I’m really tired :P]
And even then it’s not accurate if you’re running in a window. Who knows whether it’s synced? Bah.
