Skip to content

Commit 84b5f7f

Browse files
committed
add imgui cpp minimal example
1 parent 8d6ff7e commit 84b5f7f

File tree

13 files changed

+327
-155
lines changed

13 files changed

+327
-155
lines changed

.gitmodules

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
[submodule "UI/imgui"]
2+
path = UI/imgui
3+
url = https://github.com/ocornut/imgui
4+
branch = docking
5+
6+
[submodule "UI/implot"]
7+
path = UI/implot
8+
url = https://github.com/epezent/implot

UI/.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
*.o
2+
*.ini
3+
*.exe

UI/Makefile

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
CXX := g++
2+
CXXFLAGS := -Iimgui -Iimgui/backends -Iimplot
3+
LDFLAGS := -luser32 -lgdi32 -ld3d11 -ldxgi -ld3dcompiler -ldwmapi
4+
5+
# Sources
6+
IMGUI_SRC := imgui/imgui.cpp \
7+
imgui/imgui_draw.cpp \
8+
imgui/imgui_widgets.cpp \
9+
imgui/imgui_tables.cpp \
10+
imgui/backends/imgui_impl_win32.cpp \
11+
imgui/backends/imgui_impl_dx11.cpp \
12+
implot/implot.cpp \
13+
implot/implot_items.cpp
14+
15+
APP_SRC := main.cpp ui.cpp
16+
SRC := $(APP_SRC) $(IMGUI_SRC)
17+
18+
# Objects
19+
OBJ := $(SRC:.cpp=.o)
20+
21+
# Output
22+
TARGET := app.exe
23+
24+
all: $(TARGET)
25+
26+
# Link step
27+
$(TARGET): $(OBJ)
28+
$(CXX) $^ -o $@ $(LDFLAGS)
29+
30+
# Compile step
31+
%.o: %.cpp
32+
$(CXX) $(CXXFLAGS) -c $< -o $@
33+
34+
clean:
35+
del /Q $(OBJ) $(TARGET) 2>nul || true

UI/UI.py

Lines changed: 0 additions & 106 deletions
This file was deleted.

UI/cust_ui.tcl

Lines changed: 0 additions & 49 deletions
This file was deleted.
-290 Bytes
Binary file not shown.

UI/cust_ui_elems/rect-accent.png

-290 Bytes
Binary file not shown.
-322 Bytes
Binary file not shown.
-322 Bytes
Binary file not shown.

UI/imgui

Submodule imgui added at 09e7870

0 commit comments

Comments
 (0)