diff --git a/src/panda_qt/main_window.cpp b/src/panda_qt/main_window.cpp index 7d64f350..253dea96 100644 --- a/src/panda_qt/main_window.cpp +++ b/src/panda_qt/main_window.cpp @@ -10,7 +10,7 @@ #include "cheats.hpp" #include "input_mappings.hpp" #include "panda_qt/dsp_debugger.hpp" -#include "panda_qt/screen/screen_gl.hpp" +#include "panda_qt/screen/screen_mtl.hpp" #include "sdl_sensors.hpp" #include "services/dsp.hpp" #include "version.hpp" @@ -38,7 +38,7 @@ MainWindow::MainWindow(QApplication* app, QWidget* parent) : QMainWindow(parent) api = ScreenWidget::API::Metal; // We pass a callback to the screen widget that will be triggered every time we resize the screen - screen = new ScreenWidgetGL(api, [this](u32 width, u32 height) { handleScreenResize(width, height); }, this); + screen = new ScreenWidgetMTL(api, [this](u32 width, u32 height) { handleScreenResize(width, height); }, this); setCentralWidget(screen); appRunning = true; diff --git a/src/panda_qt/screen/screen.cpp b/src/panda_qt/screen/screen.cpp index 534f06d7..777e91d6 100644 --- a/src/panda_qt/screen/screen.cpp +++ b/src/panda_qt/screen/screen.cpp @@ -14,9 +14,9 @@ #include #endif -#include "panda_qt/screen//screen_mtl.hpp" #include "panda_qt/screen/screen.hpp" #include "panda_qt/screen/screen_gl.hpp" +#include "panda_qt/screen/screen_mtl.hpp" // Screen widget, based on https://github.com/stenzek/duckstation/blob/master/src/duckstation-qt/displaywidget.cpp // and https://github.com/melonDS-emu/melonDS/blob/master/src/frontend/qt_sdl/main.cpp diff --git a/src/panda_qt/screen/screen_mtl.cpp b/src/panda_qt/screen/screen_mtl.cpp index 588363fa..7c916f23 100644 --- a/src/panda_qt/screen/screen_mtl.cpp +++ b/src/panda_qt/screen/screen_mtl.cpp @@ -9,6 +9,10 @@ ScreenWidgetMTL::ScreenWidgetMTL(API api, ResizeCallback resizeCallback, QWidget show(); } -void ScreenWidgetMTL::resizeDisplay() { resizeMetalView(); } +void ScreenWidgetMTL::resizeDisplay() { + resizeMetalView(); + resizeCallback(surfaceWidth, surfaceHeight); +} + bool ScreenWidgetMTL::createContext() { return createMetalContext(); } void* ScreenWidgetMTL::getMTKLayer() { return mtkLayer; } \ No newline at end of file