source: trunk/src/input/input.h @ 1710

Last change on this file since 1710 was 1710, checked in by sam, 8 years ago

input: allow to easily track more than one input stick.

  • Property svn:keywords set to Id
File size: 1.4 KB
Line 
1//
2// Lol Engine
3//
4// Copyright: (c) 2010-2012 Sam Hocevar <sam@hocevar.net>
5//   This program is free software; you can redistribute it and/or
6//   modify it under the terms of the Do What The Fuck You Want To
7//   Public License, Version 2, as published by Sam Hocevar. See
8//   http://sam.zoy.org/projects/COPYING.WTFPL for more details.
9//
10
11//
12// The Input static class
13// ----------------------
14//
15
16#if !defined __LOL_INPUT_INPUT_H__
17#define __LOL_INPUT_INPUT_H__
18
19#include "lol/math/vector.h"
20#include "input/stick.h"
21
22namespace lol
23{
24
25class WorldEntity;
26
27class Input
28{
29public:
30    /* These methods are general queries */
31    static ivec2 GetMousePos();
32    static ivec3 GetMouseButtons();
33    //BH : Added this, is a v0.1 Alpha version.
34    static int GetButtonState(int button);
35
36    /* Entities can subscribe to events */
37    static void TrackMouse(WorldEntity *e);
38    static void UntrackMouse(WorldEntity *e);
39
40    /* These methods are called by the underlying input listeners */
41    static void SetMousePos(ivec2 coord);
42    static void SetMouseButton(int index);
43    static void UnsetMouseButton(int index);
44
45    /*
46     * Joystick handling
47     */
48
49    static Stick *CreateStick();
50    static void DestroyStick(Stick *stick);
51
52    static Stick *TrackStick(int desired);
53    static void UntrackStick(Stick *stick);
54};
55
56} /* namespace lol */
57
58#endif // __LOL_INPUT_INPUT_H__
59
Note: See TracBrowser for help on using the repository browser.