I recently upgraded LWJGL from 0.99 to 1.1.1 in JEmu2.
Everything seems to work fine, except vsync seems to be very dodgy now. It occasionally works, but most of the time it doesn’t and the games run way too fast. Using 0.99 it worked just fine.
Anything changed that I need to be aware of?
If vsync is set to always off on the driver side you cannot enable it. Always back it up with a capping method (such as Display.sync).
It’s not turned off in the driver. Like I said, vsync works fine using LWJGL 0.99, it just doesn’t work for me anymore in 1.1.1
There’s throttling too in JEmu2, but that’s not the point; I want to use vsync to prevent tearing.
yeah, regardless of driver settings - it worked in .99 - I am not sure what changed tho… I 'll try and talk to elias to see if he has a clue
yeah, regardless of driver settings - it worked in .99
Naaah. Usually there is:
-always off
-off by default
-on by default
-always on
Only with “off by default” and “on by default” you can change it from the program side. Setting the swap interval is only some kind of hint… nothing more… nothing less.
Oh sure, but I think you’re missing the point.
The thing is, that hint doesn’t seem to work anymore since 1.1.1, at least on my machine 
Unless the driver is set to ‘always off’, I should be able to get vsync. Until 0.99 this worked fine. Since I upgraded to 1.1.1, it doesn’t.
Oh sure, but I think you’re missing the point.
He said “regardless of driver setting”. I know that you meant something different. 
heh, I actually meant what eric said. :
if it worked in 99 and doesn’t work in 1.1 - with the same drivers/settings, then there is an issue!
Do you want me to create a small test case?
I just tried the org.lwjgl.test.input.MouseTest and vsync on/off worked fine. So I am not sure what the issue is ???
Hm, I just tried it on another PC and there it works just fine…
I also tried it at again on my laptop (with Intel gfx) with both 0.99 and 1.1.1, and 0.99 works without problems but in 1.1.1 vsync doesn’t work.
So I guess there must have been some change in vsync handling between LWJGL 0.99 and 1.1.1, which doesn’t work with my (perhaps crappy) video drivers.
you could maybe try a few other releases between 0.99 and 1.1.1, would help to find in which release the problem appeared, and help narrow down which changes to the lwjgl code bring about this problem on your card.
Yes, that’s exactly what I just did 
The problem appeared in 1.0 rc-1
EDIT: The .dll of beta 4 and rc-1 are exactly the same size, so a wild guess would be that it’s in the java part. I’ll check to see what’s changed there.
Not sure what exactly is going on yet, but there is a difference in setting vsync.
In the JNI code in beta 4:
JNIEXPORT void JNICALL Java_org_lwjgl_opengl_WindowsContextImplementation_nSetSwapInterval
(JNIEnv *env, jclass clazz, jobject context_handle, jint value) {
WindowsContext *context_info = (WindowsContext *)(*env)->GetDirectBufferAddress(env, context_handle);
if (context_info->extensions.WGL_EXT_swap_control) {
context_info->extensions.wglSwapIntervalEXT(value);
}
}
in rc-1:
JNIEXPORT void JNICALL Java_org_lwjgl_opengl_WindowsContextImplementation_nSetSwapInterval
(JNIEnv *env, jclass clazz, jobject context_handle, jint value) {
WGLExtensions extensions;
extgl_InitWGL(&extensions);
if (extensions.WGL_EXT_swap_control) {
extensions.wglSwapIntervalEXT(value);
}
}