| 1 | |
| 2 | |
| 3 | |
| 4 | #include "imgui.h" |
| 5 | #include <stdio.h> |
| 6 | |
| 7 | |
| 8 | |
| 9 | #include "../../backends/imgui_impl_null.h" |
| 10 | #include "../../backends/imgui_impl_null.cpp" |
| 11 | |
| 12 | int main(int, char**) |
| 13 | { |
| 14 | IMGUI_CHECKVERSION(); |
| 15 | |
| 16 | ImGui::CreateContext(); |
| 17 | ImGuiIO& io = ImGui::GetIO(); |
| 18 | |
| 19 | ImGui_ImplNullPlatform_Init(); |
| 20 | ImGui_ImplNullRender_Init(); |
| 21 | |
| 22 | for (int n = 0; n < 20; n++) |
| 23 | { |
| 24 | printf("NewFrame() %d\n", n); |
| 25 | ImGui_ImplNullPlatform_NewFrame(); |
| 26 | ImGui_ImplNullRender_NewFrame(); |
| 27 | ImGui::NewFrame(); |
| 28 | |
| 29 | static float f = 0.0f; |
| 30 | ImGui::Text("Hello, world!"); |
| 31 | ImGui::SliderFloat("float", &f, 0.0f, 1.0f); |
| 32 | ImGui::Text("Application average %.3f ms/frame (%.1f FPS)", 1000.0f / io.Framerate, io.Framerate); |
| 33 | ImGui::ShowDemoWindow(nullptr); |
| 34 | |
| 35 | ImGui::Render(); |
| 36 | } |
| 37 | |
| 38 | printf("DestroyContext()\n"); |
| 39 | ImGui_ImplNullRender_Shutdown(); |
| 40 | ImGui_ImplNullPlatform_Shutdown(); |
| 41 | ImGui::DestroyContext(); |
| 42 | return 0; |
| 43 | } |