Windows: Fix up WindowsContextImplementation.nSetSwapInterval
This commit is contained in:
parent
985d0973a8
commit
6939f9170a
|
@ -97,12 +97,12 @@ final class WindowsContextImplementation implements ContextImplementation {
|
||||||
private static native boolean nIsCurrent(ByteBuffer context_handle) throws LWJGLException;
|
private static native boolean nIsCurrent(ByteBuffer context_handle) throws LWJGLException;
|
||||||
|
|
||||||
public void setSwapInterval(int value) {
|
public void setSwapInterval(int value) {
|
||||||
boolean success = nSetSwapInterval(value) == GL11.GL_TRUE ? true : false;
|
boolean success = nSetSwapInterval(value);
|
||||||
if (!success)
|
if (!success)
|
||||||
LWJGLUtil.log("Failed to set swap interval");
|
LWJGLUtil.log("Failed to set swap interval");
|
||||||
Util.checkGLError();
|
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 {
|
public void destroy(PeerInfo peer_info, ByteBuffer handle) throws LWJGLException {
|
||||||
nDestroy(handle);
|
nDestroy(handle);
|
||||||
|
|
|
@ -105,13 +105,14 @@ JNIEXPORT jboolean JNICALL Java_org_lwjgl_opengl_WindowsContextImplementation_nI
|
||||||
return wglGetCurrentContext() == context_info->context;
|
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) {
|
(JNIEnv *env, jclass clazz, jint value) {
|
||||||
WGLExtensions extensions;
|
WGLExtensions extensions;
|
||||||
extgl_InitWGL(&extensions);
|
extgl_InitWGL(&extensions);
|
||||||
if (extensions.WGL_EXT_swap_control) {
|
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
|
JNIEXPORT void JNICALL Java_org_lwjgl_opengl_WindowsContextImplementation_nDestroy
|
||||||
|
|
Loading…
Reference in New Issue