Skip to content

Commit

Permalink
main: declare ImGui backend names
Browse files Browse the repository at this point in the history
  • Loading branch information
mochaaP committed Nov 14, 2024
1 parent ee4324e commit 3490f80
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions main.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,34 @@ void init(void) {
}
}
};

ImGuiIO *io = igGetIO();

io->BackendPlatformName = "sokol_app";

sg_backend backend = sg_query_backend();
switch (backend) {
case SG_BACKEND_GLCORE:
io->BackendRendererName = "sokol_gfx_glcore";
break;
case SG_BACKEND_GLES3:
io->BackendRendererName = "sokol_gfx_gles3";
break;
case SG_BACKEND_D3D11:
io->BackendRendererName = "sokol_gfx_d3d11";
break;
case SG_BACKEND_METAL_IOS:
case SG_BACKEND_METAL_MACOS:
case SG_BACKEND_METAL_SIMULATOR:
io->BackendRendererName = "sokol_gfx_metal";
break;
case SG_BACKEND_WGPU:
io->BackendRendererName = "sokol_gfx_wgpu";
break;
case SG_BACKEND_DUMMY:
io->BackendRendererName = "sokol_gfx_dummy";
break;
}
}

void frame(void) {
Expand Down

0 comments on commit 3490f80

Please sign in to comment.