This commit is contained in:
SimoneN64
2024-09-18 17:00:43 +02:00
parent 610990468d
commit 96ab593d6f
2 changed files with 18 additions and 0 deletions

View File

@@ -7,6 +7,7 @@
#include <imgui_impl_vulkan.h>
#include <SDL3/SDL.h>
#include <SDL3/SDL_vulkan.h>
#include <RenderWidget.hpp>
using namespace Vulkan;
using namespace RDP;
@@ -36,6 +37,21 @@ void ParallelRDP::LoadWSIPlatform(const std::shared_ptr<Vulkan::InstanceFactory>
}
windowInfo = newWindowInfo;
auto props = SDL_CreateProperties();
#ifdef SDL_PLATFORM_LINUX
SDL_SetPointerProperty(props, SDL_PROP_WINDOW_CREATE_WAYLAND_WL_SURFACE_POINTER,
dynamic_cast<QtWSIPlatform>(wsi_platform.get())->window->winId());
SDL_SetPointerProperty(props, SDL_PROP_WINDOW_X11_DISPLAY_POINTER,
dynamic_cast<QtWSIPlatform>(wsi_platform.get())->window->winId());
#elif SDL_PLATFORM_WINDOWS
SDL_SetPointerProperty(props, SDL_PROP_WINDOW_CREATE_WIN32_HWND_POINTER,
dynamic_cast<QtWSIPlatform>(wsi_platform.get())->window->winId());
#else
SDL_SetPointerProperty(props, SDL_PROP_WINDOW_CREATE_COCOA_WINDOW_POINTER,
dynamic_cast<QtWSIPlatform>(wsi_platform.get())->window->winId());
#endif
SDLWindow = SDL_CreateWindowWithProperties(props);
}
void ParallelRDP::Init(const std::shared_ptr<Vulkan::InstanceFactory> &factory,

View File

@@ -2,6 +2,7 @@
#include <backend/Core.hpp>
#include <rdp_device.hpp>
#include <wsi.hpp>
#include <SDL3/SDL.h>
class ParallelRDP {
public:
@@ -34,4 +35,5 @@ private:
std::shared_ptr<Vulkan::WSI> wsi;
std::shared_ptr<RDP::CommandProcessor> command_processor;
std::shared_ptr<WindowInfo> windowInfo;
SDL_Window *SDLWindow;
};