IRenderHandler.h 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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. VCMI_LIB_NAMESPACE_BEGIN
  13. class Services;
  14. VCMI_LIB_NAMESPACE_END
  15. struct SDL_Surface;
  16. class IImage;
  17. class CAnimation;
  18. enum class EImageBlitMode;
  19. class IRenderHandler : public boost::noncopyable
  20. {
  21. public:
  22. virtual ~IRenderHandler() = default;
  23. /// Must be called once VLC loading is over to initialize icons
  24. virtual void onLibraryLoadingFinished(const Services * services) = 0;
  25. /// Loads image using given path
  26. virtual std::shared_ptr<IImage> loadImage(const JsonNode & config) = 0;
  27. virtual std::shared_ptr<IImage> loadImage(const ImagePath & path) = 0;
  28. virtual std::shared_ptr<IImage> loadImage(const ImagePath & path, EImageBlitMode mode) = 0;
  29. virtual std::shared_ptr<IImage> loadImage(const AnimationPath & path, int frame, int group) = 0;
  30. /// temporary compatibility method. Creates IImage from existing SDL_Surface
  31. /// Surface will be shared, caller must still free it with SDL_FreeSurface
  32. virtual std::shared_ptr<IImage> createImage(SDL_Surface * source) = 0;
  33. /// Loads animation using given path
  34. virtual std::shared_ptr<CAnimation> loadAnimation(const AnimationPath & path) = 0;
  35. /// Creates empty CAnimation. Temporary compatibility method
  36. virtual std::shared_ptr<CAnimation> createAnimation() = 0;
  37. };