aboutsummaryrefslogtreecommitdiff
path: root/src/yuzu/bootmanager.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/yuzu/bootmanager.cpp')
-rw-r--r--src/yuzu/bootmanager.cpp28
1 files changed, 15 insertions, 13 deletions
diff --git a/src/yuzu/bootmanager.cpp b/src/yuzu/bootmanager.cpp
index 5c98636c5b..9e420b3591 100644
--- a/src/yuzu/bootmanager.cpp
+++ b/src/yuzu/bootmanager.cpp
@@ -91,25 +91,25 @@ void EmuThread::run() {
class GGLContext : public Core::Frontend::GraphicsContext {
public:
- explicit GGLContext(QOpenGLContext* shared_context)
- : context{std::make_unique<QOpenGLContext>(shared_context)} {
- surface.setFormat(shared_context->format());
- surface.create();
+ explicit GGLContext(QOpenGLContext* shared_context) : shared_context{shared_context} {
+ context.setFormat(shared_context->format());
+ context.setShareContext(shared_context);
+ context.create();
}
void MakeCurrent() override {
- context->makeCurrent(&surface);
+ context.makeCurrent(shared_context->surface());
}
void DoneCurrent() override {
- context->doneCurrent();
+ context.doneCurrent();
}
void SwapBuffers() override {}
private:
- std::unique_ptr<QOpenGLContext> context;
- QOffscreenSurface surface;
+ QOpenGLContext* shared_context;
+ QOpenGLContext context;
};
// This class overrides paintEvent and resizeEvent to prevent the GUI thread from stealing GL
@@ -188,7 +188,9 @@ private:
GRenderWindow::GRenderWindow(QWidget* parent, EmuThread* emu_thread)
: QWidget(parent), emu_thread(emu_thread) {
setWindowTitle(QStringLiteral("yuzu %1 | %2-%3")
- .arg(Common::g_build_name, Common::g_scm_branch, Common::g_scm_desc));
+ .arg(QString::fromUtf8(Common::g_build_name),
+ QString::fromUtf8(Common::g_scm_branch),
+ QString::fromUtf8(Common::g_scm_desc)));
setAttribute(Qt::WA_AcceptTouchEvents);
InputCommon::Init();
@@ -217,7 +219,7 @@ void GRenderWindow::SwapBuffers() {
// However:
// - The Qt debug runtime prints a bogus warning on the console if `makeCurrent` wasn't called
// since the last time `swapBuffers` was executed;
- // - On macOS, if `makeCurrent` isn't called explicitely, resizing the buffer breaks.
+ // - On macOS, if `makeCurrent` isn't called explicitly, resizing the buffer breaks.
context->makeCurrent(child);
context->swapBuffers(child);
@@ -356,7 +358,7 @@ void GRenderWindow::OnClientAreaResized(unsigned width, unsigned height) {
}
std::unique_ptr<Core::Frontend::GraphicsContext> GRenderWindow::CreateSharedContext() const {
- return std::make_unique<GGLContext>(shared_context.get());
+ return std::make_unique<GGLContext>(context.get());
}
void GRenderWindow::InitRenderTarget() {
@@ -379,6 +381,7 @@ void GRenderWindow::InitRenderTarget() {
fmt.setVersion(4, 3);
if (Settings::values.use_compatibility_profile) {
fmt.setProfile(QSurfaceFormat::CompatibilityProfile);
+ fmt.setOption(QSurfaceFormat::FormatOption::DeprecatedFunctions);
} else {
fmt.setProfile(QSurfaceFormat::CoreProfile);
}
@@ -437,8 +440,7 @@ void GRenderWindow::CaptureScreenshot(u16 res_scale, const QString& screenshot_p
layout);
}
-void GRenderWindow::OnMinimalClientAreaChangeRequest(
- const std::pair<unsigned, unsigned>& minimal_size) {
+void GRenderWindow::OnMinimalClientAreaChangeRequest(std::pair<unsigned, unsigned> minimal_size) {
setMinimumSize(minimal_size.first, minimal_size.second);
}