Merge pull request #28 from devZoGok/develop

Develop
This commit is contained in:
devZoGok
2026-05-26 15:41:35 +00:00
committed by GitHub
+9 -2
View File
@@ -7,8 +7,9 @@
#include <iostream>
namespace gameBase{
double *posX, *posY, strX, strY;
double *posX, *posY, compPosX = -1, compPosY = -1, strX, strY;
int width, height;
s64 lastMoveTime = 0;
StateManager *manager = nullptr;
void scroll_callback(GLFWwindow* window, double xOffset, double yOffset) {
@@ -18,7 +19,10 @@ namespace gameBase{
}
void foo(GLFWwindow *window, double newPosX, double newPosY){
strX = (*posX - newPosX) / width, strY = (newPosY - *posY) / height;
if(compPosX == -1) compPosX = *posX, compPosY = *posY;
strX = (compPosX - newPosX) / width, strY = (newPosY - compPosY) / height;
lastMoveTime = getTime();
}
void charFoo(GLFWwindow *window, unsigned int codepoint){
@@ -45,6 +49,9 @@ namespace gameBase{
const u8 *buttons;
const float *axis;
if(getTime() - lastMoveTime > 10)
compPosX = -1, compPosY = -1;
if(glfwJoystickPresent(GLFW_JOYSTICK_1)){
joystick = GLFW_JOYSTICK_1;
axis = glfwGetJoystickAxes(joystick, &numAxis);