26a9d5dd5e
* SDL Input Refactor (Initial Edit) * SDL Input Refactor - IMGUI Text Input Fix * SDL Input Refactor - wiGUI Text Input Fix * SDL Input Refactor - Pruning Includes * SDL Input Refactor - Fix Includes * SDL Input Refactor - Fix Compiler Error (Windows) * SDL Input Refactor - Fix Compile Error (2) * SDL Input Refactor - SDL Version Checking For LED * Trying out Sniper SDK build system * SDL Input Refactor - Processing Design Changes * SDL Input Refactor - Separate Steam Deck Build * SDL Input Refactor - Separate Steam Deck (2) * Steam SDK CI Build - Change Package Name & Reduct * Steam SDK CI - Straight up building, no apt update
40 lines
1.3 KiB
C++
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(SDL_Event &event);
|
|
#endif
|
|
}
|