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

@@ -55,7 +55,12 @@ FrontendSDL::FrontendSDL() : keyboardMappings(InputMappings::defaultKeyboardMapp
windowWidth = 400;
windowHeight = 480;
}
// Initialize output size and screen layout
emu.setOutputSize(windowWidth, windowHeight);
ScreenLayout::calculateCoordinates(
screenCoordinates, u32(windowWidth), u32(windowHeight), emu.getConfig().topScreenSize, emu.getConfig().screenLayout
);
if (needOpenGL) {
// Demand 4.1 core for OpenGL renderer (max available on MacOS), 3.3 for the software & null renderers
@@ -365,7 +370,11 @@ void FrontendSDL::run() {
if (type == SDL_WINDOWEVENT_RESIZED) {
windowWidth = event.window.data1;
windowHeight = event.window.data2;
ScreenLayout::calculateCoordinates(screenCoordinates, u32(windowWidth), u32(windowHeight), ScreenLayout::Layout::Default);
const auto& config = emu.getConfig();
ScreenLayout::calculateCoordinates(
screenCoordinates, u32(windowWidth), u32(windowHeight), emu.getConfig().topScreenSize, emu.getConfig().screenLayout
);
emu.setOutputSize(windowWidth, windowHeight);
}