From ca1fcaca3bc391491111fe951883cb57ac00a61c Mon Sep 17 00:00:00 2001 From: lizzie Date: Wed, 6 May 2026 03:23:27 +0200 Subject: [opengl] remove GLAD symbols from builds w/o OpenGL (#3922) removes unused symbols from non-OpenGL builds, notably mac I REMEMBER MAKING THIS PR A WHILE AGO but I have no record of it here, so hell lets redo it Signed-off-by: lizzie Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/3922 Reviewed-by: crueter Reviewed-by: MaranBr --- src/yuzu/bootmanager.cpp | 31 ++++++++++++++++++++++--------- 1 file changed, 22 insertions(+), 9 deletions(-) (limited to 'src/yuzu/bootmanager.cpp') diff --git a/src/yuzu/bootmanager.cpp b/src/yuzu/bootmanager.cpp index 0c0ce6e90c..2408ef265f 100644 --- a/src/yuzu/bootmanager.cpp +++ b/src/yuzu/bootmanager.cpp @@ -8,7 +8,10 @@ #include #include #include + +#ifdef HAS_OPENGL #include +#endif #include #include "common/settings_enums.h" @@ -1039,11 +1042,12 @@ void GRenderWindow::InitializeNull() { } bool GRenderWindow::LoadOpenGL() { +#ifdef HAS_OPENGL auto context = CreateSharedContext(); auto scope = context->Acquire(); if (!gladLoadGL()) { - QMessageBox::warning( - this, tr("Error while initializing OpenGL!"), + QtCommon::Frontend::Warning( + tr("Error while initializing OpenGL!"), tr("Your GPU may not support OpenGL, or you do not have the latest graphics driver.")); return false; } @@ -1052,15 +1056,16 @@ bool GRenderWindow::LoadOpenGL() { const QString renderer = QString::fromUtf8(reinterpret_cast(glGetString(GL_RENDERER))); if (!GLAD_GL_VERSION_4_6) { - QMessageBox::warning(this, tr("Error while initializing OpenGL 4.6!"), - tr("Your GPU may not support OpenGL 4.6, or you do not have the " - "latest graphics driver.

GL Renderer:
%1") - .arg(renderer)); + QtCommon::Frontend::Warning( + tr("Error while initializing OpenGL 4.6!"), + tr("Your GPU may not support OpenGL 4.6, or you do not have the " + "latest graphics driver.

GL Renderer:
%1") + .arg(renderer)); return false; } if (QStringList missing_ext = GetUnsupportedGLExtensions(); !missing_ext.empty()) { - QMessageBox::warning( - this, tr("Error while initializing OpenGL!"), + QtCommon::Frontend::Warning( + tr("Error while initializing OpenGL!"), tr("Your GPU may not support one or more required OpenGL extensions. Please ensure you " "have the latest graphics driver.

GL Renderer:
%1

Unsupported " "extensions:
%2") @@ -1069,10 +1074,17 @@ bool GRenderWindow::LoadOpenGL() { // Non fatal } return true; +#else + QtCommon::Frontend::Warning( + tr("Error while initializing OpenGL!"), + tr("This build doesn't have OpenGL support.")); + return false; +#endif } QStringList GRenderWindow::GetUnsupportedGLExtensions() const { - QStringList missing_ext; + QStringList missing_ext{}; +#ifdef HAS_OPENGL // Extensions required to support some texture formats. if (!GLAD_GL_EXT_texture_compression_s3tc) missing_ext.append(QStringLiteral("EXT_texture_compression_s3tc")); @@ -1082,6 +1094,7 @@ QStringList GRenderWindow::GetUnsupportedGLExtensions() const { LOG_ERROR(Frontend, "GPU does not support all required extensions"); for (const QString& ext : missing_ext) LOG_ERROR(Frontend, "Unsupported GL extension: {}", ext.toStdString()); +#endif return missing_ext; } -- cgit v1.2.3