| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
#ifndef SDL_DRIVER_H |
| 6 |
#define SDL_DRIVER_H |
| 7 |
|
| 8 |
#include <map> |
| 9 |
|
| 10 |
#include <SDL/SDL.h> |
| 11 |
|
| •12 |
#include "guichan.hpp" |
| 13 |
#include "guichan/sdl.hpp" |
| 14 |
|
| 15 |
#include "input.h" |
| 16 |
|
| 17 |
class SDLDriver { |
| 18 |
|
| 19 |
enum MouseState { INITIAL, MOVED, RESET_NEEDED }; |
| 20 |
|
| 21 |
public: |
| 22 |
SDLDriver(InputHandler &); |
| 23 |
|
| 24 |
~SDLDriver(); |
| 25 |
|
| 26 |
void loop(); |
| 27 |
|
| 28 |
gcn::SDLInput *getSDLInput(); |
| 29 |
|
| 30 |
Input &getSensedInput(); |
| 31 |
|
| 32 |
void initActionMap(); |
| 33 |
|
| 34 |
void setSenseMode(bool); |
| 35 |
|
| 36 |
private: |
| 37 |
void input(InputType, int, int, int, int); |
| 38 |
|
| 39 |
void toggleGrab(); |
| 40 |
|
| 41 |
std::pair< int, int> key(InputType, int, int, int); |
| 42 |
|
| 43 |
InputHandler &inputHandler; |
| 44 |
|
| 45 |
std::map< std::pair<int, int>, GameAction > actionMap; |
| 46 |
|
| 47 |
SDL_Joystick **sticks; |
| 48 |
|
| 49 |
gcn::SDLInput *sdlInput; |
| 50 |
|
| 51 |
Input *sensedInput; |
| 52 |
}; |
| 53 |
|
| 54 |
#endif |