mirror of
https://github.com/AngelAuraMC/Amethyst-Android.git
synced 2025-09-17 16:47:14 -04:00
change
This commit is contained in:
parent
d8a58484da
commit
67487dcdba
@ -150,8 +150,8 @@ 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, jlong window) {
|
JNIEXPORT jboolean JNICALL Java_org_lwjgl_glfw_GLFW_nativeEglMakeCurrent(JNIEnv* env, jclass clazz, jlong window) {
|
||||||
EGLContext *currCtx = eglGetCurrentContext();
|
EGLContext *currCtx = eglGetCurrentContext();
|
||||||
printf("EGLBridge: Comparing: thr=%d, this=%p, curr=%p\n", gettid(), window, currCtx);
|
printf("EGLBridge: Comparing: thr=%d, this=%p, curr=%p\n", gettid(), window, currCtx);
|
||||||
if (window != 0x1 && (window == 0x0 || currCtx == EGL_NO_CONTEXT || currCtx == (EGLContext *) window)) {
|
if (currCtx == NULL || window == 0) {
|
||||||
if (window != 0x0 && potatoBridge.eglContextOld != NULL && potatoBridge.eglContextOld != (void *) window) {
|
/*if (window != 0x0 && potatoBridge.eglContextOld != NULL && potatoBridge.eglContextOld != (void *) window) {
|
||||||
// Create new pbuffer per thread
|
// Create new pbuffer per thread
|
||||||
// TODO get window size for 2nd+ window!
|
// TODO get window size for 2nd+ window!
|
||||||
int surfaceWidth, surfaceHeight;
|
int surfaceWidth, surfaceHeight;
|
||||||
@ -164,14 +164,14 @@ JNIEXPORT jboolean JNICALL Java_org_lwjgl_glfw_GLFW_nativeEglMakeCurrent(JNIEnv*
|
|||||||
};
|
};
|
||||||
potatoBridge.eglSurface = eglCreatePbufferSurface(potatoBridge.eglDisplay, config, surfaceAttr);
|
potatoBridge.eglSurface = eglCreatePbufferSurface(potatoBridge.eglDisplay, config, surfaceAttr);
|
||||||
printf("EGLBridge: created pbuffer surface %p for context %p\n", potatoBridge.eglSurface, window);
|
printf("EGLBridge: created pbuffer surface %p for context %p\n", potatoBridge.eglSurface, window);
|
||||||
}
|
}*/
|
||||||
potatoBridge.eglContextOld = (void *) window;
|
//potatoBridge.eglContextOld = (void *) window;
|
||||||
// eglMakeCurrent(potatoBridge.eglDisplay, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT);
|
// eglMakeCurrent(potatoBridge.eglDisplay, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT);
|
||||||
printf("EGLBridge: Making current on window %p on thread %d\n", window, gettid());
|
printf("EGLBridge: Making current on window %p on thread %d\n", window, gettid());
|
||||||
EGLBoolean success = eglMakeCurrent(
|
EGLBoolean success = eglMakeCurrent(
|
||||||
potatoBridge.eglDisplay,
|
potatoBridge.eglDisplay,
|
||||||
/* window==0 ? (EGLSurface *) 0 : */ potatoBridge.eglSurface,
|
window==0 ? (EGLSurface *) 0 : potatoBridge.eglSurface,
|
||||||
/* window==0 ? (EGLSurface *) 0 : */ potatoBridge.eglSurface,
|
window==0 ? (EGLSurface *) 0 : potatoBridge.eglSurface,
|
||||||
/* window==0 ? EGL_NO_CONTEXT : */ (EGLContext *) window
|
/* window==0 ? EGL_NO_CONTEXT : */ (EGLContext *) window
|
||||||
);
|
);
|
||||||
if (success == EGL_FALSE) {
|
if (success == EGL_FALSE) {
|
||||||
|
@ -963,6 +963,7 @@ public class GLFW
|
|||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
nativeEglMakeCurrent(window);
|
nativeEglMakeCurrent(window);
|
||||||
|
System.out.println(Long.toString(nativeEglGetCurrentContext(),16));
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void glfwSwapBuffers(long window) {
|
public static void glfwSwapBuffers(long window) {
|
||||||
|
@ -396,7 +396,25 @@ public class Display {
|
|||||||
displayY = (monitorHeight - mode.getHeight()) / 2;
|
displayY = (monitorHeight - mode.getHeight()) / 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
glfwMakeContextCurrent(Window.handle);
|
//glfwMakeContextCurrent(Window.handle);
|
||||||
|
final DrawableGL drawable = new DrawableGL() {
|
||||||
|
public void destroy() {
|
||||||
|
synchronized ( GlobalLock.lock ) {
|
||||||
|
if ( !isCreated() )
|
||||||
|
return;
|
||||||
|
|
||||||
|
releaseDrawable();
|
||||||
|
super.destroy();
|
||||||
|
destroyWindow();
|
||||||
|
// x = y = -1;
|
||||||
|
// cached_icons = null;
|
||||||
|
reset();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
drawable.context = new ContextGL(null, null, null);
|
||||||
|
drawable.context.makeCurrent();
|
||||||
|
Display.drawable = drawable;
|
||||||
context = org.lwjgl.opengl.GLContext.createFromCurrent();
|
context = org.lwjgl.opengl.GLContext.createFromCurrent();
|
||||||
|
|
||||||
glfwSwapInterval(0);
|
glfwSwapInterval(0);
|
||||||
@ -715,23 +733,6 @@ public class Display {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
final DrawableGL drawable = new DrawableGL() {
|
|
||||||
public void destroy() {
|
|
||||||
synchronized ( GlobalLock.lock ) {
|
|
||||||
if ( !isCreated() )
|
|
||||||
return;
|
|
||||||
|
|
||||||
releaseDrawable();
|
|
||||||
super.destroy();
|
|
||||||
destroyWindow();
|
|
||||||
// x = y = -1;
|
|
||||||
// cached_icons = null;
|
|
||||||
reset();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
drawable.context = new ContextGL(null, null, null);
|
|
||||||
Display.drawable = drawable;
|
|
||||||
|
|
||||||
displayCreated = true;
|
displayCreated = true;
|
||||||
|
|
||||||
|
@ -59,4 +59,8 @@ public final class SharedDrawable extends DrawableGL {
|
|||||||
// throw new UnsupportedOperationException();
|
// throw new UnsupportedOperationException();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void makeCurrent() throws LWJGLException {
|
||||||
|
//stub
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user