IScreenHandler.h 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  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. /// Window has focus
  34. virtual bool hasFocus() = 0;
  35. };