mirror of
https://github.com/AngelAuraMC/Amethyst-Android.git
synced 2025-09-13 14:51:51 -04:00
Call eglGetDisplay() before make current to no context
This commit is contained in:
parent
696c415564
commit
8331aeaf73
@ -49,17 +49,19 @@ JNIEXPORT jboolean JNICALL Java_org_lwjgl_glfw_GLFW_nativeEglInit(JNIEnv* env, j
|
||||
}
|
||||
|
||||
JNIEXPORT jboolean JNICALL Java_org_lwjgl_glfw_GLFW_nativeEglMakeCurrent(JNIEnv* env, jclass clazz) {
|
||||
eglMakeCurrent(potatoBridge.eglDisplay, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT);
|
||||
|
||||
if (potatoBridge.eglContext == NULL || potatoBridge.eglContext == EGL_NO_CONTEXT) {
|
||||
printf("EGLBridge: Initializing\n");
|
||||
printf("ANativeWindow pointer = %p\n", potatoBridge.androidWindow);
|
||||
|
||||
if (potatoBridge.eglDisplay == NULL || potatoBridge.eglDisplay == EGL_NO_DISPLAY) {
|
||||
potatoBridge.eglDisplay = eglGetDisplay(EGL_DEFAULT_DISPLAY);
|
||||
if (potatoBridge.eglDisplay == EGL_NO_DISPLAY) {
|
||||
printf("Error: eglGetDefaultDisplay() failed: %p\n", eglGetError());
|
||||
return JNI_FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
eglMakeCurrent(potatoBridge.eglDisplay, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT);
|
||||
|
||||
if (potatoBridge.eglContext == NULL || potatoBridge.eglContext == EGL_NO_CONTEXT) {
|
||||
printf("EGLBridge: Initializing\n");
|
||||
printf("ANativeWindow pointer = %p\n", potatoBridge.androidWindow);
|
||||
|
||||
if (!eglInitialize(potatoBridge.eglDisplay, NULL, NULL)) {
|
||||
printf("Error: eglInitialize() failed\n");
|
||||
@ -129,7 +131,6 @@ JNIEXPORT jboolean JNICALL Java_org_lwjgl_glfw_GLFW_nativeEglMakeCurrent(JNIEnv*
|
||||
assert(val & EGL_WINDOW_BIT);
|
||||
}
|
||||
// return JNI_TRUE;
|
||||
|
||||
}
|
||||
|
||||
printf("EGLBridge: Making current\n");
|
||||
|
Loading…
x
Reference in New Issue
Block a user