Better screen layout support

This commit is contained in:
wheremyfoodat 2025-07-06 02:41:44 +03:00
parent 1c0f65c740
commit cf321b1ed8
17 changed files with 328 additions and 186 deletions

View file

@ -3,7 +3,7 @@
#include <functional>
#include <memory>
#include "PICA/screen_layout.hpp"
#include "screen_layout.hpp"
#include "gl/context.h"
#include "window_info.h"
@ -33,6 +33,11 @@ class ScreenWidget : public QWidget {
// Coordinates (x/y/width/height) for the two screens in window space, used for properly handling touchscreen regardless
// of layout or resizing
ScreenLayout::WindowCoordinates screenCoordinates;
// Screen layouts and sizes
ScreenLayout::Layout screenLayout = ScreenLayout::Layout::Default;
float topScreenSize = 0.5f;
void reloadScreenLayout(ScreenLayout::Layout newLayout, float newTopScreenSize);
private:
std::unique_ptr<GL::Context> glContext = nullptr;
@ -44,4 +49,6 @@ class ScreenWidget : public QWidget {
int scaledWindowWidth() const;
int scaledWindowHeight() const;
std::optional<WindowInfo> getWindowInfo();
void reloadScreenCoordinates();
};