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