2023-04-30 17:47:52 +02:00
|
|
|
/*
|
2023-05-08 12:22:01 +02:00
|
|
|
* IScreenHandler.h, part of VCMI engine
|
2023-04-30 17:47:52 +02:00
|
|
|
*
|
|
|
|
* 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
|
|
|
|
|
|
|
|
VCMI_LIB_NAMESPACE_BEGIN
|
|
|
|
class Point;
|
2023-07-05 16:17:01 +02:00
|
|
|
class Rect;
|
2023-04-30 17:47:52 +02:00
|
|
|
VCMI_LIB_NAMESPACE_END
|
|
|
|
|
2023-05-08 12:22:01 +02:00
|
|
|
class IScreenHandler
|
2023-04-30 17:47:52 +02:00
|
|
|
{
|
|
|
|
public:
|
2023-05-08 12:22:01 +02:00
|
|
|
virtual ~IScreenHandler() = default;
|
2023-04-30 17:47:52 +02:00
|
|
|
|
|
|
|
/// Updates window state after fullscreen state has been changed in settings
|
2023-05-04 21:33:25 +02:00
|
|
|
virtual void onScreenResize() = 0;
|
2023-04-30 17:47:52 +02:00
|
|
|
|
|
|
|
/// De-initializes window state
|
|
|
|
virtual void close() = 0;
|
|
|
|
|
|
|
|
/// Fills screen with black color, erasing any existing content
|
|
|
|
virtual void clearScreen() = 0;
|
|
|
|
|
|
|
|
/// Returns list of resolutions supported by current screen
|
|
|
|
virtual std::vector<Point> getSupportedResolutions() const = 0;
|
2023-05-04 22:50:33 +02:00
|
|
|
|
2023-05-08 12:22:01 +02:00
|
|
|
/// Returns <min, max> range of possible values for screen scaling percentage
|
|
|
|
virtual std::tuple<int, int> getSupportedScalingRange() const = 0;
|
2023-07-05 16:17:01 +02:00
|
|
|
|
|
|
|
/// Converts provided rect from logical coordinates into coordinates within window, accounting for scaling and viewport
|
|
|
|
virtual Rect convertLogicalPointsToWindow(const Rect & input) const = 0;
|
2023-07-13 19:11:08 +02:00
|
|
|
|
|
|
|
/// Dimensions of render output
|
|
|
|
virtual Point getRenderResolution() const = 0;
|
2023-09-19 11:20:16 +02:00
|
|
|
|
2024-07-21 23:11:02 +02:00
|
|
|
/// Dimensions of logical output. Can be different if scaling is used
|
|
|
|
virtual Point getLogicalResolution() const = 0;
|
|
|
|
|
2024-10-09 19:37:47 +02:00
|
|
|
virtual int getInterfaceScalingPercentage() const = 0;
|
|
|
|
|
2024-07-22 11:52:33 +02:00
|
|
|
virtual int getScalingFactor() const = 0;
|
|
|
|
|
2023-09-19 11:20:16 +02:00
|
|
|
/// Window has focus
|
|
|
|
virtual bool hasFocus() = 0;
|
2023-04-30 17:47:52 +02:00
|
|
|
};
|