GamepadSample.h 687 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. #ifndef GAMEPADSAMPLE_H_
  2. #define GAMEPADSAMPLE_H_
  3. #include "SamplesGame.h"
  4. #include "Gamepad.h"
  5. using namespace gameplay;
  6. class GamepadSample : public Sample
  7. {
  8. public:
  9. GamepadSample();
  10. void gamepadEvent(Gamepad::GamepadEvent evt, Gamepad* gamepad);
  11. protected:
  12. void initialize();
  13. void finalize();
  14. void update(float elapsedTime);
  15. void render(float elapsedTime);
  16. private:
  17. void updateGamepad(float elapsedTime, Gamepad* gamepad, unsigned int player);
  18. const char* getStringFromButtonMapping(Gamepad::ButtonMapping mapping);
  19. Gamepad* _gamepad;
  20. Font* _font;
  21. std::string _status;
  22. };
  23. #endif