1
0
Fork 0
mirror of https://github.com/ocornut/imgui.git synced 2026-01-12 00:14:20 +00:00

Backends: GLFW, Emscripten: fixes for canvas resizing. (#6751)

This commit is contained in:
Pello Rao 2023-12-19 15:52:44 +01:00 committed by ocornut
parent b4c5a83cfe
commit 22a7d241ff
5 changed files with 63 additions and 1 deletions

View file

@ -26,6 +26,8 @@ static WGPUSwapChain wgpu_swap_chain = nullptr;
static int wgpu_swap_chain_width = 0;
static int wgpu_swap_chain_height = 0;
const char* canvas_selector = "#canvas";
// Forward declarations
static void MainLoopStep(void* window);
static bool InitWGPU();
@ -76,6 +78,7 @@ int main(int, char**)
// Setup Platform/Renderer backends
ImGui_ImplGlfw_InitForOther(window, true);
ImGui_ImplGlfw_SetEmscriptenCanvasSelector(canvas_selector);
ImGui_ImplWGPU_Init(wgpu_device, 3, wgpu_preferred_fmt, WGPUTextureFormat_Undefined);
// Load Fonts