|
45 | 45 | // When targeting native platforms (i.e. NOT emscripten), one of IMGUI_IMPL_WEBGPU_BACKEND_DAWN
|
46 | 46 | // or IMGUI_IMPL_WEBGPU_BACKEND_WGPU must be provided. See imgui_impl_wgpu.h for more details.
|
47 | 47 |
|
48 |
| -// FIX(zig-gamedev) |
49 |
| -#define IMGUI_IMPL_WEBGPU_BACKEND_WGPU |
50 |
| - |
51 | 48 | #ifndef __EMSCRIPTEN__
|
52 | 49 | #if defined(IMGUI_IMPL_WEBGPU_BACKEND_DAWN) == defined(IMGUI_IMPL_WEBGPU_BACKEND_WGPU)
|
53 | 50 | #error exactly one of IMGUI_IMPL_WEBGPU_BACKEND_DAWN or IMGUI_IMPL_WEBGPU_BACKEND_WGPU must be defined!
|
|
61 | 58 | #include "imgui.h"
|
62 | 59 | #ifndef IMGUI_DISABLE
|
63 | 60 |
|
64 |
| -// FIX(zig-gamedev): |
65 |
| -// #include "imgui_impl_wgpu.h" |
| 61 | +#include "imgui_impl_wgpu.h" |
66 | 62 |
|
67 | 63 | #include <limits.h>
|
68 | 64 | #include <webgpu/webgpu.h>
|
|
71 | 67 | extern ImGuiID ImHashData(const void* data_p, size_t data_size, ImU32 seed = 0);
|
72 | 68 | #define MEMALIGN(_SIZE,_ALIGN) (((_SIZE) + ((_ALIGN) - 1)) & ~((_ALIGN) - 1)) // Memory align (copied from IM_ALIGN() macro).
|
73 | 69 |
|
74 |
| -// FIX(zig-gamedev): We removed header file and declare all our external functions here. |
75 |
| -extern "C" { |
76 |
| - |
77 |
| -// Initialization data, for ImGui_ImplWGPU_Init() |
78 |
| -struct ImGui_ImplWGPU_InitInfo |
79 |
| -{ |
80 |
| - WGPUDevice Device; |
81 |
| - int NumFramesInFlight = 3; |
82 |
| - WGPUTextureFormat RenderTargetFormat = WGPUTextureFormat_Undefined; |
83 |
| - WGPUTextureFormat DepthStencilFormat = WGPUTextureFormat_Undefined; |
84 |
| - WGPUMultisampleState PipelineMultisampleState = {}; |
85 |
| - |
86 |
| - ImGui_ImplWGPU_InitInfo() |
87 |
| - { |
88 |
| - PipelineMultisampleState.count = 1; |
89 |
| - PipelineMultisampleState.mask = UINT32_MAX; |
90 |
| - PipelineMultisampleState.alphaToCoverageEnabled = false; |
91 |
| - } |
92 |
| -}; |
93 |
| - |
94 |
| -// Follow "Getting Started" link and check examples/ folder to learn about using backends! |
95 |
| -IMGUI_IMPL_API bool ImGui_ImplWGPU_Init(ImGui_ImplWGPU_InitInfo* init_info); |
96 |
| -IMGUI_IMPL_API void ImGui_ImplWGPU_Shutdown(); |
97 |
| -IMGUI_IMPL_API void ImGui_ImplWGPU_NewFrame(); |
98 |
| -IMGUI_IMPL_API void ImGui_ImplWGPU_RenderDrawData(ImDrawData* draw_data, WGPURenderPassEncoder pass_encoder); |
99 |
| - |
100 |
| -// Use if you want to reset your rendering device without losing Dear ImGui state. |
101 |
| -IMGUI_IMPL_API bool ImGui_ImplWGPU_CreateDeviceObjects(); |
102 |
| -IMGUI_IMPL_API void ImGui_ImplWGPU_InvalidateDeviceObjects(); |
103 |
| - |
104 |
| -// [BETA] Selected render state data shared with callbacks. |
105 |
| -// This is temporarily stored in GetPlatformIO().Renderer_RenderState during the ImGui_ImplWGPU_RenderDrawData() call. |
106 |
| -// (Please open an issue if you feel you need access to more data) |
107 |
| -struct ImGui_ImplWGPU_RenderState |
108 |
| -{ |
109 |
| - WGPUDevice Device; |
110 |
| - WGPURenderPassEncoder RenderPassEncoder; |
111 |
| -}; |
112 |
| - |
113 |
| -} // extern "C" |
114 |
| - |
115 | 70 | // WebGPU data
|
116 | 71 | struct RenderResources
|
117 | 72 | {
|
|
0 commit comments