Skip to content

Commit 16a9488

Browse files
committed
Merge branch 'master' into docking
# Conflicts: # imgui.cpp # imgui_draw.cpp
2 parents ea03994 + fbc93de commit 16a9488

File tree

12 files changed

+392
-267
lines changed

12 files changed

+392
-267
lines changed

.github/workflows/build.yml

Lines changed: 38 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ jobs:
4343
4444
# Not using matrix here because it would inflate job count too much. Check out and setup is done for every job and that makes build times way too long.
4545
- name: Build example_null (extra warnings, mingw 64-bit)
46-
run: mingw32-make -C examples/example_null EXTRA_WARNINGS=1
46+
run: mingw32-make -C examples/example_null WITH_EXTRA_WARNINGS=1
4747

4848
- name: Build example_null (extra warnings, msvc 64-bit)
4949
shell: cmd
@@ -166,27 +166,32 @@ jobs:
166166
- name: Install Dependencies
167167
run: |
168168
sudo apt-get update
169-
sudo apt-get install -y libglfw3-dev libsdl2-dev gcc-multilib g++-multilib
169+
sudo apt-get install -y libglfw3-dev libsdl2-dev gcc-multilib g++-multilib libfreetype6-dev
170170
171171
- name: Build example_null (extra warnings, gcc 32-bit)
172172
run: |
173173
make -C examples/example_null clean
174-
CXXFLAGS="$CXXFLAGS -m32 -Werror" make -C examples/example_null EXTRA_WARNINGS=1
174+
CXXFLAGS="$CXXFLAGS -m32 -Werror" make -C examples/example_null WITH_EXTRA_WARNINGS=1
175175
176176
- name: Build example_null (extra warnings, gcc 64-bit)
177177
run: |
178178
make -C examples/example_null clean
179-
CXXFLAGS="$CXXFLAGS -m64 -Werror" make -C examples/example_null EXTRA_WARNINGS=1
179+
CXXFLAGS="$CXXFLAGS -m64 -Werror" make -C examples/example_null WITH_EXTRA_WARNINGS=1
180180
181181
- name: Build example_null (extra warnings, clang 32-bit)
182182
run: |
183183
make -C examples/example_null clean
184-
CXXFLAGS="$CXXFLAGS -m32 -Werror" CXX=clang++ make -C examples/example_null EXTRA_WARNINGS=1
184+
CXXFLAGS="$CXXFLAGS -m32 -Werror" CXX=clang++ make -C examples/example_null WITH_EXTRA_WARNINGS=1
185185
186186
- name: Build example_null (extra warnings, clang 64-bit)
187187
run: |
188188
make -C examples/example_null clean
189-
CXXFLAGS="$CXXFLAGS -m64 -Werror" CXX=clang++ make -C examples/example_null EXTRA_WARNINGS=1
189+
CXXFLAGS="$CXXFLAGS -m64 -Werror" CXX=clang++ make -C examples/example_null WITH_EXTRA_WARNINGS=1
190+
191+
- name: Build example_null (freetype)
192+
run: |
193+
make -C examples/example_null clean
194+
make -C examples/example_null WITH_FREETYPE=1
190195
191196
- name: Build example_null (single file build)
192197
run: |
@@ -203,6 +208,31 @@ jobs:
203208
echo '#include "examples/example_null/main.cpp"' >> example_single_file.cpp
204209
g++ -I. -Wall -Wformat -o example_single_file example_single_file.cpp
205210
211+
- name: Build example_null (with large ImDrawIdx)
212+
run: |
213+
echo '#define ImDrawIdx unsigned int' > example_single_file.cpp
214+
echo '#define IMGUI_IMPLEMENTATION' >> example_single_file.cpp
215+
echo '#include "misc/single_file/imgui_single_file.h"' >> example_single_file.cpp
216+
echo '#include "examples/example_null/main.cpp"' >> example_single_file.cpp
217+
g++ -I. -Wall -Wformat -o example_single_file example_single_file.cpp
218+
219+
- name: Build example_null (with IMGUI_DISABLE_OBSOLETE_FUNCTIONS)
220+
run: |
221+
echo '#define IMGUI_DISABLE_OBSOLETE_FUNCTIONS' > example_single_file.cpp
222+
echo '#define IMGUI_IMPLEMENTATION' >> example_single_file.cpp
223+
echo '#include "misc/single_file/imgui_single_file.h"' >> example_single_file.cpp
224+
echo '#include "examples/example_null/main.cpp"' >> example_single_file.cpp
225+
g++ -I. -Wall -Wformat -o example_single_file example_single_file.cpp
226+
227+
- name: Build example_null (with IMGUI_DISABLE_DEMO_WINDOWS and IMGUI_DISABLE_METRICS_WINDOW)
228+
run: |
229+
echo '#define IMGUI_DISABLE_DEMO_WINDOWS' > example_single_file.cpp
230+
echo '#define IMGUI_DISABLE_METRICS_WINDOW' >> example_single_file.cpp
231+
echo '#define IMGUI_IMPLEMENTATION' >> example_single_file.cpp
232+
echo '#include "misc/single_file/imgui_single_file.h"' >> example_single_file.cpp
233+
echo '#include "examples/example_null/main.cpp"' >> example_single_file.cpp
234+
g++ -I. -Wall -Wformat -o example_single_file example_single_file.cpp
235+
206236
- name: Build example_glfw_opengl2
207237
run: make -C examples/example_glfw_opengl2
208238

@@ -230,7 +260,7 @@ jobs:
230260
brew install sdl2
231261
232262
- name: Build example_null (extra warnings, clang 64-bit)
233-
run: make -C examples/example_null EXTRA_WARNINGS=1
263+
run: make -C examples/example_null WITH_EXTRA_WARNINGS=1
234264

235265
- name: Build example_null (single file build)
236266
run: |
@@ -328,6 +358,6 @@ jobs:
328358
exit 0
329359
fi
330360
cd examples/example_null
331-
pvs-studio-analyzer trace -- make EXTRA_WARNINGS=1
361+
pvs-studio-analyzer trace -- make WITH_EXTRA_WARNINGS=1
332362
pvs-studio-analyzer analyze -e ../../imstb_rectpack.h -e ../../imstb_textedit.h -e ../../imstb_truetype.h -l ../../pvs-studio.lic -o pvs-studio.log
333363
plog-converter -a 'GA:1,2;OP:1' -t errorfile -w pvs-studio.log

docs/CHANGELOG.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,14 @@ Other Changes:
126126
- Window: Fixed a bug with child window inheriting ItemFlags from their parent when the child
127127
window also manipulate the ItemFlags stack. (#3024) [@Stanbroek]
128128
- Font: Fixed non-ASCII space occasionally creating unnecessary empty polygons.
129+
- Misc: Added additional checks in EndFrame() to verify that io.KeyXXX values have not been
130+
tampered with between NewFrame() and EndFrame().
131+
- Misc, Freetype: Fixed support for IMGUI_STB_RECT_PACK_FILENAME compile time directive
132+
in imgui_freetype.cpp (matching support in the regular code path). (#3062) [@DonKult]
129133
- Demo: Added black and white and color gradients to Demo>Examples>Custom Rendering.
134+
- CI: Added more tests on the continuous-integration server: extra warnings for Clang/GCC, building
135+
SDL+Metal example, building imgui_freetype.cpp, more compile-time imconfig.h settings: disabling
136+
obsolete functions, enabling 32-bit ImDrawIdx, enabling 32-bit ImWchar, disabling demo. [@rokups]
130137
- Backends: Win32: Added ImGui_ImplWin32_EnableDpiAwareness(), ImGui_ImplWin32_GetDpiScaleForHwnd(),
131138
ImGui_ImplWin32_GetDpiScaleForMonitor() helpers functions (backported from the docking branch).
132139
Those functions makes it easier for example apps to support hi-dpi features without setting up

docs/TODO.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@ It's mostly a bunch of personal notes, probably incomplete. Feel free to query i
1414
- window: calling SetNextWindowSize() every frame with <= 0 doesn't do anything, may be useful to allow (particularly when used for a single axis). (#690)
1515
- window: add a way for very transient windows (non-saved, temporary overlay over hundreds of objects) to "clean" up from the global window list. perhaps a lightweight explicit cleanup pass.
1616
- window: auto-fit feedback loop when user relies on any dynamic layout (window width multiplier, column) appears weird to end-user. clarify.
17-
- window: allow resizing of child windows (possibly given min/max for each axis?.)
18-
- window: background options for child windows, border option (disable rounding).
1917
- window: begin with *p_open == false could return false.
2018
- window: get size/pos helpers given names (see discussion in #249)
2119
- window: a collapsed window can be stuck behind the main menu bar?
@@ -31,6 +29,8 @@ It's mostly a bunch of personal notes, probably incomplete. Feel free to query i
3129
- window: the size_on_first_use path of Begin() can probably be removed
3230
- window/size: manually triggered auto-fit (double-click on grip) shouldn't resize window down to viewport size?
3331
- window/opt: freeze window flag: if not focused/hovered, return false, render with previous ImDrawList. and/or reduce refresh rate. -> this may require enforcing that it is illegal to submit contents if Begin returns false.
32+
- window/child: background options for child windows, border option (disable rounding).
33+
- window/child: allow resizing of child windows (possibly given min/max for each axis?.)
3434
- window/child: the first draw command of a child window could be moved into the current draw command of the parent window (unless child+tooltip?).
3535
- window/child: border could be emitted in parent as well.
3636
- window/child: allow SetNextWindowContentSize() to work on child windows.

examples/README.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ Those will allow you to create portable applications and will solve and abstract
160160
---------------------------------------
161161

162162
Building:
163-
Unfortunately in 2018 it is still tedious to create and maintain portable build files using external
163+
Unfortunately in 2020 it is still tedious to create and maintain portable build files using external
164164
libraries (the kind we're using here to create a window and render 3D triangles) without relying on
165165
third party software. For most examples here I choose to provide:
166166
- Makefiles for Linux/OSX
@@ -171,6 +171,9 @@ Building:
171171
You can probably just import the imgui_impl_xxx.cpp/.h files into your own codebase or compile those
172172
directly with a command-line compiler.
173173

174+
If you are interested in using Cmake to build and links examples, see:
175+
https://github.com/ocornut/imgui/pull/1713 and https://github.com/ocornut/imgui/pull/3027
176+
174177

175178
example_allegro5/
176179
Allegro 5 example.

examples/example_null/Makefile

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,15 @@
22
# Cross Platform Makefile
33
# Compatible with MSYS2/MINGW, Ubuntu 14.04.1 and Mac OS X
44
#
5+
# Important: This is a "null back-end" application, with no visible output or interaction!
6+
# This is used for testing purpose and continuous integration, and has little use for end-user.
7+
#
8+
9+
# Options
10+
WITH_EXTRA_WARNINGS ?= 0
11+
WITH_FREETYPE ?= 0
512

613
EXE = example_null
7-
EXTRA_WARNINGS ?= 0
814
SOURCES = main.cpp
915
SOURCES += ../../imgui.cpp ../../imgui_demo.cpp ../../imgui_draw.cpp ../../imgui_widgets.cpp
1016
OBJS = $(addsuffix .o, $(basename $(notdir $(SOURCES))))
@@ -14,34 +20,42 @@ CXXFLAGS += -I../ -I../../
1420
CXXFLAGS += -g -Wall -Wformat
1521
LIBS =
1622

17-
# We use the EXTRA_WARNINGS flag on our CI setup to eagerly catch zealous warnings
18-
ifeq ($(EXTRA_WARNINGS), 1)
23+
# We use the WITH_EXTRA_WARNINGS flag on our CI setup to eagerly catch zealous warnings
24+
ifeq ($(WITH_EXTRA_WARNINGS), 1)
1925
CXXFLAGS += -Wno-zero-as-null-pointer-constant -Wno-double-promotion -Wno-variadic-macros
2026
endif
2127

28+
# We use the WITH_FREETYPE flag on our CI setup to test compiling misc/freetype/imgui_freetype.cpp
29+
# (only supported on Linux, and note that the imgui_freetype code currently won't be executed)
30+
ifeq ($(WITH_FREETYPE), 1)
31+
SOURCES += ../../misc/freetype/imgui_freetype.cpp
32+
CXXFLAGS += $(shell pkg-config --cflags freetype2)
33+
LIBS += $(shell pkg-config --libs freetype2)
34+
endif
35+
2236
##---------------------------------------------------------------------
2337
## BUILD FLAGS PER PLATFORM
2438
##---------------------------------------------------------------------
2539

2640
ifeq ($(UNAME_S), Linux) #LINUX
2741
ECHO_MESSAGE = "Linux"
28-
ifneq ($(EXTRA_WARNINGS), 0)
42+
ifneq ($(WITH_EXTRA_WARNINGS), 0)
2943
CXXFLAGS += -Wextra -pedantic
3044
endif
3145
CFLAGS = $(CXXFLAGS)
3246
endif
3347

3448
ifeq ($(UNAME_S), Darwin) #APPLE
3549
ECHO_MESSAGE = "Mac OS X"
36-
ifneq ($(EXTRA_WARNINGS), 0)
50+
ifneq ($(WITH_EXTRA_WARNINGS), 0)
3751
CXXFLAGS += -Weverything -Wno-reserved-id-macro -Wno-c++98-compat-pedantic -Wno-padded -Wno-c++11-long-long
3852
endif
3953
CFLAGS = $(CXXFLAGS)
4054
endif
4155

4256
ifeq ($(findstring MINGW,$(UNAME_S)),MINGW)
4357
ECHO_MESSAGE = "MinGW"
44-
ifneq ($(EXTRA_WARNINGS), 0)
58+
ifneq ($(WITH_EXTRA_WARNINGS), 0)
4559
CXXFLAGS += -Wextra -pedantic
4660
endif
4761
CFLAGS = $(CXXFLAGS)
@@ -60,6 +74,9 @@ endif
6074
%.o:../../%.cpp
6175
$(CXX) $(CXXFLAGS) -c -o $@ $<
6276

77+
%.o:../../misc/freetype/%.cpp
78+
$(CXX) $(CXXFLAGS) -c -o $@ $<
79+
6380
all: $(EXE)
6481
@echo Build complete for $(ECHO_MESSAGE)
6582

0 commit comments

Comments
 (0)