Skip to content

Commit

Permalink
Updated Dear ImGui to 1.89
Browse files Browse the repository at this point in the history
  • Loading branch information
sammyfreg committed May 20, 2023
1 parent a22de46 commit 4c38d9a
Show file tree
Hide file tree
Showing 18 changed files with 5,961 additions and 3,814 deletions.
8 changes: 6 additions & 2 deletions Source/Private/ThirdParty/DearImgui/.editorconfig
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
# See http://editorconfig.org to read about the EditorConfig format.
# - In theory automatically supported by VS2017+ and most common IDE or text editors.
# - In practice VS2019 stills gets trailing whitespaces wrong :(
# - Suggest install to trim whitespaces: https://marketplace.visualstudio.com/items?itemName=MadsKristensen.TrailingWhitespaceVisualizer
# - In practice VS2019-VS2022 stills don't trim trailing whitespaces correctly :(
# - Suggest installing this to trim whitespaces:
# GitHub https://github.com/madskristensen/TrailingWhitespace
# VS2019 https://marketplace.visualstudio.com/items?itemName=MadsKristensen.TrailingWhitespaceVisualizer
# VS2022 https://marketplace.visualstudio.com/items?itemName=MadsKristensen.TrailingWhitespace64
# (in spite of its name doesn't only visualize but also trims)
# - Alternative for older VS2010 to VS2015: https://marketplace.visualstudio.com/items?itemName=EditorConfigTeam.EditorConfig

# top-most EditorConfig file
Expand Down
13 changes: 10 additions & 3 deletions Source/Private/ThirdParty/DearImgui/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ ipch
*.VC.db
*.VC.VC.opendb

## Getting files created in JSON/Schemas/Catalog/ from a VS2022 update
JSON/

## Commonly used CMake directories
/build*/

Expand All @@ -37,17 +40,21 @@ xcuserdata
examples/*.o.tmp
examples/*.out.js
examples/*.out.wasm
examples/example_emscripten_opengl3/web/*
examples/example_glfw_opengl3/web/*
examples/example_sdl2_opengl3/web/*
examples/example_emscripten_wgpu/web/*

## JetBrains IDE artifacts
.idea
cmake-build-*

## Unix executables from our example Makefiles
examples/example_glfw_metal/example_glfw_metal
examples/example_glfw_opengl2/example_glfw_opengl2
examples/example_glfw_opengl3/example_glfw_opengl3
examples/example_glut_opengl2/example_glut_opengl2
examples/example_null/example_null
examples/example_sdl_opengl2/example_sdl_opengl2
examples/example_sdl_opengl3/example_sdl_opengl3
examples/example_sdl2_metal/example_sdl2_metal
examples/example_sdl2_opengl2/example_sdl2_opengl2
examples/example_sdl2_opengl3/example_sdl2_opengl3
examples/example_sdl2_sdlrenderer/example_sdl2_sdlrenderer
2 changes: 1 addition & 1 deletion Source/Private/ThirdParty/DearImgui/LICENSE.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2014-2022 Omar Cornut
Copyright (c) 2014-2023 Omar Cornut

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
5,529 changes: 3,434 additions & 2,095 deletions Source/Private/ThirdParty/DearImgui/imgui.cpp

Large diffs are not rendered by default.

1,029 changes: 552 additions & 477 deletions Source/Private/ThirdParty/DearImgui/imgui_demo.cpp

Large diffs are not rendered by default.

203 changes: 107 additions & 96 deletions Source/Private/ThirdParty/DearImgui/imgui_draw.cpp

Large diffs are not rendered by default.

902 changes: 619 additions & 283 deletions Source/Private/ThirdParty/DearImgui/imgui_internal.h

Large diffs are not rendered by default.

239 changes: 146 additions & 93 deletions Source/Private/ThirdParty/DearImgui/imgui_tables.cpp

Large diffs are not rendered by default.

1,090 changes: 662 additions & 428 deletions Source/Private/ThirdParty/DearImgui/imgui_widgets.cpp

Large diffs are not rendered by default.

36 changes: 13 additions & 23 deletions Source/Private/ThirdParty/DearImgui/imstb_textedit.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// This is a slightly modified version of stb_textedit.h 1.14.
// Those changes would need to be pushed into nothings/stb:
// - Fix in stb_textedit_discard_redo (see https://github.com/nothings/stb/issues/321)
// - Fix in stb_textedit_find_charpos to handle last line (see https://github.com/ocornut/imgui/issues/6000)
// Grep for [DEAR IMGUI] to find the changes.

// stb_textedit.h - v1.14 - public domain - Sean Barrett
Expand Down Expand Up @@ -524,29 +525,14 @@ static void stb_textedit_find_charpos(StbFindState *find, STB_TEXTEDIT_STRING *s
int z = STB_TEXTEDIT_STRINGLEN(str);
int i=0, first;

if (n == z) {
// if it's at the end, then find the last line -- simpler than trying to
// explicitly handle this case in the regular code
if (single_line) {
STB_TEXTEDIT_LAYOUTROW(&r, str, 0);
find->y = 0;
find->first_char = 0;
find->length = z;
find->height = r.ymax - r.ymin;
find->x = r.x1;
} else {
find->y = 0;
find->x = 0;
find->height = 1;
while (i < z) {
STB_TEXTEDIT_LAYOUTROW(&r, str, i);
prev_start = i;
i += r.num_chars;
}
find->first_char = i;
find->length = 0;
find->prev_first = prev_start;
}
if (n == z && single_line) {
// special case if it's at the end (may not be needed?)
STB_TEXTEDIT_LAYOUTROW(&r, str, 0);
find->y = 0;
find->first_char = 0;
find->length = z;
find->height = r.ymax - r.ymin;
find->x = r.x1;
return;
}

Expand All @@ -557,9 +543,13 @@ static void stb_textedit_find_charpos(StbFindState *find, STB_TEXTEDIT_STRING *s
STB_TEXTEDIT_LAYOUTROW(&r, str, i);
if (n < i + r.num_chars)
break;
if (i + r.num_chars == z && z > 0 && STB_TEXTEDIT_GETCHAR(str, z - 1) != STB_TEXTEDIT_NEWLINE) // [DEAR IMGUI] special handling for last line
break; // [DEAR IMGUI]
prev_start = i;
i += r.num_chars;
find->y += r.baseline_y_delta;
if (i == z) // [DEAR IMGUI]
break; // [DEAR IMGUI]
}

find->first_char = first = i;
Expand Down
2 changes: 1 addition & 1 deletion Source/Private/ThirdParty/DearImgui/imstb_truetype.h
Original file line number Diff line number Diff line change
Expand Up @@ -2008,7 +2008,7 @@ static stbtt__buf stbtt__cid_get_glyph_subrs(const stbtt_fontinfo *info, int gly
start = end;
}
}
if (fdselector == -1) stbtt__new_buf(NULL, 0);
if (fdselector == -1) return stbtt__new_buf(NULL, 0); // [DEAR IMGUI] fixed, see #6007 and nothings/stb#1422
return stbtt__get_subrs(info->cff, stbtt__cff_index_get(info->fontdicts, fdselector));
}

Expand Down
4 changes: 2 additions & 2 deletions Source/Private/ThirdParty/DearImgui/misc/freetype/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@ See https://gist.github.com/ocornut/b3a9ecf13502fd818799a452969649ad

- Oversampling settins are ignored but also not so much necessary with the higher quality rendering.

### Comparaison
### Comparison

Small, thin anti-aliased fonts typically benefit a lot from FreeType's hinting:
![comparing_font_rasterizers](https://user-images.githubusercontent.com/8225057/107550178-fef87f00-6bd0-11eb-8d09-e2edb2f0ccfc.gif)

### Colorful glyphs/emojis

You can use the `ImGuiFreeTypeBuilderFlags_LoadColor` flag to load certain colorful glyphs. See the
["Using Colorful Glyphs/Emojis"](https://github.com/ocornut/imgui/edit/master/docs/FONTS.md#using-colorful-glyphsemojis) section of FONTS.md.
["Using Colorful Glyphs/Emojis"](https://github.com/ocornut/imgui/blob/master/docs/FONTS.md#using-colorful-glyphsemojis) section of FONTS.md.

![colored glyphs](https://user-images.githubusercontent.com/8225057/106171241-9dc4ba80-6191-11eb-8a69-ca1467b206d1.png)
Loading

0 comments on commit 4c38d9a

Please sign in to comment.