IRenderHandler.h 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738
  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. /// temporary compatibility method. Creates IImage from existing SDL_Surface
  24. /// Surface will be shared, caller must still free it with SDL_FreeSurface
  25. virtual std::shared_ptr<IImage> createImage(SDL_Surface * source) = 0;
  26. /// Loads animation using given path
  27. virtual std::shared_ptr<CAnimation> loadAnimation(const AnimationPath & path) = 0;
  28. /// Creates empty CAnimation
  29. virtual std::shared_ptr<CAnimation> createAnimation() = 0;
  30. };