Btk
locals.hpp
1 #if !defined(_BTK_LOCALS_HPP_)
2 #define _BTK_LOCALS_HPP_
3 #include <SDL2/SDL_keycode.h>
4 #include <SDL2/SDL_scancode.h>
5 #include <SDL2/SDL_mouse.h>
6 //A headers to simply use SDL enums
7 namespace Btk{
8  typedef SDL_Keycode Keycode;
9  typedef SDL_Scancode Scancode;
10  //Keymode enum
11  enum class Keymode:Uint16{
12  Ctrl = KMOD_CTRL,
13  Shift = KMOD_SHIFT,
14  //etc...
15  };
16  inline Keymode operator |(Keymode a,Keymode b){
17  return static_cast<Keymode>
18  (static_cast<Uint16>(a) | static_cast<Uint16>(b)
19  );
20  };
21  inline Keymode operator &(Keymode a,Keymode b){
22  return static_cast<Keymode>
23  (static_cast<Uint16>(a) & static_cast<Uint16>(b)
24  );
25  };
26  inline bool operator ==(Keymode a,Uint16 b){
27  return Uint16(a) == b;
28  };
29  inline bool operator !=(Keymode a,Uint16 b){
30  return Uint16(a) != b;
31  };
32 };
33 
34 #endif // _BTK_LOCALS_HPP_
This header include many useful containers.
Definition: async.hpp:7