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