mirror of
https://github.com/AngelAuraMC/Amethyst-Android.git
synced 2025-09-19 01:27:18 -04:00
[GLFW] Fix EGL stuff
This commit is contained in:
parent
e8cac591b1
commit
462afeca6a
@ -220,11 +220,12 @@ JNIEXPORT jboolean JNICALL Java_org_lwjgl_glfw_GLFW_nativeEglMakeCurrent(JNIEnv*
|
|||||||
|
|
||||||
if (window != 0x1) {
|
if (window != 0x1) {
|
||||||
printf("Making current on window %p\n", window);
|
printf("Making current on window %p\n", window);
|
||||||
|
potatoBridge.eglContext = (EGLContext *) window;
|
||||||
EGLBoolean success = eglMakeCurrent(
|
EGLBoolean success = eglMakeCurrent(
|
||||||
potatoBridge.eglDisplay,
|
potatoBridge.eglDisplay,
|
||||||
potatoBridge.eglSurface,
|
potatoBridge.eglSurface,
|
||||||
potatoBridge.eglSurface,
|
potatoBridge.eglSurface,
|
||||||
/* window==0 ? EGL_NO_CONTEXT : */ (EGLContext *) window
|
/* window == 0 ? EGL_NO_CONTEXT : */ (EGLContext *) window
|
||||||
);
|
);
|
||||||
if (success == EGL_FALSE) {
|
if (success == EGL_FALSE) {
|
||||||
printf("Error: eglMakeCurrent() failed: %p\n", eglGetError());
|
printf("Error: eglMakeCurrent() failed: %p\n", eglGetError());
|
||||||
|
@ -772,11 +772,7 @@ public class GLFW
|
|||||||
}
|
}
|
||||||
static boolean isGLFWReady;
|
static boolean isGLFWReady;
|
||||||
public static boolean glfwInit() {
|
public static boolean glfwInit() {
|
||||||
if (!isGLFWReady) {
|
return true;
|
||||||
mGLFWInitialTime = (double) System.nanoTime();
|
|
||||||
isGLFWReady = nativeEglInit();
|
|
||||||
}
|
|
||||||
return isGLFWReady;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void glfwTerminate() {
|
public static void glfwTerminate() {
|
||||||
@ -982,6 +978,11 @@ public class GLFW
|
|||||||
|
|
||||||
// GLFW Window functions
|
// GLFW Window functions
|
||||||
public static long glfwCreateWindow(int width, int height, CharSequence title, long monitor, long share) {
|
public static long glfwCreateWindow(int width, int height, CharSequence title, long monitor, long share) {
|
||||||
|
if (!isGLFWReady) {
|
||||||
|
mGLFWInitialTime = (double) System.nanoTime();
|
||||||
|
isGLFWReady = nativeEglInit();
|
||||||
|
}
|
||||||
|
|
||||||
EventLoop.OffScreen.check();
|
EventLoop.OffScreen.check();
|
||||||
// Create an ACTUAL EGL context
|
// Create an ACTUAL EGL context
|
||||||
long ptr = nativeEglCreateContext(share);
|
long ptr = nativeEglCreateContext(share);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user