Backends: WebGPU: added ImGui_ImplWGPU_CreateWGPUSurfaceHelper(). (#8381, #8831, #8567, #8191, #7435)

This commit is contained in:
BrutPitt
2025-10-31 18:50:12 +01:00
committed by ocornut
parent 505ff536f9
commit d0e3b1d4e2
3 changed files with 94 additions and 1 deletions

View File

@@ -81,4 +81,23 @@ struct ImGui_ImplWGPU_RenderState
WGPURenderPassEncoder RenderPassEncoder;
};
//-------------------------------------------------------------------------
// Internal Helpers
// Those are currently used by our example applications.
//-------------------------------------------------------------------------
// (Optional) Helper to create a surface on macOS/Wayland/X11/Window
#if defined(IMGUI_IMPL_WEBGPU_BACKEND_WGPU) || defined(IMGUI_IMPL_WEBGPU_BACKEND_DAWN) && !defined(__EMSCRIPTEN__)
struct ImGui_ImplWGPU_CreateSurfaceInfo
{
WGPUInstance Instance;
const char* System; // "cocoa" | "wayland" | "x11" | "win32"
void* RawWindow; // NSWindow* | 0 | Window | HWND
void* RawDisplay; // 0 | wl_display* | Display* | 0
void* RawSurface; // | wl_surface* | 0 | 0
void* RawInstance; // 0 | 0 | 0 | HINSTANCE
};
WGPUSurface ImGui_ImplWGPU_CreateWGPUSurfaceHelper(ImGui_ImplWGPU_CreateSurfaceInfo* info);
#endif
#endif // #ifndef IMGUI_DISABLE