imgui_impl_wgpu.h (1325B)
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 copy and use unmodified imgui_impl_* files in your project. See examples/ folder for examples of using this. 10 // If you are new to Dear ImGui, read documentation from the docs/ folder + read the top of imgui.cpp. 11 // Read online: https://github.com/ocornut/imgui/tree/master/docs 12 13 #pragma once 14 #include "imgui.h" // IMGUI_IMPL_API 15 #include <webgpu/webgpu.h> 16 17 IMGUI_IMPL_API bool ImGui_ImplWGPU_Init(WGPUDevice device, int num_frames_in_flight, WGPUTextureFormat rt_format); 18 IMGUI_IMPL_API void ImGui_ImplWGPU_Shutdown(); 19 IMGUI_IMPL_API void ImGui_ImplWGPU_NewFrame(); 20 IMGUI_IMPL_API void ImGui_ImplWGPU_RenderDrawData(ImDrawData* draw_data, WGPURenderPassEncoder pass_encoder); 21 22 // Use if you want to reset your rendering device without losing Dear ImGui state. 23 IMGUI_IMPL_API void ImGui_ImplWGPU_InvalidateDeviceObjects(); 24 IMGUI_IMPL_API bool ImGui_ImplWGPU_CreateDeviceObjects();