Okokokokokokokok

This commit is contained in:
Simone
2024-01-18 17:12:23 +01:00
parent 25a6a9f23d
commit 607a43620a
9 changed files with 156 additions and 25 deletions

View File

@@ -0,0 +1,31 @@
#include <RenderWidget.hpp>
#include <KaizenQt.hpp>
RenderWidget::RenderWidget(QWidget* parent) : QWidget(parent) {
if (volkInitialize() != VK_SUCCESS) {
Util::panic("Could not initialize Vulkan loader!");
}
create();
setAttribute(Qt::WA_NativeWindow);
setAttribute(Qt::WA_PaintOnScreen);
if (GetOSCompositorCategory() == CompositorCategory::Wayland) {
setAttribute(Qt::WA_DontCreateNativeAncestors);
}
if (GetOSCompositorCategory() == CompositorCategory::MacOS) {
windowHandle()->setSurfaceType(QWindow::MetalSurface);
}
else {
windowHandle()->setSurfaceType(QWindow::VulkanSurface);
}
instance.create();
windowHandle()->setVulkanInstance(&instance);
wsiPlatform = new QtWSIPlatform(windowHandle());
windowInfo = std::make_unique<QtParallelRdpWindowInfo>(windowHandle());
LoadWSIPlatform(wsiPlatform, std::move(windowInfo));
}