framebuffer_layout.h 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. // Copyright 2016 Citra Emulator Project
  2. // Licensed under GPLv2 or any later version
  3. // Refer to the license.txt file included.
  4. #pragma once
  5. #include "common/math_util.h"
  6. namespace Layout {
  7. /// Describes the layout of the window framebuffer (size and top/bottom screen positions)
  8. struct FramebufferLayout {
  9. unsigned width;
  10. unsigned height;
  11. bool top_screen_enabled;
  12. bool bottom_screen_enabled;
  13. MathUtil::Rectangle<unsigned> top_screen;
  14. MathUtil::Rectangle<unsigned> bottom_screen;
  15. };
  16. /**
  17. * Factory method for constructing a default FramebufferLayout
  18. * @param width Window framebuffer width in pixels
  19. * @param height Window framebuffer height in pixels
  20. * @param is_swapped if true, the bottom screen will be displayed above the top screen
  21. * @return Newly created FramebufferLayout object with default screen regions initialized
  22. */
  23. FramebufferLayout DefaultFrameLayout(unsigned width, unsigned height, bool is_swapped);
  24. /**
  25. * Factory method for constructing a FramebufferLayout with only the top or bottom screen
  26. * @param width Window framebuffer width in pixels
  27. * @param height Window framebuffer height in pixels
  28. * @param is_swapped if true, the bottom screen will be displayed (and the top won't be displayed)
  29. * @return Newly created FramebufferLayout object with default screen regions initialized
  30. */
  31. FramebufferLayout SingleFrameLayout(unsigned width, unsigned height, bool is_swapped);
  32. /**
  33. * Factory method for constructing a Frame with the a 4x size Top screen with a 1x size bottom
  34. * screen on the right
  35. * This is useful in particular because it matches well with a 1920x1080 resolution monitor
  36. * @param width Window framebuffer width in pixels
  37. * @param height Window framebuffer height in pixels
  38. * @param is_swapped if true, the bottom screen will be the large display
  39. * @return Newly created FramebufferLayout object with default screen regions initialized
  40. */
  41. FramebufferLayout LargeFrameLayout(unsigned width, unsigned height, bool is_swapped);
  42. }