FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
imgui/examples/example_null/main.cpp at master · codeage/imgui · GitHub
codeage
imgui
Repository navigation
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
imgui
/
examples
/
example_null
/
main.cpp
Copy path
More file actions
More file actions
Latest commit
History
History
History
37 lines (31 loc) · 1.06 KB
Breadcrumbs
imgui
/
examples
/
example_null
/
main.cpp
Copy path
File metadata and controls
37 lines (31 loc) · 1.06 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
//
dear imgui: "null" example application
//
(compile and link imgui, create context, run headless with NO INPUTS, NO GRAPHICS OUTPUT)
//
This is useful to test building, but you cannot interact with anything here!
#
include
"
imgui.h
"
#
include
<
stdio.h
>
int
main
(
int
,
char
**)
{
IMGUI_CHECKVERSION
();
ImGui::CreateContext
();
ImGuiIO& io =
ImGui::GetIO
();
//
Build atlas
unsigned
char
* tex_pixels =
nullptr
;
int
tex_w, tex_h;
io.
Fonts
->
GetTexDataAsRGBA32
(&tex_pixels, &tex_w, &tex_h);
for
(
int
n =
0
; n <
20
; 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
(
nullptr
);
ImGui::Render
();
}
printf
(
"
DestroyContext()
\n
"
);
ImGui::DestroyContext
();
return
0
;
}
Back
|
FazBrowse Home
|
New Git URL