2019-06-11 17:11:19 +03:00
|
|
|
// dear imgui: null/dummy example application
|
|
|
|
// (compile and link imgui, create context, run headless with NO INPUTS, NO GRAPHICS OUTPUT)
|
2019-04-08 20:16:45 +03:00
|
|
|
// This is useful to test building, but you cannot interact with anything here!
|
2018-01-29 16:38:46 +03:00
|
|
|
#include "imgui.h"
|
2017-12-23 15:40:01 +03:00
|
|
|
#include <stdio.h>
|
|
|
|
|
|
|
|
int main(int, char**)
|
|
|
|
{
|
2018-04-25 23:07:14 +03:00
|
|
|
IMGUI_CHECKVERSION();
|
2018-01-21 22:09:30 +03:00
|
|
|
ImGui::CreateContext();
|
2017-12-23 15:40:01 +03:00
|
|
|
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);
|
|
|
|
|
2019-04-08 20:16:45 +03:00
|
|
|
for (int n = 0; n < 20; n++)
|
2017-12-23 15:40:01 +03:00
|
|
|
{
|
|
|
|
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);
|
2017-12-24 20:16:22 +03:00
|
|
|
ImGui::ShowDemoWindow(NULL);
|
2017-12-23 15:40:01 +03:00
|
|
|
|
|
|
|
ImGui::Render();
|
|
|
|
}
|
|
|
|
|
2018-01-21 22:09:30 +03:00
|
|
|
printf("DestroyContext()\n");
|
|
|
|
ImGui::DestroyContext();
|
2017-12-23 15:40:01 +03:00
|
|
|
return 0;
|
|
|
|
}
|