mirror of
https://github.com/AngelAuraMC/Amethyst-Android.git
synced 2025-09-16 08:05:34 -04:00
Try trigger callback on first eglSwapBuffers()
This commit is contained in:
parent
8c86158de2
commit
3865ae1bc2
@ -100,7 +100,7 @@ public class ControlData implements Cloneable
|
|||||||
}
|
}
|
||||||
|
|
||||||
public ControlData(String name, int keycode, float x, float y, float width, float height) {
|
public ControlData(String name, int keycode, float x, float y, float width, float height) {
|
||||||
this(name, keycode, null, null, width, height);
|
this(name, keycode, Float.toString(x), Float.toString(y), width, height);
|
||||||
}
|
}
|
||||||
|
|
||||||
public ControlData(String name, int keycode, String dynamicX, String dynamicY) {
|
public ControlData(String name, int keycode, String dynamicX, String dynamicY) {
|
||||||
|
@ -190,8 +190,13 @@ JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL_nativeRegalMakeCurrent(JNIEnv *e
|
|||||||
RegalMakeCurrent(potatoBridge.eglContext);
|
RegalMakeCurrent(potatoBridge.eglContext);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool isSizeSet;
|
||||||
JNIEXPORT jboolean JNICALL Java_org_lwjgl_glfw_GLFW_nativeEglSwapBuffers(JNIEnv *env, jclass clazz) {
|
JNIEXPORT jboolean JNICALL Java_org_lwjgl_glfw_GLFW_nativeEglSwapBuffers(JNIEnv *env, jclass clazz) {
|
||||||
return eglSwapBuffers(potatoBridge.eglDisplay, potatoBridge.eglSurface);
|
if (!isSizeSet) {
|
||||||
|
isSizeSet = true;
|
||||||
|
Java_org_lwjgl_glfw_CallbackBridge_nativeSendScreenSize(NULL, NULL, savedWidth, savedHeight);
|
||||||
|
}
|
||||||
|
return eglSwapBuffers(potatoBridge.eglDisplay, potatoBridge.eglSurface);
|
||||||
}
|
}
|
||||||
|
|
||||||
JNIEXPORT jboolean JNICALL Java_org_lwjgl_glfw_GLFW_nativeEglSwapInterval(JNIEnv *env, jclass clazz, jint interval) {
|
JNIEXPORT jboolean JNICALL Java_org_lwjgl_glfw_GLFW_nativeEglSwapInterval(JNIEnv *env, jclass clazz, jint interval) {
|
||||||
|
@ -290,6 +290,9 @@ JNIEXPORT void JNICALL Java_org_lwjgl_glfw_CallbackBridge_nativeSendMouseButton(
|
|||||||
}
|
}
|
||||||
|
|
||||||
JNIEXPORT void JNICALL Java_org_lwjgl_glfw_CallbackBridge_nativeSendScreenSize(JNIEnv* env, jclass clazz, jint width, jint height) {
|
JNIEXPORT void JNICALL Java_org_lwjgl_glfw_CallbackBridge_nativeSendScreenSize(JNIEnv* env, jclass clazz, jint width, jint height) {
|
||||||
|
savedWidth = width;
|
||||||
|
savedHeight = height;
|
||||||
|
|
||||||
if (isInputReady) {
|
if (isInputReady) {
|
||||||
if (GLFW_invoke_FramebufferSize) {
|
if (GLFW_invoke_FramebufferSize) {
|
||||||
if (isUseStackQueueCall) {
|
if (isUseStackQueueCall) {
|
||||||
|
@ -15,6 +15,8 @@ long showingWindow;
|
|||||||
|
|
||||||
bool isInputReady, isCursorEntered, isPrepareGrabPos, isUseStackQueueCall;
|
bool isInputReady, isCursorEntered, isPrepareGrabPos, isUseStackQueueCall;
|
||||||
|
|
||||||
|
int savedWidth, savedHeight;
|
||||||
|
|
||||||
jboolean attachThread(bool isAndroid, JNIEnv** secondJNIEnvPtr);
|
jboolean attachThread(bool isAndroid, JNIEnv** secondJNIEnvPtr);
|
||||||
char** convert_to_char_array(JNIEnv *env, jobjectArray jstringArray);
|
char** convert_to_char_array(JNIEnv *env, jobjectArray jstringArray);
|
||||||
jobjectArray convert_from_char_array(JNIEnv *env, char **charArray, int num_rows);
|
jobjectArray convert_from_char_array(JNIEnv *env, char **charArray, int num_rows);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user