qt: Disable OpenGL 3.0 renderer for macOS.
Until it's figured out, macOS has dummy implementation to keep it building.
This commit is contained in:
@@ -49,13 +49,6 @@ add_library(ui STATIC
|
|||||||
qt_softwarerenderer.hpp
|
qt_softwarerenderer.hpp
|
||||||
qt_hardwarerenderer.cpp
|
qt_hardwarerenderer.cpp
|
||||||
qt_hardwarerenderer.hpp
|
qt_hardwarerenderer.hpp
|
||||||
qt_openglrenderer.cpp
|
|
||||||
qt_openglrenderer.hpp
|
|
||||||
qt_opengloptions.cpp
|
|
||||||
qt_opengloptions.hpp
|
|
||||||
qt_opengloptionsdialog.cpp
|
|
||||||
qt_opengloptionsdialog.hpp
|
|
||||||
qt_opengloptionsdialog.ui
|
|
||||||
|
|
||||||
qt_settings.cpp
|
qt_settings.cpp
|
||||||
qt_settings.hpp
|
qt_settings.hpp
|
||||||
@@ -137,6 +130,19 @@ add_library(ui STATIC
|
|||||||
../qt_resources.qrc
|
../qt_resources.qrc
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if(NOT APPLE)
|
||||||
|
target_sources(ui PRIVATE
|
||||||
|
qt_openglrenderer.cpp
|
||||||
|
qt_openglrenderer.hpp
|
||||||
|
qt_opengloptions.cpp
|
||||||
|
qt_opengloptions.hpp
|
||||||
|
qt_opengloptionsdialog.cpp
|
||||||
|
qt_opengloptionsdialog.hpp
|
||||||
|
qt_opengloptionsdialog.ui
|
||||||
|
)
|
||||||
|
else()
|
||||||
|
target_sources(ui PRIVATE qt_opengldummy.hpp)
|
||||||
|
endif()
|
||||||
|
|
||||||
if(WIN32)
|
if(WIN32)
|
||||||
enable_language(RC)
|
enable_language(RC)
|
||||||
|
@@ -231,6 +231,9 @@ MainWindow::MainWindow(QWidget *parent) :
|
|||||||
ui->actionHardware_Renderer_OpenGL_ES->setVisible(QOpenGLContext::openGLModuleType() == QOpenGLContext::LibGLES);
|
ui->actionHardware_Renderer_OpenGL_ES->setVisible(QOpenGLContext::openGLModuleType() == QOpenGLContext::LibGLES);
|
||||||
if (QOpenGLContext::openGLModuleType() != QOpenGLContext::LibGLES && vid_api == 2) vid_api = 1;
|
if (QOpenGLContext::openGLModuleType() != QOpenGLContext::LibGLES && vid_api == 2) vid_api = 1;
|
||||||
#endif
|
#endif
|
||||||
|
#ifdef Q_OS_MACOS
|
||||||
|
ui->actionOpenGL_3_0_Core->setVisible(false);
|
||||||
|
#endif
|
||||||
|
|
||||||
if (QApplication::platformName().contains("eglfs") && vid_api >= 1) {
|
if (QApplication::platformName().contains("eglfs") && vid_api >= 1) {
|
||||||
fprintf(stderr, "OpenGL renderers are unsupported on EGLFS.\n");
|
fprintf(stderr, "OpenGL renderers are unsupported on EGLFS.\n");
|
||||||
|
40
src/qt/qt_opengldummy.hpp
Normal file
40
src/qt/qt_opengldummy.hpp
Normal file
@@ -0,0 +1,40 @@
|
|||||||
|
#ifndef QT_OPENGLDUMMY_HPP
|
||||||
|
#define QT_OPENGLDUMMY_HPP
|
||||||
|
|
||||||
|
#include <QResizeEvent>
|
||||||
|
#include <QWidget>
|
||||||
|
#include <QWindow>
|
||||||
|
|
||||||
|
#include <atomic>
|
||||||
|
#include <tuple>
|
||||||
|
#include <vector>
|
||||||
|
|
||||||
|
#include "qt_renderercommon.hpp"
|
||||||
|
|
||||||
|
/* Dummy implementation of OpenGLRenderer so macOS builds. */
|
||||||
|
class OpenGLRenderer : public QWindow, public RendererCommon {
|
||||||
|
Q_OBJECT
|
||||||
|
public:
|
||||||
|
OpenGLRenderer(QWidget *parent = nullptr) { emit errorInitializing(); }
|
||||||
|
virtual std::vector<std::tuple<uint8_t *, std::atomic_flag *>> getBuffers() { return std::vector<std::tuple<uint8_t *, std::atomic_flag *>>(); }
|
||||||
|
|
||||||
|
signals:
|
||||||
|
void initialized();
|
||||||
|
void errorInitializing();
|
||||||
|
|
||||||
|
public slots:
|
||||||
|
void onBlit(int buf_idx, int x, int y, int w, int h) { }
|
||||||
|
|
||||||
|
protected:
|
||||||
|
void exposeEvent(QExposeEvent *event) override
|
||||||
|
{
|
||||||
|
if (!done)
|
||||||
|
emit errorInitializing();
|
||||||
|
done = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
private:
|
||||||
|
bool done = false;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
@@ -22,15 +22,21 @@
|
|||||||
#include "ui_qt_rendererstack.h"
|
#include "ui_qt_rendererstack.h"
|
||||||
|
|
||||||
#include "qt_hardwarerenderer.hpp"
|
#include "qt_hardwarerenderer.hpp"
|
||||||
#include "qt_openglrenderer.hpp"
|
|
||||||
#include "qt_softwarerenderer.hpp"
|
#include "qt_softwarerenderer.hpp"
|
||||||
|
|
||||||
|
#ifndef Q_OS_MACOS
|
||||||
|
# include "qt_openglrenderer.hpp"
|
||||||
|
#else
|
||||||
|
# include "qt_opengldummy.hpp"
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "qt_mainwindow.hpp"
|
#include "qt_mainwindow.hpp"
|
||||||
#include "qt_util.hpp"
|
#include "qt_util.hpp"
|
||||||
|
|
||||||
#include "evdev_mouse.hpp"
|
#include "evdev_mouse.hpp"
|
||||||
|
|
||||||
#include <QScreen>
|
#include <QScreen>
|
||||||
|
#include <QTimer>
|
||||||
|
|
||||||
#ifdef __APPLE__
|
#ifdef __APPLE__
|
||||||
# include <CoreGraphics/CoreGraphics.h>
|
# include <CoreGraphics/CoreGraphics.h>
|
||||||
|
Reference in New Issue
Block a user