diff options
| author | grm <grm@eyesin.space> | 2026-03-14 02:29:15 +0200 |
|---|---|---|
| committer | grm <grm@eyesin.space> | 2026-03-14 02:29:15 +0200 |
| commit | 650e5afde271d22b3653832daf339e1bd09a10d6 (patch) | |
| tree | cc5e536b0150de1109daa43a055547d2266e60dd /lib/imgui-1.92.6/examples/example_null/main.cpp | |
| parent | 20e64711ce2a09b657fb79d59cb824e9e34d2b07 (diff) | |
| download | cgame-650e5afde271d22b3653832daf339e1bd09a10d6.tar.gz cgame-650e5afde271d22b3653832daf339e1bd09a10d6.tar.bz2 cgame-650e5afde271d22b3653832daf339e1bd09a10d6.zip | |
Diffstat (limited to 'lib/imgui-1.92.6/examples/example_null/main.cpp')
| -rw-r--r-- | lib/imgui-1.92.6/examples/example_null/main.cpp | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/lib/imgui-1.92.6/examples/example_null/main.cpp b/lib/imgui-1.92.6/examples/example_null/main.cpp new file mode 100644 index 0000000..eba6756 --- /dev/null +++ b/lib/imgui-1.92.6/examples/example_null/main.cpp @@ -0,0 +1,43 @@ +// dear imgui: "null" example application +// (compile and link imgui, create context, run headless with NO INPUTS, NO GRAPHICS OUTPUT) +// This is useful to test building, but you cannot interact with anything here! +#include "imgui.h" +#include <stdio.h> + +// For imgui_impl_null: use relative filename + embed implementation directly by including the .cpp file. +// This is to simplify casual building of this example from all sorts of test scripts. +#include "../../backends/imgui_impl_null.h" +#include "../../backends/imgui_impl_null.cpp" + +int main(int, char**) +{ + IMGUI_CHECKVERSION(); + + ImGui::CreateContext(); + ImGuiIO& io = ImGui::GetIO(); + + ImGui_ImplNullPlatform_Init(); + ImGui_ImplNullRender_Init(); + + for (int n = 0; n < 20; n++) + { + printf("NewFrame() %d\n", n); + ImGui_ImplNullPlatform_NewFrame(); + ImGui_ImplNullRender_NewFrame(); + ImGui::NewFrame(); + + static float f = 0.0f; + ImGui::Text("Hello, world!"); + ImGui::SliderFloat("float", &f, 0.0f, 1.0f); + ImGui::Text("Application average %.3f ms/frame (%.1f FPS)", 1000.0f / io.Framerate, io.Framerate); + ImGui::ShowDemoWindow(nullptr); + + ImGui::Render(); + } + + printf("DestroyContext()\n"); + ImGui_ImplNullRender_Shutdown(); + ImGui_ImplNullPlatform_Shutdown(); + ImGui::DestroyContext(); + return 0; +} |
