xbmc
GameClientController.h
1 /*
2  * Copyright (C) 2018 Team Kodi
3  * http://kodi.tv
4  *
5  * This Program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation; either version 2, or (at your option)
8  * any later version.
9  *
10  * This Program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this Program; see the file COPYING. If not, see
17  * <http://www.gnu.org/licenses/>.
18  *
19  */
20 
21 #pragma once
22 
23 #include "addons/kodi-dev-kit/include/kodi/addon-instance/Game.h"
24 #include "games/controllers/ControllerTypes.h"
25 
26 #include <string>
27 #include <vector>
28 
29 namespace KODI
30 {
31 namespace GAME
32 {
33 class CGameClientInput;
34 
42 {
43 public:
50 
54  game_controller_layout TranslateController() const;
55 
56 private:
57  // Construction parameters
58  CGameClientInput& m_input;
59  const ControllerPtr m_controller;
60 
61  // Buffer parameters
62  std::string m_controllerId;
63  std::vector<char*> m_digitalButtons;
64  std::vector<char*> m_analogButtons;
65  std::vector<char*> m_analogSticks;
66  std::vector<char*> m_accelerometers;
67  std::vector<char*> m_keys;
68  std::vector<char*> m_relPointers;
69  std::vector<char*> m_absPointers;
70  std::vector<char*> m_motors;
71 };
72 } // namespace GAME
73 } // namespace KODI
Definition: GameClientInput.h:47
CGameClientController(CGameClientInput &input, ControllerPtr controller)
Construct a controller layout.
Definition: GameClientController.cpp:35
Definition: AudioDecoder.h:18
std::shared_ptr< CController > ControllerPtr
Smart pointer to a game controller (CController)
Definition: ControllerTypes.h:25
A container for the layout of a controller connected to a game client input port. ...
Definition: GameClientController.h:41
game_controller_layout TranslateController() const
Get a controller layout for the Game API.
Definition: GameClientController.cpp:89