summaryrefslogtreecommitdiff
path: root/src/yuzu/bootmanager.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/yuzu/bootmanager.cpp')
-rw-r--r--src/yuzu/bootmanager.cpp32
1 files changed, 27 insertions, 5 deletions
diff --git a/src/yuzu/bootmanager.cpp b/src/yuzu/bootmanager.cpp
index d88efacd7..5b5b6fed8 100644
--- a/src/yuzu/bootmanager.cpp
+++ b/src/yuzu/bootmanager.cpp
@@ -4,8 +4,10 @@
#include <glad/glad.h>
#include <QApplication>
+#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0)) && YUZU_USE_QT_MULTIMEDIA
#include <QCameraImageCapture>
#include <QCameraInfo>
+#endif
#include <QHBoxLayout>
#include <QMessageBox>
#include <QPainter>
@@ -116,7 +118,7 @@ void EmuThread::run() {
}
} else {
std::unique_lock lock{running_mutex};
- running_cv.wait(lock, stop_token, [this] { return IsRunning(); });
+ Common::CondvarWait(running_cv, lock, stop_token, [&] { return IsRunning(); });
}
}
@@ -235,8 +237,7 @@ private:
GRenderWindow* render_window;
};
-class OpenGLRenderWidget : public RenderWidget {
-public:
+struct OpenGLRenderWidget : public RenderWidget {
explicit OpenGLRenderWidget(GRenderWindow* parent) : RenderWidget(parent) {
windowHandle()->setSurfaceType(QWindow::OpenGLSurface);
}
@@ -249,13 +250,16 @@ private:
std::unique_ptr<Core::Frontend::GraphicsContext> context;
};
-class VulkanRenderWidget : public RenderWidget {
-public:
+struct VulkanRenderWidget : public RenderWidget {
explicit VulkanRenderWidget(GRenderWindow* parent) : RenderWidget(parent) {
windowHandle()->setSurfaceType(QWindow::VulkanSurface);
}
};
+struct NullRenderWidget : public RenderWidget {
+ explicit NullRenderWidget(GRenderWindow* parent) : RenderWidget(parent) {}
+};
+
static Core::Frontend::WindowSystemType GetWindowSystemType() {
// Determine WSI type based on Qt platform.
QString platform_name = QGuiApplication::platformName();
@@ -265,6 +269,10 @@ static Core::Frontend::WindowSystemType GetWindowSystemType() {
return Core::Frontend::WindowSystemType::X11;
else if (platform_name == QStringLiteral("wayland"))
return Core::Frontend::WindowSystemType::Wayland;
+ else if (platform_name == QStringLiteral("cocoa"))
+ return Core::Frontend::WindowSystemType::Cocoa;
+ else if (platform_name == QStringLiteral("android"))
+ return Core::Frontend::WindowSystemType::Android;
LOG_CRITICAL(Frontend, "Unknown Qt platform!");
return Core::Frontend::WindowSystemType::Windows;
@@ -707,6 +715,7 @@ void GRenderWindow::TouchEndEvent() {
}
void GRenderWindow::InitializeCamera() {
+#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0)) && YUZU_USE_QT_MULTIMEDIA
constexpr auto camera_update_ms = std::chrono::milliseconds{50}; // (50ms, 20Hz)
if (!Settings::values.enable_ir_sensor) {
return;
@@ -760,18 +769,22 @@ void GRenderWindow::InitializeCamera() {
connect(camera_timer.get(), &QTimer::timeout, [this] { RequestCameraCapture(); });
// This timer should be dependent of camera resolution 5ms for every 100 pixels
camera_timer->start(camera_update_ms);
+#endif
}
void GRenderWindow::FinalizeCamera() {
+#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0)) && YUZU_USE_QT_MULTIMEDIA
if (camera_timer) {
camera_timer->stop();
}
if (camera) {
camera->unload();
}
+#endif
}
void GRenderWindow::RequestCameraCapture() {
+#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0)) && YUZU_USE_QT_MULTIMEDIA
if (!Settings::values.enable_ir_sensor) {
return;
}
@@ -788,6 +801,7 @@ void GRenderWindow::RequestCameraCapture() {
pending_camera_snapshots++;
camera_capture->capture();
+#endif
}
void GRenderWindow::OnCameraCapture(int requestId, const QImage& img) {
@@ -866,6 +880,9 @@ bool GRenderWindow::InitRenderTarget() {
return false;
}
break;
+ case Settings::RendererBackend::Null:
+ InitializeNull();
+ break;
}
// Update the Window System information with the new render target
@@ -962,6 +979,11 @@ bool GRenderWindow::InitializeVulkan() {
return true;
}
+void GRenderWindow::InitializeNull() {
+ child_widget = new NullRenderWidget(this);
+ main_context = std::make_unique<DummyContext>();
+}
+
bool GRenderWindow::LoadOpenGL() {
auto context = CreateSharedContext();
auto scope = context->Acquire();