Visual.h 789 B

123456789101112131415161718192021222324252627282930313233343536
  1. //
  2. // Created by jovian on 18/07/17.
  3. //
  4. #ifndef TINYSHOOTER_VISUAL_H
  5. #define TINYSHOOTER_VISUAL_H
  6. #include <vector>
  7. #include "../Maths/b2_math.h"
  8. /* class Visual :
  9. * Describe something to show.
  10. */
  11. #define DEFAULT_ZOOM 100.0f // Default Universe/pixel scale
  12. class Visual {
  13. public :
  14. Visual(unsigned int imgId, const b2Vec2 &relPos, float angle, float scale = 1.0f);
  15. unsigned int getImgId() const;
  16. const b2Vec2 &getPos() const;
  17. float getAngle() const;
  18. float getScale() const;
  19. protected:
  20. const unsigned int m_imgId; // Id of SDL texture
  21. const b2Vec2 m_relPos; // From left top corner
  22. const float m_angle; // Angle of object
  23. const float m_scale; // Zoom multiplier
  24. };
  25. void clearVisuals(std::vector<Visual*> &scope);
  26. #endif //TINYSHOOTER_VISUAL_H