mirror of
https://github.com/devZoGok/gameBase.git
synced 2026-08-26 19:43:28 +00:00
+9
-2
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user