Files
kaizen/src/frontend/RenderWidget.cpp
SimoneN64 042fd05338 WORKS
2024-01-19 00:59:47 +01:00

28 lines
902 B
C++

#include <RenderWidget.hpp>
#include <KaizenQt.hpp>
RenderWidget::RenderWidget(QWidget* parent) : QWidget(parent) {
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);
}
if(!Vulkan::Context::init_loader(nullptr)) {
Util::panic("Could not initialize Vulkan ICD");
}
instance = std::make_unique<QtInstanceFactory>();
windowHandle()->setVulkanInstance(&instance->qVkInstance);
windowHandle()->create();
wsiPlatform = std::make_unique<QtWSIPlatform>(windowHandle());
windowInfo = std::make_unique<QtParallelRdpWindowInfo>(windowHandle());
}