mirror of
https://github.com/azahar-emu/azahar.git
synced 2026-06-06 02:33:44 -04:00
Update framebuffer layout and renderers to correctly render hybrid mode on both primary and secondary displays
This commit is contained in:
parent
41b4e77206
commit
21fbf9f5ca
4 changed files with 11 additions and 9 deletions
|
|
@ -275,18 +275,19 @@ FramebufferLayout HybridScreenLayout(u32 width, u32 height, bool swapped, bool u
|
|||
std::swap(width, height);
|
||||
}
|
||||
|
||||
// Split the window into two parts. Give 2.25x width to the main screen,
|
||||
// and make a bar on the right side with 1x width top screen and 1.25x width bottom screen
|
||||
// To do that, find the total emulation box and maximize that based on window size
|
||||
// use Large Screen layout with these specific ratios to get two of the pieces
|
||||
const float scale_factor = swapped ? 2.25 : 1.8;
|
||||
const Settings::SmallScreenPosition pos = swapped ? Settings::SmallScreenPosition::TopRight
|
||||
: Settings::SmallScreenPosition::BottomRight;
|
||||
FramebufferLayout res = LargeFrameLayout(width, height, swapped, upright, scale_factor, pos);
|
||||
// always pass false as the upright value here, as it is being handled here not there
|
||||
FramebufferLayout res = LargeFrameLayout(width, height, swapped, false, scale_factor, pos);
|
||||
const Common::Rectangle<u32> main = swapped ? res.bottom_screen : res.top_screen;
|
||||
const Common::Rectangle<u32> small = swapped ? res.top_screen : res.bottom_screen;
|
||||
res.additional_screen = Common::Rectangle<u32>{small.left, swapped ? small.bottom : main.top,
|
||||
small.right, swapped ? main.bottom : small.top};
|
||||
res.additional_screen_is_bottom = swapped;
|
||||
res.additional_screen_enabled = true;
|
||||
res.is_rotated = !upright;
|
||||
if (upright) {
|
||||
return reverseLayout(res);
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -32,13 +32,14 @@ struct FramebufferLayout {
|
|||
bool bottom_screen_enabled;
|
||||
Common::Rectangle<u32> top_screen;
|
||||
Common::Rectangle<u32> bottom_screen;
|
||||
// is_rotated is true when the screen is in landscape mode - not sure why!
|
||||
bool is_rotated = true;
|
||||
bool is_portrait = false;
|
||||
bool additional_screen_enabled;
|
||||
bool additional_screen_enabled = false;
|
||||
// top_opacity is currently not used but could be used in the future
|
||||
float top_opacity = 1.0f;
|
||||
float bottom_opacity = 1.0f;
|
||||
bool additional_screen_is_bottom = false;
|
||||
Common::Rectangle<u32> additional_screen;
|
||||
|
||||
CardboardSettings cardboard;
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -706,7 +706,7 @@ void RendererOpenGL::DrawScreens(const Layout::FramebufferLayout& layout, bool f
|
|||
|
||||
if (layout.additional_screen_enabled) {
|
||||
const auto& additional_screen = layout.additional_screen;
|
||||
if (!Settings::values.swap_screen.GetValue()) {
|
||||
if (!layout.additional_screen_is_bottom) {
|
||||
DrawTopScreen(layout, additional_screen);
|
||||
} else {
|
||||
DrawBottomScreen(layout, additional_screen);
|
||||
|
|
|
|||
|
|
@ -1037,7 +1037,7 @@ void RendererVulkan::DrawScreens(Frame* frame, const Layout::FramebufferLayout&
|
|||
|
||||
if (layout.additional_screen_enabled) {
|
||||
const auto& additional_screen = layout.additional_screen;
|
||||
if (!Settings::values.swap_screen.GetValue()) {
|
||||
if (!layout.additional_screen_is_bottom) {
|
||||
DrawTopScreen(layout, additional_screen);
|
||||
} else {
|
||||
DrawBottomScreen(layout, additional_screen);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue