File: sdl_driver.h

package info (click to toggle)
qonk 0.3.1-1
  • links: PTS, VCS
  • area: main
  • in suites: lenny
  • size: 2,076 kB
  • ctags: 2,026
  • sloc: cpp: 14,978; sh: 3,464; makefile: 200
file content (54 lines) | stat: -rw-r--r-- 881 bytes parent folder | download | duplicates (3)
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/guichan.hpp"
#include "guichan/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