Texture2D.h 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. #pragma once
  2. #include "Array.h"
  3. namespace Framework
  4. {
  5. class Image;
  6. class Animation2DData;
  7. class Texture2D : public virtual ReferenceCounter
  8. {
  9. private:
  10. struct Animation
  11. {
  12. Animation2DData* data;
  13. int now;
  14. double compensation;
  15. };
  16. bool circularAnimation;
  17. int animationIndex;
  18. Image* txt;
  19. Array<Animation*>* animData;
  20. public:
  21. //! Constructor
  22. DLLEXPORT Texture2D();
  23. //! Destructor
  24. DLLEXPORT ~Texture2D();
  25. //! Sets whether the animation should repeat automatically
  26. //! \param ca 1 if the animation should repeat automatically
  27. DLLEXPORT void setCircularAnimation(bool ca);
  28. //! Sets a pointer to the texture (if not animated)
  29. //! \param textur The pointer to the image
  30. DLLEXPORT void setTextureZ(Image* textur);
  31. //! Adds an animation
  32. //! \param textur The pointer to the animation data
  33. DLLEXPORT void addAnimationZ(Animation2DData* textur);
  34. //! Sets the current animation
  35. //! \param index The index of the animation
  36. DLLEXPORT void setAnimation(int index);
  37. //! Activates the next animation
  38. DLLEXPORT void nextAnimation();
  39. //! Sets the elapsed time since the last call
  40. //! \param t The elapsed time in seconds
  41. DLLEXPORT bool tick(double t);
  42. //! Returns the current texture
  43. DLLEXPORT Image* zTexture() const;
  44. };
  45. } // namespace Framework