IScreenHandler.h 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. /*
  2. * IScreenHandler.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. VCMI_LIB_NAMESPACE_BEGIN
  12. class Point;
  13. class Rect;
  14. VCMI_LIB_NAMESPACE_END
  15. class IScreenHandler
  16. {
  17. public:
  18. virtual ~IScreenHandler() = default;
  19. /// Updates window state after fullscreen state has been changed in settings
  20. virtual void onScreenResize() = 0;
  21. /// De-initializes window state
  22. virtual void close() = 0;
  23. /// Fills screen with black color, erasing any existing content
  24. virtual void clearScreen() = 0;
  25. /// Returns list of resolutions supported by current screen
  26. virtual std::vector<Point> getSupportedResolutions() const = 0;
  27. /// Returns <min, max> range of possible values for screen scaling percentage
  28. virtual std::tuple<int, int> getSupportedScalingRange() const = 0;
  29. /// Converts provided rect from logical coordinates into coordinates within window, accounting for scaling and viewport
  30. virtual Rect convertLogicalPointsToWindow(const Rect & input) const = 0;
  31. /// Dimensions of render output
  32. virtual Point getRenderResolution() const = 0;
  33. /// Dimensions of logical output. Can be different if scaling is used
  34. virtual Point getLogicalResolution() const = 0;
  35. virtual int getInterfaceScalingPercentage() const = 0;
  36. virtual int getScalingFactor() const = 0;
  37. /// Window has focus
  38. virtual bool hasFocus() = 0;
  39. };