MeshPrimitiveSample.h 896 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. #ifndef MESHPRIMITIVESAMPLE_H_
  2. #define MESHPRIMITIVESAMPLE_H_
  3. #include "gameplay.h"
  4. #include "Sample.h"
  5. using namespace gameplay;
  6. /**
  7. * Sample programmatically creating and drawing the supported mesh primitives.
  8. */
  9. class MeshPrimitiveSample : public Sample
  10. {
  11. public:
  12. MeshPrimitiveSample();
  13. void touchEvent(Touch::TouchEvent evt, int x, int y, unsigned int contactIndex);
  14. protected:
  15. void initialize();
  16. void finalize();
  17. void update(float elapsedTime);
  18. void render(float elapsedTime);
  19. private:
  20. static Material* createMaterial();
  21. static MeshBatch* createMeshBatch(Mesh::PrimitiveType primitiveType);
  22. Font* _font;
  23. Model* _triangles;
  24. Model* _triangleStrip;
  25. Model* _lineStrip;
  26. Model* _lines;
  27. Model* _points;
  28. Matrix _viewProjectionMatrix;
  29. Vector2 _touchPoint;
  30. Vector2 _tilt;
  31. std::list<Font::Text*> _text;
  32. };
  33. #endif