IRenderHandler.h 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. /*
  2. * IRenderHandler.h, part of VCMI engine
  3. *
  4. * Authors: listed in file AUTHORS in main folder
  5. *
  6. * License: GNU General Public License v2.0 or later
  7. * Full text of license available in license.txt file, in main folder
  8. *
  9. */
  10. #pragma once
  11. #include "../../lib/filesystem/ResourcePath.h"
  12. struct SDL_Surface;
  13. class IImage;
  14. class CAnimation;
  15. enum class EImageBlitMode;
  16. class IRenderHandler : public boost::noncopyable
  17. {
  18. public:
  19. virtual ~IRenderHandler() = default;
  20. /// Loads image using given path
  21. virtual std::shared_ptr<IImage> loadImage(const ImagePath & path) = 0;
  22. virtual std::shared_ptr<IImage> loadImage(const ImagePath & path, EImageBlitMode mode) = 0;
  23. virtual std::shared_ptr<IImage> loadImage(const AnimationPath & path, int frame, int group) = 0;
  24. /// temporary compatibility method. Creates IImage from existing SDL_Surface
  25. /// Surface will be shared, caller must still free it with SDL_FreeSurface
  26. virtual std::shared_ptr<IImage> createImage(SDL_Surface * source) = 0;
  27. /// Loads animation using given path
  28. virtual std::shared_ptr<CAnimation> loadAnimation(const AnimationPath & path) = 0;
  29. /// Creates empty CAnimation. Temporary compatibility method
  30. virtual std::shared_ptr<CAnimation> createAnimation() = 0;
  31. };