Hello!
I added SDL2 + Metal on docking branch to my app based on example_sdl_metal. It seems the example does not support docking features:
There were a few changes required, the example does not have these lines in render loop (i.e. docking windows update):
if (io.ConfigFlags & ImGuiConfigFlags_ViewportsEnable)
{
ImGui::UpdatePlatformWindows();
ImGui::RenderPlatformWindowsDefault();
}
Also, I had to add in imgui_impl_sdl.cpp update of the PlatformHandleRaw around line 418 and 765, otherwise it crashed when Metal backend tried to cast SDL_Window PlatformHandle to NSWindow:
#ifdef __APPLE__
SDL_SysWMinfo info;
SDL_VERSION(&info.version);
if (SDL_GetWindowWMInfo(window, &info))
main_viewport->PlatformHandleRaw = (void*)info.info.cocoa.window;
#endif
The above works almost perfect:
-
The code needs to be updated to add nearest-neighbour texture sampler, not only bilinear (I know how to do that).
-
However, I have an issue when I deserialise INI file in the runtime - I have workspaces feature, so that user can store and restore layout of windows, this works perfect for OpenGL3, but has problems with properly restoring windows layout when running on Metal backend:
ImGui::LoadIniSettingsFromMemory((const char*)data);
When windows are restored in Metal then interior size is smaller than window's, please check this screenshot:

The X button shows where are window's interior boundaries, and black border around shows where it should be. Any hint how to fix this @ocornut ? Thanks in advance.
Hello!
I added SDL2 + Metal on docking branch to my app based on example_sdl_metal. It seems the example does not support docking features:
There were a few changes required, the example does not have these lines in render loop (i.e. docking windows update):
Also, I had to add in imgui_impl_sdl.cpp update of the PlatformHandleRaw around line 418 and 765, otherwise it crashed when Metal backend tried to cast SDL_Window PlatformHandle to NSWindow:
The above works almost perfect:
The code needs to be updated to add nearest-neighbour texture sampler, not only bilinear (I know how to do that).
However, I have an issue when I deserialise INI file in the runtime - I have workspaces feature, so that user can store and restore layout of windows, this works perfect for OpenGL3, but has problems with properly restoring windows layout when running on Metal backend:
When windows are restored in Metal then interior size is smaller than window's, please check this screenshot:
The X button shows where are window's interior boundaries, and black border around shows where it should be. Any hint how to fix this @ocornut ? Thanks in advance.