IRenderHandler.h 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  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. enum class EImageBlitMode : uint8_t;
  20. enum EFonts : int8_t;
  21. class IRenderHandler : public boost::noncopyable
  22. {
  23. public:
  24. virtual ~IRenderHandler() = default;
  25. /// Must be called once VLC loading is over to initialize icons
  26. virtual void onLibraryLoadingFinished(const Services * services) = 0;
  27. /// Loads image using given path
  28. virtual std::shared_ptr<IImage> loadImage(const ImageLocator & locator, EImageBlitMode mode) = 0;
  29. virtual std::shared_ptr<IImage> loadImage(const ImagePath & path, EImageBlitMode mode) = 0;
  30. virtual std::shared_ptr<IImage> loadImage(const AnimationPath & path, int frame, int group, EImageBlitMode mode) = 0;
  31. /// temporary compatibility method. Creates IImage from existing SDL_Surface
  32. /// Surface will be shared, caller must still free it with SDL_FreeSurface
  33. virtual std::shared_ptr<IImage> createImage(SDL_Surface * source) = 0;
  34. /// Loads animation using given path
  35. virtual std::shared_ptr<CAnimation> loadAnimation(const AnimationPath & path, EImageBlitMode mode) = 0;
  36. /// Returns font with specified identifer
  37. virtual std::shared_ptr<const IFont> loadFont(EFonts font) = 0;
  38. };