https://github.com/rsms/cgui
super duper simple gui for C, wrapping imgui and stb
https://github.com/rsms/cgui
Last synced: 10 months ago
JSON representation
super duper simple gui for C, wrapping imgui and stb
- Host: GitHub
- URL: https://github.com/rsms/cgui
- Owner: rsms
- License: mit
- Created: 2021-10-17T21:34:22.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2021-10-18T20:49:16.000Z (over 4 years ago)
- Last Synced: 2025-08-08T07:41:43.077Z (11 months ago)
- Language: C
- Homepage:
- Size: 2.24 MB
- Stars: 13
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
super duper simle gui for C, wrapping imgui and stb
You can use it as a static library with cmake.
See the `example` directory for a complete example.
Example:
```c
#include
#include
#include
static void render_frame(gui_t* g) {
ImGuiIO* io = igGetIO();
igBegin("window", NULL, ImGuiWindowFlags_NoTitleBar); {
static float f = 0.0f;
igText("Hello World!");
igSliderFloat("float", &f, 0.0f, 1.0f, "%.3f", 0);
if (g->isAnimating) {
igText("Render: %.2f ms, Frame: %.1f ms (%.0f FPS)",
g->avgRenderTime * 1000.0,
1000.0f / io->Framerate,
io->Framerate);
} else {
igText("Render: %.2f ms", g->avgRenderTime * 1000.0);
}
} igEnd();
igShowDemoWindow(NULL);
}
void gui_start(gui_t* g) {
g->onRenderFrame = render_frame;
gui_win_set_title(g->mainWindow, "Example");
}
```
Try it: `cd example && ../ext/ckit/bin/ckit watch -run example`