From 07b52eb2f62bcd05de1a85d7506e34ad692598d4 Mon Sep 17 00:00:00 2001 From: khanhduytran0 Date: Sat, 17 Oct 2020 18:41:16 +0700 Subject: [PATCH] Add debugs --- app/src/main/jni/input_bridge.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/app/src/main/jni/input_bridge.c b/app/src/main/jni/input_bridge.c index 9a59a1f9e..77a2b8123 100644 --- a/app/src/main/jni/input_bridge.c +++ b/app/src/main/jni/input_bridge.c @@ -160,9 +160,15 @@ JNIEXPORT jboolean JNICALL Java_org_lwjgl_glfw_CallbackBridge_nativeIsGrabbing(J return isGrabbing; } -int diffX, diffY, diffGrabX, diffGrabY; +int diffX, diffY, diffGrabX, diffGrabY, debugTimes; JNIEXPORT void JNICALL Java_org_lwjgl_glfw_GLFW_nglfwPollEvents(JNIEnv* env, jclass clazz) { if (!isInputReady) isInputReady = true; + + if (debugTimes < 1000) { + debugTimes++; + LOGI("INPUT: IsUseStackQueue=%d, CurrentInputLength=%d, CursorX=%d, CursorY=%d", isUseStackQueueCall, glfwInputEventIndex, lastCursorX, lastCursorY); + } + if (isUseStackQueueCall) { if (diffX != lastCursorX || diffY != lastCursorY) { diffX = lastCursorX; @@ -175,6 +181,11 @@ JNIEXPORT void JNICALL Java_org_lwjgl_glfw_GLFW_nglfwPollEvents(JNIEnv* env, jcl for (int i = 0; i <= glfwInputEventIndex; i++) { struct GLFWInputEvent curr = glfwInputEventArr[i]; + + if (debugTimes < 1000) { + LOGI("INPUT: Got input event %d", curr.type); + } + switch (curr.type) { case EVENT_TYPE_CHAR: if (GLFW_invoke_Char) {