Windows: Fix up WindowsContextImplementation.nSetSwapInterval

This commit is contained in:
Elias Naur 2007-05-27 15:32:25 +00:00
parent 985d0973a8
commit 6939f9170a
2 changed files with 6 additions and 5 deletions

View File

@ -97,12 +97,12 @@ final class WindowsContextImplementation implements ContextImplementation {
private static native boolean nIsCurrent(ByteBuffer context_handle) throws LWJGLException;
public void setSwapInterval(int value) {
boolean success = nSetSwapInterval(value) == GL11.GL_TRUE ? true : false;
boolean success = nSetSwapInterval(value);
if (!success)
LWJGLUtil.log("Failed to set swap interval");
Util.checkGLError();
}
private static native int nSetSwapInterval(int value);
private static native boolean nSetSwapInterval(int value);
public void destroy(PeerInfo peer_info, ByteBuffer handle) throws LWJGLException {
nDestroy(handle);

View File

@ -105,13 +105,14 @@ JNIEXPORT jboolean JNICALL Java_org_lwjgl_opengl_WindowsContextImplementation_nI
return wglGetCurrentContext() == context_info->context;
}
JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_WindowsContextImplementation_nSetSwapInterval
JNIEXPORT jboolean JNICALL Java_org_lwjgl_opengl_WindowsContextImplementation_nSetSwapInterval
(JNIEnv *env, jclass clazz, jint value) {
WGLExtensions extensions;
extgl_InitWGL(&extensions);
if (extensions.WGL_EXT_swap_control) {
extensions.wglSwapIntervalEXT(value);
}
return extensions.wglSwapIntervalEXT(value) ? JNI_TRUE : JNI_FALSE;
} else
return JNI_FALSE;
}
JNIEXPORT void JNICALL Java_org_lwjgl_opengl_WindowsContextImplementation_nDestroy