2023-09-04 18:01:44 +03:00
|
|
|
/*
|
|
|
|
* IRenderHandler.h, part of VCMI engine
|
|
|
|
*
|
|
|
|
* Authors: listed in file AUTHORS in main folder
|
|
|
|
*
|
|
|
|
* License: GNU General Public License v2.0 or later
|
|
|
|
* Full text of license available in license.txt file, in main folder
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
|
2024-06-17 09:30:16 +00:00
|
|
|
#include "ImageLocator.h"
|
2023-09-04 18:01:44 +03:00
|
|
|
|
2024-06-05 14:31:37 +00:00
|
|
|
VCMI_LIB_NAMESPACE_BEGIN
|
|
|
|
class Services;
|
|
|
|
VCMI_LIB_NAMESPACE_END
|
|
|
|
|
2023-09-04 18:01:44 +03:00
|
|
|
struct SDL_Surface;
|
|
|
|
|
2024-09-23 15:43:11 +00:00
|
|
|
class IFont;
|
2023-09-04 18:01:44 +03:00
|
|
|
class IImage;
|
|
|
|
class CAnimation;
|
2025-01-16 15:09:03 +00:00
|
|
|
class CanvasImage;
|
2025-01-15 17:05:45 +00:00
|
|
|
class SDLImageShared;
|
2024-07-25 10:38:48 +00:00
|
|
|
enum class EImageBlitMode : uint8_t;
|
2025-01-16 15:09:03 +00:00
|
|
|
enum class CanvasScalingPolicy;
|
2024-09-23 15:43:11 +00:00
|
|
|
enum EFonts : int8_t;
|
2023-09-04 18:01:44 +03:00
|
|
|
|
|
|
|
class IRenderHandler : public boost::noncopyable
|
|
|
|
{
|
|
|
|
public:
|
2023-09-04 22:44:01 +03:00
|
|
|
virtual ~IRenderHandler() = default;
|
|
|
|
|
2024-06-05 14:31:37 +00:00
|
|
|
/// Must be called once VLC loading is over to initialize icons
|
|
|
|
virtual void onLibraryLoadingFinished(const Services * services) = 0;
|
|
|
|
|
2023-09-04 18:01:44 +03:00
|
|
|
/// Loads image using given path
|
2025-01-15 17:05:45 +00:00
|
|
|
virtual std::shared_ptr<IImage> loadImage(const ImageLocator & locator) = 0;
|
2023-09-04 18:01:44 +03:00
|
|
|
virtual std::shared_ptr<IImage> loadImage(const ImagePath & path, EImageBlitMode mode) = 0;
|
2024-06-08 07:35:13 +00:00
|
|
|
virtual std::shared_ptr<IImage> loadImage(const AnimationPath & path, int frame, int group, EImageBlitMode mode) = 0;
|
2024-05-22 11:28:13 +00:00
|
|
|
|
2025-01-17 12:17:29 +00:00
|
|
|
/// Loads single upscaled image without auto-scaling support
|
|
|
|
virtual std::shared_ptr<SDLImageShared> loadScaledImage(const ImageLocator & locator) = 0;
|
2025-01-15 17:05:45 +00:00
|
|
|
|
2025-01-16 15:09:03 +00:00
|
|
|
/// Creates image which can be used as target for drawing on
|
|
|
|
virtual std::shared_ptr<CanvasImage> createImage(const Point & size, CanvasScalingPolicy scalingPolicy) = 0;
|
2023-09-04 18:01:44 +03:00
|
|
|
|
|
|
|
/// Loads animation using given path
|
2024-06-08 07:35:13 +00:00
|
|
|
virtual std::shared_ptr<CAnimation> loadAnimation(const AnimationPath & path, EImageBlitMode mode) = 0;
|
2024-09-23 15:43:11 +00:00
|
|
|
|
|
|
|
/// Returns font with specified identifer
|
|
|
|
virtual std::shared_ptr<const IFont> loadFont(EFonts font) = 0;
|
2025-01-29 10:03:58 +00:00
|
|
|
|
|
|
|
virtual void exportGeneratedAssets() = 0;
|
2023-09-04 18:01:44 +03:00
|
|
|
};
|