IRenderHandler.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  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 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 ImageLocator & locator, EImageBlitMode mode) = 0;
  27. virtual std::shared_ptr<IImage> loadImage(const ImagePath & path, EImageBlitMode mode) = 0;
  28. virtual std::shared_ptr<IImage> loadImage(const AnimationPath & path, int frame, int group, EImageBlitMode mode) = 0;
  29. /// temporary compatibility method. Creates IImage from existing SDL_Surface
  30. /// Surface will be shared, caller must still free it with SDL_FreeSurface
  31. virtual std::shared_ptr<IImage> createImage(SDL_Surface * source) = 0;
  32. /// Loads animation using given path
  33. virtual std::shared_ptr<CAnimation> loadAnimation(const AnimationPath & path, EImageBlitMode mode) = 0;
  34. };