mirror of
https://github.com/ocornut/imgui.git
synced 2025-12-19 12:55:34 +00:00
Backends: WebGPU: added ImGui_ImplWGPU_CreateWGPUSurfaceHelper(). (#8381, #8831, #8567, #8191, #7435)
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user