Files
WickedEngine/WickedEngine/wiSDLInput.h
T
Matteo De Carlo 474b52ed20 Joystick improvements (#769)
- Fix joystick drift on linux (deadzone was way too low, SDL suggest at least 10%, my xbox360 wired controller suggests at least 20%)
- Editor should not normalize joystick movement.

Signed-off-by: Matteo De Carlo <matteo.dek@covolunablu.org>
2023-10-29 09:03:43 +01:00

40 lines
1.3 KiB
C++

#pragma once
#include "CommonInclude.h"
#include "wiInput.h"
#include "wiVector.h"
#ifdef SDL2
#include <SDL2/SDL.h>
#endif
namespace wi::input::sdlinput
{
// Call this once to register raw input devices
void Initialize();
// Updates the state of raw input devices, call once per frame
void Update();
// Writes the keyboard state into state parameter
void GetKeyboardState(wi::input::KeyboardState* state);
// Writes the mouse state into state parameter
void GetMouseState(wi::input::MouseState* state);
// Returns how many controller devices have received input ever. This doesn't correlate with which ones are currently available
int GetMaxControllerCount();
// Returns whether the controller identified by index parameter is available or not
// Id state parameter is not nullptr, and the controller is available, the state will be written into it
bool GetControllerState(wi::input::ControllerState* state, int index);
// Sends feedback data for the controller identified by index parameter to output
void SetControllerFeedback(const wi::input::ControllerFeedback& data, int index);
// External events can be used for events that is needed outside the engine library, like main_SDL2.cpp for example
#ifdef SDL2
// Call this within the main.cpp program loop for the engine to be able handle the input
void ProcessEvent(const SDL_Event &event);
#endif
}