imgui_impl_wgpu.h 1.4 KB

1234567891011121314151617181920212223242526
  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. // Implemented features:
  5. // [X] Renderer: User texture binding. Use 'WGPUTextureView' as ImTextureID. Read the FAQ about ImTextureID!
  6. // [X] Renderer: Support for large meshes (64k+ vertices) with 16-bit indices.
  7. // You can use unmodified imgui_impl_* files in your project. See examples/ folder for examples of using this.
  8. // Prefer including the entire imgui/ repository into your project (either as a copy or as a submodule), and only build the backends you need.
  9. // If you are new to Dear ImGui, read documentation from the docs/ folder + read the top of imgui.cpp.
  10. // Read online: https://github.com/ocornut/imgui/tree/master/docs
  11. #pragma once
  12. #include "imgui.h" // IMGUI_IMPL_API
  13. #include <webgpu/webgpu.h>
  14. IMGUI_IMPL_API bool ImGui_ImplWGPU_Init(WGPUDevice device, int num_frames_in_flight, WGPUTextureFormat rt_format);
  15. IMGUI_IMPL_API void ImGui_ImplWGPU_Shutdown();
  16. IMGUI_IMPL_API void ImGui_ImplWGPU_NewFrame();
  17. IMGUI_IMPL_API void ImGui_ImplWGPU_RenderDrawData(ImDrawData* draw_data, WGPURenderPassEncoder pass_encoder);
  18. // Use if you want to reset your rendering device without losing Dear ImGui state.
  19. IMGUI_IMPL_API void ImGui_ImplWGPU_InvalidateDeviceObjects();
  20. IMGUI_IMPL_API bool ImGui_ImplWGPU_CreateDeviceObjects();