1 // dear imgui: Renderer for WebGPU 2 // This needs to be used along with a Platform Binding (e.g. GLFW) 3 // (Please note that WebGPU is currently experimental, will not run on non-beta browsers, and may break.) 4 5 // Implemented features: 6 // [X] Renderer: User texture binding. Use 'WGPUTextureView' as ImTextureID. Read the FAQ about ImTextureID! 7 // [X] Renderer: Support for large meshes (64k+ vertices) with 16-bit indices. 8 9 // You can use unmodified imgui_impl_* files in your project. See examples/ folder for examples of using this. 10 // Prefer including the entire imgui/ repository into your project (either as a copy or as a submodule), and only build the backends you need. 11 // If you are new to Dear ImGui, read documentation from the docs/ folder + read the top of imgui.cpp. 12 // Read online: https://github.com/ocornut/imgui/tree/master/docs 13 14 #pragma once 15 #include "imgui.h" // IMGUI_IMPL_API 16 #include <webgpu/webgpu.h> 17 18 IMGUI_IMPL_API bool ImGui_ImplWGPU_Init(WGPUDevice device, int num_frames_in_flight, WGPUTextureFormat rt_format); 19 IMGUI_IMPL_API void ImGui_ImplWGPU_Shutdown(); 20 IMGUI_IMPL_API void ImGui_ImplWGPU_NewFrame(); 21 IMGUI_IMPL_API void ImGui_ImplWGPU_RenderDrawData(ImDrawData* draw_data, WGPURenderPassEncoder pass_encoder); 22 23 // Use if you want to reset your rendering device without losing Dear ImGui state. 24 IMGUI_IMPL_API void ImGui_ImplWGPU_InvalidateDeviceObjects(); 25 IMGUI_IMPL_API bool ImGui_ImplWGPU_CreateDeviceObjects(); 26