diff options
author | Miodrag Milanovic <mmicko@gmail.com> | 2018-10-21 09:28:35 +0200 |
---|---|---|
committer | Miodrag Milanovic <mmicko@gmail.com> | 2018-10-24 19:00:58 +0200 |
commit | b948b76c8ea5ec57b6a424baa1b117c0025c0328 (patch) | |
tree | 2708d134a5caf9652822052f0629a7a9f43d3efe /3rdparty/imgui/examples/example_null/main.cpp | |
parent | 169b42da4a1064f28776ee80eaa7449facaf200b (diff) | |
download | nextpnr-b948b76c8ea5ec57b6a424baa1b117c0025c0328.tar.gz nextpnr-b948b76c8ea5ec57b6a424baa1b117c0025c0328.tar.bz2 nextpnr-b948b76c8ea5ec57b6a424baa1b117c0025c0328.zip |
add imgui library
Diffstat (limited to '3rdparty/imgui/examples/example_null/main.cpp')
-rw-r--r-- | 3rdparty/imgui/examples/example_null/main.cpp | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/3rdparty/imgui/examples/example_null/main.cpp b/3rdparty/imgui/examples/example_null/main.cpp new file mode 100644 index 00000000..90521f9b --- /dev/null +++ b/3rdparty/imgui/examples/example_null/main.cpp @@ -0,0 +1,35 @@ +// dear imgui: null/dummy example application (compile and link imgui with no inputs, no outputs) +#include "imgui.h" +#include <stdio.h> + +int main(int, char**) +{ + IMGUI_CHECKVERSION(); + ImGui::CreateContext(); + ImGuiIO& io = ImGui::GetIO(); + + // Build atlas + unsigned char* tex_pixels = NULL; + int tex_w, tex_h; + io.Fonts->GetTexDataAsRGBA32(&tex_pixels, &tex_w, &tex_h); + + for (int n = 0; n < 50; n++) + { + printf("NewFrame() %d\n", n); + io.DisplaySize = ImVec2(1920, 1080); + io.DeltaTime = 1.0f / 60.0f; + 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(NULL); + + ImGui::Render(); + } + + printf("DestroyContext()\n"); + ImGui::DestroyContext(); + return 0; +} |