2022-05-19 01:51:26 -07:00
|
|
|
#ifndef DINPUT_H
|
|
|
|
#define DINPUT_H
|
|
|
|
|
2022-07-29 10:04:37 -07:00
|
|
|
#include <SDL.h>
|
|
|
|
|
2022-05-19 01:51:26 -07:00
|
|
|
typedef struct MouseData {
|
|
|
|
int x;
|
|
|
|
int y;
|
|
|
|
unsigned char buttons[2];
|
|
|
|
} MouseData;
|
|
|
|
|
|
|
|
typedef struct KeyboardData {
|
2022-05-23 01:44:49 -07:00
|
|
|
int key;
|
2022-05-19 01:51:26 -07:00
|
|
|
char down;
|
|
|
|
} KeyboardData;
|
|
|
|
|
|
|
|
bool directInputInit();
|
|
|
|
void directInputFree();
|
|
|
|
bool mouseDeviceAcquire();
|
|
|
|
bool mouseDeviceUnacquire();
|
|
|
|
bool mouseDeviceGetData(MouseData* mouseData);
|
|
|
|
bool keyboardDeviceAcquire();
|
|
|
|
bool keyboardDeviceUnacquire();
|
|
|
|
bool keyboardDeviceReset();
|
|
|
|
bool keyboardDeviceGetData(KeyboardData* keyboardData);
|
|
|
|
bool mouseDeviceInit();
|
|
|
|
void mouseDeviceFree();
|
|
|
|
bool keyboardDeviceInit();
|
|
|
|
void keyboardDeviceFree();
|
|
|
|
|
2022-07-29 10:04:37 -07:00
|
|
|
void handleTouchFingerEvent(SDL_TouchFingerEvent* event);
|
|
|
|
|
2022-05-19 01:51:26 -07:00
|
|
|
#endif /* DINPUT_H */
|