mirror of
https://github.com/86Box/86Box.git
synced 2026-02-25 04:45:31 -07:00
Merge branch 'master' of https://github.com/86Box/86Box
This commit is contained in:
@@ -54,6 +54,7 @@ extern "C" {
|
||||
#include <86box/apm.h>
|
||||
#include <86box/nvr.h>
|
||||
#include <86box/acpi.h>
|
||||
#include <86box/renderdefs.h>
|
||||
|
||||
#ifdef USE_VNC
|
||||
# include <86box/vnc.h>
|
||||
@@ -424,29 +425,17 @@ MainWindow::MainWindow(QWidget *parent)
|
||||
ui->actionEnable_Discord_integration->setEnabled(discord_loaded);
|
||||
#endif
|
||||
|
||||
#if defined Q_OS_WINDOWS || defined Q_OS_MACOS
|
||||
/* Make the option visible only if ANGLE is loaded. */
|
||||
ui->actionHardware_Renderer_OpenGL_ES->setVisible(QOpenGLContext::openGLModuleType() == QOpenGLContext::LibGLES);
|
||||
if (QOpenGLContext::openGLModuleType() != QOpenGLContext::LibGLES && vid_api == 2)
|
||||
vid_api = 1;
|
||||
#endif
|
||||
ui->actionHardware_Renderer_OpenGL->setVisible(QOpenGLContext::openGLModuleType() != QOpenGLContext::LibGLES);
|
||||
if (QOpenGLContext::openGLModuleType() == QOpenGLContext::LibGLES && vid_api == 1)
|
||||
vid_api = 0;
|
||||
|
||||
if ((QApplication::platformName().contains("eglfs") || QApplication::platformName() == "haiku")) {
|
||||
if (vid_api >= 1)
|
||||
if ((vid_api == RENDERER_OPENGL3) || (vid_api == RENDERER_VULKAN))
|
||||
fprintf(stderr, "OpenGL renderers are unsupported on %s.\n", QApplication::platformName().toUtf8().data());
|
||||
vid_api = 0;
|
||||
ui->actionHardware_Renderer_OpenGL->setVisible(false);
|
||||
ui->actionHardware_Renderer_OpenGL_ES->setVisible(false);
|
||||
vid_api = RENDERER_SOFTWARE;
|
||||
ui->actionVulkan->setVisible(false);
|
||||
ui->actionOpenGL_3_0_Core->setVisible(false);
|
||||
}
|
||||
|
||||
#ifndef USE_VNC
|
||||
if (vid_api == 5)
|
||||
vid_api = 0;
|
||||
if (vid_api == RENDERER_VNC)
|
||||
vid_api = RENDERER_SOFTWARE;
|
||||
ui->actionVNC->setVisible(false);
|
||||
#endif
|
||||
|
||||
@@ -466,15 +455,13 @@ MainWindow::MainWindow(QWidget *parent)
|
||||
if (!vulkanAvailable)
|
||||
#endif
|
||||
{
|
||||
if (vid_api == 4)
|
||||
vid_api = 0;
|
||||
if (vid_api == RENDERER_VULKAN)
|
||||
vid_api = RENDERER_SOFTWARE;
|
||||
ui->actionVulkan->setVisible(false);
|
||||
}
|
||||
|
||||
auto actGroup = new QActionGroup(this);
|
||||
actGroup->addAction(ui->actionSoftware_Renderer);
|
||||
actGroup->addAction(ui->actionHardware_Renderer_OpenGL);
|
||||
actGroup->addAction(ui->actionHardware_Renderer_OpenGL_ES);
|
||||
actGroup->addAction(ui->actionOpenGL_3_0_Core);
|
||||
actGroup->addAction(ui->actionVulkan);
|
||||
actGroup->addAction(ui->actionVNC);
|
||||
@@ -483,7 +470,7 @@ MainWindow::MainWindow(QWidget *parent)
|
||||
connect(actGroup, &QActionGroup::triggered, [this](QAction *action) {
|
||||
vid_api = action->property("vid_api").toInt();
|
||||
#ifdef USE_VNC
|
||||
if (vnc_enabled && vid_api != 5) {
|
||||
if (vnc_enabled && vid_api != RENDERER_VNC) {
|
||||
startblit();
|
||||
vnc_enabled = 0;
|
||||
vnc_close();
|
||||
@@ -495,23 +482,17 @@ MainWindow::MainWindow(QWidget *parent)
|
||||
switch (vid_api) {
|
||||
default:
|
||||
break;
|
||||
case 0:
|
||||
case RENDERER_SOFTWARE:
|
||||
newVidApi = RendererStack::Renderer::Software;
|
||||
break;
|
||||
case 1:
|
||||
newVidApi = RendererStack::Renderer::OpenGL;
|
||||
break;
|
||||
case 2:
|
||||
newVidApi = RendererStack::Renderer::OpenGLES;
|
||||
break;
|
||||
case 3:
|
||||
case RENDERER_OPENGL3:
|
||||
newVidApi = RendererStack::Renderer::OpenGL3;
|
||||
break;
|
||||
case 4:
|
||||
case RENDERER_VULKAN:
|
||||
newVidApi = RendererStack::Renderer::Vulkan;
|
||||
break;
|
||||
#ifdef USE_VNC
|
||||
case 5:
|
||||
case RENDERER_VNC:
|
||||
{
|
||||
newVidApi = RendererStack::Renderer::Software;
|
||||
startblit();
|
||||
|
||||
Reference in New Issue
Block a user