fixed input with keyboard and controller at the same time

This commit is contained in:
Sarah Faey 2025-04-18 15:47:07 +02:00
parent d8fa53801b
commit eabeb55115
11 changed files with 95 additions and 68 deletions

View file

@ -0,0 +1,20 @@
#ifndef DIRECTION_BUTTON_STATUS_H
#define DIRECTION_BUTTON_STATUS_H
#include <math.h>
#include <SDL3/SDL.h>
#include "NormalizedDirection.h"
class DirectionButtonStatus
{
public:
bool UpPressed = false;
bool DownPressed = false;
bool LeftPressed = false;
bool RightPressed = false;
const float c_NormalizedDiagonal = 1 / sqrt(2);
bool GetDirection(NormalizedDirection & ref_direction);
};
#endif