aboutsummaryrefslogtreecommitdiffstats
path: root/3rdparty/imgui/examples/example_null
diff options
context:
space:
mode:
authorClifford Wolf <clifford@clifford.at>2018-11-09 12:57:14 +0100
committerClifford Wolf <clifford@clifford.at>2018-11-09 12:57:14 +0100
commit66dd17664c08aca17b53d2853558121aa9e702e4 (patch)
treeb6bc5dd919e5f525ec7328861b81f616673a1ea6 /3rdparty/imgui/examples/example_null
parente91241f10d68fcaaf0a81fa77e9a91666120ccee (diff)
parent15d9b3d3cc05656e58d01ba2f97ec92b6daaee1c (diff)
downloadnextpnr-66dd17664c08aca17b53d2853558121aa9e702e4.tar.gz
nextpnr-66dd17664c08aca17b53d2853558121aa9e702e4.tar.bz2
nextpnr-66dd17664c08aca17b53d2853558121aa9e702e4.zip
Merge branch 'master' of github.com:YosysHQ/nextpnr into router_improve
Diffstat (limited to '3rdparty/imgui/examples/example_null')
-rw-r--r--3rdparty/imgui/examples/example_null/build_win32.bat3
-rw-r--r--3rdparty/imgui/examples/example_null/main.cpp35
2 files changed, 38 insertions, 0 deletions
diff --git a/3rdparty/imgui/examples/example_null/build_win32.bat b/3rdparty/imgui/examples/example_null/build_win32.bat
new file mode 100644
index 00000000..12cb70ab
--- /dev/null
+++ b/3rdparty/imgui/examples/example_null/build_win32.bat
@@ -0,0 +1,3 @@
+@REM Build for Visual Studio compiler. Run your copy of vcvars32.bat or vcvarsall.bat to setup command-line compiler.
+mkdir Debug
+cl /nologo /Zi /MD /I ..\.. *.cpp ..\..\*.cpp /FeDebug/example_null.exe /FoDebug/ /link gdi32.lib shell32.lib
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;
+}