dependencies
third-party
imgui
src
examples
example_null
dependencies/third-party/imgui/src/examples/example_null/main.cpp
Go to the documentation of this file.
1
// dear imgui: null/dummy example application
2
// (compile and link imgui, create context, run headless with NO INPUTS, NO GRAPHICS OUTPUT)
3
// This is useful to test building, but you cannot interact with anything here!
4
#include "
imgui.h
"
5
#include <stdio.h>
6
7
int
main
(
int
,
char
**)
8
{
9
IMGUI_CHECKVERSION
();
10
ImGui::CreateContext
();
11
ImGuiIO
& io =
ImGui::GetIO
();
12
13
// Build atlas
14
unsigned
char
* tex_pixels =
NULL
;
15
int
tex_w, tex_h;
16
io.
Fonts
->
GetTexDataAsRGBA32
(&tex_pixels, &tex_w, &tex_h);
17
18
for
(
int
n
= 0;
n
< 20;
n
++)
19
{
20
printf(
"NewFrame() %d\n"
,
n
);
21
io.
DisplaySize
=
ImVec2
(1920, 1080);
22
io.
DeltaTime
= 1.0f / 60.0f;
23
ImGui::NewFrame
();
24
25
static
float
f
= 0.0f;
26
ImGui::Text
(
"Hello, world!"
);
27
ImGui::SliderFloat
(
"float"
, &
f
, 0.0
f
, 1.0
f
);
28
ImGui::Text
(
"Application average %.3f ms/frame (%.1f FPS)"
, 1000.0
f
/ io.
Framerate
, io.
Framerate
);
29
ImGui::ShowDemoWindow
(
NULL
);
30
31
ImGui::Render
();
32
}
33
34
printf(
"DestroyContext()\n"
);
35
ImGui::DestroyContext
();
36
return
0;
37
}
ImGuiIO::Fonts
ImFontAtlas * Fonts
Definition:
imgui.h:1435
NULL
NULL
Definition:
test_security_zap.cpp:405
ImGui::Render
IMGUI_API void Render()
Definition:
imgui.cpp:4222
imgui.h
ImGui::Text
IMGUI_API void Text(const char *fmt,...) IM_FMTARGS(1)
Definition:
imgui_widgets.cpp:247
ImVec2
Definition:
imgui.h:208
ImGui::GetIO
IMGUI_API ImGuiIO & GetIO()
Definition:
imgui.cpp:3286
ImGui::ShowDemoWindow
IMGUI_API void ShowDemoWindow(bool *p_open=NULL)
Definition:
imgui_demo.cpp:208
ImGuiIO::Framerate
float Framerate
Definition:
imgui.h:1513
ImGui::SliderFloat
IMGUI_API bool SliderFloat(const char *label, float *v, float v_min, float v_max, const char *format="%.3f", float power=1.0f)
Definition:
imgui_widgets.cpp:2652
ImGui::DestroyContext
IMGUI_API void DestroyContext(ImGuiContext *ctx=NULL)
Definition:
imgui.cpp:3276
ImGui::CreateContext
IMGUI_API ImGuiContext * CreateContext(ImFontAtlas *shared_font_atlas=NULL)
Definition:
imgui.cpp:3267
n
GLdouble n
Definition:
glcorearb.h:4153
ImGui::NewFrame
IMGUI_API void NewFrame()
Definition:
imgui.cpp:3691
ImGuiIO::DisplaySize
ImVec2 DisplaySize
Definition:
imgui.h:1422
main
int main(int, char **)
Definition:
dependencies/third-party/imgui/src/examples/example_null/main.cpp:7
ImGuiIO
Definition:
imgui.h:1414
f
GLfloat f
Definition:
glcorearb.h:3964
ImGuiIO::DeltaTime
float DeltaTime
Definition:
imgui.h:1423
ImFontAtlas::GetTexDataAsRGBA32
IMGUI_API void GetTexDataAsRGBA32(unsigned char **out_pixels, int *out_width, int *out_height, int *out_bytes_per_pixel=NULL)
Definition:
imgui_draw.cpp:1679
IMGUI_CHECKVERSION
#define IMGUI_CHECKVERSION()
Definition:
imgui.h:64
libaditof
Author(s):
autogenerated on Wed May 21 2025 02:06:55