Try trigger callback on first eglSwapBuffers()

This commit is contained in:
khanhduytran0 2020-11-23 17:42:06 +07:00
parent 8c86158de2
commit 3865ae1bc2
4 changed files with 12 additions and 2 deletions

View File

@ -100,7 +100,7 @@ public class ControlData implements Cloneable
}
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) {

View File

@ -190,7 +190,12 @@ JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL_nativeRegalMakeCurrent(JNIEnv *e
RegalMakeCurrent(potatoBridge.eglContext);
}
bool isSizeSet;
JNIEXPORT jboolean JNICALL Java_org_lwjgl_glfw_GLFW_nativeEglSwapBuffers(JNIEnv *env, jclass clazz) {
if (!isSizeSet) {
isSizeSet = true;
Java_org_lwjgl_glfw_CallbackBridge_nativeSendScreenSize(NULL, NULL, savedWidth, savedHeight);
}
return eglSwapBuffers(potatoBridge.eglDisplay, potatoBridge.eglSurface);
}

View File

@ -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) {
savedWidth = width;
savedHeight = height;
if (isInputReady) {
if (GLFW_invoke_FramebufferSize) {
if (isUseStackQueueCall) {

View File

@ -15,6 +15,8 @@ long showingWindow;
bool isInputReady, isCursorEntered, isPrepareGrabPos, isUseStackQueueCall;
int savedWidth, savedHeight;
jboolean attachThread(bool isAndroid, JNIEnv** secondJNIEnvPtr);
char** convert_to_char_array(JNIEnv *env, jobjectArray jstringArray);
jobjectArray convert_from_char_array(JNIEnv *env, char **charArray, int num_rows);