Tweak CALayer mode to active correctly
This commit is contained in:
parent
02c0e80fb6
commit
fc9e4f4bda
|
@ -111,6 +111,8 @@ final class MacOSXDisplay implements DisplayImplementation {
|
||||||
|
|
||||||
private native int nGetHeight(ByteBuffer window_handle);
|
private native int nGetHeight(ByteBuffer window_handle);
|
||||||
|
|
||||||
|
private native boolean nIsNativeMode(ByteBuffer peer_info_handle);
|
||||||
|
|
||||||
private static boolean isUndecorated() {
|
private static boolean isUndecorated() {
|
||||||
return Display.getPrivilegedBoolean("org.lwjgl.opengl.Window.undecorated");
|
return Display.getPrivilegedBoolean("org.lwjgl.opengl.Window.undecorated");
|
||||||
}
|
}
|
||||||
|
@ -125,8 +127,6 @@ final class MacOSXDisplay implements DisplayImplementation {
|
||||||
|
|
||||||
close_requested = false;
|
close_requested = false;
|
||||||
|
|
||||||
native_mode = isNativeMode();
|
|
||||||
|
|
||||||
DrawableGL gl_drawable = (DrawableGL)Display.getDrawable();
|
DrawableGL gl_drawable = (DrawableGL)Display.getDrawable();
|
||||||
PeerInfo peer_info = gl_drawable.peer_info;
|
PeerInfo peer_info = gl_drawable.peer_info;
|
||||||
ByteBuffer peer_handle = peer_info.lockAndGetHandle();
|
ByteBuffer peer_handle = peer_info.lockAndGetHandle();
|
||||||
|
@ -145,6 +145,9 @@ final class MacOSXDisplay implements DisplayImplementation {
|
||||||
current_viewport.put(3, mode.getHeight());
|
current_viewport.put(3, mode.getHeight());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
native_mode = nIsNativeMode(peer_handle);
|
||||||
|
|
||||||
} catch (LWJGLException e) {
|
} catch (LWJGLException e) {
|
||||||
destroyWindow();
|
destroyWindow();
|
||||||
throw e;
|
throw e;
|
||||||
|
@ -153,16 +156,6 @@ final class MacOSXDisplay implements DisplayImplementation {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean isNativeMode() {
|
|
||||||
//return true;
|
|
||||||
|
|
||||||
if (Display.isFullscreen() || Display.getParent() == null) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void doHandleQuit() {
|
public void doHandleQuit() {
|
||||||
synchronized (this) {
|
synchronized (this) {
|
||||||
close_requested = true;
|
close_requested = true;
|
||||||
|
|
|
@ -543,6 +543,16 @@ JNIEXPORT void JNICALL Java_org_lwjgl_opengl_MacOSXDisplay_nDestroyCALayer(JNIEn
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
JNIEXPORT jboolean JNICALL Java_org_lwjgl_opengl_MacOSXDisplay_nIsNativeMode(JNIEnv *env, jobject this, jobject peer_info_handle) {
|
||||||
|
MacOSXPeerInfo *peer_info = (MacOSXPeerInfo *)(*env)->GetDirectBufferAddress(env, peer_info_handle);
|
||||||
|
if (peer_info->isCALayer) {
|
||||||
|
return JNI_FALSE;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
return JNI_TRUE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
JNIEXPORT jint JNICALL Java_org_lwjgl_DefaultSysImplementation_getJNIVersion(JNIEnv *env, jobject ignored) {
|
JNIEXPORT jint JNICALL Java_org_lwjgl_DefaultSysImplementation_getJNIVersion(JNIEnv *env, jobject ignored) {
|
||||||
return org_lwjgl_MacOSXSysImplementation_JNI_VERSION;
|
return org_lwjgl_MacOSXSysImplementation_JNI_VERSION;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue