Update input_bridge.c

This commit is contained in:
Tran Khanh Duy authored and GitHub committed 2020-10-27 16:03:03 +07:00
1 parent 3253142c34
commit ddeb4b5ce7
1 file changed
+6 -2
+6 -2
View File
@@ -10,7 +10,8 @@ struct GLFWInputEvent {
int i1, i2, i3, i4;
double d1, d2;
};
struct char* glfwInputEventArr[100];
// struct char* glfwInputEventArr[100];
GLFWInputEvent glfwInputEventArr[100];
int glfwInputEventIndex;
int *grabCursorX, *grabCursorY, *lastCursorX, *lastCursorY;
@@ -131,7 +132,10 @@ void invokeCursorPos(int x, int y) {
}
void addInputToQueue(GLFWInputEvent event) {
if (glfwInputEventIndex++
if (glfwInputEventIndex++ >= 100) {
// player type too fast? or fps lower than player tps?
glfwInputEventIndex = 0;
}
glfwInputEventArr[glfwInputEventIndex] = (char*) event;
}