mirror of
https://github.com/Drezil/imgui.git
synced 2025-07-12 07:49:55 +02:00
This commit is contained in:
@ -564,7 +564,13 @@ static void ImGui_ImplDX11_CreateWindow(ImGuiViewport* viewport)
|
||||
ImGuiViewportDataDx11* data = IM_NEW(ImGuiViewportDataDx11)();
|
||||
viewport->RendererUserData = data;
|
||||
|
||||
HWND hwnd = (HWND)viewport->PlatformHandle;
|
||||
// When using SDL, PlatformHandleRaw will be the HWND (because PlatformHandle would be the SDL_Window)
|
||||
// If not using SDL, PlatformHandleRaw will be null and PlatformHandle will contain the HWND
|
||||
HWND hwnd = (HWND)viewport->PlatformHandleRaw;
|
||||
if (hwnd == 0)
|
||||
{
|
||||
hwnd = (HWND)viewport->PlatformHandle;
|
||||
}
|
||||
IM_ASSERT(hwnd != 0);
|
||||
|
||||
// Create swap chain
|
||||
|
@ -456,6 +456,16 @@ static void ImGui_ImplSDL2_CreateWindow(ImGuiViewport* viewport)
|
||||
if (use_opengl && backup_context)
|
||||
SDL_GL_MakeCurrent(data->Window, backup_context);
|
||||
viewport->PlatformHandle = (void*)data->Window;
|
||||
|
||||
#if defined(_WIN32)
|
||||
// save the window handle for render that needs it (directX)
|
||||
SDL_SysWMinfo info;
|
||||
SDL_VERSION(&info.version);
|
||||
if (SDL_GetWindowWMInfo(data->Window, &info))
|
||||
{
|
||||
viewport->PlatformHandleRaw = info.info.win.window;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
static void ImGui_ImplSDL2_DestroyWindow(ImGuiViewport* viewport)
|
||||
|
Reference in New Issue
Block a user