MeshGame.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. #ifndef MESHGAME_H_
  2. #define MESHGAME_H_
  3. #include "gameplay.h"
  4. using namespace gameplay;
  5. /**
  6. * Sample game for rendering a scene with a model/mesh.
  7. */
  8. class MeshGame: public Game
  9. {
  10. public:
  11. /**
  12. * Constructor.
  13. */
  14. MeshGame();
  15. /**
  16. * Destructor.
  17. */
  18. virtual ~MeshGame();
  19. /**
  20. * @see Game::keyEvent
  21. */
  22. void keyEvent(Keyboard::KeyEvent evt, int key);
  23. /**
  24. * @see Game::touchEvent
  25. */
  26. void touchEvent(Touch::TouchEvent evt, int x, int y, unsigned int contactIndex);
  27. protected:
  28. /**
  29. * @see Game::initialize
  30. */
  31. void initialize();
  32. /**
  33. * @see Game::finalize
  34. */
  35. void finalize();
  36. /**
  37. * @see Game::update
  38. */
  39. void update(float elapsedTime);
  40. /**
  41. * @see Game::render
  42. */
  43. void render(float elapsedTime);
  44. private:
  45. bool drawScene(Node* node);
  46. void drawFrameRate(Font* font, const Vector4& color, unsigned int x, unsigned int y, unsigned int fps);
  47. void drawSplash(void* param);
  48. Model* createGridModel(unsigned int lineCount = 41);
  49. Font* _font;
  50. Scene* _scene;
  51. Node* _modelNode;
  52. bool _touched;
  53. int _touchX;
  54. };
  55. #endif