IRenderHandler.h 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  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 "ImageLocator.h"
  12. VCMI_LIB_NAMESPACE_BEGIN
  13. class Services;
  14. VCMI_LIB_NAMESPACE_END
  15. struct SDL_Surface;
  16. class IFont;
  17. class IImage;
  18. class CAnimation;
  19. class CanvasImage;
  20. class SDLImageShared;
  21. enum class EImageBlitMode : uint8_t;
  22. enum class CanvasScalingPolicy;
  23. enum EFonts : int8_t;
  24. class IRenderHandler : public boost::noncopyable
  25. {
  26. public:
  27. virtual ~IRenderHandler() = default;
  28. /// Must be called once VLC loading is over to initialize icons
  29. virtual void onLibraryLoadingFinished(const Services * services) = 0;
  30. /// Loads image using given path
  31. virtual std::shared_ptr<IImage> loadImage(const ImageLocator & locator) = 0;
  32. virtual std::shared_ptr<IImage> loadImage(const ImagePath & path, EImageBlitMode mode) = 0;
  33. virtual std::shared_ptr<IImage> loadImage(const AnimationPath & path, int frame, int group, EImageBlitMode mode) = 0;
  34. /// Loads single upscaled image without auto-scaling support
  35. virtual std::shared_ptr<SDLImageShared> loadScaledImage(const ImageLocator & locator) = 0;
  36. /// Creates image which can be used as target for drawing on
  37. virtual std::shared_ptr<CanvasImage> createImage(const Point & size, CanvasScalingPolicy scalingPolicy) = 0;
  38. /// Loads animation using given path
  39. virtual std::shared_ptr<CAnimation> loadAnimation(const AnimationPath & path, EImageBlitMode mode) = 0;
  40. /// Returns font with specified identifer
  41. virtual std::shared_ptr<const IFont> loadFont(EFonts font) = 0;
  42. virtual void exportGeneratedAssets() = 0;
  43. };