diff --git a/.github/workflows/demo-release.yml b/.github/workflows/demo-release.yml
index f3ebb9f..aa7a1ed 100644
--- a/.github/workflows/demo-release.yml
+++ b/.github/workflows/demo-release.yml
@@ -2,7 +2,7 @@ name: Prebuilt demo
on:
pull_request:
- branches: [master]
+ branches: [master, standard]
paths:
- .github/workflows/demo-release.yml
- packaging/demo/**
@@ -12,13 +12,19 @@ on:
- .github/scripts/setup-vulkan-ci.sh
- build_vimgui.sh
- build_vimgui.vsh
+ - generate_v.sh
+ - cleanup_imgui_implot.perl
+ - scripts/update_upstream.sh
+ - scripts/check_upstream_variant.sh
+ - scripts/configure_variant.sh
+ - UPSTREAM_VARIANT
- CMakeLists.txt
- imgui.v
- implot/**
- impl_glfw/**
- impl_vulkan/**
push:
- branches: [master]
+ branches: [master, standard]
workflow_dispatch:
permissions:
@@ -67,6 +73,9 @@ jobs:
echo "$GITHUB_WORKSPACE/toolchain/v" >> "$GITHUB_PATH"
- name: Install native dependencies
run: sudo apt-get update && sudo apt-get install -y build-essential cmake libglfw3-dev libvulkan-dev libvulkan-volk-dev patchelf pkg-config xvfb zip
+ - name: Verify generated upstream variant
+ working-directory: source/modules/antono2/imgui
+ run: ./scripts/check_upstream_variant.sh
- name: Build native ImGui library
working-directory: source/modules/antono2/imgui
run: |
diff --git a/QUICKSTART.md b/QUICKSTART.md
index 49c0375..8ce1b00 100644
--- a/QUICKSTART.md
+++ b/QUICKSTART.md
@@ -85,5 +85,9 @@ v run build_vimgui.vsh --linkage shared --glfw bundled --glfw-version 3.4
## Regenerating bindings
-Binding regeneration is maintainer-oriented and additionally requires LuaJIT.
-Run `./generate_v.sh` only when updating the generated ImGui or ImPlot API.
+Binding regeneration is maintainer-oriented. Run `./generate_v.sh` only when
+updating the generated ImGui or ImPlot API. It translates the generated API
+committed by the pinned upstream submodules; LuaJIT is required only with the
+advanced `--regenerate-c` option. Use `./scripts/update_upstream.sh docking` on
+the default branch or `./scripts/update_upstream.sh standard` on the standard
+variant branch to advance the corresponding upstream line.
diff --git a/README.md b/README.md
index 423ca2e..8b0935f 100644
--- a/README.md
+++ b/README.md
@@ -13,6 +13,22 @@ This is an automated process to generate `imgui.v` and `implot.v`
- `v translate` C to V
- `cleanup_imgui.perl` and `cleanup_implot.perl` to fix some errors
+## Upstream variants
+
+This repository supports both official Dear ImGui lines:
+
+- `master` is the default **docking** build, generated from cimgui's
+ `docking_inter` branch. It includes docking and multi-viewport support while
+ retaining the normal Dear ImGui API.
+- The `standard` branch is generated from cimgui's `master` branch for users
+ who want to track Dear ImGui's smaller standard line exactly.
+
+Both currently track Dear ImGui `1.92.9b`. The `b` is an upstream patch-level
+suffix shared by the release; it does not identify the docking variant. Check
+`UPSTREAM_VARIANT` in a checkout to see which line its generated bindings and
+native sources use. Do not mix a generated binding from one line with a native
+library built from the other.
+
## Dependencies
`v install antono2.vulkan`
`v install antono2.glfw`
@@ -85,24 +101,31 @@ GLFW provider remain build-time choices for developers; they do not need to
multiply the end-user demo downloads.
## Generate
-On `Ubuntu`
+
```bash
-sudo apt install -y luajit
-~/.vmodules/antono2/imgui/generate_v.sh
+# Go to the installed antono2/imgui module
+./generate_v.sh
```
-Or
+`generate_v.sh` regenerates both V bindings from the generated C API committed
+by the pinned cimgui/cimplot revisions, then builds `libvimgui`. It therefore
+does not require LuaJIT for a normal upstream refresh. Pass `--regenerate-c`
+only when intentionally rerunning the upstream Lua generators; that advanced
+mode requires LuaJIT. `v generate.vsh` is retained as a compatibility entry
+point and delegates to the same canonical script.
+
+Maintainers can update either line reproducibly with:
+
```bash
-# Install luajit for your OS
-# Go to the installed antono2/imgui module
-v generate.vsh
+./scripts/update_upstream.sh docking
+# On the standard branch:
+./scripts/update_upstream.sh standard
```
-`generate_v.sh` and `generate.vsh` regenerate both bindings and then build
-`libvimgui`. To only rebuild the native library after a system upgrade or on
-an older Linux distribution, run `v run build_vimgui.vsh`. The Bash
-`build_vimgui.sh` helper remains available as a bootstrap fallback on Unix-like
-machines where V is not yet in `PATH`.
+To only rebuild the native library after a system upgrade or on an older Linux
+distribution, run `v run build_vimgui.vsh`. The Bash `build_vimgui.sh` helper
+remains available as a bootstrap fallback on Unix-like machines where V is not
+yet in `PATH`.
## Thanks
Thank you [@ryoskzypu](https://github.com/ryoskzypu) - from #regex on [libera.chat](https://libera.chat/) - for loving perl and helping people out.
diff --git a/UPSTREAM_VARIANT b/UPSTREAM_VARIANT
new file mode 100644
index 0000000..789e051
--- /dev/null
+++ b/UPSTREAM_VARIANT
@@ -0,0 +1 @@
+docking
diff --git a/cimgui b/cimgui
index 0e533fd..7001407 160000
--- a/cimgui
+++ b/cimgui
@@ -1 +1 @@
-Subproject commit 0e533fd0b70f6add19825bea83b66743d5b8d95b
+Subproject commit 700140771a12e61f4bb851fb4e2d885f04b32dd9
diff --git a/cimplot b/cimplot
index 75a0383..11f13e6 160000
--- a/cimplot
+++ b/cimplot
@@ -1 +1 @@
-Subproject commit 75a03832860f7832712cb5ad8d6e3ad6b69dd97c
+Subproject commit 11f13e6cd0f80e83d6409e78592b392967fa7954
diff --git a/cleanup_imgui_implot.perl b/cleanup_imgui_implot.perl
index b924fde..e8bbebe 100755
--- a/cleanup_imgui_implot.perl
+++ b/cleanup_imgui_implot.perl
@@ -85,6 +85,10 @@ sub clean_one {
while ($i < $#lines && $lines[$i+1] =~ /^\s*\@\[[^\]]+\]\s*$/) { $i++; push @attrs, $lines[$i]; }
if ($i < $#lines && $lines[$i+1] =~ /^\s*(?:pub\s+)?fn\s+/) {
my $decl = $lines[++$i];
+ # cimplot.h includes the complete cimgui API. Its ig*/ImGui* symbols
+ # are already declared by the imported imgui module and must not be
+ # emitted a second time with independently translated signatures.
+ next if $kind eq 'implot' && $csym =~ /^(?:ig|ImGui)/;
if (my @fn = parse_fn($decl)) { push @out, emit_function($kind, $csym, @fn, \%const_params); }
}
next;
@@ -94,6 +98,7 @@ sub clean_one {
if ($line =~ /^\s*(?:pub\s+)?fn\s+/) {
if (my @fn = parse_fn($line)) {
my ($vname) = @fn;
+ next if $kind eq 'implot' && $vname =~ /^im_gui_/;
my $csym = infer_c_symbol($kind, $vname);
push @out, emit_function($kind, $csym, @fn, \%const_params);
}
@@ -112,13 +117,21 @@ sub clean_one {
}
# Struct block.
- if ($line =~ /^\s*(?:pub\s+)?struct\s+((?:C\.)?[A-Za-z_]\w*)\s*\{\s*$/) {
- my $orig = $1;
+ if ($line =~ /^\s*(?:pub\s+)?struct\s+((?:(?:C|imgui)\.)?[A-Za-z_]\w*)\s*\{\s*(\})?\s*$/) {
+ my ($orig, $inline_closed) = ($1, $2);
my @body;
- while (++$i <= $#lines) { last if $lines[$i] =~ /^\s*}\s*$/; push @body, $lines[$i]; }
+ if (!defined $inline_closed) {
+ while (++$i <= $#lines) { last if $lines[$i] =~ /^\s*}\s*$/; push @body, $lines[$i]; }
+ }
+ # cimplot includes cimgui.h, and current c2v emits empty declarations
+ # such as `struct ImGuiTextFilter {}` for types owned by the imported
+ # ImGui module. They are references, not structs that ImPlot may declare.
+ next if $kind eq 'implot' && $orig =~ /^(?:imgui\.|ImGui)/;
my $clean = clean_type_name($kind, $orig);
my $c_name = $orig;
$c_name =~ s/^C\.//;
+ $c_name = 'stbrp_node' if $c_name eq 'Stbrp_node';
+ $c_name = 'stbrp_context_opaque' if $c_name eq 'Stbrp_context_opaque';
if ($kind eq 'implot' && $imported_c_struct{$c_name}) {
my $alias = $imported_c_alias{$c_name};
if (defined $alias && !$seen_type{$clean}++) {
@@ -164,6 +177,11 @@ sub clean_one {
$final =~ s/\bmain\.//g;
$final =~ s/\bMain\.//g;
$final = final_sanitize($kind, $final);
+ my $header_aliases = header_alias_decls($kind, $final, $hdr);
+ $final =~ s/(pub const version_num[^\n]*\n\n)/$1$header_aliases/s if $header_aliases ne '';
+ my $c_alias_targets = missing_c_alias_target_decls($final);
+ $final =~ s/(pub const version_num[^\n]*\n\n)/$1$c_alias_targets/s if $c_alias_targets ne '';
+ $final = final_sanitize($kind, $final);
$final =~ s/\n{4,}/\n\n\n/g;
write_file($outfile, $final);
print "cleaned $kind: $infile -> $outfile\n";
@@ -213,6 +231,15 @@ sub skip_line {
sub parse_version {
my ($src,$hdr,$kind)=@_;
my ($v,$n)=('', '');
+ if ($kind eq 'implot') {
+ for my $file (qw(cimplot/implot/implot.h include/implot/implot.h)) {
+ next unless -e $file;
+ my $version_header = slurp($file);
+ if ($version_header =~ /#define\s+IMPLOT_VERSION\s+"([^"]+)"/) { $v=$1; }
+ if ($version_header =~ /#define\s+IMPLOT_VERSION_NUM\s+(\d+)/) { $n=$1; }
+ return ($v,$n) if $v ne '';
+ }
+ }
if ($src =~ /file version\s+"([^"]+)"\s+(\d+)/) { ($v,$n)=($1,$2); }
my $m = $CFG{$kind}{version_macro};
if (!$v && $hdr =~ /#define\s+${m}_VERSION\s+"([^"]+)"/) { $v=$1; }
@@ -261,11 +288,11 @@ sub cleanup_notes {
Vector fields remain lowercase x/y/z/w for V literals.
5. Remove self-module prefixes: imgui.v must not refer to imgui.Type; implot.v
must not refer to implot.Type, because each file is already inside that module.
-6. STB rectpack names are intentionally preserved from C when c2v produces
- aliases like:
+6. STB rectpack names are intentionally preserved from C when c2v title-cases
+ lower-case C identifiers in aliases like:
example: `pub type Stbrp_node_im = Stbrp_node`
- Normalize the RHS to C.stbrp_node and emit an opaque C.stbrp_node typedef
- generically through C-backed alias handling.
+ Normalize those references to C.stbrp_node/C.stbrp_context_opaque and emit
+ their C-backed declarations with the identifiers used by the headers.
7. Enum aliases are handled dynamically, never by member-name lists. V enums
reject duplicate integer values, while C/C++ enums often define aliases:
any_popup = 1 << 10 | 1 << 11
@@ -541,6 +568,8 @@ sub special_vec_csym {
sub emit_struct {
my ($kind, $orig_name, $clean_name, $body_lines)=@_;
$orig_name =~ s/^C\.//;
+ $orig_name = 'stbrp_node' if $orig_name eq 'Stbrp_node';
+ $orig_name = 'stbrp_context_opaque' if $orig_name eq 'Stbrp_context_opaque';
return '' if $clean_name eq '' || $clean_name =~ /\./;
my @fields;
for my $l (@$body_lines) {
@@ -549,7 +578,7 @@ sub emit_struct {
next if $l =~ /^\s*$/;
if ($l =~ /^\s*([A-Za-z_]\w*)\s+(.+?)\s*$/) {
my ($field,$typ)=($1,clean_type_expr($kind,$2));
- $field = ucfirst($field) unless $orig_name =~ /^(ImVec2|ImVec4|ImVec2_c|ImVec4_c|ImDrawVert)$/;
+ $field = ucfirst($field) unless $orig_name =~ /^(ImVec2|ImVec4|ImVec2_c|ImVec2i_c|ImVec2ih|ImVec4_c|ImDrawVert)$/;
push @fields, "\t$field $typ";
}
}
@@ -707,6 +736,8 @@ sub clean_type_expr {
$s =~ s/\bmain\.//g;
$s =~ s/\bMain\.//g;
$s =~ s/\bC\.int\(([^)]+)\)/$1/g;
+ $s =~ s/\bC\.Stbrp_node\b/C.stbrp_node/g;
+ $s =~ s/\bC\.Stbrp_context_opaque\b/C.stbrp_context_opaque/g;
$s =~ s/\bi8\b/char/g if $s =~ /\&\s*i8\b/;
if ($kind eq 'imgui') {
$s =~ s/\bimgui\.//g;
@@ -753,6 +784,7 @@ sub normalize_alias_rhs {
# lower-case stb_rect_pack.h: typedef struct stbrp_node stbrp_node;
# Example broken V: pub type Stbrp_node_im = Stbrp_node
$rhs = 'C.stbrp_node' if $rhs eq 'Stbrp_node';
+ $rhs = 'C.stbrp_context_opaque' if $rhs eq 'Stbrp_context_opaque';
}
return $rhs;
}
@@ -826,13 +858,19 @@ sub header_alias_decls {
while ($body =~ /^\s*(?:pub\s+)?type\s+([A-Za-z_]\w*)\s*=/gm) { $defined{$1}=1; }
my %body_c_struct;
while ($body =~ /^\s*pub\s+struct\s+C\.([A-Za-z_]\w*)\b/gm) { $body_c_struct{$1}=1; }
+ my %referenced;
+ while ($body =~ /(? -1 {
- mcp(fpath, '${dst}/${entry}')
- }
- }
-}
-
-// START
-cd(wd)
-
-println(' --- Updating Submodules')
-println(' Note: Change submodule version to change cimgui version')
-/*
-if exists('${wd}/cimgui/cimgui.h') {
- cd('${wd}/cimgui')
- sh('git stash')
- cd('${wd}')
-}
-if exists('${wd}/cimplot/cimplot.h') {
- cd('${wd}/cimplot')
- sh('git stash')
- cd('${wd}')
-}
-*/
-if !exists('${wd}/cimgui/cimgui.h') {
- sh('git submodule update --init --recursive')
- // sh('git submodule foreach git pull')
-}
-
-println(' --- Generate cimgui')
-cd('${wd}/cimgui/generator')
-// ./generator.lua ""
-sh('luajit generator.lua gcc ${targets_cimgui} ${cflags}')
-
-println(' --- Add ____TRANSLATIONFIX____ to cimgui.h')
-cd('${wd}/cimgui')
-/*
- -p=print each line -i=edit in place -g=whole file at once -e=execute
- Each struct, where typedef comes right after, but not struct or enum
- Note: Struct may contain another scope inside for the union definition, which has { }
-*/
-sh("perl -p -i -g -e 's/(struct\\s[\\w\\d]+\\s\\{[^\\}]+(?:union\\s+\\{[^\\}]+\\};[^\\}]+)?\\};\\s)(typedef\\s(?!struct|enum)[^\\n]+)/$1\\n\\nstruct ____TRANSLATIONFIX____;\\n$2/g' cimgui.h")
-
-println(' --- Copy cimgui to include')
-copy_by_ext('${wd}/cimgui', '${wd}/include', ['.h', '.cpp'])
-
-// Keep a copy at its original place. For the next run
-mcp('${wd}/include/cimgui_impl.h', '${wd}/cimgui/generator/output/cimgui_impl.h')
-mcp('${wd}/include/cimgui_impl.cpp', '${wd}/cimgui/generator/output/cimgui_impl.cpp')
-
-println(' --- Generate cimplot')
-cd('${wd}/cimplot/generator')
-sh('luajit generator.lua gcc ${targets_cimplot} ${cflags}')
-
-println(' --- Add ____TRANSLATIONFIX____ to cimplot.h')
-cd('${wd}/cimplot')
-sh("perl -p -i -g -e 's/(struct\\s[\\w\\d]+\\s\\{[^\\}]+(?:union\\s+\\{[^\\}]+\\};[^\\}]+)?\\};\\s)(typedef\\s(?!struct|enum)[^\\n]+)/$1\\n\\nstruct ____TRANSLATIONFIX____;\\n$2/g' cimplot.h")
-
-println(' --- Copy cimplot to include')
-copy_by_ext('${wd}/cimplot', '${wd}/include', ['.h', '.cpp'])
-
-// Keep a copy at its original place. For the next run
-mcp('${wd}/include/cimplot.h', '${wd}/cimplot/generator/output/cimplot.h')
-mcp('${wd}/include/cimplot.cpp', '${wd}/cimplot/generator/output/cimplot.cpp')
-
-println(' --- Copy imgui to ./include/imgui')
-println(' Note, ./cimgui/imgui submodule is copied')
-cd('${wd}/cimgui/imgui')
-sh('git checkout-index -a -f --prefix=${wd}/include/imgui/')
-
-println(' --- Copy implot to ./include/implot')
-cd('${wd}/cimplot/implot')
-sh('git checkout-index -a -f --prefix=${wd}/include/implot/')
-
-println(' --- Translate to V')
-cd('${wd}/include')
-write_file('${wd}/include/c2v.toml', '[project]\nadditional_flags = "${dflags}"') or {
- panic('Could not write ${wd}/include/c2v.toml')
-}
-sh('v translate cimgui.h')
-sh('v translate cimplot.h')
-// v translate leaves machine-specific Clang AST metadata behind. It is not
-// needed by the bindings and contains absolute builder and system paths.
-rm('${wd}/include/cimgui.json') or {}
-rm('${wd}/include/cimplot.json') or {}
-
-println(' --- Move implot&gui.v')
-mv('${wd}/include/cimgui.v', '${wd}/imgui.v', overwrite: true) or {
- panic('Could not move ${wd}/include/cimgui.v to ${wd}/imgui.v')
-}
-mv('${wd}/include/cimplot.v', '${wd}/implot/implot.v', overwrite: true) or {
- panic('Could not move ${wd}/include/cimplot.v to ${wd}/implot/implot.v')
-}
-
-println(' --- Cleanup generated implot&gui.v')
-cd(wd)
-sh('${wd}/cleanup_imgui_implot.perl ${wd}/imgui.v ${wd}/imgui.v imgui')
-sh('${wd}/cleanup_imgui_implot.perl ${wd}/implot/implot.v ${wd}/implot/implot.v implot')
-sh('v fmt -w ${wd}/imgui.v')
-sh('v fmt -w ${wd}/implot/implot.v')
-
-println('--- Build vimgui')
-sh('v run ${wd}/build_vimgui.vsh')
-
-println('GENERATED')
-println('${wd}/imgui.v')
-println('${wd}/implot/implot.v')
diff --git a/generate_v.sh b/generate_v.sh
index 8fa95d4..389bd01 100755
--- a/generate_v.sh
+++ b/generate_v.sh
@@ -1,23 +1,23 @@
#!/usr/bin/env bash
set -euo pipefail
+regenerate_c=0
+while (($#)); do
+ case "$1" in
+ --regenerate-c) regenerate_c=1; shift ;;
+ -h|--help)
+ printf '%s\n' 'Usage: generate_v.sh [--regenerate-c]'
+ printf '%s\n' 'By default, translate the generated C API committed by cimgui/cimplot.'
+ exit 0 ;;
+ *) printf 'Unknown option: %s\n' "$1" >&2; exit 2 ;;
+ esac
+done
+
# Make sure the current working dir = this script dir
SCRIPT_DIR=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)
pushd "$SCRIPT_DIR" >/dev/null
printf " --- Changed working dir to\n$SCRIPT_DIR\n\n"
-printf " --- Stashing CIMGUI / CIMPLOT changes"
-#pushd cimgui
-#git stash
-#popd
-#pushd cimplot
-#git stash
-#popd
-printf " --- Updating Submodules"
-printf " Note: Change submodule version to change cimgui version"
-#git submodule update --init --recursive
-#git submodule foreach git pull
-
TARGETS_CIMGUI="internal" #"comments constructors internal noimstrv"
TARGETS_CIMPLOT="internal"
#DFLAGS="-DCMAKE_BUILD_TYPE=RelWithDebInfo -DCIMGUI_DEFINE_ENUMS_AND_STRUCTS=ON -DIMGUI_STATIC=ON -DCIMGUI_NO_EXPORT=ON -DCIMGUI_USE_GLFW=ON"
@@ -26,48 +26,40 @@ CFLAGS="glfw" #opengl3 opengl2 sdl2 sdl3"
printf " --- Generate cimgui\n\n"
rm -f cimgui/CMakeCache.txt cimplot/CMakeCache.txt CMakeCache.txt
-pushd cimgui/generator
- # ./generator.lua ""
- luajit ./generator.lua gcc $TARGETS_CIMGUI $CFLAGS &> /dev/null
-popd
+if ((regenerate_c)); then
+ pushd cimgui/generator
+ # ./generator.lua ""
+ luajit ./generator.lua gcc $TARGETS_CIMGUI $CFLAGS &> /dev/null
+ popd
+else
+ printf " Using the generated API committed by the pinned cimgui revision\n"
+fi
+
+printf " --- Copy cimgui to include\n\n"
+cp cimgui/*.h include/
+cp cimgui/*.cpp include/
-printf " --- Build cimgui\n\n"
-pushd cimgui
-# cmake $DFLAGS $CFLAGS . &> /dev/null
-# make &> /dev/null
-printf " --- Add ____TRANSLATIONFIX____ to cimgui.h\n\n"
+printf " --- Add ____TRANSLATIONFIX____ to include/cimgui.h\n\n"
# -p=print each line -i=edit in place -g=whole file at once -e=execute
# Each struct, where typedef comes right after, but not struct or enum
# Note: Struct may contain another scope inside for the union definition, which has { }
-perl -p -i -g -e 's/(struct\s[\w\d]+\s\{[^\}]+(?:union\s+\{[^\}]+\};[^\}]+)?\};\s)(typedef\s(?!struct|enum)[^\n]+)/$1\n\nstruct ____TRANSLATIONFIX____;\n$2/g' cimgui.h
-popd
-
-printf " --- Copy cimgui to include & lib\n\n"
-cp cimgui/*.a lib/
-cp cimgui/*.h include/
-cp cimgui/*.cpp include/
-# Keep a copy at its original place. For the next run
-cp include/cimgui_impl.h cimgui/generator/output/
-cp include/cimgui_impl.cpp cimgui/generator/output/
+perl -p -i -g -e 's/(struct\s[\w\d]+\s\{[^\}]+(?:union\s+\{[^\}]+\};[^\}]+)?\};\s)(typedef\s(?!struct|enum)[^\n]+)/$1\n\nstruct ____TRANSLATIONFIX____;\n$2/g' include/cimgui.h
printf " --- Generate cimplot\n\n"
-pushd cimplot/generator
- luajit ./generator.lua gcc $TARGETS_CIMPLOT $CFLAGS &> /dev/null
-popd
-
-printf " --- Build cimplot\n\n"
-pushd cimplot
-printf " --- Add ____TRANSLATIONFIX____ to cimplot.h\n\n"
-perl -p -i -g -e 's/(struct\s[\w\d]+\s\{[^\}]+(?:union\s+\{[^\}]+\};[^\}]+)?\};\s)(typedef\s(?!struct|enum)[^\n]+)/$1\n\nstruct ____TRANSLATIONFIX____;\n$2/g' cimplot.h
-popd
-
-printf " --- Copy cimplot to include & lib\n\n"
-cp cimplot/*.a lib/
+if ((regenerate_c)); then
+ pushd cimplot/generator
+ luajit ./generator.lua gcc $TARGETS_CIMPLOT $CFLAGS &> /dev/null
+ popd
+else
+ printf " Using the generated API committed by the pinned cimplot revision\n"
+fi
+
+printf " --- Copy cimplot to include\n\n"
cp cimplot/*.cpp include/
cp cimplot/*.h include/
-# Keep a copy at its original place. For the next run
-cp include/cimplot.h cimplot/generator/output/
-cp include/cimplot.cpp cimplot/generator/output/
+
+printf " --- Add ____TRANSLATIONFIX____ to include/cimplot.h\n\n"
+perl -p -i -g -e 's/(struct\s[\w\d]+\s\{[^\}]+(?:union\s+\{[^\}]+\};[^\}]+)?\};\s)(typedef\s(?!struct|enum)[^\n]+)/$1\n\nstruct ____TRANSLATIONFIX____;\n$2/g' include/cimplot.h
#printf "Remove Asserts"
#perl -p -i -g -e 's/(IM_ASSERT\(ImGuiImplVulkanFuncs_vkCmdBeginRenderingKHR != nullptr\);)/\/\/$1/g' cimgui/imgui/backends/imgui_impl_vulkan.cpp
diff --git a/imgui.v b/imgui.v
index 213e222..9a0a531 100644
--- a/imgui.v
+++ b/imgui.v
@@ -19,13 +19,13 @@ Covered cases and examples:
4. Value backing structs such as ImVec2_c/ImVec4_c/ImColor_c/ImRect_c back public
aliases ImVec2/ImVec4/ImColor/ImRect. Do not emit duplicate empty C structs.
Vector fields remain lowercase x/y/z/w for V literals.
-5. Remove self-module prefixes: v must not refer to Type; implot.v
+5. Remove self-module prefixes: imgui.v must not refer to Type; implot.v
must not refer to implot.Type, because each file is already inside that module.
-6. STB rectpack names are intentionally preserved from C when c2v produces
- aliases like:
+6. STB rectpack names are intentionally preserved from C when c2v title-cases
+ lower-case C identifiers in aliases like:
example: `pub type Stbrp_node_im = Stbrp_node`
- Normalize the RHS to C.stbrp_node and emit an opaque C.stbrp_node typedef
- generically through C-backed alias handling.
+ Normalize those references to C.stbrp_node/C.stbrp_context_opaque and emit
+ their C-backed declarations with the identifiers used by the headers.
7. Enum aliases are handled dynamically, never by member-name lists. V enums
reject duplicate integer values, while C/C++ enums often define aliases:
any_popup = 1 << 10 | 1 << 11
@@ -62,54 +62,73 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
-pub const version = '1.92.7'
-pub const version_num = 19270
+pub const version = '1.92.9b'
+pub const version_num = 19291
-pub type DockNodeSettings = C.ImGuiDockNodeSettings
+pub type ImWchar = u32
-@[typedef]
-pub struct C.ImGuiDockNodeSettings {}
+pub type InputTextCallback = fn (&InputTextCallbackData) i32
-pub type DockRequest = C.ImGuiDockRequest
+pub type SizeCallback = fn (&SizeCallbackData)
+
+pub type Va_list = C.va_list
@[typedef]
-pub struct C.ImGuiDockRequest {}
+pub struct C.va_list {}
-pub type ImColor = C.ImColor_c
+// External C type declarations (from headers)
-pub type ImFontAtlasBuilder = C.ImFontAtlasBuilder
+pub type ImVec2_c = C.ImVec2_c
@[typedef]
-pub struct C.ImFontAtlasBuilder {}
+pub struct C.ImVec2_c {
+pub mut:
+ x f32
+ y f32
+}
+
+// docking branch
+pub type ImColor = C.ImColor_c
pub type ImRect = C.ImRect_c
+pub type ImTextureRef = ImTextureRef_c
+
pub type ImVec2 = C.ImVec2_c
pub type ImVec2i = C.ImVec2i_c
pub type ImVec4 = C.ImVec4_c
-pub type ImWchar = u32
+pub type TextFilter = C.ImGuiTextFilter
-pub type InputTextCallback = fn (&InputTextCallbackData) i32
+@[typedef]
+pub struct C.ImGuiTextFilter {}
-pub type SizeCallback = fn (&SizeCallbackData)
+pub type DockRequest = C.ImGuiDockRequest
-pub type TextFilter = C.ImGuiTextFilter
+@[typedef]
+pub struct C.ImGuiDockRequest {}
+
+pub type DockNodeSettings = C.ImGuiDockNodeSettings
@[typedef]
-pub struct C.ImGuiTextFilter {}
+pub struct C.ImGuiDockNodeSettings {}
-pub type Va_list = C.va_list
+pub type InputTextDeactivateData = C.ImGuiInputTextDeactivateData
@[typedef]
-pub struct C.va_list {}
+pub struct C.ImGuiInputTextDeactivateData {}
+
+pub type TableColumnsSettings = C.ImGuiTableColumnsSettings
@[typedef]
-pub struct C.stbrp_node {}
+pub struct C.ImGuiTableColumnsSettings {}
-// docking branch
+pub type Stbrp_node = C.stbrp_node
+
+@[typedef]
+pub struct C.stbrp_node {}
pub type ImVector_const_charPtr = C.ImVector_const_charPtr
@@ -122,69 +141,111 @@ pub mut:
}
pub type ID = u32
+
pub type ImS8 = i8
+
pub type ImU8 = u8
+
pub type ImS16 = i16
+
pub type ImU16 = u16
+
pub type ImS32 = i32
+
pub type ImU32 = u32
+
pub type ImS64 = i64
+
pub type ImU64 = i64
+
pub type Col = i32
+
pub type Cond = i32
+
pub type DataType = i32
+
pub type MouseButton = i32
+
pub type MouseCursor = i32
+
pub type StyleVar = i32
+
pub type TableBgTarget = i32
+
pub type ImDrawFlags = i32
+
pub type ImDrawListFlags = i32
+
pub type ImDrawTextFlags = i32
+
pub type ImFontFlags = i32
+
pub type ImFontAtlasFlags = i32
+
pub type BackendFlags = i32
+
pub type ButtonFlags = i32
+
pub type ChildFlags = i32
+
pub type ColorEditFlags = i32
+
pub type ConfigFlags = i32
+
pub type ComboFlags = i32
+
pub type DockNodeFlags = i32
+
pub type DragDropFlags = i32
+
pub type FocusedFlags = i32
+
pub type HoveredFlags = i32
+
pub type InputFlags = i32
+
pub type InputTextFlags = i32
+
pub type ItemFlags = i32
+
pub type KeyChord = i32
+
pub type ListClipperFlags = i32
+
pub type PopupFlags = i32
+
pub type MultiSelectFlags = i32
+
pub type SelectableFlags = i32
+
pub type SliderFlags = i32
+
pub type TabBarFlags = i32
+
pub type TabItemFlags = i32
+
pub type TableFlags = i32
+
pub type TableColumnFlags = i32
+
pub type TableRowFlags = i32
+
pub type TreeNodeFlags = i32
+
pub type ViewportFlags = i32
+
pub type WindowFlags = i32
+
pub type ImWchar32 = u32
+
pub type ImWchar16 = u16
+
pub type SelectionUserData = i64
+
pub type MemAllocFunc = fn (usize, voidptr) voidptr
pub type MemFreeFunc = fn (voidptr, voidptr)
-pub type ImVec2_c = C.ImVec2_c
-
-@[typedef]
-pub struct C.ImVec2_c {
-pub mut:
- x f32
- y f32
-}
-
pub type ImVec4_c = C.ImVec4_c
@[typedef]
@@ -254,14 +315,17 @@ pub enum ChildFlags_ {
}
pub enum ItemFlags_ {
- none = 0
- no_tab_stop = 1 << 0
- no_nav = 1 << 1
- no_nav_default_focus = 1 << 2
- button_repeat = 1 << 3
- auto_close_popups = 1 << 4
- allow_duplicate_id = 1 << 5
- disabled = 1 << 6
+ none = 0
+ no_tab_stop = 1 << 0
+ no_nav = 1 << 1
+ no_nav_default_focus = 1 << 2
+ button_repeat = 1 << 3
+ auto_close_popups = 1 << 4
+ allow_duplicate_id = 1 << 5
+ disabled = 1 << 6
+ live_edit_on_input_text = 1 << 7
+ live_edit_on_input_scalar = 1 << 8
+ live_edit_on_input = 1 << 7 | 1 << 8
}
pub enum InputTextFlags_ {
@@ -331,7 +395,7 @@ pub enum PopupFlags_ {
any_popup = 1 << 10 | 1 << 11
mouse_button_shift_ = 1 << 1
// mouse_button_mask_ = 1 << 2 | 1 << 3
- invalid_mask_ = 1 << 0 | 1 << 1
+ invalid_mask_ = 1 << 0 | 1 << 1
}
pub enum SelectableFlags_ {
@@ -481,8 +545,8 @@ pub enum SortDirection {
}
pub enum Key {
- none = 0
- named_key_begin = 512
+ none = 0
+ named_key_begin = 512
// tab = 512
left_arrow = 513
right_arrow = 514
@@ -641,11 +705,11 @@ pub enum Key {
named_key_end = 667
named_key_count = 155
// mod_none = 0
- mod_ctrl = 4096
- mod_shift = 8192
- mod_alt = 16384
- mod_super = 32768
- mod_mask_ = 61440
+ mod_ctrl = 4096
+ mod_shift = 8192
+ mod_alt = 16384
+ mod_super = 32768
+ mod_mask_ = 61440
}
pub enum InputFlags_ {
@@ -708,6 +772,7 @@ pub enum Col_ {
scrollbar_grab_hovered
scrollbar_grab_active
check_mark
+ checkbox_selected_bg
slider_grab
slider_grab_active
button
@@ -790,6 +855,9 @@ pub enum StyleVar_ {
table_angled_headers_text_align
tree_lines_size
tree_lines_rounding
+ menu_item_rounding
+ selectable_rounding
+ drag_drop_target_rounding
button_text_align
selectable_text_align
separator_size
@@ -835,14 +903,15 @@ pub enum ColorEditFlags_ {
float = 1 << 24
picker_hue_bar = 1 << 25
picker_hue_wheel = 1 << 26
- input_rgb = 1 << 27
- input_hsv = 1 << 28
- default_options_ = 1 << 20 | 1 << 23 | 1 << 25 | 1 << 27
+ picker_no_rotate = 1 << 27
+ input_rgb = 1 << 28
+ input_hsv = 1 << 29
+ default_options_ = 1 << 20 | 1 << 23 | 1 << 25 | 1 << 28
alpha_mask_ = 1 << 1 | 1 << 12 | 1 << 13 | 1 << 14
display_mask_ = 1 << 20 | 1 << 21 | 1 << 22
data_type_mask_ = 1 << 23 | 1 << 24
picker_mask_ = 1 << 25 | 1 << 26
- input_mask_ = 1 << 27 | 1 << 28
+ input_mask_ = 1 << 28 | 1 << 29
}
pub enum SliderFlags_ {
@@ -1052,6 +1121,8 @@ pub mut:
TreeLinesFlags TreeNodeFlags
TreeLinesSize f32
TreeLinesRounding f32
+ MenuItemRounding f32
+ SelectableRounding f32
DragDropTargetRounding f32
DragDropTargetBorderSize f32
DragDropTargetPadding f32
@@ -1059,6 +1130,7 @@ pub mut:
ColorButtonPosition Dir
ButtonTextAlign ImVec2_c
SelectableTextAlign ImVec2_c
+ InputTextCursorSize f32
SeparatorSize f32
SeparatorTextBorderSize f32
SeparatorTextAlign ImVec2_c
@@ -1073,7 +1145,7 @@ pub mut:
AntiAliasedFill bool
CurveTessellationTol f32
CircleTessellationMaxError f32
- Colors [62]ImVec4_c
+ Colors [63]ImVec4_c
HoverStationaryDelay f32
HoverDelayShort f32
HoverDelayNormal f32
@@ -1140,19 +1212,24 @@ pub mut:
ConfigViewportsPlatformFocusSetsImGuiFocus bool
ConfigDpiScaleFonts bool
ConfigDpiScaleViewports bool
- MouseDrawCursor bool
ConfigMacOSXBehaviors bool
ConfigInputTrickleEventQueue bool
ConfigInputTextCursorBlink bool
ConfigInputTextEnterKeepActive bool
+ ConfigColorEditFlags ColorEditFlags
ConfigDragClickToInputText bool
ConfigWindowsResizeFromEdges bool
ConfigWindowsMoveFromTitleBarOnly bool
ConfigWindowsCopyContentsWithCtrlC bool
ConfigScrollbarScrollByPage bool
+ ConfigIniSettingsSaveLastUsedDate bool
+ ConfigIniSettingsAutoDiscardMonths i32
+ ConfigDebugIniSettings bool
+ MouseDrawCursor bool
ConfigMemoryCompactTimer f32
MouseDoubleClickTime f32
MouseDoubleClickMaxDist f32
+ MouseSingleClickDelay f32
MouseDragThreshold f32
KeyRepeatDelay f32
KeyRepeatRate f32
@@ -1166,7 +1243,6 @@ pub mut:
ConfigDebugBeginReturnValueOnce bool
ConfigDebugBeginReturnValueLoop bool
ConfigDebugIgnoreFocusLoss bool
- ConfigDebugIniSettings bool
BackendPlatformName &char
BackendRendererName &char
BackendPlatformUserData voidptr
@@ -1270,6 +1346,7 @@ pub mut:
DockNodeFlagsOverrideSet DockNodeFlags
DockingAlwaysTabBar bool
DockingAllowUnclassed bool
+ PlatformIconData voidptr
}
pub type Payload = C.ImGuiPayload
@@ -1409,6 +1486,7 @@ pub enum MultiSelectFlags_ {
nav_wrap_x = 1 << 16
no_select_on_right_click = 1 << 17
select_on_mask_ = 1 << 13 | 1 << 14 | 1 << 15
+ checkbox_mode_ = 1 << 20
}
pub type ImVector_SelectionRequest = C.ImVector_ImGuiSelectionRequest
@@ -1475,6 +1553,7 @@ pub mut:
}
pub type ImDrawIdx = u16
+
pub type ImDrawCallback = fn (&ImDrawList, &ImDrawCmd)
pub type ImDrawCmd = C.ImDrawCmd
@@ -1564,19 +1643,20 @@ pub mut:
pub enum ImDrawFlags_ {
none = 0
- closed = 1 << 0
round_corners_top_left = 1 << 4
round_corners_top_right = 1 << 5
round_corners_bottom_left = 1 << 6
round_corners_bottom_right = 1 << 7
round_corners_none = 1 << 8
+ round_corners_all = 1 << 4 | 1 << 5 | 1 << 6 | 1 << 7
+ // round_corners_default_ = 1 << 4 | 1 << 5 | 1 << 6 | 1 << 7
round_corners_top = 1 << 4 | 1 << 5
round_corners_bottom = 1 << 6 | 1 << 7
round_corners_left = 1 << 4 | 1 << 6
round_corners_right = 1 << 5 | 1 << 7
- round_corners_all = 1 << 4 | 1 << 5 | 1 << 6 | 1 << 7
- // round_corners_default_ = 1 << 4 | 1 << 5 | 1 << 6 | 1 << 7
- round_corners_mask_ = 1 << 4 | 1 << 5 | 1 << 6 | 1 << 7 | 1 << 8
+ round_corners_mask_ = 1 << 4 | 1 << 5 | 1 << 6 | 1 << 7 | 1 << 8
+ closed = 1 << 9
+ invalid_mask_ = -2147483633
}
pub enum ImDrawListFlags_ {
@@ -1585,6 +1665,7 @@ pub enum ImDrawListFlags_ {
anti_aliased_lines_use_tex = 1 << 1
anti_aliased_fill = 1 << 2
allow_vtx_offset = 1 << 3
+ text_no_pixel_snap = 1 << 4
}
pub type ImVector_ImDrawVert = C.ImVector_ImDrawVert
@@ -1686,7 +1767,7 @@ pub type ImDrawData = C.ImDrawData
pub struct C.ImDrawData {
pub mut:
Valid bool
- CmdListsCount i32
+ FrameCount i32
TotalIdxCount i32
TotalVtxCount i32
CmdLists ImVector_ImDrawListPtr
@@ -1739,6 +1820,7 @@ pub mut:
UniqueID i32
Status ImTextureStatus
BackendUserData voidptr
+ QueueUserData voidptr
TexID ImTextureID
Format ImTextureFormat
Width i32
@@ -1969,10 +2051,11 @@ pub mut:
}
pub enum ImFontFlags_ {
- none = 0
- no_load_error = 1 << 1
- no_load_glyphs = 1 << 2
- lock_baked_sizes = 1 << 3
+ none = 0
+ no_load_error = 1 << 1
+ no_load_glyphs = 1 << 2
+ lock_baked_sizes = 1 << 3
+ implicit_ref_size = 1 << 4
}
pub type ImVector_ImFontConfigPtr = C.ImVector_ImFontConfigPtr
@@ -2040,6 +2123,7 @@ pub mut:
DrawData &ImDrawData
RendererUserData voidptr
PlatformUserData voidptr
+ PlatformIconData voidptr
PlatformHandle voidptr
PlatformHandleRaw voidptr
PlatformWindowCreated bool
@@ -2081,9 +2165,13 @@ pub mut:
Platform_SetImeDataFn fn (&Context, &Viewport, &PlatformImeData)
Platform_ImeUserData voidptr
Platform_LocaleDecimalPoint ImWchar
+ Platform_SessionDate i32
Renderer_TextureMaxWidth i32
Renderer_TextureMaxHeight i32
Renderer_RenderState voidptr
+ DrawCallback_ResetRenderState ImDrawCallback
+ DrawCallback_SetSamplerLinear ImDrawCallback
+ DrawCallback_SetSamplerNearest ImDrawCallback
Platform_CreateWindow fn (&Viewport)
Platform_DestroyWindow fn (&Viewport)
Platform_ShowWindow fn (&Viewport)
@@ -2139,26 +2227,46 @@ pub mut:
ViewportId ID
}
-pub type DataAuthority = i32
+pub type DataAuthority = u32
+
pub type LayoutType = i32
+
pub type ActivateFlags = i32
+
pub type DebugLogFlags = i32
+
pub type FocusRequestFlags = i32
+
pub type ItemStatusFlags = i32
+
pub type OldColumnFlags = i32
+
pub type LogFlags = i32
+
pub type NavRenderCursorFlags = i32
+
pub type NavMoveFlags = i32
+
pub type NextItemDataFlags = i32
+
pub type NextWindowDataFlags = i32
+
pub type ScrollFlags = i32
+
pub type SeparatorFlags = i32
+
pub type TextFlags = i32
+
pub type TooltipFlags = i32
+
pub type TypingSelectFlags = i32
+
pub type WindowBgClickFlags = i32
+
pub type WindowRefreshFlags = i32
+
pub type TableColumnIdx = i16
+
pub type TableDrawChannelIdx = u16
pub enum ImDrawTextFlags_ {
@@ -2179,18 +2287,15 @@ pub type ImFileHandle = &C.FILE
pub type ImVec1 = C.ImVec1
@[typedef]
-pub struct C.ImVec1 {
-pub mut:
- X f32
-}
+pub struct C.ImVec1 {}
pub type ImVec2i_c = C.ImVec2i_c
@[typedef]
pub struct C.ImVec2i_c {
pub mut:
- x i32
- y i32
+ x int
+ y int
}
pub type ImVec2ih = C.ImVec2ih
@@ -2198,8 +2303,8 @@ pub type ImVec2ih = C.ImVec2ih
@[typedef]
pub struct C.ImVec2ih {
pub mut:
- X i16
- Y i16
+ x i16
+ y i16
}
pub type ImRect_c = C.ImRect_c
@@ -2242,28 +2347,38 @@ pub mut:
EndOffset i32
}
+pub type PackedDate = C.ImGuiPackedDate
+
+@[typedef]
+pub struct C.ImGuiPackedDate {
+pub mut:
+ Year ImU16
+ Month ImU16
+ Day ImU16
+}
+
pub type ImDrawListSharedData = C.ImDrawListSharedData
@[typedef]
pub struct C.ImDrawListSharedData {
pub mut:
- TexUvWhitePixel ImVec2_c
- TexUvLines &ImVec4_c
- FontAtlas &ImFontAtlas
- Font &ImFont
- FontSize f32
- FontScale f32
- CurveTessellationTol f32
- CircleSegmentMaxError f32
- InitialFringeScale f32
- InitialFlags ImDrawListFlags
- ClipRectFullscreen ImVec4_c
- TempBuffer ImVector_ImVec2
- DrawLists ImVector_ImDrawListPtr
- Context &Context
- ArcFastVtx [48]ImVec2_c
- ArcFastRadiusCutoff f32
- CircleSegmentCounts [64]ImU8
+ TexUvWhitePixel ImVec2_c
+ TexUvLines &ImVec4_c
+ FontAtlas &ImFontAtlas
+ Font &ImFont
+ FontSize f32
+ FontScale f32
+ CurveTessellationTol f32
+ CircleTessellationMaxError f32
+ InitialFringeScale f32
+ InitialFlags ImDrawListFlags
+ ClipRectFullscreen ImVec4_c
+ TempBuffer ImVector_ImVec2
+ DrawLists ImVector_ImDrawListPtr
+ Context &Context
+ ArcFastVtx [48]ImVec2_c
+ ArcFastRadiusCutoff f32
+ CircleSegmentCounts [64]ImU8
}
pub type ImDrawDataBuilder = C.ImDrawDataBuilder
@@ -2347,7 +2462,7 @@ pub enum ItemFlagsPrivate_ {
inputable = 1 << 20
has_selection_user_data = 1 << 21
is_multi_select = 1 << 22
- default_ = 1 << 4
+ default_ = 1 << 4 | 1 << 7
}
pub enum ItemStatusFlags_ {
@@ -2363,6 +2478,7 @@ pub enum ItemStatusFlags_ {
visible = 1 << 8
has_clip_rect = 1 << 9
has_shortcut = 1 << 10
+ edited_internal = 1 << 11
}
pub enum HoveredFlagsPrivate_ {
@@ -2490,20 +2606,20 @@ pub type GroupData = C.ImGuiGroupData
@[typedef]
pub struct C.ImGuiGroupData {
pub mut:
- WindowID ID
- BackupCursorPos ImVec2_c
- BackupCursorMaxPos ImVec2_c
- BackupCursorPosPrevLine ImVec2_c
- BackupIndent ImVec1
- BackupGroupOffset ImVec1
- BackupCurrLineSize ImVec2_c
- BackupCurrLineTextBaseOffset f32
- BackupActiveIdIsAlive ID
- BackupActiveIdHasBeenEditedThisFrame bool
- BackupDeactivatedIdIsAlive bool
- BackupHoveredIdIsAlive bool
- BackupIsSameLine bool
- EmitItem bool
+ WindowID ID
+ BackupCursorPos ImVec2_c
+ BackupCursorMaxPos ImVec2_c
+ BackupCursorPosPrevLine ImVec2_c
+ BackupIndent ImVec1
+ BackupGroupOffset ImVec1
+ BackupCurrLineSize ImVec2_c
+ BackupCurrLineTextBaseOffset f32
+ BackupActiveIdIsAlive ID
+ BackupAnyIdHasBeenEditedThisFrame bool
+ BackupDeactivatedIdIsAlive bool
+ BackupHoveredIdIsAlive bool
+ BackupIsSameLine bool
+ EmitItem bool
}
pub type MenuColumns = C.ImGuiMenuColumns
@@ -2526,8 +2642,9 @@ pub type InputTextDeactivatedState = C.ImGuiInputTextDeactivatedState
@[typedef]
pub struct C.ImGuiInputTextDeactivatedState {
pub mut:
- ID ID
- TextA ImVector_char
+ ID ID
+ ElapseFrame i32
+ TextA ImVector_char
}
pub type ImStbTexteditState = C.STB_TexteditState
@@ -2641,7 +2758,7 @@ pub type NextItemData = C.ImGuiNextItemData
pub struct C.ImGuiNextItemData {
pub mut:
HasFlags NextItemDataFlags
- ItemFlags ItemFlags
+ ItemFlagsSet ItemFlags
FocusScopeId ID
SelectionUserData SelectionUserData
Width f32
@@ -2932,14 +3049,14 @@ pub enum InputFlagsPrivate_ {
repeat_until_mask_ = 1 << 4 | 1 << 5 | 1 << 6 | 1 << 7
repeat_mask_ = 1 << 0 | 1 << 1 | 1 << 2 | 1 << 3 | 1 << 4 | 1 << 5 | 1 << 6 | 1 << 7
// cond_mask_ = 1 << 22 | 1 << 23
- route_type_mask_ = 1 << 10 | 1 << 11 | 1 << 12 | 1 << 13
- route_options_mask_ = 1 << 14 | 1 << 15 | 1 << 16 | 1 << 17
+ route_type_mask_ = 1 << 10 | 1 << 11 | 1 << 12 | 1 << 13
+ route_options_mask_ = 1 << 14 | 1 << 15 | 1 << 16 | 1 << 17
// supported_by_is_key_pressed = 1 << 0 | 1 << 1 | 1 << 2 | 1 << 3 | 1 << 4 | 1 << 5 | 1 << 6 | 1 << 7
- supported_by_is_mouse_clicked = 1 << 0
- supported_by_shortcut = 1 << 0 | 1 << 1 | 1 << 2 | 1 << 3 | 1 << 4 | 1 << 5 | 1 << 6 | 1 << 7 | 1 << 10 | 1 << 11 | 1 << 12 | 1 << 13 | 1 << 14 | 1 << 15 | 1 << 16 | 1 << 17
- supported_by_set_next_item_shortcut = 1 << 0 | 1 << 1 | 1 << 2 | 1 << 3 | 1 << 4 | 1 << 5 | 1 << 6 | 1 << 7 | 1 << 10 | 1 << 11 | 1 << 12 | 1 << 13 | 1 << 14 | 1 << 15 | 1 << 16 | 1 << 17 | 1 << 18
- supported_by_set_key_owner = 1 << 20 | 1 << 21
- supported_by_set_item_key_owner = 1 << 20 | 1 << 21 | 1 << 22 | 1 << 23
+ supported_by_is_mouse_clicked = 1 << 0
+ supported_by_shortcut = 1 << 0 | 1 << 1 | 1 << 2 | 1 << 3 | 1 << 4 | 1 << 5 | 1 << 6 | 1 << 7 | 1 << 10 | 1 << 11 | 1 << 12 | 1 << 13 | 1 << 14 | 1 << 15 | 1 << 16 | 1 << 17
+ supported_by_set_next_item_shortcut = 1 << 0 | 1 << 1 | 1 << 2 | 1 << 3 | 1 << 4 | 1 << 5 | 1 << 6 | 1 << 7 | 1 << 10 | 1 << 11 | 1 << 12 | 1 << 13 | 1 << 14 | 1 << 15 | 1 << 16 | 1 << 17 | 1 << 18
+ supported_by_set_key_owner = 1 << 20 | 1 << 21
+ supported_by_set_item_key_owner = 1 << 20 | 1 << 21 | 1 << 22 | 1 << 23
}
pub type ListClipperRange = C.ImGuiListClipperRange
@@ -3003,7 +3120,6 @@ pub enum NavRenderCursorFlags_ {
none = 0
compact = 1 << 1
always_draw = 1 << 2
- no_rounding = 1 << 3
}
pub enum NavMoveFlags_ {
@@ -3162,6 +3278,7 @@ pub mut:
Window &Window
UnclipMode bool
UnclipRect ImRect_c
+ UnclipRects [2]ImRect_c
BoxSelectRectPrev ImRect_c
BoxSelectRectCurr ImRect_c
}
@@ -3171,22 +3288,22 @@ pub type MultiSelectTempData = C.ImGuiMultiSelectTempData
@[typedef]
pub struct C.ImGuiMultiSelectTempData {
pub mut:
- IO MultiSelectIO
- Storage &MultiSelectState
- FocusScopeId ID
- Flags MultiSelectFlags
- ScopeRectMin ImVec2_c
- BackupCursorMaxPos ImVec2_c
- LastSubmittedItem SelectionUserData
- BoxSelectId ID
- KeyMods KeyChord
- LoopRequestSetAll ImS8
- IsEndIO bool
- IsFocused bool
- IsKeyboardSetRange bool
- NavIdPassedBy bool
- RangeSrcPassedBy bool
- RangeDstPassedBy bool
+ IO MultiSelectIO
+ Storage &MultiSelectState
+ FocusScopeId ID
+ Flags MultiSelectFlags
+ ScopeRectMin ImVec2_c
+ BackupCursorMaxPos ImVec2_c
+ BoxSelectId ID
+ KeyMods KeyChord
+ LoopRequestSetAll ImS8
+ IsEndIO bool
+ IsFocused bool
+ IsKeyboardSetRange bool
+ NavIdPassedBy bool
+ RangeSrcPassedBy bool
+ RangeDstPassedBy bool
+ IsSoleOrUnknownSelectionSize bool
}
pub type MultiSelectState = C.ImGuiMultiSelectState
@@ -3267,8 +3384,8 @@ pub mut:
Size ImVec2_c
SizeRef ImVec2_c
SplitAxis Axis
- WindowClass WindowClass
LastBgColor ImU32
+ WindowClass WindowClass
HostWindow &Window
VisibleWindow &Window
CentralNode &DockNode
@@ -3281,9 +3398,9 @@ pub mut:
SelectedTabId ID
WantCloseTabId ID
RefViewportId ID
- AuthorityForPos DataAuthority
- AuthorityForSize DataAuthority
- AuthorityForViewport DataAuthority
+ AuthorityForPos ImU8
+ AuthorityForSize ImU8
+ AuthorityForViewport ImU8
IsVisible bool
IsFocused bool
IsBgDrawnThisFrame bool
@@ -3384,18 +3501,33 @@ pub type WindowSettings = C.ImGuiWindowSettings
@[typedef]
pub struct C.ImGuiWindowSettings {
pub mut:
- ID ID
- Pos ImVec2ih
- Size ImVec2ih
- ViewportPos ImVec2ih
- ViewportId ID
- DockId ID
- ClassId ID
- DockOrder i16
- Collapsed bool
- IsChild bool
- WantApply bool
- WantDelete bool
+ ID ID
+ Pos ImVec2ih
+ Size ImVec2ih
+ ViewportPos ImVec2ih
+ ViewportId ID
+ DockId ID
+ ClassId ID
+ DockOrder i16
+ LastUsedDate PackedDate
+ Collapsed bool
+ IsChild bool
+ WantApply bool
+ WantDelete bool
+}
+
+pub type SettingsCleanupArgs = C.ImGuiSettingsCleanupArgs
+
+@[typedef]
+pub struct C.ImGuiSettingsCleanupArgs {
+pub mut:
+ TypeHashFilter ID
+ DiscardOlderThanMonths i32
+ DiscardWhenMissingDate bool
+ DiscardAll bool
+ SetCurrentSessionDateToAll bool
+ SetCurrentSessionDateWhenMissingDate bool
+ _DiscardOlderThanDate i32
}
pub type SettingsHandler = C.ImGuiSettingsHandler
@@ -3419,16 +3551,18 @@ pub enum LocKey {
table_size_one = 1
table_size_all_fit = 2
table_size_all_default = 3
- table_reset_order = 4
- windowing_main_menu_bar = 5
- windowing_popup = 6
- windowing_untitled = 7
- open_link_s = 8
- copy_link = 9
- docking_hide_tab_bar = 10
- docking_hold_shift_to_dock = 11
- docking_drag_to_undock_or_move_node = 12
- count = 13
+ table_reset = 4
+ table_reset_order = 5
+ table_reset_visibility = 6
+ windowing_main_menu_bar = 7
+ windowing_popup = 8
+ windowing_untitled = 9
+ open_link_s = 10
+ copy_link = 11
+ docking_hide_tab_bar = 12
+ docking_hold_shift_to_dock = 13
+ docking_drag_to_undock_or_move_node = 14
+ count = 15
}
pub type LocEntry = C.ImGuiLocEntry
@@ -3456,7 +3590,8 @@ pub enum DebugLogFlags_ {
event_input_routing = 1 << 9
event_docking = 1 << 10
event_viewport = 1 << 11
- event_mask_ = 1 << 0 | 1 << 1 | 1 << 2 | 1 << 3 | 1 << 4 | 1 << 5 | 1 << 6 | 1 << 7 | 1 << 8 | 1 << 9 | 1 << 10 | 1 << 11
+ event_table = 1 << 12
+ event_mask_ = 1 << 0 | 1 << 1 | 1 << 2 | 1 << 3 | 1 << 4 | 1 << 5 | 1 << 6 | 1 << 7 | 1 << 8 | 1 << 9 | 1 << 10 | 1 << 11 | 1 << 12
output_to_tty = 1 << 20
output_to_debugger = 1 << 21
output_to_test_engine = 1 << 22
@@ -3488,21 +3623,23 @@ pub type MetricsConfig = C.ImGuiMetricsConfig
@[typedef]
pub struct C.ImGuiMetricsConfig {
pub mut:
- ShowDebugLog bool
- ShowIDStackTool bool
- ShowWindowsRects bool
- ShowWindowsBeginOrder bool
- ShowTablesRects bool
- ShowDrawCmdMesh bool
- ShowDrawCmdBoundingBoxes bool
- ShowTextEncodingViewer bool
- ShowTextureUsedRect bool
- ShowDockingNodes bool
- ShowWindowsRectsType i32
- ShowTablesRectsType i32
- HighlightMonitorIdx i32
- HighlightViewportID ID
- ShowFontPreview bool
+ ShowDebugLog bool
+ ShowIDStackTool bool
+ ShowWindowsRects bool
+ ShowWindowsBeginOrder bool
+ ShowTablesRects bool
+ ShowDrawCmdMesh bool
+ ShowDrawCmdBoundingBoxes bool
+ ShowTextEncodingViewer bool
+ ShowTextureUsedRect bool
+ ShowDockingNodes bool
+ ShowWindowsRectsType i32
+ ShowTablesRectsType i32
+ HighlightMonitorIdx i32
+ HighlightViewportID ID
+ SettingsDiscardMonths i32
+ SettingsHighlightOldEntries bool
+ ShowFontPreview bool
}
pub type StackLevelInfo = C.ImGuiStackLevelInfo
@@ -3898,6 +4035,7 @@ pub mut:
CurrentDpiScale f32
DrawListSharedData ImDrawListSharedData
WithinEndChildID ID
+ WithinEndPopupID ID
TestEngine voidptr
InputEventsQueue ImVector_InputEvent
InputEventsTrail ImVector_InputEvent
@@ -3933,10 +4071,13 @@ pub mut:
HoveredIdAllowOverlap bool
HoveredIdIsDisabled bool
ItemUnclipByLog bool
+ AnyIdHasBeenEditedThisFrame bool
ActiveId ID
ActiveIdIsAlive ID
ActiveIdTimer f32
ActiveIdIsJustActivated bool
+ ActiveIdWasSelected bool
+ ActiveIdWasSoleSelected bool
ActiveIdAllowOverlap bool
ActiveIdNoClearOnFocusLoss bool
ActiveIdHasBeenPressedBefore bool
@@ -3953,6 +4094,8 @@ pub mut:
ActiveIdValueOnActivation DataTypeStorage
LastActiveId ID
LastActiveIdTimer f32
+ LastActiveIdWasSelected bool
+ LastActiveIdWasSoleSelected bool
LastKeyModsChangeTime f64
LastKeyModsChangeFromNoneTime f64
LastKeyboardKeyPressTime f64
@@ -4113,7 +4256,6 @@ pub mut:
DataTypeZeroValue DataTypeStorage
BeginMenuDepth i32
BeginComboDepth i32
- ColorEditOptions ColorEditFlags
ColorEditCurrentID ID
ColorEditSavedID ID
ColorEditSavedHue f32
@@ -4143,6 +4285,7 @@ pub mut:
UserTextures ImVector_ImTextureDataPtr
DockContext DockContext
DockNodeWindowMenuHandler fn (&Context, &DockNode, &TabBar)
+ SessionDate PackedDate
SettingsLoaded bool
SettingsDirtyTimer f32
SettingsIniData TextBuffer
@@ -4152,7 +4295,7 @@ pub mut:
Hooks ImVector_ContextHook
HookIdNext ID
DemoMarkerCallback DemoMarkerCallback
- LocalizationTable [13]&char
+ LocalizationTable [15]&char
LogEnabled bool
LogLineFirstItem bool
LogFlags LogFlags
@@ -4499,7 +4642,8 @@ pub mut:
StretchWeight f32
InitStretchWeightOrWidth f32
ClipRect ImRect_c
- UserID ID
+ ID ID
+ UserData ID
WorkMinX f32
WorkMaxX f32
ItemWidth f32
@@ -4524,6 +4668,10 @@ pub mut:
IsRequestOutput bool
IsSkipItems bool
IsPreserveWidthAuto bool
+ IsJustCreated bool
+ IsLoadedSettings bool
+ IsNeedReconcileSrc bool
+ IsNeedReconcileDst bool
NavLayerCurrent ImS8
AutoFitQueue ImU8
CannotSkipItemsQueue ImU8
@@ -4533,6 +4681,21 @@ pub mut:
SortDirectionsAvailList ImU8
}
+pub type TableReconcileColumnData = C.ImGuiTableReconcileColumnData
+
+@[typedef]
+pub struct C.ImGuiTableReconcileColumnData {
+pub mut:
+ ID ID
+ NameOffset ImS16
+ Flags TableColumnFlags
+ InitWidthOrWeight f32
+ UserData ID
+ ColumnNewIdx TableColumnIdx
+ ColumnOldIdx TableColumnIdx
+ ColumnOldData TableColumn
+}
+
pub type TableCellData = C.ImGuiTableCellData
@[typedef]
@@ -4715,6 +4878,7 @@ pub mut:
IsLayoutLocked bool
IsInsideRow bool
IsInitializing bool
+ IsReconcileMode bool
IsSortSpecsDirty bool
IsUsingHeaders bool
IsContextPopupOpen bool
@@ -4722,8 +4886,10 @@ pub mut:
IsSettingsRequestLoad bool
IsSettingsDirty bool
IsDefaultDisplayOrder bool
+ IsDefaultVisibility bool
IsResetAllRequest bool
IsResetDisplayOrderRequest bool
+ IsResetVisibilityRequest bool
IsUnfrozenRows bool
IsDefaultSizingPolicy bool
IsActiveIdAliveBeforeTable bool
@@ -4744,6 +4910,16 @@ pub mut:
Data &TableHeaderData
}
+pub type ImVector_TableReconcileColumnData = C.ImVector_ImGuiTableReconcileColumnData
+
+@[typedef]
+pub struct C.ImVector_ImGuiTableReconcileColumnData {
+pub mut:
+ Size i32
+ Capacity i32
+ Data &TableReconcileColumnData
+}
+
pub type TableTempData = C.ImGuiTableTempData
@[typedef]
@@ -4754,6 +4930,9 @@ pub mut:
LastTimeActive f32
AngledHeadersExtraWidth f32
AngledHeadersRequests ImVector_TableHeaderData
+ ReconcileColumnsRequests ImVector_TableReconcileColumnData
+ OldColumnsRawData voidptr
+ OldColumnsData ImSpan_TableColumn
UserOuterSize ImVec2_c
DrawSplitter ImDrawListSplitter
HostBackupWorkRect ImRect_c
@@ -4772,13 +4951,14 @@ pub type TableColumnSettings = C.ImGuiTableColumnSettings
pub struct C.ImGuiTableColumnSettings {
pub mut:
WidthOrWeight f32
- UserID ID
+ ID ID
Index TableColumnIdx
DisplayOrder TableColumnIdx
SortOrder TableColumnIdx
SortDirection ImU8
IsEnabled ImS8
IsStretch ImU8
+ IsLoaded bool
}
pub type TableSettings = C.ImGuiTableSettings
@@ -4791,6 +4971,7 @@ pub mut:
RefScale f32
ColumnsCount TableColumnIdx
ColumnsCountMax TableColumnIdx
+ LastUsedDate PackedDate
WantApply bool
}
@@ -4840,10 +5021,10 @@ pub mut:
pub type Stbrp_node_im = C.stbrp_node
-pub type Stbrp_context_opaque = C.Stbrp_context_opaque
+pub type Stbrp_context_opaque = C.stbrp_context_opaque
@[typedef]
-pub struct C.Stbrp_context_opaque {
+pub struct C.stbrp_context_opaque {
pub mut:
Data [80]i8
}
@@ -4888,10 +5069,10 @@ pub mut:
Blocks ImVector_ImFontBakedPtr
}
-pub type ImTextureRef = C.ImTextureRef
+pub type ImFontAtlasBuilder = C.ImFontAtlasBuilder
@[typedef]
-pub struct C.ImTextureRef {
+pub struct C.ImFontAtlasBuilder {
pub mut:
PackContext Stbrp_context_opaque
PackNodes ImVector_stbrp_node_im
@@ -4915,6 +5096,67 @@ pub mut:
PackIdLinesTexData ImFontAtlasRectId
}
+pub type StbUndoRecord = C.StbUndoRecord
+
+@[typedef]
+pub struct C.StbUndoRecord {
+pub mut:
+ Where i32
+ Insert_length i32
+ Delete_length i32
+ Char_storage i32
+}
+
+pub type StbUndoState = C.StbUndoState
+
+@[typedef]
+pub struct C.StbUndoState {
+pub mut:
+ Undo_rec [99]StbUndoRecord
+ Undo_char [999]i8
+ Undo_point i16
+ Redo_point i16
+ Undo_char_point i32
+ Redo_char_point i32
+}
+
+pub type STB_TexteditState = C.STB_TexteditState
+
+@[typedef]
+pub struct C.STB_TexteditState {
+pub mut:
+ Cursor i32
+ Select_start i32
+ Select_end i32
+ Insert_mode u8
+ Row_count_per_page i32
+ Cursor_at_end_of_line u8
+ Initialized u8
+ Has_preferred_x u8
+ Single_line u8
+ Padding1 u8
+ Padding2 u8
+ Padding3 u8
+ Preferred_x f32
+ Undostate StbUndoState
+}
+
+pub type StbTexteditRow = C.StbTexteditRow
+
+@[typedef]
+pub struct C.StbTexteditRow {}
+
+@[typedef]
+pub struct C.ImTextureRef {
+pub mut:
+ X0 f32
+ X1 f32
+ Baseline_y_delta f32
+ Ymin f32
+ Ymax f32
+ Num_chars i32
+}
+
@[keep_args_alive]
fn C.ImVec2_ImVec2_Nil() &ImVec2
@@ -5111,7 +5353,7 @@ pub fn show_debug_log_window(p_open &bool) {
fn C.igShowIDStackToolWindow(p_open &bool)
@[inline]
-pub fn show_ids_tack_tool_window(p_open &bool) {
+pub fn show_id_stack_tool_window(p_open &bool) {
C.igShowIDStackToolWindow(p_open)
}
@@ -6020,10 +6262,10 @@ pub fn text(const_fmt &char) {
}
@[keep_args_alive]
-fn C.igTextV(const_fmt &char, args Va_list)
+fn C.igTextV(const_fmt &char, args C.va_list)
@[inline]
-pub fn text_v(const_fmt &char, args Va_list) {
+pub fn text_v(const_fmt &char, args C.va_list) {
C.igTextV(const_fmt, args)
}
@@ -6036,10 +6278,10 @@ pub fn text_colored(col ImVec4_c, const_fmt &char) {
}
@[keep_args_alive]
-fn C.igTextColoredV(col ImVec4_c, const_fmt &char, args Va_list)
+fn C.igTextColoredV(col ImVec4_c, const_fmt &char, args C.va_list)
@[inline]
-pub fn text_colored_v(col ImVec4_c, const_fmt &char, args Va_list) {
+pub fn text_colored_v(col ImVec4_c, const_fmt &char, args C.va_list) {
C.igTextColoredV(col, const_fmt, args)
}
@@ -6052,10 +6294,10 @@ pub fn text_disabled(const_fmt &char) {
}
@[keep_args_alive]
-fn C.igTextDisabledV(const_fmt &char, args Va_list)
+fn C.igTextDisabledV(const_fmt &char, args C.va_list)
@[inline]
-pub fn text_disabled_v(const_fmt &char, args Va_list) {
+pub fn text_disabled_v(const_fmt &char, args C.va_list) {
C.igTextDisabledV(const_fmt, args)
}
@@ -6068,10 +6310,10 @@ pub fn text_wrapped(const_fmt &char) {
}
@[keep_args_alive]
-fn C.igTextWrappedV(const_fmt &char, args Va_list)
+fn C.igTextWrappedV(const_fmt &char, args C.va_list)
@[inline]
-pub fn text_wrapped_v(const_fmt &char, args Va_list) {
+pub fn text_wrapped_v(const_fmt &char, args C.va_list) {
C.igTextWrappedV(const_fmt, args)
}
@@ -6084,10 +6326,10 @@ pub fn label_text(const_label &char, const_fmt &char) {
}
@[keep_args_alive]
-fn C.igLabelTextV(const_label &char, const_fmt &char, args Va_list)
+fn C.igLabelTextV(const_label &char, const_fmt &char, args C.va_list)
@[inline]
-pub fn label_text_v(const_label &char, const_fmt &char, args Va_list) {
+pub fn label_text_v(const_label &char, const_fmt &char, args C.va_list) {
C.igLabelTextV(const_label, const_fmt, args)
}
@@ -6100,10 +6342,10 @@ pub fn bullet_text(const_fmt &char) {
}
@[keep_args_alive]
-fn C.igBulletTextV(const_fmt &char, args Va_list)
+fn C.igBulletTextV(const_fmt &char, args C.va_list)
@[inline]
-pub fn bullet_text_v(const_fmt &char, args Va_list) {
+pub fn bullet_text_v(const_fmt &char, args C.va_list) {
C.igBulletTextV(const_fmt, args)
}
@@ -6140,10 +6382,10 @@ pub fn invisible_button(const_str_id &char, size ImVec2_c, flags ButtonFlags) bo
}
@[keep_args_alive]
-fn C.igArrowButton(const_str_id &char, dir Dir) bool
+fn C.igArrowButton(const_str_id &char, dir i32) bool
@[inline]
-pub fn arrow_button(const_str_id &char, dir Dir) bool {
+pub fn arrow_button(const_str_id &char, dir i32) bool {
return C.igArrowButton(const_str_id, dir)
}
@@ -6264,8 +6506,7 @@ fn C.igCombo_Str_arr(const_label &char, current_item &i32, items &&u8, items_cou
@[inline]
pub fn combo_str_arr(const_label &char, current_item &i32, items &&u8, items_count i32, popup_max_height_in_items i32) bool {
- return C.igCombo_Str_arr(const_label, current_item, items, items_count,
- popup_max_height_in_items)
+ return C.igCombo_Str_arr(const_label, current_item, items, items_count, popup_max_height_in_items)
}
@[keep_args_alive]
@@ -6273,8 +6514,7 @@ fn C.igCombo_Str(const_label &char, current_item &i32, items_separated_by_zeros
@[inline]
pub fn combo_str(const_label &char, current_item &i32, items_separated_by_zeros &char, popup_max_height_in_items i32) bool {
- return C.igCombo_Str(const_label, current_item, items_separated_by_zeros,
- popup_max_height_in_items)
+ return C.igCombo_Str(const_label, current_item, items_separated_by_zeros, popup_max_height_in_items)
}
@[keep_args_alive]
@@ -6282,8 +6522,7 @@ fn C.igCombo_FnStrPtr(const_label &char, current_item &i32, getter fn (voidptr,
@[inline]
pub fn combo_fn_str_ptr(const_label &char, current_item &i32, getter fn (voidptr, i32) &char, user_data voidptr, items_count i32, popup_max_height_in_items i32) bool {
- return C.igCombo_FnStrPtr(const_label, current_item, getter, user_data, items_count,
- popup_max_height_in_items)
+ return C.igCombo_FnStrPtr(const_label, current_item, getter, user_data, items_count, popup_max_height_in_items)
}
@[keep_args_alive]
@@ -6323,8 +6562,7 @@ fn C.igDragFloatRange2(const_label &char, v_current_min &f32, v_current_max &f32
@[inline]
pub fn drag_float_range2(const_label &char, v_current_min &f32, v_current_max &f32, v_speed f32, v_min f32, v_max f32, format &char, format_max &char, flags SliderFlags) bool {
- return C.igDragFloatRange2(const_label, v_current_min, v_current_max, v_speed, v_min, v_max,
- format, format_max, flags)
+ return C.igDragFloatRange2(const_label, v_current_min, v_current_max, v_speed, v_min, v_max, format, format_max, flags)
}
@[keep_args_alive]
@@ -6364,8 +6602,7 @@ fn C.igDragIntRange2(const_label &char, v_current_min &i32, v_current_max &i32,
@[inline]
pub fn drag_int_range2(const_label &char, v_current_min &i32, v_current_max &i32, v_speed f32, v_min i32, v_max i32, format &char, format_max &char, flags SliderFlags) bool {
- return C.igDragIntRange2(const_label, v_current_min, v_current_max, v_speed, v_min, v_max,
- format, format_max, flags)
+ return C.igDragIntRange2(const_label, v_current_min, v_current_max, v_speed, v_min, v_max, format, format_max, flags)
}
@[keep_args_alive]
@@ -6381,8 +6618,7 @@ fn C.igDragScalarN(const_label &char, data_type DataType, p_data voidptr, compon
@[inline]
pub fn drag_scalar_n(const_label &char, data_type DataType, p_data voidptr, components i32, v_speed f32, p_min voidptr, p_max voidptr, format &char, flags SliderFlags) bool {
- return C.igDragScalarN(const_label, data_type, p_data, components, v_speed, p_min, p_max,
- format, flags)
+ return C.igDragScalarN(const_label, data_type, p_data, components, v_speed, p_min, p_max, format, flags)
}
@[keep_args_alive]
@@ -6470,8 +6706,7 @@ fn C.igSliderScalarN(const_label &char, data_type DataType, p_data voidptr, comp
@[inline]
pub fn slider_scalar_n(const_label &char, data_type DataType, p_data voidptr, components i32, p_min voidptr, p_max voidptr, format &char, flags SliderFlags) bool {
- return C.igSliderScalarN(const_label, data_type, p_data, components, p_min, p_max, format,
- flags)
+ return C.igSliderScalarN(const_label, data_type, p_data, components, p_min, p_max, format, flags)
}
@[keep_args_alive]
@@ -6607,8 +6842,7 @@ fn C.igInputScalarN(const_label &char, data_type DataType, p_data voidptr, compo
@[inline]
pub fn input_scalar_n(const_label &char, data_type DataType, p_data voidptr, components i32, p_step voidptr, p_step_fast voidptr, format &char, flags InputTextFlags) bool {
- return C.igInputScalarN(const_label, data_type, p_data, components, p_step, p_step_fast,
- format, flags)
+ return C.igInputScalarN(const_label, data_type, p_data, components, p_step, p_step_fast, format, flags)
}
@[keep_args_alive]
@@ -6651,14 +6885,6 @@ pub fn color_button(desc_id &char, col ImVec4_c, flags ColorEditFlags, size ImVe
return C.igColorButton(desc_id, col, flags, size)
}
-@[keep_args_alive]
-fn C.igSetColorEditOptions(flags ColorEditFlags)
-
-@[inline]
-pub fn set_color_edit_options(flags ColorEditFlags) {
- C.igSetColorEditOptions(flags)
-}
-
@[keep_args_alive]
fn C.igTreeNode_Str(const_label &char) bool
@@ -6684,18 +6910,18 @@ pub fn tree_node_ptr(ptr_id voidptr, const_fmt &char) bool {
}
@[keep_args_alive]
-fn C.igTreeNodeV_Str(const_str_id &char, const_fmt &char, args Va_list) bool
+fn C.igTreeNodeV_Str(const_str_id &char, const_fmt &char, args C.va_list) bool
@[inline]
-pub fn tree_node_v_str(const_str_id &char, const_fmt &char, args Va_list) bool {
+pub fn tree_node_v_str(const_str_id &char, const_fmt &char, args C.va_list) bool {
return C.igTreeNodeV_Str(const_str_id, const_fmt, args)
}
@[keep_args_alive]
-fn C.igTreeNodeV_Ptr(ptr_id voidptr, const_fmt &char, args Va_list) bool
+fn C.igTreeNodeV_Ptr(ptr_id voidptr, const_fmt &char, args C.va_list) bool
@[inline]
-pub fn tree_node_v_ptr(ptr_id voidptr, const_fmt &char, args Va_list) bool {
+pub fn tree_node_v_ptr(ptr_id voidptr, const_fmt &char, args C.va_list) bool {
return C.igTreeNodeV_Ptr(ptr_id, const_fmt, args)
}
@@ -6724,18 +6950,18 @@ pub fn tree_node_ex_ptr(ptr_id voidptr, flags TreeNodeFlags, const_fmt &char) bo
}
@[keep_args_alive]
-fn C.igTreeNodeExV_Str(const_str_id &char, flags TreeNodeFlags, const_fmt &char, args Va_list) bool
+fn C.igTreeNodeExV_Str(const_str_id &char, flags TreeNodeFlags, const_fmt &char, args C.va_list) bool
@[inline]
-pub fn tree_node_ex_v_str(const_str_id &char, flags TreeNodeFlags, const_fmt &char, args Va_list) bool {
+pub fn tree_node_ex_v_str(const_str_id &char, flags TreeNodeFlags, const_fmt &char, args C.va_list) bool {
return C.igTreeNodeExV_Str(const_str_id, flags, const_fmt, args)
}
@[keep_args_alive]
-fn C.igTreeNodeExV_Ptr(ptr_id voidptr, flags TreeNodeFlags, const_fmt &char, args Va_list) bool
+fn C.igTreeNodeExV_Ptr(ptr_id voidptr, flags TreeNodeFlags, const_fmt &char, args C.va_list) bool
@[inline]
-pub fn tree_node_ex_v_ptr(ptr_id voidptr, flags TreeNodeFlags, const_fmt &char, args Va_list) bool {
+pub fn tree_node_ex_v_ptr(ptr_id voidptr, flags TreeNodeFlags, const_fmt &char, args C.va_list) bool {
return C.igTreeNodeExV_Ptr(ptr_id, flags, const_fmt, args)
}
@@ -6888,8 +7114,7 @@ fn C.igListBox_FnStrPtr(const_label &char, current_item &i32, getter fn (voidptr
@[inline]
pub fn list_box_fn_str_ptr(const_label &char, current_item &i32, getter fn (voidptr, i32) &char, user_data voidptr, items_count i32, height_in_items i32) bool {
- return C.igListBox_FnStrPtr(const_label, current_item, getter, user_data, items_count,
- height_in_items)
+ return C.igListBox_FnStrPtr(const_label, current_item, getter, user_data, items_count, height_in_items)
}
@[keep_args_alive]
@@ -6897,8 +7122,7 @@ fn C.igPlotLines_FloatPtr(const_label &char, values &f32, values_count i32, valu
@[inline]
pub fn plot_lines_float_ptr(const_label &char, values &f32, values_count i32, values_offset i32, overlay_text &char, scale_min f32, scale_max f32, graph_size ImVec2_c, stride i32) {
- C.igPlotLines_FloatPtr(const_label, values, values_count, values_offset, overlay_text,
- scale_min, scale_max, graph_size, stride)
+ C.igPlotLines_FloatPtr(const_label, values, values_count, values_offset, overlay_text, scale_min, scale_max, graph_size, stride)
}
@[keep_args_alive]
@@ -6906,8 +7130,7 @@ fn C.igPlotLines_FnFloatPtr(const_label &char, values_getter fn (voidptr, i32) f
@[inline]
pub fn plot_lines_fn_float_ptr(const_label &char, values_getter fn (voidptr, i32) f32, data voidptr, values_count i32, values_offset i32, overlay_text &char, scale_min f32, scale_max f32, graph_size ImVec2_c) {
- C.igPlotLines_FnFloatPtr(const_label, values_getter, data, values_count, values_offset,
- overlay_text, scale_min, scale_max, graph_size)
+ C.igPlotLines_FnFloatPtr(const_label, values_getter, data, values_count, values_offset, overlay_text, scale_min, scale_max, graph_size)
}
@[keep_args_alive]
@@ -6915,8 +7138,7 @@ fn C.igPlotHistogram_FloatPtr(const_label &char, values &f32, values_count i32,
@[inline]
pub fn plot_histogram_float_ptr(const_label &char, values &f32, values_count i32, values_offset i32, overlay_text &char, scale_min f32, scale_max f32, graph_size ImVec2_c, stride i32) {
- C.igPlotHistogram_FloatPtr(const_label, values, values_count, values_offset, overlay_text,
- scale_min, scale_max, graph_size, stride)
+ C.igPlotHistogram_FloatPtr(const_label, values, values_count, values_offset, overlay_text, scale_min, scale_max, graph_size, stride)
}
@[keep_args_alive]
@@ -6924,8 +7146,7 @@ fn C.igPlotHistogram_FnFloatPtr(const_label &char, values_getter fn (voidptr, i3
@[inline]
pub fn plot_histogram_fn_float_ptr(const_label &char, values_getter fn (voidptr, i32) f32, data voidptr, values_count i32, values_offset i32, overlay_text &char, scale_min f32, scale_max f32, graph_size ImVec2_c) {
- C.igPlotHistogram_FnFloatPtr(const_label, values_getter, data, values_count, values_offset,
- overlay_text, scale_min, scale_max, graph_size)
+ C.igPlotHistogram_FnFloatPtr(const_label, values_getter, data, values_count, values_offset, overlay_text, scale_min, scale_max, graph_size)
}
@[keep_args_alive]
@@ -7049,10 +7270,10 @@ pub fn set_tooltip(const_fmt &char) {
}
@[keep_args_alive]
-fn C.igSetTooltipV(const_fmt &char, args Va_list)
+fn C.igSetTooltipV(const_fmt &char, args C.va_list)
@[inline]
-pub fn set_tooltip_v(const_fmt &char, args Va_list) {
+pub fn set_tooltip_v(const_fmt &char, args C.va_list) {
C.igSetTooltipV(const_fmt, args)
}
@@ -7073,10 +7294,10 @@ pub fn set_item_tooltip(const_fmt &char) {
}
@[keep_args_alive]
-fn C.igSetItemTooltipV(const_fmt &char, args Va_list)
+fn C.igSetItemTooltipV(const_fmt &char, args C.va_list)
@[inline]
-pub fn set_item_tooltip_v(const_fmt &char, args Va_list) {
+pub fn set_item_tooltip_v(const_fmt &char, args C.va_list) {
C.igSetItemTooltipV(const_fmt, args)
}
@@ -7105,27 +7326,27 @@ pub fn end_popup() {
}
@[keep_args_alive]
-fn C.igOpenPopup_Str(const_str_id &char, popup_flags PopupFlags)
+fn C.igOpenPopup_Str(const_str_id &char, popup_flags PopupFlags) bool
@[inline]
-pub fn open_popup_str(const_str_id &char, popup_flags PopupFlags) {
- C.igOpenPopup_Str(const_str_id, popup_flags)
+pub fn open_popup_str(const_str_id &char, popup_flags PopupFlags) bool {
+ return C.igOpenPopup_Str(const_str_id, popup_flags)
}
@[keep_args_alive]
-fn C.igOpenPopup_ID(id ID, popup_flags PopupFlags)
+fn C.igOpenPopup_ID(id ID, popup_flags PopupFlags) bool
@[inline]
-pub fn open_popup_id(id ID, popup_flags PopupFlags) {
- C.igOpenPopup_ID(id, popup_flags)
+pub fn open_popup_id(id ID, popup_flags PopupFlags) bool {
+ return C.igOpenPopup_ID(id, popup_flags)
}
@[keep_args_alive]
-fn C.igOpenPopupOnItemClick(const_str_id &char, popup_flags PopupFlags)
+fn C.igOpenPopupOnItemClick(const_str_id &char, popup_flags PopupFlags) bool
@[inline]
-pub fn open_popup_on_item_click(const_str_id &char, popup_flags PopupFlags) {
- C.igOpenPopupOnItemClick(const_str_id, popup_flags)
+pub fn open_popup_on_item_click(const_str_id &char, popup_flags PopupFlags) bool {
+ return C.igOpenPopupOnItemClick(const_str_id, popup_flags)
}
@[keep_args_alive]
@@ -7209,11 +7430,11 @@ pub fn table_set_column_index(column_n i32) bool {
}
@[keep_args_alive]
-fn C.igTableSetupColumn(const_label &char, flags TableColumnFlags, init_width_or_weight f32, user_id ID)
+fn C.igTableSetupColumn(const_label &char, flags TableColumnFlags, init_width_or_weight f32, user_data ID)
@[inline]
-pub fn table_setup_column(const_label &char, flags TableColumnFlags, init_width_or_weight f32, user_id ID) {
- C.igTableSetupColumn(const_label, flags, init_width_or_weight, user_id)
+pub fn table_setup_column(const_label &char, flags TableColumnFlags, init_width_or_weight f32, user_data ID) {
+ C.igTableSetupColumn(const_label, flags, init_width_or_weight, user_data)
}
@[keep_args_alive]
@@ -7529,10 +7750,10 @@ pub fn log_text(const_fmt &char) {
}
@[keep_args_alive]
-fn C.igLogTextV(const_fmt &char, args Va_list)
+fn C.igLogTextV(const_fmt &char, args C.va_list)
@[inline]
-pub fn log_text_v(const_fmt &char, args Va_list) {
+pub fn log_text_v(const_fmt &char, args C.va_list) {
C.igLogTextV(const_fmt, args)
}
@@ -7800,6 +8021,14 @@ pub fn get_item_flags() ItemFlags {
return C.igGetItemFlags()
}
+@[keep_args_alive]
+fn C.igGetItemClickedCountWithSingleClickDelay(mouse_button MouseButton, delay f32) i32
+
+@[inline]
+pub fn get_item_clicked_count_with_single_click_delay(mouse_button MouseButton, delay f32) i32 {
+ return C.igGetItemClickedCountWithSingleClickDelay(mouse_button, delay)
+}
+
@[keep_args_alive]
fn C.igGetMainViewport() &Viewport
@@ -7916,7 +8145,7 @@ pub fn color_convert_float4_to_u32(in_ ImVec4_c) ImU32 {
fn C.igColorConvertRGBtoHSV(r f32, g f32, b f32, out_h &f32, out_s &f32, out_v &f32)
@[inline]
-pub fn color_convert_rgb_to_hsv(r f32, g f32, b f32, out_h &f32, out_s &f32, out_v &f32) {
+pub fn color_convert_rg_bto_hsv(r f32, g f32, b f32, out_h &f32, out_s &f32, out_v &f32) {
C.igColorConvertRGBtoHSV(r, g, b, out_h, out_s, out_v)
}
@@ -7924,31 +8153,31 @@ pub fn color_convert_rgb_to_hsv(r f32, g f32, b f32, out_h &f32, out_s &f32, out
fn C.igColorConvertHSVtoRGB(h f32, s f32, v f32, out_r &f32, out_g &f32, out_b &f32)
@[inline]
-pub fn color_convert_hsv_to_rgb(h f32, s f32, v f32, out_r &f32, out_g &f32, out_b &f32) {
+pub fn color_convert_hs_vto_rgb(h f32, s f32, v f32, out_r &f32, out_g &f32, out_b &f32) {
C.igColorConvertHSVtoRGB(h, s, v, out_r, out_g, out_b)
}
@[keep_args_alive]
-fn C.igIsKeyDown_Nil(key Key) bool
+fn C.igIsKeyDown_Nil(key i32) bool
@[inline]
-pub fn is_key_down_nil(key Key) bool {
+pub fn is_key_down_nil(key i32) bool {
return C.igIsKeyDown_Nil(key)
}
@[keep_args_alive]
-fn C.igIsKeyPressed_Bool(key Key, repeat bool) bool
+fn C.igIsKeyPressed_Bool(key i32, repeat bool) bool
@[inline]
-pub fn is_key_pressed_bool(key Key, repeat bool) bool {
+pub fn is_key_pressed_bool(key i32, repeat bool) bool {
return C.igIsKeyPressed_Bool(key, repeat)
}
@[keep_args_alive]
-fn C.igIsKeyReleased_Nil(key Key) bool
+fn C.igIsKeyReleased_Nil(key i32) bool
@[inline]
-pub fn is_key_released_nil(key Key) bool {
+pub fn is_key_released_nil(key i32) bool {
return C.igIsKeyReleased_Nil(key)
}
@@ -7961,18 +8190,18 @@ pub fn is_key_chord_pressed_nil(key_chord KeyChord) bool {
}
@[keep_args_alive]
-fn C.igGetKeyPressedAmount(key Key, repeat_delay f32, rate f32) i32
+fn C.igGetKeyPressedAmount(key i32, repeat_delay f32, rate f32) i32
@[inline]
-pub fn get_key_pressed_amount(key Key, repeat_delay f32, rate f32) i32 {
+pub fn get_key_pressed_amount(key i32, repeat_delay f32, rate f32) i32 {
return C.igGetKeyPressedAmount(key, repeat_delay, rate)
}
@[keep_args_alive]
-fn C.igGetKeyName(key Key) &char
+fn C.igGetKeyName(key i32) &char
@[inline]
-pub fn get_key_name(key Key) &char {
+pub fn get_key_name(key i32) &char {
return C.igGetKeyName(key)
}
@@ -8001,11 +8230,11 @@ pub fn set_next_item_shortcut(key_chord KeyChord, flags InputFlags) {
}
@[keep_args_alive]
-fn C.igSetItemKeyOwner_Nil(key Key)
+fn C.igSetItemKeyOwner_Nil(key i32) bool
@[inline]
-pub fn set_item_key_owner_nil(key Key) {
- C.igSetItemKeyOwner_Nil(key)
+pub fn set_item_key_owner_nil(key i32) bool {
+ return C.igSetItemKeyOwner_Nil(key)
}
@[keep_args_alive]
@@ -8221,8 +8450,7 @@ fn C.igDebugCheckVersionAndDataLayout(version_str &char, sz_io usize, sz_style u
@[inline]
pub fn debug_check_version_and_data_layout(version_str &char, sz_io usize, sz_style usize, sz_vec2 usize, sz_vec4 usize, sz_drawvert usize, sz_drawidx usize) bool {
- return C.igDebugCheckVersionAndDataLayout(version_str, sz_io, sz_style, sz_vec2, sz_vec4,
- sz_drawvert, sz_drawidx)
+ return C.igDebugCheckVersionAndDataLayout(version_str, sz_io, sz_style, sz_vec2, sz_vec4, sz_drawvert, sz_drawidx)
}
@[keep_args_alive]
@@ -8234,10 +8462,10 @@ pub fn debug_log(const_fmt &char) {
}
@[keep_args_alive]
-fn C.igDebugLogV(const_fmt &char, args Va_list)
+fn C.igDebugLogV(const_fmt &char, args C.va_list)
@[inline]
-pub fn debug_log_v(const_fmt &char, args Va_list) {
+pub fn debug_log_v(const_fmt &char, args C.va_list) {
C.igDebugLogV(const_fmt, args)
}
@@ -8370,18 +8598,18 @@ pub fn style_scale_all_sizes(self &Style, scale_factor f32) {
}
@[keep_args_alive]
-fn C.ImGuiIO_AddKeyEvent(self &IO, key Key, down bool)
+fn C.ImGuiIO_AddKeyEvent(self &IO, key i32, down bool)
@[inline]
-pub fn io_add_key_event(self &IO, key Key, down bool) {
+pub fn io_add_key_event(self &IO, key i32, down bool) {
C.ImGuiIO_AddKeyEvent(self, key, down)
}
@[keep_args_alive]
-fn C.ImGuiIO_AddKeyAnalogEvent(self &IO, key Key, down bool, v f32)
+fn C.ImGuiIO_AddKeyAnalogEvent(self &IO, key i32, down bool, v f32)
@[inline]
-pub fn io_add_key_analog_event(self &IO, key Key, down bool, v f32) {
+pub fn io_add_key_analog_event(self &IO, key i32, down bool, v f32) {
C.ImGuiIO_AddKeyAnalogEvent(self, key, down, v)
}
@@ -8410,10 +8638,10 @@ pub fn io_add_mouse_wheel_event(self &IO, wheel_x f32, wheel_y f32) {
}
@[keep_args_alive]
-fn C.ImGuiIO_AddMouseSourceEvent(self &IO, source MouseSource)
+fn C.ImGuiIO_AddMouseSourceEvent(self &IO, source i32)
@[inline]
-pub fn io_add_mouse_source_event(self &IO, source MouseSource) {
+pub fn io_add_mouse_source_event(self &IO, source i32) {
C.ImGuiIO_AddMouseSourceEvent(self, source)
}
@@ -8458,10 +8686,10 @@ pub fn io_add_input_characters_utf_8(self &IO, const_str &char) {
}
@[keep_args_alive]
-fn C.ImGuiIO_SetKeyEventNativeData(self &IO, key Key, native_keycode i32, native_scancode i32, native_legacy_index i32)
+fn C.ImGuiIO_SetKeyEventNativeData(self &IO, key i32, native_keycode i32, native_scancode i32, native_legacy_index i32)
@[inline]
-pub fn io_set_key_event_native_data(self &IO, key Key, native_keycode i32, native_scancode i32, native_legacy_index i32) {
+pub fn io_set_key_event_native_data(self &IO, key i32, native_keycode i32, native_scancode i32, native_legacy_index i32) {
C.ImGuiIO_SetKeyEventNativeData(self, key, native_keycode, native_scancode, native_legacy_index)
}
@@ -8842,10 +9070,10 @@ pub fn text_buffer_append(self &TextBuffer, const_str &char, str_end &char) {
}
@[keep_args_alive]
-fn C.ImGuiTextBuffer_appendfv(self &TextBuffer, const_fmt &char, args Va_list)
+fn C.ImGuiTextBuffer_appendfv(self &TextBuffer, const_fmt &char, args C.va_list)
@[inline]
-pub fn text_buffer_appendfv(self &TextBuffer, const_fmt &char, args Va_list) {
+pub fn text_buffer_appendfv(self &TextBuffer, const_fmt &char, args C.va_list) {
C.ImGuiTextBuffer_appendfv(self, const_fmt, args)
}
@@ -9386,11 +9614,27 @@ pub fn im_draw_list_add_line(self &ImDrawList, p1 ImVec2_c, p2 ImVec2_c, col ImU
}
@[keep_args_alive]
-fn C.ImDrawList_AddRect(self &ImDrawList, p_min ImVec2_c, p_max ImVec2_c, col ImU32, rounding f32, flags ImDrawFlags, thickness f32)
+fn C.ImDrawList_AddLineH(self &ImDrawList, min_x f32, max_x f32, y f32, col ImU32, thickness f32)
+
+@[inline]
+pub fn im_draw_list_add_line_h(self &ImDrawList, min_x f32, max_x f32, y f32, col ImU32, thickness f32) {
+ C.ImDrawList_AddLineH(self, min_x, max_x, y, col, thickness)
+}
+
+@[keep_args_alive]
+fn C.ImDrawList_AddLineV(self &ImDrawList, x f32, min_y f32, max_y f32, col ImU32, thickness f32)
@[inline]
-pub fn im_draw_list_add_rect(self &ImDrawList, p_min ImVec2_c, p_max ImVec2_c, col ImU32, rounding f32, flags ImDrawFlags, thickness f32) {
- C.ImDrawList_AddRect(self, p_min, p_max, col, rounding, flags, thickness)
+pub fn im_draw_list_add_line_v(self &ImDrawList, x f32, min_y f32, max_y f32, col ImU32, thickness f32) {
+ C.ImDrawList_AddLineV(self, x, min_y, max_y, col, thickness)
+}
+
+@[keep_args_alive]
+fn C.ImDrawList_AddRect(self &ImDrawList, p_min ImVec2_c, p_max ImVec2_c, col ImU32, rounding f32, thickness f32, flags ImDrawFlags)
+
+@[inline]
+pub fn im_draw_list_add_rect(self &ImDrawList, p_min ImVec2_c, p_max ImVec2_c, col ImU32, rounding f32, thickness f32, flags ImDrawFlags) {
+ C.ImDrawList_AddRect(self, p_min, p_max, col, rounding, thickness, flags)
}
@[keep_args_alive]
@@ -9406,8 +9650,7 @@ fn C.ImDrawList_AddRectFilledMultiColor(self &ImDrawList, p_min ImVec2_c, p_max
@[inline]
pub fn im_draw_list_add_rect_filled_multi_color(self &ImDrawList, p_min ImVec2_c, p_max ImVec2_c, col_upr_left ImU32, col_upr_right ImU32, col_bot_right ImU32, col_bot_left ImU32) {
- C.ImDrawList_AddRectFilledMultiColor(self, p_min, p_max, col_upr_left, col_upr_right,
- col_bot_right, col_bot_left)
+ C.ImDrawList_AddRectFilledMultiColor(self, p_min, p_max, col_upr_left, col_upr_right, col_bot_right, col_bot_left)
}
@[keep_args_alive]
@@ -9503,8 +9746,7 @@ fn C.ImDrawList_AddText_FontPtr(self &ImDrawList, font &ImFont, font_size f32, p
@[inline]
pub fn im_draw_list_add_text_font_ptr(self &ImDrawList, font &ImFont, font_size f32, pos ImVec2_c, col ImU32, text_begin &char, const_text_end &char, wrap_width f32, cpu_fine_clip_rect &ImVec4) {
- C.ImDrawList_AddText_FontPtr(self, font, font_size, pos, col, text_begin, const_text_end,
- wrap_width, cpu_fine_clip_rect)
+ C.ImDrawList_AddText_FontPtr(self, font, font_size, pos, col, text_begin, const_text_end, wrap_width, cpu_fine_clip_rect)
}
@[keep_args_alive]
@@ -9524,11 +9766,11 @@ pub fn im_draw_list_add_bezier_quadratic(self &ImDrawList, p1 ImVec2_c, p2 ImVec
}
@[keep_args_alive]
-fn C.ImDrawList_AddPolyline(self &ImDrawList, points &ImVec2_c, num_points i32, col ImU32, flags ImDrawFlags, thickness f32)
+fn C.ImDrawList_AddPolyline(self &ImDrawList, points &ImVec2_c, num_points i32, col ImU32, thickness f32, flags ImDrawFlags)
@[inline]
-pub fn im_draw_list_add_polyline(self &ImDrawList, points &ImVec2_c, num_points i32, col ImU32, flags ImDrawFlags, thickness f32) {
- C.ImDrawList_AddPolyline(self, points, num_points, col, flags, thickness)
+pub fn im_draw_list_add_polyline(self &ImDrawList, points &ImVec2_c, num_points i32, col ImU32, thickness f32, flags ImDrawFlags) {
+ C.ImDrawList_AddPolyline(self, points, num_points, col, thickness, flags)
}
@[keep_args_alive]
@@ -9612,11 +9854,11 @@ pub fn im_draw_list_path_fill_concave(self &ImDrawList, col ImU32) {
}
@[keep_args_alive]
-fn C.ImDrawList_PathStroke(self &ImDrawList, col ImU32, flags ImDrawFlags, thickness f32)
+fn C.ImDrawList_PathStroke(self &ImDrawList, col ImU32, thickness f32, flags ImDrawFlags)
@[inline]
-pub fn im_draw_list_path_stroke(self &ImDrawList, col ImU32, flags ImDrawFlags, thickness f32) {
- C.ImDrawList_PathStroke(self, col, flags, thickness)
+pub fn im_draw_list_path_stroke(self &ImDrawList, col ImU32, thickness f32, flags ImDrawFlags) {
+ C.ImDrawList_PathStroke(self, col, thickness, flags)
}
@[keep_args_alive]
@@ -9940,10 +10182,10 @@ pub fn im_texture_data_destroy(self &ImTextureData) {
}
@[keep_args_alive]
-fn C.ImTextureData_Create(self &ImTextureData, format ImTextureFormat, w i32, h i32)
+fn C.ImTextureData_Create(self &ImTextureData, format i32, w i32, h i32)
@[inline]
-pub fn im_texture_data_create(self &ImTextureData, format ImTextureFormat, w i32, h i32) {
+pub fn im_texture_data_create(self &ImTextureData, format i32, w i32, h i32) {
C.ImTextureData_Create(self, format, w, h)
}
@@ -10012,10 +10254,10 @@ pub fn im_texture_data_set_tex_id(self &ImTextureData, tex_id ImTextureID) {
}
@[keep_args_alive]
-fn C.ImTextureData_SetStatus(self &ImTextureData, status ImTextureStatus)
+fn C.ImTextureData_SetStatus(self &ImTextureData, status i32)
@[inline]
-pub fn im_texture_data_set_status(self &ImTextureData, status ImTextureStatus) {
+pub fn im_texture_data_set_status(self &ImTextureData, status i32) {
C.ImTextureData_SetStatus(self, status)
}
@@ -10200,8 +10442,7 @@ fn C.ImFontAtlas_AddFontFromMemoryTTF(self &ImFontAtlas, font_data voidptr, font
@[inline]
pub fn im_font_atlas_add_font_from_memory_ttf(self &ImFontAtlas, font_data voidptr, font_data_size i32, size_pixels f32, font_cfg &ImFontConfig, glyph_ranges &ImWchar) &ImFont {
- return C.ImFontAtlas_AddFontFromMemoryTTF(self, font_data, font_data_size, size_pixels,
- font_cfg, glyph_ranges)
+ return C.ImFontAtlas_AddFontFromMemoryTTF(self, font_data, font_data_size, size_pixels, font_cfg, glyph_ranges)
}
@[keep_args_alive]
@@ -10209,8 +10450,7 @@ fn C.ImFontAtlas_AddFontFromMemoryCompressedTTF(self &ImFontAtlas, compressed_fo
@[inline]
pub fn im_font_atlas_add_font_from_memory_compressed_ttf(self &ImFontAtlas, compressed_font_data voidptr, compressed_font_data_size i32, size_pixels f32, font_cfg &ImFontConfig, glyph_ranges &ImWchar) &ImFont {
- return C.ImFontAtlas_AddFontFromMemoryCompressedTTF(self, compressed_font_data,
- compressed_font_data_size, size_pixels, font_cfg, glyph_ranges)
+ return C.ImFontAtlas_AddFontFromMemoryCompressedTTF(self, compressed_font_data, compressed_font_data_size, size_pixels, font_cfg, glyph_ranges)
}
@[keep_args_alive]
@@ -10218,8 +10458,7 @@ fn C.ImFontAtlas_AddFontFromMemoryCompressedBase85TTF(self &ImFontAtlas, compres
@[inline]
pub fn im_font_atlas_add_font_from_memory_compressed_base85_ttf(self &ImFontAtlas, compressed_font_data_base85 &char, size_pixels f32, font_cfg &ImFontConfig, glyph_ranges &ImWchar) &ImFont {
- return C.ImFontAtlas_AddFontFromMemoryCompressedBase85TTF(self, compressed_font_data_base85,
- size_pixels, font_cfg, glyph_ranges)
+ return C.ImFontAtlas_AddFontFromMemoryCompressedBase85TTF(self, compressed_font_data_base85, size_pixels, font_cfg, glyph_ranges)
}
@[keep_args_alive]
@@ -10230,14 +10469,6 @@ pub fn im_font_atlas_remove_font(self &ImFontAtlas, font &ImFont) {
C.ImFontAtlas_RemoveFont(self, font)
}
-@[keep_args_alive]
-fn C.ImFontAtlas_Clear(self &ImFontAtlas)
-
-@[inline]
-pub fn im_font_atlas_clear(self &ImFontAtlas) {
- C.ImFontAtlas_Clear(self)
-}
-
@[keep_args_alive]
fn C.ImFontAtlas_CompactCache(self &ImFontAtlas)
@@ -10255,11 +10486,11 @@ pub fn im_font_atlas_set_font_loader(self &ImFontAtlas, font_loader &ImFontLoade
}
@[keep_args_alive]
-fn C.ImFontAtlas_ClearInputData(self &ImFontAtlas)
+fn C.ImFontAtlas_Clear(self &ImFontAtlas)
@[inline]
-pub fn im_font_atlas_clear_input_data(self &ImFontAtlas) {
- C.ImFontAtlas_ClearInputData(self)
+pub fn im_font_atlas_clear(self &ImFontAtlas) {
+ C.ImFontAtlas_Clear(self)
}
@[keep_args_alive]
@@ -10270,6 +10501,14 @@ pub fn im_font_atlas_clear_fonts(self &ImFontAtlas) {
C.ImFontAtlas_ClearFonts(self)
}
+@[keep_args_alive]
+fn C.ImFontAtlas_ClearInputData(self &ImFontAtlas)
+
+@[inline]
+pub fn im_font_atlas_clear_input_data(self &ImFontAtlas) {
+ C.ImFontAtlas_ClearInputData(self)
+}
+
@[keep_args_alive]
fn C.ImFontAtlas_ClearTexData(self &ImFontAtlas)
@@ -10419,8 +10658,7 @@ fn C.ImFont_CalcTextSizeA(self &ImFont, size f32, max_width f32, wrap_width f32,
@[inline]
pub fn im_font_calc_text_size_a(self &ImFont, size f32, max_width f32, wrap_width f32, text_begin &char, const_text_end &char, out_remaining &&u8) ImVec2_c {
- return C.ImFont_CalcTextSizeA(self, size, max_width, wrap_width, text_begin, const_text_end,
- out_remaining)
+ return C.ImFont_CalcTextSizeA(self, size, max_width, wrap_width, text_begin, const_text_end, out_remaining)
}
@[keep_args_alive]
@@ -10444,8 +10682,7 @@ fn C.ImFont_RenderText(self &ImFont, draw_list &ImDrawList, size f32, pos ImVec2
@[inline]
pub fn im_font_render_text(self &ImFont, draw_list &ImDrawList, size f32, pos ImVec2_c, col ImU32, clip_rect ImVec4_c, text_begin &char, const_text_end &char, wrap_width f32, flags ImDrawTextFlags) {
- C.ImFont_RenderText(self, draw_list, size, pos, col, clip_rect, text_begin, const_text_end,
- wrap_width, flags)
+ C.ImFont_RenderText(self, draw_list, size, pos, col, clip_rect, text_begin, const_text_end, wrap_width, flags)
}
@[keep_args_alive]
@@ -10793,10 +11030,10 @@ pub fn im_format_string(buf &char, buf_size usize, const_fmt &char) i32 {
}
@[keep_args_alive]
-fn C.igImFormatStringV(buf &char, buf_size usize, const_fmt &char, args Va_list) i32
+fn C.igImFormatStringV(buf &char, buf_size usize, const_fmt &char, args C.va_list) i32
@[inline]
-pub fn im_format_string_v(buf &char, buf_size usize, const_fmt &char, args Va_list) i32 {
+pub fn im_format_string_v(buf &char, buf_size usize, const_fmt &char, args C.va_list) i32 {
return C.igImFormatStringV(buf, buf_size, const_fmt, args)
}
@@ -10809,10 +11046,10 @@ pub fn im_format_string_to_temp_buffer(out_buf &&u8, out_buf_end &&u8, const_fmt
}
@[keep_args_alive]
-fn C.igImFormatStringToTempBufferV(out_buf &&u8, out_buf_end &&u8, const_fmt &char, args Va_list)
+fn C.igImFormatStringToTempBufferV(out_buf &&u8, out_buf_end &&u8, const_fmt &char, args C.va_list)
@[inline]
-pub fn im_format_string_to_temp_buffer_v(out_buf &&u8, out_buf_end &&u8, const_fmt &char, args Va_list) {
+pub fn im_format_string_to_temp_buffer_v(out_buf &&u8, out_buf_end &&u8, const_fmt &char, args C.va_list) {
C.igImFormatStringToTempBufferV(out_buf, out_buf_end, const_fmt, args)
}
@@ -10949,8 +11186,7 @@ fn C.igImFontCalcTextSizeEx(font &ImFont, size f32, max_width f32, wrap_width f3
@[inline]
pub fn im_font_calc_text_size_ex(font &ImFont, size f32, max_width f32, wrap_width f32, text_begin &char, text_end_display &char, const_text_end &char, out_remaining &&u8, out_offset &ImVec2_c, flags ImDrawTextFlags) ImVec2_c {
- return C.igImFontCalcTextSizeEx(font, size, max_width, wrap_width, text_begin,
- text_end_display, const_text_end, out_remaining, out_offset, flags)
+ return C.igImFontCalcTextSizeEx(font, size, max_width, wrap_width, text_begin, text_end_display, const_text_end, out_remaining, out_offset, flags)
}
@[keep_args_alive]
@@ -10958,8 +11194,7 @@ fn C.igImFontCalcWordWrapPositionEx(font &ImFont, size f32, const_text &char, co
@[inline]
pub fn im_font_calc_word_wrap_position_ex(font &ImFont, size f32, const_text &char, const_text_end &char, wrap_width f32, flags ImDrawTextFlags) &char {
- return C.igImFontCalcWordWrapPositionEx(font, size, const_text, const_text_end, wrap_width,
- flags)
+ return C.igImFontCalcWordWrapPositionEx(font, size, const_text, const_text_end, wrap_width, flags)
}
@[keep_args_alive]
@@ -10979,26 +11214,26 @@ pub fn im_text_init_classifiers() {
}
@[keep_args_alive]
-fn C.igImTextClassifierClear(bits &ImU32, codepoint_min u32, codepoint_end u32, char_class ImWcharClass)
+fn C.igImTextClassifierClear(bits &ImU32, codepoint_min u32, codepoint_end u32, char_class i32)
@[inline]
-pub fn im_text_classifier_clear(bits &ImU32, codepoint_min u32, codepoint_end u32, char_class ImWcharClass) {
+pub fn im_text_classifier_clear(bits &ImU32, codepoint_min u32, codepoint_end u32, char_class i32) {
C.igImTextClassifierClear(bits, codepoint_min, codepoint_end, char_class)
}
@[keep_args_alive]
-fn C.igImTextClassifierSetCharClass(bits &ImU32, codepoint_min u32, codepoint_end u32, char_class ImWcharClass, c u32)
+fn C.igImTextClassifierSetCharClass(bits &ImU32, codepoint_min u32, codepoint_end u32, char_class i32, c u32)
@[inline]
-pub fn im_text_classifier_set_char_class(bits &ImU32, codepoint_min u32, codepoint_end u32, char_class ImWcharClass, c u32) {
+pub fn im_text_classifier_set_char_class(bits &ImU32, codepoint_min u32, codepoint_end u32, char_class i32, c u32) {
C.igImTextClassifierSetCharClass(bits, codepoint_min, codepoint_end, char_class, c)
}
@[keep_args_alive]
-fn C.igImTextClassifierSetCharClassFromStr(bits &ImU32, codepoint_min u32, codepoint_end u32, char_class ImWcharClass, s &char)
+fn C.igImTextClassifierSetCharClassFromStr(bits &ImU32, codepoint_min u32, codepoint_end u32, char_class i32, s &char)
@[inline]
-pub fn im_text_classifier_set_char_class_from_str(bits &ImU32, codepoint_min u32, codepoint_end u32, char_class ImWcharClass, s &char) {
+pub fn im_text_classifier_set_char_class_from_str(bits &ImU32, codepoint_min u32, codepoint_end u32, char_class i32, s &char) {
C.igImTextClassifierSetCharClassFromStr(bits, codepoint_min, codepoint_end, char_class, s)
}
@@ -11266,6 +11501,14 @@ pub fn im_round64(f f32) f32 {
return C.igImRound64(f)
}
+@[keep_args_alive]
+fn C.igImCeilFast(f f32) f32
+
+@[inline]
+pub fn im_ceil_fast(f f32) f32 {
+ return C.igImCeilFast(f)
+}
+
@[keep_args_alive]
fn C.igImModPositive(a i32, b i32) i32
@@ -11650,6 +11893,22 @@ pub fn im_rect_add_rect(self &ImRect, r ImRect_c) {
C.ImRect_Add_Rect(self, r)
}
+@[keep_args_alive]
+fn C.ImRect_AddX(self &ImRect, x f32)
+
+@[inline]
+pub fn im_rect_add_x(self &ImRect, x f32) {
+ C.ImRect_AddX(self, x)
+}
+
+@[keep_args_alive]
+fn C.ImRect_AddY(self &ImRect, y f32)
+
+@[inline]
+pub fn im_rect_add_y(self &ImRect, y f32) {
+ C.ImRect_AddY(self, y)
+}
+
@[keep_args_alive]
fn C.ImRect_Expand_Float(self &ImRect, amount f32)
@@ -11859,19 +12118,67 @@ pub fn text_index_append(self &TextIndex, base &char, old_size i32, new_size i32
}
@[keep_args_alive]
-fn C.igImLowerBound(in_begin &StoragePair, in_end &StoragePair, key ID) &StoragePair
+fn C.ImGuiPackedDate_ImGuiPackedDate_Nil() &PackedDate
@[inline]
-pub fn im_lower_bound(in_begin &StoragePair, in_end &StoragePair, key ID) &StoragePair {
- return C.igImLowerBound(in_begin, in_end, key)
+pub fn packed_date_packed_date_nil() &PackedDate {
+ return C.ImGuiPackedDate_ImGuiPackedDate_Nil()
}
@[keep_args_alive]
-fn C.ImDrawListSharedData_ImDrawListSharedData() &ImDrawListSharedData
+fn C.ImGuiPackedDate_destroy(self &PackedDate)
@[inline]
-pub fn im_draw_list_shared_data_im_draw_list_shared_data() &ImDrawListSharedData {
- return C.ImDrawListSharedData_ImDrawListSharedData()
+pub fn packed_date_destroy(self &PackedDate) {
+ C.ImGuiPackedDate_destroy(self)
+}
+
+@[keep_args_alive]
+fn C.ImGuiPackedDate_ImGuiPackedDate_Int(yyyymmdd i32) &PackedDate
+
+@[inline]
+pub fn packed_date_packed_date_int(yyyymmdd i32) &PackedDate {
+ return C.ImGuiPackedDate_ImGuiPackedDate_Int(yyyymmdd)
+}
+
+@[keep_args_alive]
+fn C.ImGuiPackedDate_IsValid(self &PackedDate) bool
+
+@[inline]
+pub fn packed_date_is_valid(self &PackedDate) bool {
+ return C.ImGuiPackedDate_IsValid(self)
+}
+
+@[keep_args_alive]
+fn C.ImGuiPackedDate_Unpack(self &PackedDate) i32
+
+@[inline]
+pub fn packed_date_unpack(self &PackedDate) i32 {
+ return C.ImGuiPackedDate_Unpack(self)
+}
+
+@[keep_args_alive]
+fn C.ImGuiPackedDate_SubtractMonths(self &PackedDate, m i32)
+
+@[inline]
+pub fn packed_date_subtract_months(self &PackedDate, m i32) {
+ C.ImGuiPackedDate_SubtractMonths(self, m)
+}
+
+@[keep_args_alive]
+fn C.igImLowerBound(in_begin &StoragePair, in_end &StoragePair, key ID) &StoragePair
+
+@[inline]
+pub fn im_lower_bound(in_begin &StoragePair, in_end &StoragePair, key ID) &StoragePair {
+ return C.igImLowerBound(in_begin, in_end, key)
+}
+
+@[keep_args_alive]
+fn C.ImDrawListSharedData_ImDrawListSharedData() &ImDrawListSharedData
+
+@[inline]
+pub fn im_draw_list_shared_data_im_draw_list_shared_data() &ImDrawListSharedData {
+ return C.ImDrawListSharedData_ImDrawListSharedData()
}
@[keep_args_alive]
@@ -12854,7 +13161,7 @@ pub fn debug_item_path_query_destroy(self &DebugItemPathQuery) {
fn C.ImGuiIDStackTool_ImGuiIDStackTool() &IDStackTool
@[inline]
-pub fn ids_tack_tool_ids_tack_tool() &IDStackTool {
+pub fn id_stack_tool_id_stack_tool() &IDStackTool {
return C.ImGuiIDStackTool_ImGuiIDStackTool()
}
@@ -12862,7 +13169,7 @@ pub fn ids_tack_tool_ids_tack_tool() &IDStackTool {
fn C.ImGuiIDStackTool_destroy(self &IDStackTool)
@[inline]
-pub fn ids_tack_tool_destroy(self &IDStackTool) {
+pub fn id_stack_tool_destroy(self &IDStackTool) {
C.ImGuiIDStackTool_destroy(self)
}
@@ -12942,7 +13249,7 @@ pub fn window_get_id_int(self &Window, n i32) ID {
fn C.ImGuiWindow_GetIDFromPos(self &Window, p_abs ImVec2_c) ID
@[inline]
-pub fn window_get_idf_rom_pos(self &Window, p_abs ImVec2_c) ID {
+pub fn window_get_id_from_pos(self &Window, p_abs ImVec2_c) ID {
return C.ImGuiWindow_GetIDFromPos(self, p_abs)
}
@@ -12950,7 +13257,7 @@ pub fn window_get_idf_rom_pos(self &Window, p_abs ImVec2_c) ID {
fn C.ImGuiWindow_GetIDFromRectangle(self &Window, r_abs ImRect_c) ID
@[inline]
-pub fn window_get_idf_rom_rectangle(self &Window, r_abs ImRect_c) ID {
+pub fn window_get_id_from_rectangle(self &Window, r_abs ImRect_c) ID {
return C.ImGuiWindow_GetIDFromRectangle(self, r_abs)
}
@@ -13115,2679 +13422,2739 @@ pub fn table_settings_get_column_settings(self &TableSettings) &TableColumnSetti
}
@[keep_args_alive]
-fn C.igGetIO_ContextPtr(ctx &Context) &IO
+fn C.igTableOpenContextMenu(column_n i32)
@[inline]
-pub fn get_io_context_ptr(ctx &Context) &IO {
- return C.igGetIO_ContextPtr(ctx)
+pub fn table_open_context_menu(column_n i32) {
+ C.igTableOpenContextMenu(column_n)
}
@[keep_args_alive]
-fn C.igGetPlatformIO_ContextPtr(ctx &Context) &PlatformIO
+fn C.igTableSetColumnWidth(column_n i32, width f32)
@[inline]
-pub fn get_platform_io_context_ptr(ctx &Context) &PlatformIO {
- return C.igGetPlatformIO_ContextPtr(ctx)
+pub fn table_set_column_width(column_n i32, width f32) {
+ C.igTableSetColumnWidth(column_n, width)
}
@[keep_args_alive]
-fn C.igGetScale() f32
+fn C.igTableSetColumnSortDirection(column_n i32, sort_direction i32, append_to_sort_specs bool)
@[inline]
-pub fn get_scale() f32 {
- return C.igGetScale()
+pub fn table_set_column_sort_direction(column_n i32, sort_direction i32, append_to_sort_specs bool) {
+ C.igTableSetColumnSortDirection(column_n, sort_direction, append_to_sort_specs)
}
@[keep_args_alive]
-fn C.igGetCurrentWindowRead() &Window
+fn C.igTableGetHoveredRow() i32
@[inline]
-pub fn get_current_window_read() &Window {
- return C.igGetCurrentWindowRead()
+pub fn table_get_hovered_row() i32 {
+ return C.igTableGetHoveredRow()
}
@[keep_args_alive]
-fn C.igGetCurrentWindow() &Window
+fn C.igTableGetHeaderRowHeight() f32
@[inline]
-pub fn get_current_window() &Window {
- return C.igGetCurrentWindow()
+pub fn table_get_header_row_height() f32 {
+ return C.igTableGetHeaderRowHeight()
}
@[keep_args_alive]
-fn C.igFindWindowByID(id ID) &Window
+fn C.igTableGetHeaderAngledMaxLabelWidth() f32
@[inline]
-pub fn find_window_by_id(id ID) &Window {
- return C.igFindWindowByID(id)
+pub fn table_get_header_angled_max_label_width() f32 {
+ return C.igTableGetHeaderAngledMaxLabelWidth()
}
@[keep_args_alive]
-fn C.igFindWindowByName(const_name &char) &Window
+fn C.igTablePushBackgroundChannel()
@[inline]
-pub fn find_window_by_name(const_name &char) &Window {
- return C.igFindWindowByName(const_name)
+pub fn table_push_background_channel() {
+ C.igTablePushBackgroundChannel()
}
@[keep_args_alive]
-fn C.igUpdateWindowParentAndRootLinks(window &Window, flags WindowFlags, parent_window &Window)
+fn C.igTablePopBackgroundChannel()
@[inline]
-pub fn update_window_parent_and_root_links(window &Window, flags WindowFlags, parent_window &Window) {
- C.igUpdateWindowParentAndRootLinks(window, flags, parent_window)
+pub fn table_pop_background_channel() {
+ C.igTablePopBackgroundChannel()
}
@[keep_args_alive]
-fn C.igUpdateWindowSkipRefresh(window &Window)
+fn C.igTablePushColumnChannel(column_n i32)
@[inline]
-pub fn update_window_skip_refresh(window &Window) {
- C.igUpdateWindowSkipRefresh(window)
+pub fn table_push_column_channel(column_n i32) {
+ C.igTablePushColumnChannel(column_n)
}
@[keep_args_alive]
-fn C.igCalcWindowNextAutoFitSize(window &Window) ImVec2_c
+fn C.igTablePopColumnChannel()
@[inline]
-pub fn calc_window_next_auto_fit_size(window &Window) ImVec2_c {
- return C.igCalcWindowNextAutoFitSize(window)
+pub fn table_pop_column_channel() {
+ C.igTablePopColumnChannel()
}
@[keep_args_alive]
-fn C.igIsWindowChildOf(window &Window, potential_parent &Window, popup_hierarchy bool, dock_hierarchy bool) bool
+fn C.igTableAngledHeadersRowEx(row_id ID, angle f32, max_label_width f32, data &TableHeaderData, data_count i32)
@[inline]
-pub fn is_window_child_of(window &Window, potential_parent &Window, popup_hierarchy bool, dock_hierarchy bool) bool {
- return C.igIsWindowChildOf(window, potential_parent, popup_hierarchy, dock_hierarchy)
+pub fn table_angled_headers_row_ex(row_id ID, angle f32, max_label_width f32, data &TableHeaderData, data_count i32) {
+ C.igTableAngledHeadersRowEx(row_id, angle, max_label_width, data, data_count)
}
@[keep_args_alive]
-fn C.igIsWindowInBeginStack(window &Window) bool
+fn C.igGetCurrentTable() &Table
@[inline]
-pub fn is_window_in_begin_stack(window &Window) bool {
- return C.igIsWindowInBeginStack(window)
+pub fn get_current_table() &Table {
+ return C.igGetCurrentTable()
}
@[keep_args_alive]
-fn C.igIsWindowWithinBeginStackOf(window &Window, potential_parent &Window) bool
+fn C.igTableFindByID(id ID) &Table
@[inline]
-pub fn is_window_within_begin_stack_of(window &Window, potential_parent &Window) bool {
- return C.igIsWindowWithinBeginStackOf(window, potential_parent)
+pub fn table_find_by_id(id ID) &Table {
+ return C.igTableFindByID(id)
}
@[keep_args_alive]
-fn C.igIsWindowAbove(potential_above &Window, potential_below &Window) bool
+fn C.igBeginTableEx(const_name &char, id ID, columns_count i32, flags TableFlags, outer_size ImVec2_c, inner_width f32) bool
@[inline]
-pub fn is_window_above(potential_above &Window, potential_below &Window) bool {
- return C.igIsWindowAbove(potential_above, potential_below)
+pub fn begin_table_ex(const_name &char, id ID, columns_count i32, flags TableFlags, outer_size ImVec2_c, inner_width f32) bool {
+ return C.igBeginTableEx(const_name, id, columns_count, flags, outer_size, inner_width)
}
@[keep_args_alive]
-fn C.igIsWindowNavFocusable(window &Window) bool
+fn C.igTableBeginInitMemory(table &Table, columns_count i32)
@[inline]
-pub fn is_window_nav_focusable(window &Window) bool {
- return C.igIsWindowNavFocusable(window)
+pub fn table_begin_init_memory(table &Table, columns_count i32) {
+ C.igTableBeginInitMemory(table, columns_count)
}
@[keep_args_alive]
-fn C.igSetWindowPos_WindowPtr(window &Window, pos ImVec2_c, cond Cond)
+fn C.igTableApplyQueuedRequests(table &Table)
@[inline]
-pub fn set_window_pos_window_ptr(window &Window, pos ImVec2_c, cond Cond) {
- C.igSetWindowPos_WindowPtr(window, pos, cond)
+pub fn table_apply_queued_requests(table &Table) {
+ C.igTableApplyQueuedRequests(table)
}
@[keep_args_alive]
-fn C.igSetWindowSize_WindowPtr(window &Window, size ImVec2_c, cond Cond)
+fn C.igTableSetupDrawChannels(table &Table)
@[inline]
-pub fn set_window_size_window_ptr(window &Window, size ImVec2_c, cond Cond) {
- C.igSetWindowSize_WindowPtr(window, size, cond)
+pub fn table_setup_draw_channels(table &Table) {
+ C.igTableSetupDrawChannels(table)
}
@[keep_args_alive]
-fn C.igSetWindowCollapsed_WindowPtr(window &Window, collapsed bool, cond Cond)
+fn C.igTableReconcileColumns(table &Table)
@[inline]
-pub fn set_window_collapsed_window_ptr(window &Window, collapsed bool, cond Cond) {
- C.igSetWindowCollapsed_WindowPtr(window, collapsed, cond)
+pub fn table_reconcile_columns(table &Table) {
+ C.igTableReconcileColumns(table)
}
@[keep_args_alive]
-fn C.igSetWindowHitTestHole(window &Window, pos ImVec2_c, size ImVec2_c)
+fn C.igTableUpdateLayout(table &Table)
@[inline]
-pub fn set_window_hit_test_hole(window &Window, pos ImVec2_c, size ImVec2_c) {
- C.igSetWindowHitTestHole(window, pos, size)
+pub fn table_update_layout(table &Table) {
+ C.igTableUpdateLayout(table)
}
@[keep_args_alive]
-fn C.igSetWindowHiddenAndSkipItemsForCurrentFrame(window &Window)
+fn C.igTableUpdateBorders(table &Table)
@[inline]
-pub fn set_window_hidden_and_skip_items_for_current_frame(window &Window) {
- C.igSetWindowHiddenAndSkipItemsForCurrentFrame(window)
+pub fn table_update_borders(table &Table) {
+ C.igTableUpdateBorders(table)
}
@[keep_args_alive]
-fn C.igSetWindowParentWindowForFocusRoute(window &Window, parent_window &Window)
+fn C.igTableUpdateColumnsWeightFromWidth(table &Table)
@[inline]
-pub fn set_window_parent_window_for_focus_route(window &Window, parent_window &Window) {
- C.igSetWindowParentWindowForFocusRoute(window, parent_window)
+pub fn table_update_columns_weight_from_width(table &Table) {
+ C.igTableUpdateColumnsWeightFromWidth(table)
}
@[keep_args_alive]
-fn C.igWindowRectAbsToRel(window &Window, r ImRect_c) ImRect_c
+fn C.igTableApplyExternalUnclipRect(table &Table, rect &ImRect)
@[inline]
-pub fn window_rect_abs_to_rel(window &Window, r ImRect_c) ImRect_c {
- return C.igWindowRectAbsToRel(window, r)
+pub fn table_apply_external_unclip_rect(table &Table, rect &ImRect) {
+ C.igTableApplyExternalUnclipRect(table, rect)
}
@[keep_args_alive]
-fn C.igWindowRectRelToAbs(window &Window, r ImRect_c) ImRect_c
+fn C.igTableDrawBorders(table &Table)
@[inline]
-pub fn window_rect_rel_to_abs(window &Window, r ImRect_c) ImRect_c {
- return C.igWindowRectRelToAbs(window, r)
+pub fn table_draw_borders(table &Table) {
+ C.igTableDrawBorders(table)
}
@[keep_args_alive]
-fn C.igWindowPosAbsToRel(window &Window, p ImVec2_c) ImVec2_c
+fn C.igTableDrawDefaultContextMenu(table &Table, flags_for_section_to_display TableFlags)
@[inline]
-pub fn window_pos_abs_to_rel(window &Window, p ImVec2_c) ImVec2_c {
- return C.igWindowPosAbsToRel(window, p)
+pub fn table_draw_default_context_menu(table &Table, flags_for_section_to_display TableFlags) {
+ C.igTableDrawDefaultContextMenu(table, flags_for_section_to_display)
}
@[keep_args_alive]
-fn C.igWindowPosRelToAbs(window &Window, p ImVec2_c) ImVec2_c
+fn C.igTableBeginContextMenuPopup(table &Table) bool
@[inline]
-pub fn window_pos_rel_to_abs(window &Window, p ImVec2_c) ImVec2_c {
- return C.igWindowPosRelToAbs(window, p)
+pub fn table_begin_context_menu_popup(table &Table) bool {
+ return C.igTableBeginContextMenuPopup(table)
}
@[keep_args_alive]
-fn C.igFocusWindow(window &Window, flags FocusRequestFlags)
+fn C.igTableMergeDrawChannels(table &Table)
@[inline]
-pub fn focus_window(window &Window, flags FocusRequestFlags) {
- C.igFocusWindow(window, flags)
+pub fn table_merge_draw_channels(table &Table) {
+ C.igTableMergeDrawChannels(table)
}
@[keep_args_alive]
-fn C.igFocusTopMostWindowUnderOne(under_this_window &Window, ignore_window &Window, filter_viewport &Viewport, flags FocusRequestFlags)
+fn C.igTableGetInstanceData(table &Table, instance_no i32) &TableInstanceData
@[inline]
-pub fn focus_top_most_window_under_one(under_this_window &Window, ignore_window &Window, filter_viewport &Viewport, flags FocusRequestFlags) {
- C.igFocusTopMostWindowUnderOne(under_this_window, ignore_window, filter_viewport, flags)
+pub fn table_get_instance_data(table &Table, instance_no i32) &TableInstanceData {
+ return C.igTableGetInstanceData(table, instance_no)
}
@[keep_args_alive]
-fn C.igBringWindowToFocusFront(window &Window)
+fn C.igTableGetInstanceID(table &Table, instance_no i32) ID
@[inline]
-pub fn bring_window_to_focus_front(window &Window) {
- C.igBringWindowToFocusFront(window)
+pub fn table_get_instance_id(table &Table, instance_no i32) ID {
+ return C.igTableGetInstanceID(table, instance_no)
}
@[keep_args_alive]
-fn C.igBringWindowToDisplayFront(window &Window)
+fn C.igTableFixDisplayOrder(table &Table)
@[inline]
-pub fn bring_window_to_display_front(window &Window) {
- C.igBringWindowToDisplayFront(window)
+pub fn table_fix_display_order(table &Table) {
+ C.igTableFixDisplayOrder(table)
}
@[keep_args_alive]
-fn C.igBringWindowToDisplayBack(window &Window)
+fn C.igTableSortSpecsSanitize(table &Table)
@[inline]
-pub fn bring_window_to_display_back(window &Window) {
- C.igBringWindowToDisplayBack(window)
+pub fn table_sort_specs_sanitize(table &Table) {
+ C.igTableSortSpecsSanitize(table)
}
@[keep_args_alive]
-fn C.igBringWindowToDisplayBehind(window &Window, above_window &Window)
+fn C.igTableSortSpecsBuild(table &Table)
@[inline]
-pub fn bring_window_to_display_behind(window &Window, above_window &Window) {
- C.igBringWindowToDisplayBehind(window, above_window)
+pub fn table_sort_specs_build(table &Table) {
+ C.igTableSortSpecsBuild(table)
}
@[keep_args_alive]
-fn C.igFindWindowDisplayIndex(window &Window) i32
+fn C.igTableInitColumnDefaults(table &Table, column &TableColumn, init_mask TableColumnFlags)
@[inline]
-pub fn find_window_display_index(window &Window) i32 {
- return C.igFindWindowDisplayIndex(window)
+pub fn table_init_column_defaults(table &Table, column &TableColumn, init_mask TableColumnFlags) {
+ C.igTableInitColumnDefaults(table, column, init_mask)
}
@[keep_args_alive]
-fn C.igFindBottomMostVisibleWindowWithinBeginStack(window &Window) &Window
+fn C.igTableGetColumnNextSortDirection(column &TableColumn) i32
@[inline]
-pub fn find_bottom_most_visible_window_within_begin_stack(window &Window) &Window {
- return C.igFindBottomMostVisibleWindowWithinBeginStack(window)
+pub fn table_get_column_next_sort_direction(column &TableColumn) i32 {
+ return C.igTableGetColumnNextSortDirection(column)
}
@[keep_args_alive]
-fn C.igSetNextWindowRefreshPolicy(flags WindowRefreshFlags)
+fn C.igTableFixColumnSortDirection(table &Table, column &TableColumn)
@[inline]
-pub fn set_next_window_refresh_policy(flags WindowRefreshFlags) {
- C.igSetNextWindowRefreshPolicy(flags)
+pub fn table_fix_column_sort_direction(table &Table, column &TableColumn) {
+ C.igTableFixColumnSortDirection(table, column)
}
@[keep_args_alive]
-fn C.igRegisterUserTexture(tex &ImTextureData)
+fn C.igTableGetColumnWidthAuto(table &Table, column &TableColumn) f32
@[inline]
-pub fn register_user_texture(tex &ImTextureData) {
- C.igRegisterUserTexture(tex)
+pub fn table_get_column_width_auto(table &Table, column &TableColumn) f32 {
+ return C.igTableGetColumnWidthAuto(table, column)
}
@[keep_args_alive]
-fn C.igUnregisterUserTexture(tex &ImTextureData)
+fn C.igTableBeginRow(table &Table)
@[inline]
-pub fn unregister_user_texture(tex &ImTextureData) {
- C.igUnregisterUserTexture(tex)
+pub fn table_begin_row(table &Table) {
+ C.igTableBeginRow(table)
}
@[keep_args_alive]
-fn C.igRegisterFontAtlas(atlas &ImFontAtlas)
+fn C.igTableEndRow(table &Table)
@[inline]
-pub fn register_font_atlas(atlas &ImFontAtlas) {
- C.igRegisterFontAtlas(atlas)
+pub fn table_end_row(table &Table) {
+ C.igTableEndRow(table)
}
@[keep_args_alive]
-fn C.igUnregisterFontAtlas(atlas &ImFontAtlas)
+fn C.igTableBeginCell(table &Table, column_n i32)
@[inline]
-pub fn unregister_font_atlas(atlas &ImFontAtlas) {
- C.igUnregisterFontAtlas(atlas)
+pub fn table_begin_cell(table &Table, column_n i32) {
+ C.igTableBeginCell(table, column_n)
}
@[keep_args_alive]
-fn C.igSetCurrentFont(font &ImFont, font_size_before_scaling f32, font_size_after_scaling f32)
+fn C.igTableEndCell(table &Table)
@[inline]
-pub fn set_current_font(font &ImFont, font_size_before_scaling f32, font_size_after_scaling f32) {
- C.igSetCurrentFont(font, font_size_before_scaling, font_size_after_scaling)
+pub fn table_end_cell(table &Table) {
+ C.igTableEndCell(table)
}
@[keep_args_alive]
-fn C.igUpdateCurrentFontSize(restore_font_size_after_scaling f32)
+fn C.igTableGetCellBgRect(table &Table, column_n i32) ImRect_c
@[inline]
-pub fn update_current_font_size(restore_font_size_after_scaling f32) {
- C.igUpdateCurrentFontSize(restore_font_size_after_scaling)
+pub fn table_get_cell_bg_rect(table &Table, column_n i32) ImRect_c {
+ return C.igTableGetCellBgRect(table, column_n)
}
@[keep_args_alive]
-fn C.igSetFontRasterizerDensity(rasterizer_density f32)
+fn C.igTableGetColumnName_TablePtr(table &Table, column_n i32) &char
@[inline]
-pub fn set_font_rasterizer_density(rasterizer_density f32) {
- C.igSetFontRasterizerDensity(rasterizer_density)
+pub fn table_get_column_name_table_ptr(table &Table, column_n i32) &char {
+ return C.igTableGetColumnName_TablePtr(table, column_n)
}
@[keep_args_alive]
-fn C.igGetFontRasterizerDensity() f32
+fn C.igTableGetColumnResizeID(table &Table, column_n i32, instance_no i32) ID
@[inline]
-pub fn get_font_rasterizer_density() f32 {
- return C.igGetFontRasterizerDensity()
+pub fn table_get_column_resize_id(table &Table, column_n i32, instance_no i32) ID {
+ return C.igTableGetColumnResizeID(table, column_n, instance_no)
}
@[keep_args_alive]
-fn C.igGetRoundedFontSize(size f32) f32
+fn C.igTableCalcMaxColumnWidth(table &Table, column_n i32) f32
@[inline]
-pub fn get_rounded_font_size(size f32) f32 {
- return C.igGetRoundedFontSize(size)
+pub fn table_calc_max_column_width(table &Table, column_n i32) f32 {
+ return C.igTableCalcMaxColumnWidth(table, column_n)
}
@[keep_args_alive]
-fn C.igGetDefaultFont() &ImFont
+fn C.igTableSetColumnWidthAutoSingle(table &Table, column_n i32)
@[inline]
-pub fn get_default_font() &ImFont {
- return C.igGetDefaultFont()
+pub fn table_set_column_width_auto_single(table &Table, column_n i32) {
+ C.igTableSetColumnWidthAutoSingle(table, column_n)
}
@[keep_args_alive]
-fn C.igPushPasswordFont()
+fn C.igTableSetColumnWidthAutoAll(table &Table)
@[inline]
-pub fn push_password_font() {
- C.igPushPasswordFont()
+pub fn table_set_column_width_auto_all(table &Table) {
+ C.igTableSetColumnWidthAutoAll(table)
}
@[keep_args_alive]
-fn C.igPopPasswordFont()
+fn C.igTableSetColumnDisplayOrder(table &Table, column_n i32, dst_order i32)
@[inline]
-pub fn pop_password_font() {
- C.igPopPasswordFont()
+pub fn table_set_column_display_order(table &Table, column_n i32, dst_order i32) {
+ C.igTableSetColumnDisplayOrder(table, column_n, dst_order)
}
@[keep_args_alive]
-fn C.igGetForegroundDrawList_WindowPtr(window &Window) &ImDrawList
+fn C.igTableQueueSetColumnDisplayOrder(table &Table, column_n i32, dst_order i32)
@[inline]
-pub fn get_foreground_draw_list_window_ptr(window &Window) &ImDrawList {
- return C.igGetForegroundDrawList_WindowPtr(window)
+pub fn table_queue_set_column_display_order(table &Table, column_n i32, dst_order i32) {
+ C.igTableQueueSetColumnDisplayOrder(table, column_n, dst_order)
}
@[keep_args_alive]
-fn C.igAddDrawListToDrawDataEx(draw_data &ImDrawData, out_list &ImVector_ImDrawListPtr, draw_list &ImDrawList)
+fn C.igTableRemove(table &Table)
@[inline]
-pub fn add_draw_list_to_draw_data_ex(draw_data &ImDrawData, out_list &ImVector_ImDrawListPtr, draw_list &ImDrawList) {
- C.igAddDrawListToDrawDataEx(draw_data, out_list, draw_list)
+pub fn table_remove(table &Table) {
+ C.igTableRemove(table)
}
@[keep_args_alive]
-fn C.igInitialize()
+fn C.igTableGcCompactTransientBuffers_TablePtr(table &Table)
@[inline]
-pub fn initialize() {
- C.igInitialize()
+pub fn table_gc_compact_transient_buffers_table_ptr(table &Table) {
+ C.igTableGcCompactTransientBuffers_TablePtr(table)
}
@[keep_args_alive]
-fn C.igShutdown()
+fn C.igTableGcCompactTransientBuffers_TableTempDataPtr(table &TableTempData)
@[inline]
-pub fn shutdown() {
- C.igShutdown()
+pub fn table_gc_compact_transient_buffers_table_temp_data_ptr(table &TableTempData) {
+ C.igTableGcCompactTransientBuffers_TableTempDataPtr(table)
}
@[keep_args_alive]
-fn C.igSetContextName(ctx &Context, const_name &char)
+fn C.igTableGcCompactSettings()
@[inline]
-pub fn set_context_name(ctx &Context, const_name &char) {
- C.igSetContextName(ctx, const_name)
+pub fn table_gc_compact_settings() {
+ C.igTableGcCompactSettings()
}
@[keep_args_alive]
-fn C.igAddContextHook(ctx &Context, hook &ContextHook) ID
+fn C.igTableLoadSettings(table &Table)
@[inline]
-pub fn add_context_hook(ctx &Context, hook &ContextHook) ID {
- return C.igAddContextHook(ctx, hook)
+pub fn table_load_settings(table &Table) {
+ C.igTableLoadSettings(table)
}
@[keep_args_alive]
-fn C.igRemoveContextHook(ctx &Context, hook_to_remove ID)
+fn C.igTableLoadSettingsForColumns(table &Table)
@[inline]
-pub fn remove_context_hook(ctx &Context, hook_to_remove ID) {
- C.igRemoveContextHook(ctx, hook_to_remove)
+pub fn table_load_settings_for_columns(table &Table) {
+ C.igTableLoadSettingsForColumns(table)
}
@[keep_args_alive]
-fn C.igCallContextHooks(ctx &Context, type_ ContextHookType)
+fn C.igTableLoadSettingsForColumn(column &TableColumn, column_settings &TableColumnSettings, load_flags TableFlags)
@[inline]
-pub fn call_context_hooks(ctx &Context, type_ ContextHookType) {
- C.igCallContextHooks(ctx, type_)
+pub fn table_load_settings_for_column(column &TableColumn, column_settings &TableColumnSettings, load_flags TableFlags) {
+ C.igTableLoadSettingsForColumn(column, column_settings, load_flags)
}
@[keep_args_alive]
-fn C.igUpdateInputEvents(trickle_fast_inputs bool)
+fn C.igTableSaveSettings(table &Table)
@[inline]
-pub fn update_input_events(trickle_fast_inputs bool) {
- C.igUpdateInputEvents(trickle_fast_inputs)
+pub fn table_save_settings(table &Table) {
+ C.igTableSaveSettings(table)
}
@[keep_args_alive]
-fn C.igUpdateHoveredWindowAndCaptureFlags(mouse_pos ImVec2_c)
+fn C.igTableResetSettings(table &Table)
@[inline]
-pub fn update_hovered_window_and_capture_flags(mouse_pos ImVec2_c) {
- C.igUpdateHoveredWindowAndCaptureFlags(mouse_pos)
+pub fn table_reset_settings(table &Table) {
+ C.igTableResetSettings(table)
}
@[keep_args_alive]
-fn C.igFindHoveredWindowEx(pos ImVec2_c, find_first_and_in_any_viewport bool, out_hovered_window &&Window, out_hovered_window_under_moving_window &&Window)
+fn C.igTableGetBoundSettings(table &Table) &TableSettings
@[inline]
-pub fn find_hovered_window_ex(pos ImVec2_c, find_first_and_in_any_viewport bool, out_hovered_window &&Window, out_hovered_window_under_moving_window &&Window) {
- C.igFindHoveredWindowEx(pos, find_first_and_in_any_viewport, out_hovered_window,
- out_hovered_window_under_moving_window)
+pub fn table_get_bound_settings(table &Table) &TableSettings {
+ return C.igTableGetBoundSettings(table)
}
@[keep_args_alive]
-fn C.igStartMouseMovingWindow(window &Window)
+fn C.igTableSettingsAddSettingsHandler()
@[inline]
-pub fn start_mouse_moving_window(window &Window) {
- C.igStartMouseMovingWindow(window)
+pub fn table_settings_add_settings_handler() {
+ C.igTableSettingsAddSettingsHandler()
}
@[keep_args_alive]
-fn C.igStartMouseMovingWindowOrNode(window &Window, node &DockNode, undock bool)
+fn C.igTableSettingsCreate(id ID, columns_count i32) &TableSettings
@[inline]
-pub fn start_mouse_moving_window_or_node(window &Window, node &DockNode, undock bool) {
- C.igStartMouseMovingWindowOrNode(window, node, undock)
+pub fn table_settings_create(id ID, columns_count i32) &TableSettings {
+ return C.igTableSettingsCreate(id, columns_count)
}
@[keep_args_alive]
-fn C.igStopMouseMovingWindow()
+fn C.igTableSettingsFindByID(id ID) &TableSettings
@[inline]
-pub fn stop_mouse_moving_window() {
- C.igStopMouseMovingWindow()
+pub fn table_settings_find_by_id(id ID) &TableSettings {
+ return C.igTableSettingsFindByID(id)
}
@[keep_args_alive]
-fn C.igUpdateMouseMovingWindowNewFrame()
+fn C.igSetWindowClipRectBeforeSetChannel(window &Window, clip_rect ImRect_c)
@[inline]
-pub fn update_mouse_moving_window_new_frame() {
- C.igUpdateMouseMovingWindowNewFrame()
+pub fn set_window_clip_rect_before_set_channel(window &Window, clip_rect ImRect_c) {
+ C.igSetWindowClipRectBeforeSetChannel(window, clip_rect)
}
@[keep_args_alive]
-fn C.igUpdateMouseMovingWindowEndFrame()
+fn C.igBeginColumns(const_str_id &char, count i32, flags OldColumnFlags)
@[inline]
-pub fn update_mouse_moving_window_end_frame() {
- C.igUpdateMouseMovingWindowEndFrame()
+pub fn begin_columns(const_str_id &char, count i32, flags OldColumnFlags) {
+ C.igBeginColumns(const_str_id, count, flags)
}
@[keep_args_alive]
-fn C.igTranslateWindowsInViewport(viewport &ViewportP, old_pos ImVec2_c, new_pos ImVec2_c, old_size ImVec2_c, new_size ImVec2_c)
+fn C.igEndColumns()
@[inline]
-pub fn translate_windows_in_viewport(viewport &ViewportP, old_pos ImVec2_c, new_pos ImVec2_c, old_size ImVec2_c, new_size ImVec2_c) {
- C.igTranslateWindowsInViewport(viewport, old_pos, new_pos, old_size, new_size)
+pub fn end_columns() {
+ C.igEndColumns()
}
@[keep_args_alive]
-fn C.igScaleWindowsInViewport(viewport &ViewportP, scale f32)
+fn C.igPushColumnClipRect(column_index i32)
@[inline]
-pub fn scale_windows_in_viewport(viewport &ViewportP, scale f32) {
- C.igScaleWindowsInViewport(viewport, scale)
+pub fn push_column_clip_rect(column_index i32) {
+ C.igPushColumnClipRect(column_index)
}
@[keep_args_alive]
-fn C.igDestroyPlatformWindow(viewport &ViewportP)
+fn C.igPushColumnsBackground()
@[inline]
-pub fn destroy_platform_window(viewport &ViewportP) {
- C.igDestroyPlatformWindow(viewport)
+pub fn push_columns_background() {
+ C.igPushColumnsBackground()
}
@[keep_args_alive]
-fn C.igSetWindowViewport(window &Window, viewport &ViewportP)
+fn C.igPopColumnsBackground()
@[inline]
-pub fn set_window_viewport(window &Window, viewport &ViewportP) {
- C.igSetWindowViewport(window, viewport)
+pub fn pop_columns_background() {
+ C.igPopColumnsBackground()
}
@[keep_args_alive]
-fn C.igSetCurrentViewport(window &Window, viewport &ViewportP)
+fn C.igGetColumnsID(const_str_id &char, count i32) ID
@[inline]
-pub fn set_current_viewport(window &Window, viewport &ViewportP) {
- C.igSetCurrentViewport(window, viewport)
+pub fn get_columns_id(const_str_id &char, count i32) ID {
+ return C.igGetColumnsID(const_str_id, count)
}
@[keep_args_alive]
-fn C.igGetViewportPlatformMonitor(viewport &Viewport) &PlatformMonitor
+fn C.igFindOrCreateColumns(window &Window, id ID) &OldColumns
@[inline]
-pub fn get_viewport_platform_monitor(viewport &Viewport) &PlatformMonitor {
- return C.igGetViewportPlatformMonitor(viewport)
+pub fn find_or_create_columns(window &Window, id ID) &OldColumns {
+ return C.igFindOrCreateColumns(window, id)
}
@[keep_args_alive]
-fn C.igFindHoveredViewportFromPlatformWindowStack(mouse_platform_pos ImVec2_c) &ViewportP
+fn C.igGetColumnOffsetFromNorm(columns &OldColumns, offset_norm f32) f32
@[inline]
-pub fn find_hovered_viewport_from_platform_window_stack(mouse_platform_pos ImVec2_c) &ViewportP {
- return C.igFindHoveredViewportFromPlatformWindowStack(mouse_platform_pos)
+pub fn get_column_offset_from_norm(columns &OldColumns, offset_norm f32) f32 {
+ return C.igGetColumnOffsetFromNorm(columns, offset_norm)
}
@[keep_args_alive]
-fn C.igMarkIniSettingsDirty_Nil()
+fn C.igGetColumnNormFromOffset(columns &OldColumns, offset f32) f32
@[inline]
-pub fn mark_ini_settings_dirty_nil() {
- C.igMarkIniSettingsDirty_Nil()
+pub fn get_column_norm_from_offset(columns &OldColumns, offset f32) f32 {
+ return C.igGetColumnNormFromOffset(columns, offset)
}
@[keep_args_alive]
-fn C.igMarkIniSettingsDirty_WindowPtr(window &Window)
+fn C.igGetIO_ContextPtr(ctx &Context) &IO
@[inline]
-pub fn mark_ini_settings_dirty_window_ptr(window &Window) {
- C.igMarkIniSettingsDirty_WindowPtr(window)
+pub fn get_io_context_ptr(ctx &Context) &IO {
+ return C.igGetIO_ContextPtr(ctx)
}
@[keep_args_alive]
-fn C.igClearIniSettings()
+fn C.igGetPlatformIO_ContextPtr(ctx &Context) &PlatformIO
@[inline]
-pub fn clear_ini_settings() {
- C.igClearIniSettings()
+pub fn get_platform_io_context_ptr(ctx &Context) &PlatformIO {
+ return C.igGetPlatformIO_ContextPtr(ctx)
}
@[keep_args_alive]
-fn C.igAddSettingsHandler(handler &SettingsHandler)
+fn C.igGetScale() f32
@[inline]
-pub fn add_settings_handler(handler &SettingsHandler) {
- C.igAddSettingsHandler(handler)
+pub fn get_scale() f32 {
+ return C.igGetScale()
}
@[keep_args_alive]
-fn C.igRemoveSettingsHandler(type_name &char)
+fn C.igGetCurrentWindowRead() &Window
@[inline]
-pub fn remove_settings_handler(type_name &char) {
- C.igRemoveSettingsHandler(type_name)
+pub fn get_current_window_read() &Window {
+ return C.igGetCurrentWindowRead()
}
@[keep_args_alive]
-fn C.igFindSettingsHandler(type_name &char) &SettingsHandler
+fn C.igGetCurrentWindow() &Window
@[inline]
-pub fn find_settings_handler(type_name &char) &SettingsHandler {
- return C.igFindSettingsHandler(type_name)
+pub fn get_current_window() &Window {
+ return C.igGetCurrentWindow()
}
@[keep_args_alive]
-fn C.igCreateNewWindowSettings(const_name &char) &WindowSettings
+fn C.igFindWindowByID(id ID) &Window
@[inline]
-pub fn create_new_window_settings(const_name &char) &WindowSettings {
- return C.igCreateNewWindowSettings(const_name)
+pub fn find_window_by_id(id ID) &Window {
+ return C.igFindWindowByID(id)
}
@[keep_args_alive]
-fn C.igFindWindowSettingsByID(id ID) &WindowSettings
+fn C.igFindWindowByName(const_name &char) &Window
@[inline]
-pub fn find_window_settings_by_id(id ID) &WindowSettings {
- return C.igFindWindowSettingsByID(id)
+pub fn find_window_by_name(const_name &char) &Window {
+ return C.igFindWindowByName(const_name)
}
@[keep_args_alive]
-fn C.igFindWindowSettingsByWindow(window &Window) &WindowSettings
+fn C.igUpdateWindowParentAndRootLinks(window &Window, flags WindowFlags, parent_window &Window)
@[inline]
-pub fn find_window_settings_by_window(window &Window) &WindowSettings {
- return C.igFindWindowSettingsByWindow(window)
+pub fn update_window_parent_and_root_links(window &Window, flags WindowFlags, parent_window &Window) {
+ C.igUpdateWindowParentAndRootLinks(window, flags, parent_window)
}
@[keep_args_alive]
-fn C.igClearWindowSettings(const_name &char)
+fn C.igUpdateWindowSkipRefresh(window &Window)
@[inline]
-pub fn clear_window_settings(const_name &char) {
- C.igClearWindowSettings(const_name)
+pub fn update_window_skip_refresh(window &Window) {
+ C.igUpdateWindowSkipRefresh(window)
}
@[keep_args_alive]
-fn C.igLocalizeRegisterEntries(entries &LocEntry, count i32)
+fn C.igCalcWindowNextAutoFitSize(window &Window) ImVec2_c
@[inline]
-pub fn localize_register_entries(entries &LocEntry, count i32) {
- C.igLocalizeRegisterEntries(entries, count)
+pub fn calc_window_next_auto_fit_size(window &Window) ImVec2_c {
+ return C.igCalcWindowNextAutoFitSize(window)
}
@[keep_args_alive]
-fn C.igLocalizeGetMsg(key LocKey) &char
+fn C.igIsWindowChildOf(window &Window, potential_parent &Window, popup_hierarchy bool, dock_hierarchy bool) bool
@[inline]
-pub fn localize_get_msg(key LocKey) &char {
- return C.igLocalizeGetMsg(key)
+pub fn is_window_child_of(window &Window, potential_parent &Window, popup_hierarchy bool, dock_hierarchy bool) bool {
+ return C.igIsWindowChildOf(window, potential_parent, popup_hierarchy, dock_hierarchy)
}
@[keep_args_alive]
-fn C.igSetScrollX_WindowPtr(window &Window, scroll_x f32)
+fn C.igIsWindowInBeginStack(window &Window) bool
@[inline]
-pub fn set_scroll_x_window_ptr(window &Window, scroll_x f32) {
- C.igSetScrollX_WindowPtr(window, scroll_x)
+pub fn is_window_in_begin_stack(window &Window) bool {
+ return C.igIsWindowInBeginStack(window)
}
@[keep_args_alive]
-fn C.igSetScrollY_WindowPtr(window &Window, scroll_y f32)
+fn C.igIsWindowWithinBeginStackOf(window &Window, potential_parent &Window) bool
@[inline]
-pub fn set_scroll_y_window_ptr(window &Window, scroll_y f32) {
- C.igSetScrollY_WindowPtr(window, scroll_y)
+pub fn is_window_within_begin_stack_of(window &Window, potential_parent &Window) bool {
+ return C.igIsWindowWithinBeginStackOf(window, potential_parent)
}
@[keep_args_alive]
-fn C.igSetScrollFromPosX_WindowPtr(window &Window, local_x f32, center_x_ratio f32)
+fn C.igIsWindowAbove(potential_above &Window, potential_below &Window) bool
@[inline]
-pub fn set_scroll_from_pos_x_window_ptr(window &Window, local_x f32, center_x_ratio f32) {
- C.igSetScrollFromPosX_WindowPtr(window, local_x, center_x_ratio)
+pub fn is_window_above(potential_above &Window, potential_below &Window) bool {
+ return C.igIsWindowAbove(potential_above, potential_below)
}
@[keep_args_alive]
-fn C.igSetScrollFromPosY_WindowPtr(window &Window, local_y f32, center_y_ratio f32)
+fn C.igIsWindowNavFocusable(window &Window) bool
@[inline]
-pub fn set_scroll_from_pos_y_window_ptr(window &Window, local_y f32, center_y_ratio f32) {
- C.igSetScrollFromPosY_WindowPtr(window, local_y, center_y_ratio)
+pub fn is_window_nav_focusable(window &Window) bool {
+ return C.igIsWindowNavFocusable(window)
}
@[keep_args_alive]
-fn C.igScrollToItem(flags ScrollFlags)
+fn C.igSetWindowPos_WindowPtr(window &Window, pos ImVec2_c, cond Cond)
@[inline]
-pub fn scroll_to_item(flags ScrollFlags) {
- C.igScrollToItem(flags)
+pub fn set_window_pos_window_ptr(window &Window, pos ImVec2_c, cond Cond) {
+ C.igSetWindowPos_WindowPtr(window, pos, cond)
}
@[keep_args_alive]
-fn C.igScrollToRect(window &Window, rect ImRect_c, flags ScrollFlags)
+fn C.igSetWindowSize_WindowPtr(window &Window, size ImVec2_c, cond Cond)
@[inline]
-pub fn scroll_to_rect(window &Window, rect ImRect_c, flags ScrollFlags) {
- C.igScrollToRect(window, rect, flags)
+pub fn set_window_size_window_ptr(window &Window, size ImVec2_c, cond Cond) {
+ C.igSetWindowSize_WindowPtr(window, size, cond)
}
@[keep_args_alive]
-fn C.igScrollToRectEx(window &Window, rect ImRect_c, flags ScrollFlags) ImVec2_c
+fn C.igSetWindowCollapsed_WindowPtr(window &Window, collapsed bool, cond Cond)
@[inline]
-pub fn scroll_to_rect_ex(window &Window, rect ImRect_c, flags ScrollFlags) ImVec2_c {
- return C.igScrollToRectEx(window, rect, flags)
+pub fn set_window_collapsed_window_ptr(window &Window, collapsed bool, cond Cond) {
+ C.igSetWindowCollapsed_WindowPtr(window, collapsed, cond)
}
@[keep_args_alive]
-fn C.igScrollToBringRectIntoView(window &Window, rect ImRect_c)
+fn C.igSetWindowHitTestHole(window &Window, pos ImVec2_c, size ImVec2_c)
@[inline]
-pub fn scroll_to_bring_rect_into_view(window &Window, rect ImRect_c) {
- C.igScrollToBringRectIntoView(window, rect)
+pub fn set_window_hit_test_hole(window &Window, pos ImVec2_c, size ImVec2_c) {
+ C.igSetWindowHitTestHole(window, pos, size)
}
@[keep_args_alive]
-fn C.igGetItemStatusFlags() ItemStatusFlags
+fn C.igSetWindowHiddenAndSkipItemsForCurrentFrame(window &Window)
@[inline]
-pub fn get_item_status_flags() ItemStatusFlags {
- return C.igGetItemStatusFlags()
+pub fn set_window_hidden_and_skip_items_for_current_frame(window &Window) {
+ C.igSetWindowHiddenAndSkipItemsForCurrentFrame(window)
}
@[keep_args_alive]
-fn C.igGetActiveID() ID
+fn C.igSetWindowParentWindowForFocusRoute(window &Window, parent_window &Window)
@[inline]
-pub fn get_active_id() ID {
- return C.igGetActiveID()
+pub fn set_window_parent_window_for_focus_route(window &Window, parent_window &Window) {
+ C.igSetWindowParentWindowForFocusRoute(window, parent_window)
}
@[keep_args_alive]
-fn C.igGetFocusID() ID
+fn C.igWindowRectAbsToRel(window &Window, r ImRect_c) ImRect_c
@[inline]
-pub fn get_focus_id() ID {
- return C.igGetFocusID()
+pub fn window_rect_abs_to_rel(window &Window, r ImRect_c) ImRect_c {
+ return C.igWindowRectAbsToRel(window, r)
}
@[keep_args_alive]
-fn C.igSetActiveID(id ID, window &Window)
+fn C.igWindowRectRelToAbs(window &Window, r ImRect_c) ImRect_c
@[inline]
-pub fn set_active_id(id ID, window &Window) {
- C.igSetActiveID(id, window)
+pub fn window_rect_rel_to_abs(window &Window, r ImRect_c) ImRect_c {
+ return C.igWindowRectRelToAbs(window, r)
+}
+
+@[keep_args_alive]
+fn C.igWindowPosAbsToRel(window &Window, p ImVec2_c) ImVec2_c
+
+@[inline]
+pub fn window_pos_abs_to_rel(window &Window, p ImVec2_c) ImVec2_c {
+ return C.igWindowPosAbsToRel(window, p)
+}
+
+@[keep_args_alive]
+fn C.igWindowPosRelToAbs(window &Window, p ImVec2_c) ImVec2_c
+
+@[inline]
+pub fn window_pos_rel_to_abs(window &Window, p ImVec2_c) ImVec2_c {
+ return C.igWindowPosRelToAbs(window, p)
+}
+
+@[keep_args_alive]
+fn C.igFocusWindow(window &Window, flags FocusRequestFlags)
+
+@[inline]
+pub fn focus_window(window &Window, flags FocusRequestFlags) {
+ C.igFocusWindow(window, flags)
+}
+
+@[keep_args_alive]
+fn C.igFocusTopMostWindowUnderOne(under_this_window &Window, ignore_window &Window, filter_viewport &Viewport, flags FocusRequestFlags)
+
+@[inline]
+pub fn focus_top_most_window_under_one(under_this_window &Window, ignore_window &Window, filter_viewport &Viewport, flags FocusRequestFlags) {
+ C.igFocusTopMostWindowUnderOne(under_this_window, ignore_window, filter_viewport, flags)
+}
+
+@[keep_args_alive]
+fn C.igBringWindowToFocusFront(window &Window)
+
+@[inline]
+pub fn bring_window_to_focus_front(window &Window) {
+ C.igBringWindowToFocusFront(window)
+}
+
+@[keep_args_alive]
+fn C.igBringWindowToDisplayFront(window &Window)
+
+@[inline]
+pub fn bring_window_to_display_front(window &Window) {
+ C.igBringWindowToDisplayFront(window)
+}
+
+@[keep_args_alive]
+fn C.igBringWindowToDisplayBack(window &Window)
+
+@[inline]
+pub fn bring_window_to_display_back(window &Window) {
+ C.igBringWindowToDisplayBack(window)
+}
+
+@[keep_args_alive]
+fn C.igBringWindowToDisplayBehind(window &Window, above_window &Window)
+
+@[inline]
+pub fn bring_window_to_display_behind(window &Window, above_window &Window) {
+ C.igBringWindowToDisplayBehind(window, above_window)
}
@[keep_args_alive]
-fn C.igSetFocusID(id ID, window &Window)
+fn C.igFindWindowDisplayIndex(window &Window) i32
@[inline]
-pub fn set_focus_id(id ID, window &Window) {
- C.igSetFocusID(id, window)
+pub fn find_window_display_index(window &Window) i32 {
+ return C.igFindWindowDisplayIndex(window)
}
@[keep_args_alive]
-fn C.igClearActiveID()
+fn C.igFindBottomMostVisibleWindowWithinBeginStack(window &Window) &Window
@[inline]
-pub fn clear_active_id() {
- C.igClearActiveID()
+pub fn find_bottom_most_visible_window_within_begin_stack(window &Window) &Window {
+ return C.igFindBottomMostVisibleWindowWithinBeginStack(window)
}
@[keep_args_alive]
-fn C.igGetHoveredID() ID
+fn C.igSetNextWindowRefreshPolicy(flags WindowRefreshFlags)
@[inline]
-pub fn get_hovered_id() ID {
- return C.igGetHoveredID()
+pub fn set_next_window_refresh_policy(flags WindowRefreshFlags) {
+ C.igSetNextWindowRefreshPolicy(flags)
}
@[keep_args_alive]
-fn C.igSetHoveredID(id ID)
+fn C.igRegisterUserTexture(tex &ImTextureData)
@[inline]
-pub fn set_hovered_id(id ID) {
- C.igSetHoveredID(id)
+pub fn register_user_texture(tex &ImTextureData) {
+ C.igRegisterUserTexture(tex)
}
@[keep_args_alive]
-fn C.igKeepAliveID(id ID)
+fn C.igUnregisterUserTexture(tex &ImTextureData)
@[inline]
-pub fn keep_alive_id(id ID) {
- C.igKeepAliveID(id)
+pub fn unregister_user_texture(tex &ImTextureData) {
+ C.igUnregisterUserTexture(tex)
}
@[keep_args_alive]
-fn C.igMarkItemEdited(id ID)
+fn C.igRegisterFontAtlas(atlas &ImFontAtlas)
@[inline]
-pub fn mark_item_edited(id ID) {
- C.igMarkItemEdited(id)
+pub fn register_font_atlas(atlas &ImFontAtlas) {
+ C.igRegisterFontAtlas(atlas)
}
@[keep_args_alive]
-fn C.igPushOverrideID(id ID)
+fn C.igUnregisterFontAtlas(atlas &ImFontAtlas)
@[inline]
-pub fn push_override_id(id ID) {
- C.igPushOverrideID(id)
+pub fn unregister_font_atlas(atlas &ImFontAtlas) {
+ C.igUnregisterFontAtlas(atlas)
}
@[keep_args_alive]
-fn C.igGetIDWithSeed_Str(str_id_begin &char, str_id_end &char, seed ID) ID
+fn C.igSetCurrentFont(font &ImFont, font_size_before_scaling f32, font_size_after_scaling f32)
@[inline]
-pub fn get_idw_ith_seed_str(str_id_begin &char, str_id_end &char, seed ID) ID {
- return C.igGetIDWithSeed_Str(str_id_begin, str_id_end, seed)
+pub fn set_current_font(font &ImFont, font_size_before_scaling f32, font_size_after_scaling f32) {
+ C.igSetCurrentFont(font, font_size_before_scaling, font_size_after_scaling)
}
@[keep_args_alive]
-fn C.igGetIDWithSeed_Int(n i32, seed ID) ID
+fn C.igUpdateCurrentFontSize(restore_font_size_after_scaling f32)
@[inline]
-pub fn get_idw_ith_seed_int(n i32, seed ID) ID {
- return C.igGetIDWithSeed_Int(n, seed)
+pub fn update_current_font_size(restore_font_size_after_scaling f32) {
+ C.igUpdateCurrentFontSize(restore_font_size_after_scaling)
}
@[keep_args_alive]
-fn C.igItemSize_Vec2(size ImVec2_c, text_baseline_y f32)
+fn C.igSetFontRasterizerDensity(rasterizer_density f32)
@[inline]
-pub fn item_size_vec2(size ImVec2_c, text_baseline_y f32) {
- C.igItemSize_Vec2(size, text_baseline_y)
+pub fn set_font_rasterizer_density(rasterizer_density f32) {
+ C.igSetFontRasterizerDensity(rasterizer_density)
}
@[keep_args_alive]
-fn C.igItemSize_Rect(bb ImRect_c, text_baseline_y f32)
+fn C.igGetFontRasterizerDensity() f32
@[inline]
-pub fn item_size_rect(bb ImRect_c, text_baseline_y f32) {
- C.igItemSize_Rect(bb, text_baseline_y)
+pub fn get_font_rasterizer_density() f32 {
+ return C.igGetFontRasterizerDensity()
}
@[keep_args_alive]
-fn C.igItemAdd(bb ImRect_c, id ID, nav_bb &ImRect, extra_flags ItemFlags) bool
+fn C.igGetRoundedFontSize(size f32) f32
@[inline]
-pub fn item_add(bb ImRect_c, id ID, nav_bb &ImRect, extra_flags ItemFlags) bool {
- return C.igItemAdd(bb, id, nav_bb, extra_flags)
+pub fn get_rounded_font_size(size f32) f32 {
+ return C.igGetRoundedFontSize(size)
}
@[keep_args_alive]
-fn C.igItemHoverable(bb ImRect_c, id ID, item_flags ItemFlags) bool
+fn C.igGetDefaultFont() &ImFont
@[inline]
-pub fn item_hoverable(bb ImRect_c, id ID, item_flags ItemFlags) bool {
- return C.igItemHoverable(bb, id, item_flags)
+pub fn get_default_font() &ImFont {
+ return C.igGetDefaultFont()
}
@[keep_args_alive]
-fn C.igIsWindowContentHoverable(window &Window, flags HoveredFlags) bool
+fn C.igPushPasswordFont()
@[inline]
-pub fn is_window_content_hoverable(window &Window, flags HoveredFlags) bool {
- return C.igIsWindowContentHoverable(window, flags)
+pub fn push_password_font() {
+ C.igPushPasswordFont()
}
@[keep_args_alive]
-fn C.igIsClippedEx(bb ImRect_c, id ID) bool
+fn C.igPopPasswordFont()
@[inline]
-pub fn is_clipped_ex(bb ImRect_c, id ID) bool {
- return C.igIsClippedEx(bb, id)
+pub fn pop_password_font() {
+ C.igPopPasswordFont()
}
@[keep_args_alive]
-fn C.igSetLastItemData(item_id ID, item_flags ItemFlags, status_flags ItemStatusFlags, item_rect ImRect_c)
+fn C.igGetForegroundDrawList_WindowPtr(window &Window) &ImDrawList
@[inline]
-pub fn set_last_item_data(item_id ID, item_flags ItemFlags, status_flags ItemStatusFlags, item_rect ImRect_c) {
- C.igSetLastItemData(item_id, item_flags, status_flags, item_rect)
+pub fn get_foreground_draw_list_window_ptr(window &Window) &ImDrawList {
+ return C.igGetForegroundDrawList_WindowPtr(window)
}
@[keep_args_alive]
-fn C.igCalcItemSize(size ImVec2_c, default_w f32, default_h f32) ImVec2_c
+fn C.igAddDrawListToDrawDataEx(draw_data &ImDrawData, out_list &ImVector_ImDrawListPtr, draw_list &ImDrawList)
@[inline]
-pub fn calc_item_size(size ImVec2_c, default_w f32, default_h f32) ImVec2_c {
- return C.igCalcItemSize(size, default_w, default_h)
+pub fn add_draw_list_to_draw_data_ex(draw_data &ImDrawData, out_list &ImVector_ImDrawListPtr, draw_list &ImDrawList) {
+ C.igAddDrawListToDrawDataEx(draw_data, out_list, draw_list)
}
@[keep_args_alive]
-fn C.igCalcWrapWidthForPos(pos ImVec2_c, wrap_pos_x f32) f32
+fn C.igInitialize()
@[inline]
-pub fn calc_wrap_width_for_pos(pos ImVec2_c, wrap_pos_x f32) f32 {
- return C.igCalcWrapWidthForPos(pos, wrap_pos_x)
+pub fn initialize() {
+ C.igInitialize()
}
@[keep_args_alive]
-fn C.igPushMultiItemsWidths(components i32, width_full f32)
+fn C.igShutdown()
@[inline]
-pub fn push_multi_items_widths(components i32, width_full f32) {
- C.igPushMultiItemsWidths(components, width_full)
+pub fn shutdown() {
+ C.igShutdown()
}
@[keep_args_alive]
-fn C.igShrinkWidths(items &ShrinkWidthItem, count i32, width_excess f32, width_min f32)
+fn C.igSetContextName(ctx &Context, const_name &char)
@[inline]
-pub fn shrink_widths(items &ShrinkWidthItem, count i32, width_excess f32, width_min f32) {
- C.igShrinkWidths(items, count, width_excess, width_min)
+pub fn set_context_name(ctx &Context, const_name &char) {
+ C.igSetContextName(ctx, const_name)
}
@[keep_args_alive]
-fn C.igCalcClipRectVisibleItemsY(clip_rect ImRect_c, pos ImVec2_c, items_height f32, out_visible_start &i32, out_visible_end &i32)
+fn C.igAddContextHook(ctx &Context, hook &ContextHook) ID
@[inline]
-pub fn calc_clip_rect_visible_items_y(clip_rect ImRect_c, pos ImVec2_c, items_height f32, out_visible_start &i32, out_visible_end &i32) {
- C.igCalcClipRectVisibleItemsY(clip_rect, pos, items_height, out_visible_start, out_visible_end)
+pub fn add_context_hook(ctx &Context, hook &ContextHook) ID {
+ return C.igAddContextHook(ctx, hook)
}
@[keep_args_alive]
-fn C.igGetStyleVarInfo(idx StyleVar) &StyleVarInfo
+fn C.igRemoveContextHook(ctx &Context, hook_to_remove ID)
@[inline]
-pub fn get_style_var_info(idx StyleVar) &StyleVarInfo {
- return C.igGetStyleVarInfo(idx)
+pub fn remove_context_hook(ctx &Context, hook_to_remove ID) {
+ C.igRemoveContextHook(ctx, hook_to_remove)
}
@[keep_args_alive]
-fn C.igBeginDisabledOverrideReenable()
+fn C.igCallContextHooks(ctx &Context, type_ i32)
@[inline]
-pub fn begin_disabled_override_reenable() {
- C.igBeginDisabledOverrideReenable()
+pub fn call_context_hooks(ctx &Context, type_ i32) {
+ C.igCallContextHooks(ctx, type_)
}
@[keep_args_alive]
-fn C.igEndDisabledOverrideReenable()
+fn C.igUpdateInputEvents(trickle_fast_inputs bool)
@[inline]
-pub fn end_disabled_override_reenable() {
- C.igEndDisabledOverrideReenable()
+pub fn update_input_events(trickle_fast_inputs bool) {
+ C.igUpdateInputEvents(trickle_fast_inputs)
}
@[keep_args_alive]
-fn C.igLogBegin(flags LogFlags, auto_open_depth i32)
+fn C.igUpdateHoveredWindowAndCaptureFlags(mouse_pos ImVec2_c)
@[inline]
-pub fn log_begin(flags LogFlags, auto_open_depth i32) {
- C.igLogBegin(flags, auto_open_depth)
+pub fn update_hovered_window_and_capture_flags(mouse_pos ImVec2_c) {
+ C.igUpdateHoveredWindowAndCaptureFlags(mouse_pos)
}
@[keep_args_alive]
-fn C.igLogToBuffer(auto_open_depth i32)
+fn C.igFindHoveredWindowEx(pos ImVec2_c, find_first_and_in_any_viewport bool, out_hovered_window &&Window, out_hovered_window_under_moving_window &&Window)
@[inline]
-pub fn log_to_buffer(auto_open_depth i32) {
- C.igLogToBuffer(auto_open_depth)
+pub fn find_hovered_window_ex(pos ImVec2_c, find_first_and_in_any_viewport bool, out_hovered_window &&Window, out_hovered_window_under_moving_window &&Window) {
+ C.igFindHoveredWindowEx(pos, find_first_and_in_any_viewport, out_hovered_window, out_hovered_window_under_moving_window)
}
@[keep_args_alive]
-fn C.igLogRenderedText(ref_pos &ImVec2_c, const_text &char, const_text_end &char)
+fn C.igStartMouseMovingWindow(window &Window)
@[inline]
-pub fn log_rendered_text(ref_pos &ImVec2_c, const_text &char, const_text_end &char) {
- C.igLogRenderedText(ref_pos, const_text, const_text_end)
+pub fn start_mouse_moving_window(window &Window) {
+ C.igStartMouseMovingWindow(window)
}
@[keep_args_alive]
-fn C.igLogSetNextTextDecoration(prefix &char, suffix &char)
+fn C.igStartMouseMovingWindowOrNode(window &Window, node &DockNode, undock bool)
@[inline]
-pub fn log_set_next_text_decoration(prefix &char, suffix &char) {
- C.igLogSetNextTextDecoration(prefix, suffix)
+pub fn start_mouse_moving_window_or_node(window &Window, node &DockNode, undock bool) {
+ C.igStartMouseMovingWindowOrNode(window, node, undock)
}
@[keep_args_alive]
-fn C.igBeginChildEx(const_name &char, id ID, size_arg ImVec2_c, child_flags ChildFlags, window_flags WindowFlags) bool
+fn C.igStopMouseMovingWindow()
@[inline]
-pub fn begin_child_ex(const_name &char, id ID, size_arg ImVec2_c, child_flags ChildFlags, window_flags WindowFlags) bool {
- return C.igBeginChildEx(const_name, id, size_arg, child_flags, window_flags)
+pub fn stop_mouse_moving_window() {
+ C.igStopMouseMovingWindow()
}
@[keep_args_alive]
-fn C.igBeginPopupEx(id ID, extra_window_flags WindowFlags) bool
+fn C.igUpdateMouseMovingWindowNewFrame()
@[inline]
-pub fn begin_popup_ex(id ID, extra_window_flags WindowFlags) bool {
- return C.igBeginPopupEx(id, extra_window_flags)
+pub fn update_mouse_moving_window_new_frame() {
+ C.igUpdateMouseMovingWindowNewFrame()
}
@[keep_args_alive]
-fn C.igBeginPopupMenuEx(id ID, const_label &char, extra_window_flags WindowFlags) bool
+fn C.igUpdateMouseMovingWindowEndFrame()
@[inline]
-pub fn begin_popup_menu_ex(id ID, const_label &char, extra_window_flags WindowFlags) bool {
- return C.igBeginPopupMenuEx(id, const_label, extra_window_flags)
+pub fn update_mouse_moving_window_end_frame() {
+ C.igUpdateMouseMovingWindowEndFrame()
}
@[keep_args_alive]
-fn C.igOpenPopupEx(id ID, popup_flags PopupFlags)
+fn C.igTranslateWindowsInViewport(viewport &ViewportP, old_pos ImVec2_c, new_pos ImVec2_c, old_size ImVec2_c, new_size ImVec2_c)
@[inline]
-pub fn open_popup_ex(id ID, popup_flags PopupFlags) {
- C.igOpenPopupEx(id, popup_flags)
+pub fn translate_windows_in_viewport(viewport &ViewportP, old_pos ImVec2_c, new_pos ImVec2_c, old_size ImVec2_c, new_size ImVec2_c) {
+ C.igTranslateWindowsInViewport(viewport, old_pos, new_pos, old_size, new_size)
}
@[keep_args_alive]
-fn C.igClosePopupToLevel(remaining i32, restore_focus_to_window_under_popup bool)
+fn C.igScaleWindowsInViewport(viewport &ViewportP, scale f32)
@[inline]
-pub fn close_popup_to_level(remaining i32, restore_focus_to_window_under_popup bool) {
- C.igClosePopupToLevel(remaining, restore_focus_to_window_under_popup)
+pub fn scale_windows_in_viewport(viewport &ViewportP, scale f32) {
+ C.igScaleWindowsInViewport(viewport, scale)
}
@[keep_args_alive]
-fn C.igClosePopupsOverWindow(ref_window &Window, restore_focus_to_window_under_popup bool)
+fn C.igDestroyPlatformWindow(viewport &ViewportP)
@[inline]
-pub fn close_popups_over_window(ref_window &Window, restore_focus_to_window_under_popup bool) {
- C.igClosePopupsOverWindow(ref_window, restore_focus_to_window_under_popup)
+pub fn destroy_platform_window(viewport &ViewportP) {
+ C.igDestroyPlatformWindow(viewport)
}
@[keep_args_alive]
-fn C.igClosePopupsExceptModals()
+fn C.igSetWindowViewport(window &Window, viewport &ViewportP)
@[inline]
-pub fn close_popups_except_modals() {
- C.igClosePopupsExceptModals()
+pub fn set_window_viewport(window &Window, viewport &ViewportP) {
+ C.igSetWindowViewport(window, viewport)
}
@[keep_args_alive]
-fn C.igIsPopupOpen_ID(id ID, popup_flags PopupFlags) bool
+fn C.igSetCurrentViewport(window &Window, viewport &ViewportP)
@[inline]
-pub fn is_popup_open_id(id ID, popup_flags PopupFlags) bool {
- return C.igIsPopupOpen_ID(id, popup_flags)
+pub fn set_current_viewport(window &Window, viewport &ViewportP) {
+ C.igSetCurrentViewport(window, viewport)
}
@[keep_args_alive]
-fn C.igGetPopupAllowedExtentRect(window &Window) ImRect_c
+fn C.igGetViewportPlatformMonitor(viewport &Viewport) &PlatformMonitor
@[inline]
-pub fn get_popup_allowed_extent_rect(window &Window) ImRect_c {
- return C.igGetPopupAllowedExtentRect(window)
+pub fn get_viewport_platform_monitor(viewport &Viewport) &PlatformMonitor {
+ return C.igGetViewportPlatformMonitor(viewport)
}
@[keep_args_alive]
-fn C.igGetTopMostPopupModal() &Window
+fn C.igFindHoveredViewportFromPlatformWindowStack(mouse_platform_pos ImVec2_c) &ViewportP
@[inline]
-pub fn get_top_most_popup_modal() &Window {
- return C.igGetTopMostPopupModal()
+pub fn find_hovered_viewport_from_platform_window_stack(mouse_platform_pos ImVec2_c) &ViewportP {
+ return C.igFindHoveredViewportFromPlatformWindowStack(mouse_platform_pos)
}
@[keep_args_alive]
-fn C.igGetTopMostAndVisiblePopupModal() &Window
+fn C.igMarkIniSettingsDirty_Nil()
@[inline]
-pub fn get_top_most_and_visible_popup_modal() &Window {
- return C.igGetTopMostAndVisiblePopupModal()
+pub fn mark_ini_settings_dirty_nil() {
+ C.igMarkIniSettingsDirty_Nil()
}
@[keep_args_alive]
-fn C.igFindBlockingModal(window &Window) &Window
+fn C.igMarkIniSettingsDirty_WindowPtr(window &Window)
@[inline]
-pub fn find_blocking_modal(window &Window) &Window {
- return C.igFindBlockingModal(window)
+pub fn mark_ini_settings_dirty_window_ptr(window &Window) {
+ C.igMarkIniSettingsDirty_WindowPtr(window)
}
@[keep_args_alive]
-fn C.igFindBestWindowPosForPopup(window &Window) ImVec2_c
+fn C.igClearIniSettings()
@[inline]
-pub fn find_best_window_pos_for_popup(window &Window) ImVec2_c {
- return C.igFindBestWindowPosForPopup(window)
+pub fn clear_ini_settings() {
+ C.igClearIniSettings()
}
@[keep_args_alive]
-fn C.igFindBestWindowPosForPopupEx(ref_pos ImVec2_c, size ImVec2_c, last_dir &Dir, r_outer ImRect_c, r_avoid ImRect_c, policy PopupPositionPolicy) ImVec2_c
+fn C.igCleanupIniSettings(args &SettingsCleanupArgs)
@[inline]
-pub fn find_best_window_pos_for_popup_ex(ref_pos ImVec2_c, size ImVec2_c, last_dir &Dir, r_outer ImRect_c, r_avoid ImRect_c, policy PopupPositionPolicy) ImVec2_c {
- return C.igFindBestWindowPosForPopupEx(ref_pos, size, last_dir, r_outer, r_avoid, policy)
+pub fn cleanup_ini_settings(args &SettingsCleanupArgs) {
+ C.igCleanupIniSettings(args)
}
@[keep_args_alive]
-fn C.igGetMouseButtonFromPopupFlags(flags PopupFlags) MouseButton
+fn C.igAddSettingsHandler(handler &SettingsHandler)
@[inline]
-pub fn get_mouse_button_from_popup_flags(flags PopupFlags) MouseButton {
- return C.igGetMouseButtonFromPopupFlags(flags)
+pub fn add_settings_handler(handler &SettingsHandler) {
+ C.igAddSettingsHandler(handler)
}
@[keep_args_alive]
-fn C.igIsPopupOpenRequestForItem(flags PopupFlags, id ID) bool
+fn C.igRemoveSettingsHandler(type_name &char)
@[inline]
-pub fn is_popup_open_request_for_item(flags PopupFlags, id ID) bool {
- return C.igIsPopupOpenRequestForItem(flags, id)
+pub fn remove_settings_handler(type_name &char) {
+ C.igRemoveSettingsHandler(type_name)
}
@[keep_args_alive]
-fn C.igIsPopupOpenRequestForWindow(flags PopupFlags) bool
+fn C.igFindSettingsHandler(type_name &char) &SettingsHandler
@[inline]
-pub fn is_popup_open_request_for_window(flags PopupFlags) bool {
- return C.igIsPopupOpenRequestForWindow(flags)
+pub fn find_settings_handler(type_name &char) &SettingsHandler {
+ return C.igFindSettingsHandler(type_name)
}
@[keep_args_alive]
-fn C.igBeginTooltipEx(tooltip_flags TooltipFlags, extra_window_flags WindowFlags) bool
+fn C.igCreateNewWindowSettings(const_name &char) &WindowSettings
@[inline]
-pub fn begin_tooltip_ex(tooltip_flags TooltipFlags, extra_window_flags WindowFlags) bool {
- return C.igBeginTooltipEx(tooltip_flags, extra_window_flags)
+pub fn create_new_window_settings(const_name &char) &WindowSettings {
+ return C.igCreateNewWindowSettings(const_name)
}
@[keep_args_alive]
-fn C.igBeginTooltipHidden() bool
+fn C.igFindWindowSettingsByID(id ID) &WindowSettings
@[inline]
-pub fn begin_tooltip_hidden() bool {
- return C.igBeginTooltipHidden()
+pub fn find_window_settings_by_id(id ID) &WindowSettings {
+ return C.igFindWindowSettingsByID(id)
}
@[keep_args_alive]
-fn C.igBeginViewportSideBar(const_name &char, viewport &Viewport, dir Dir, size f32, window_flags WindowFlags) bool
+fn C.igFindWindowSettingsByWindow(window &Window) &WindowSettings
@[inline]
-pub fn begin_viewport_side_bar(const_name &char, viewport &Viewport, dir Dir, size f32, window_flags WindowFlags) bool {
- return C.igBeginViewportSideBar(const_name, viewport, dir, size, window_flags)
+pub fn find_window_settings_by_window(window &Window) &WindowSettings {
+ return C.igFindWindowSettingsByWindow(window)
}
@[keep_args_alive]
-fn C.igBeginMenuEx(const_label &char, icon &char, enabled bool) bool
+fn C.igClearWindowSettings(const_name &char)
@[inline]
-pub fn begin_menu_ex(const_label &char, icon &char, enabled bool) bool {
- return C.igBeginMenuEx(const_label, icon, enabled)
+pub fn clear_window_settings(const_name &char) {
+ C.igClearWindowSettings(const_name)
}
@[keep_args_alive]
-fn C.igMenuItemEx(const_label &char, icon &char, const_shortcut &char, selected bool, enabled bool) bool
+fn C.igLocalizeRegisterEntries(entries &LocEntry, count i32)
@[inline]
-pub fn menu_item_ex(const_label &char, icon &char, const_shortcut &char, selected bool, enabled bool) bool {
- return C.igMenuItemEx(const_label, icon, const_shortcut, selected, enabled)
+pub fn localize_register_entries(entries &LocEntry, count i32) {
+ C.igLocalizeRegisterEntries(entries, count)
}
@[keep_args_alive]
-fn C.igBeginComboPopup(popup_id ID, bb ImRect_c, flags ComboFlags) bool
+fn C.igLocalizeGetMsg(key i32) &char
@[inline]
-pub fn begin_combo_popup(popup_id ID, bb ImRect_c, flags ComboFlags) bool {
- return C.igBeginComboPopup(popup_id, bb, flags)
+pub fn localize_get_msg(key i32) &char {
+ return C.igLocalizeGetMsg(key)
}
@[keep_args_alive]
-fn C.igBeginComboPreview() bool
+fn C.igSetScrollX_WindowPtr(window &Window, scroll_x f32)
@[inline]
-pub fn begin_combo_preview() bool {
- return C.igBeginComboPreview()
+pub fn set_scroll_x_window_ptr(window &Window, scroll_x f32) {
+ C.igSetScrollX_WindowPtr(window, scroll_x)
}
@[keep_args_alive]
-fn C.igEndComboPreview()
+fn C.igSetScrollY_WindowPtr(window &Window, scroll_y f32)
@[inline]
-pub fn end_combo_preview() {
- C.igEndComboPreview()
+pub fn set_scroll_y_window_ptr(window &Window, scroll_y f32) {
+ C.igSetScrollY_WindowPtr(window, scroll_y)
}
@[keep_args_alive]
-fn C.igNavInitWindow(window &Window, force_reinit bool)
+fn C.igSetScrollFromPosX_WindowPtr(window &Window, local_x f32, center_x_ratio f32)
@[inline]
-pub fn nav_init_window(window &Window, force_reinit bool) {
- C.igNavInitWindow(window, force_reinit)
+pub fn set_scroll_from_pos_x_window_ptr(window &Window, local_x f32, center_x_ratio f32) {
+ C.igSetScrollFromPosX_WindowPtr(window, local_x, center_x_ratio)
}
@[keep_args_alive]
-fn C.igNavInitRequestApplyResult()
+fn C.igSetScrollFromPosY_WindowPtr(window &Window, local_y f32, center_y_ratio f32)
@[inline]
-pub fn nav_init_request_apply_result() {
- C.igNavInitRequestApplyResult()
+pub fn set_scroll_from_pos_y_window_ptr(window &Window, local_y f32, center_y_ratio f32) {
+ C.igSetScrollFromPosY_WindowPtr(window, local_y, center_y_ratio)
}
@[keep_args_alive]
-fn C.igNavMoveRequestButNoResultYet() bool
+fn C.igScrollToItem(flags ScrollFlags)
@[inline]
-pub fn nav_move_request_but_no_result_yet() bool {
- return C.igNavMoveRequestButNoResultYet()
+pub fn scroll_to_item(flags ScrollFlags) {
+ C.igScrollToItem(flags)
}
@[keep_args_alive]
-fn C.igNavMoveRequestSubmit(move_dir Dir, clip_dir Dir, move_flags NavMoveFlags, scroll_flags ScrollFlags)
+fn C.igScrollToRect(window &Window, rect ImRect_c, flags ScrollFlags)
@[inline]
-pub fn nav_move_request_submit(move_dir Dir, clip_dir Dir, move_flags NavMoveFlags, scroll_flags ScrollFlags) {
- C.igNavMoveRequestSubmit(move_dir, clip_dir, move_flags, scroll_flags)
+pub fn scroll_to_rect(window &Window, rect ImRect_c, flags ScrollFlags) {
+ C.igScrollToRect(window, rect, flags)
}
@[keep_args_alive]
-fn C.igNavMoveRequestForward(move_dir Dir, clip_dir Dir, move_flags NavMoveFlags, scroll_flags ScrollFlags)
+fn C.igScrollToRectEx(window &Window, rect ImRect_c, flags ScrollFlags) ImVec2_c
@[inline]
-pub fn nav_move_request_forward(move_dir Dir, clip_dir Dir, move_flags NavMoveFlags, scroll_flags ScrollFlags) {
- C.igNavMoveRequestForward(move_dir, clip_dir, move_flags, scroll_flags)
+pub fn scroll_to_rect_ex(window &Window, rect ImRect_c, flags ScrollFlags) ImVec2_c {
+ return C.igScrollToRectEx(window, rect, flags)
}
@[keep_args_alive]
-fn C.igNavMoveRequestResolveWithLastItem(result &NavItemData)
+fn C.igScrollToBringRectIntoView(window &Window, rect ImRect_c)
@[inline]
-pub fn nav_move_request_resolve_with_last_item(result &NavItemData) {
- C.igNavMoveRequestResolveWithLastItem(result)
+pub fn scroll_to_bring_rect_into_view(window &Window, rect ImRect_c) {
+ C.igScrollToBringRectIntoView(window, rect)
}
@[keep_args_alive]
-fn C.igNavMoveRequestResolveWithPastTreeNode(result &NavItemData, tree_node_data &TreeNodeStackData)
+fn C.igGetItemStatusFlags() ItemStatusFlags
@[inline]
-pub fn nav_move_request_resolve_with_past_tree_node(result &NavItemData, tree_node_data &TreeNodeStackData) {
- C.igNavMoveRequestResolveWithPastTreeNode(result, tree_node_data)
+pub fn get_item_status_flags() ItemStatusFlags {
+ return C.igGetItemStatusFlags()
}
@[keep_args_alive]
-fn C.igNavMoveRequestCancel()
+fn C.igGetActiveID() ID
@[inline]
-pub fn nav_move_request_cancel() {
- C.igNavMoveRequestCancel()
+pub fn get_active_id() ID {
+ return C.igGetActiveID()
}
@[keep_args_alive]
-fn C.igNavMoveRequestApplyResult()
+fn C.igGetFocusID() ID
@[inline]
-pub fn nav_move_request_apply_result() {
- C.igNavMoveRequestApplyResult()
+pub fn get_focus_id() ID {
+ return C.igGetFocusID()
}
@[keep_args_alive]
-fn C.igNavMoveRequestTryWrapping(window &Window, move_flags NavMoveFlags)
+fn C.igSetActiveID(id ID, window &Window)
@[inline]
-pub fn nav_move_request_try_wrapping(window &Window, move_flags NavMoveFlags) {
- C.igNavMoveRequestTryWrapping(window, move_flags)
+pub fn set_active_id(id ID, window &Window) {
+ C.igSetActiveID(id, window)
}
@[keep_args_alive]
-fn C.igNavHighlightActivated(id ID)
+fn C.igSetFocusID(id ID, window &Window)
@[inline]
-pub fn nav_highlight_activated(id ID) {
- C.igNavHighlightActivated(id)
+pub fn set_focus_id(id ID, window &Window) {
+ C.igSetFocusID(id, window)
}
@[keep_args_alive]
-fn C.igNavClearPreferredPosForAxis(axis Axis)
+fn C.igClearActiveID()
@[inline]
-pub fn nav_clear_preferred_pos_for_axis(axis Axis) {
- C.igNavClearPreferredPosForAxis(axis)
+pub fn clear_active_id() {
+ C.igClearActiveID()
}
@[keep_args_alive]
-fn C.igSetNavCursorVisibleAfterMove()
+fn C.igGetHoveredID() ID
@[inline]
-pub fn set_nav_cursor_visible_after_move() {
- C.igSetNavCursorVisibleAfterMove()
+pub fn get_hovered_id() ID {
+ return C.igGetHoveredID()
}
@[keep_args_alive]
-fn C.igNavUpdateCurrentWindowIsScrollPushableX()
+fn C.igSetHoveredID(id ID)
@[inline]
-pub fn nav_update_current_window_is_scroll_pushable_x() {
- C.igNavUpdateCurrentWindowIsScrollPushableX()
+pub fn set_hovered_id(id ID) {
+ C.igSetHoveredID(id)
}
@[keep_args_alive]
-fn C.igSetNavWindow(window &Window)
+fn C.igKeepAliveID(id ID)
@[inline]
-pub fn set_nav_window(window &Window) {
- C.igSetNavWindow(window)
+pub fn keep_alive_id(id ID) {
+ C.igKeepAliveID(id)
}
@[keep_args_alive]
-fn C.igSetNavID(id ID, nav_layer NavLayer, focus_scope_id ID, rect_rel ImRect_c)
+fn C.igMarkItemEdited(id ID)
@[inline]
-pub fn set_nav_id(id ID, nav_layer NavLayer, focus_scope_id ID, rect_rel ImRect_c) {
- C.igSetNavID(id, nav_layer, focus_scope_id, rect_rel)
+pub fn mark_item_edited(id ID) {
+ C.igMarkItemEdited(id)
}
@[keep_args_alive]
-fn C.igSetNavFocusScope(focus_scope_id ID)
+fn C.igPushOverrideID(id ID)
@[inline]
-pub fn set_nav_focus_scope(focus_scope_id ID) {
- C.igSetNavFocusScope(focus_scope_id)
+pub fn push_override_id(id ID) {
+ C.igPushOverrideID(id)
}
@[keep_args_alive]
-fn C.igFocusItem()
+fn C.igGetIDWithSeed_Str(str_id_begin &char, str_id_end &char, seed ID) ID
@[inline]
-pub fn focus_item() {
- C.igFocusItem()
+pub fn get_id_with_seed_str(str_id_begin &char, str_id_end &char, seed ID) ID {
+ return C.igGetIDWithSeed_Str(str_id_begin, str_id_end, seed)
}
@[keep_args_alive]
-fn C.igActivateItemByID(id ID)
+fn C.igGetIDWithSeed_Int(n i32, seed ID) ID
@[inline]
-pub fn activate_item_by_id(id ID) {
- C.igActivateItemByID(id)
+pub fn get_id_with_seed_int(n i32, seed ID) ID {
+ return C.igGetIDWithSeed_Int(n, seed)
}
@[keep_args_alive]
-fn C.igIsNamedKey(key Key) bool
+fn C.igItemSize_Vec2(size ImVec2_c, text_baseline_y f32)
@[inline]
-pub fn is_named_key(key Key) bool {
- return C.igIsNamedKey(key)
+pub fn item_size_vec2(size ImVec2_c, text_baseline_y f32) {
+ C.igItemSize_Vec2(size, text_baseline_y)
}
@[keep_args_alive]
-fn C.igIsNamedKeyOrMod(key Key) bool
+fn C.igItemSize_Rect(bb ImRect_c, text_baseline_y f32)
@[inline]
-pub fn is_named_key_or_mod(key Key) bool {
- return C.igIsNamedKeyOrMod(key)
+pub fn item_size_rect(bb ImRect_c, text_baseline_y f32) {
+ C.igItemSize_Rect(bb, text_baseline_y)
}
@[keep_args_alive]
-fn C.igIsLegacyKey(key Key) bool
+fn C.igItemAdd(bb ImRect_c, id ID, nav_bb &ImRect, extra_flags ItemFlags) bool
@[inline]
-pub fn is_legacy_key(key Key) bool {
- return C.igIsLegacyKey(key)
+pub fn item_add(bb ImRect_c, id ID, nav_bb &ImRect, extra_flags ItemFlags) bool {
+ return C.igItemAdd(bb, id, nav_bb, extra_flags)
}
@[keep_args_alive]
-fn C.igIsKeyboardKey(key Key) bool
+fn C.igItemHoverable(bb ImRect_c, id ID, item_flags ItemFlags) bool
@[inline]
-pub fn is_keyboard_key(key Key) bool {
- return C.igIsKeyboardKey(key)
+pub fn item_hoverable(bb ImRect_c, id ID, item_flags ItemFlags) bool {
+ return C.igItemHoverable(bb, id, item_flags)
}
@[keep_args_alive]
-fn C.igIsGamepadKey(key Key) bool
+fn C.igIsWindowContentHoverable(window &Window, flags HoveredFlags) bool
@[inline]
-pub fn is_gamepad_key(key Key) bool {
- return C.igIsGamepadKey(key)
+pub fn is_window_content_hoverable(window &Window, flags HoveredFlags) bool {
+ return C.igIsWindowContentHoverable(window, flags)
}
@[keep_args_alive]
-fn C.igIsMouseKey(key Key) bool
+fn C.igIsClippedEx(bb ImRect_c, id ID) bool
@[inline]
-pub fn is_mouse_key(key Key) bool {
- return C.igIsMouseKey(key)
+pub fn is_clipped_ex(bb ImRect_c, id ID) bool {
+ return C.igIsClippedEx(bb, id)
}
@[keep_args_alive]
-fn C.igIsAliasKey(key Key) bool
+fn C.igSetLastItemData(item_id ID, item_flags ItemFlags, status_flags ItemStatusFlags, item_rect ImRect_c)
@[inline]
-pub fn is_alias_key(key Key) bool {
- return C.igIsAliasKey(key)
+pub fn set_last_item_data(item_id ID, item_flags ItemFlags, status_flags ItemStatusFlags, item_rect ImRect_c) {
+ C.igSetLastItemData(item_id, item_flags, status_flags, item_rect)
}
@[keep_args_alive]
-fn C.igIsLRModKey(key Key) bool
+fn C.igCalcItemSize(size ImVec2_c, default_w f32, default_h f32) ImVec2_c
@[inline]
-pub fn is_lrm_od_key(key Key) bool {
- return C.igIsLRModKey(key)
+pub fn calc_item_size(size ImVec2_c, default_w f32, default_h f32) ImVec2_c {
+ return C.igCalcItemSize(size, default_w, default_h)
}
@[keep_args_alive]
-fn C.igFixupKeyChord(key_chord KeyChord) KeyChord
+fn C.igCalcWrapWidthForPos(pos ImVec2_c, wrap_pos_x f32) f32
@[inline]
-pub fn fixup_key_chord(key_chord KeyChord) KeyChord {
- return C.igFixupKeyChord(key_chord)
+pub fn calc_wrap_width_for_pos(pos ImVec2_c, wrap_pos_x f32) f32 {
+ return C.igCalcWrapWidthForPos(pos, wrap_pos_x)
}
@[keep_args_alive]
-fn C.igConvertSingleModFlagToKey(key Key) Key
+fn C.igPushMultiItemsWidths(components i32, width_full f32)
@[inline]
-pub fn convert_single_mod_flag_to_key(key Key) Key {
- return C.igConvertSingleModFlagToKey(key)
+pub fn push_multi_items_widths(components i32, width_full f32) {
+ C.igPushMultiItemsWidths(components, width_full)
}
@[keep_args_alive]
-fn C.igGetKeyData_ContextPtr(ctx &Context, key Key) &KeyData
+fn C.igShrinkWidths(items &ShrinkWidthItem, count i32, width_excess f32, width_min f32)
@[inline]
-pub fn get_key_data_context_ptr(ctx &Context, key Key) &KeyData {
- return C.igGetKeyData_ContextPtr(ctx, key)
+pub fn shrink_widths(items &ShrinkWidthItem, count i32, width_excess f32, width_min f32) {
+ C.igShrinkWidths(items, count, width_excess, width_min)
}
@[keep_args_alive]
-fn C.igGetKeyData_Key(key Key) &KeyData
+fn C.igCalcClipRectVisibleItemsY(clip_rect ImRect_c, pos ImVec2_c, items_height f32, out_visible_start &i32, out_visible_end &i32)
@[inline]
-pub fn get_key_data_key(key Key) &KeyData {
- return C.igGetKeyData_Key(key)
+pub fn calc_clip_rect_visible_items_y(clip_rect ImRect_c, pos ImVec2_c, items_height f32, out_visible_start &i32, out_visible_end &i32) {
+ C.igCalcClipRectVisibleItemsY(clip_rect, pos, items_height, out_visible_start, out_visible_end)
}
@[keep_args_alive]
-fn C.igGetKeyChordName(key_chord KeyChord) &char
+fn C.igGetStyleVarInfo(idx StyleVar) &StyleVarInfo
@[inline]
-pub fn get_key_chord_name(key_chord KeyChord) &char {
- return C.igGetKeyChordName(key_chord)
+pub fn get_style_var_info(idx StyleVar) &StyleVarInfo {
+ return C.igGetStyleVarInfo(idx)
}
@[keep_args_alive]
-fn C.igMouseButtonToKey(button MouseButton) Key
+fn C.igBeginDisabledOverrideReenable()
@[inline]
-pub fn mouse_button_to_key(button MouseButton) Key {
- return C.igMouseButtonToKey(button)
+pub fn begin_disabled_override_reenable() {
+ C.igBeginDisabledOverrideReenable()
}
@[keep_args_alive]
-fn C.igIsMouseDragPastThreshold(button MouseButton, lock_threshold f32) bool
+fn C.igEndDisabledOverrideReenable()
@[inline]
-pub fn is_mouse_drag_past_threshold(button MouseButton, lock_threshold f32) bool {
- return C.igIsMouseDragPastThreshold(button, lock_threshold)
+pub fn end_disabled_override_reenable() {
+ C.igEndDisabledOverrideReenable()
}
@[keep_args_alive]
-fn C.igGetKeyMagnitude2d(key_left Key, key_right Key, key_up Key, key_down Key) ImVec2_c
+fn C.igLogBegin(flags LogFlags, auto_open_depth i32)
@[inline]
-pub fn get_key_magnitude2d(key_left Key, key_right Key, key_up Key, key_down Key) ImVec2_c {
- return C.igGetKeyMagnitude2d(key_left, key_right, key_up, key_down)
+pub fn log_begin(flags LogFlags, auto_open_depth i32) {
+ C.igLogBegin(flags, auto_open_depth)
}
@[keep_args_alive]
-fn C.igGetNavTweakPressedAmount(axis Axis) f32
+fn C.igLogToBuffer(auto_open_depth i32)
@[inline]
-pub fn get_nav_tweak_pressed_amount(axis Axis) f32 {
- return C.igGetNavTweakPressedAmount(axis)
+pub fn log_to_buffer(auto_open_depth i32) {
+ C.igLogToBuffer(auto_open_depth)
}
@[keep_args_alive]
-fn C.igCalcTypematicRepeatAmount(t0 f32, t1 f32, repeat_delay f32, repeat_rate f32) i32
+fn C.igLogRenderedText(ref_pos &ImVec2_c, const_text &char, const_text_end &char)
@[inline]
-pub fn calc_typematic_repeat_amount(t0 f32, t1 f32, repeat_delay f32, repeat_rate f32) i32 {
- return C.igCalcTypematicRepeatAmount(t0, t1, repeat_delay, repeat_rate)
+pub fn log_rendered_text(ref_pos &ImVec2_c, const_text &char, const_text_end &char) {
+ C.igLogRenderedText(ref_pos, const_text, const_text_end)
}
@[keep_args_alive]
-fn C.igGetTypematicRepeatRate(flags InputFlags, repeat_delay &f32, repeat_rate &f32)
+fn C.igLogSetNextTextDecoration(prefix &char, suffix &char)
@[inline]
-pub fn get_typematic_repeat_rate(flags InputFlags, repeat_delay &f32, repeat_rate &f32) {
- C.igGetTypematicRepeatRate(flags, repeat_delay, repeat_rate)
+pub fn log_set_next_text_decoration(prefix &char, suffix &char) {
+ C.igLogSetNextTextDecoration(prefix, suffix)
}
@[keep_args_alive]
-fn C.igTeleportMousePos(pos ImVec2_c)
+fn C.igBeginChildEx(const_name &char, id ID, size_arg ImVec2_c, child_flags ChildFlags, window_flags WindowFlags) bool
@[inline]
-pub fn teleport_mouse_pos(pos ImVec2_c) {
- C.igTeleportMousePos(pos)
+pub fn begin_child_ex(const_name &char, id ID, size_arg ImVec2_c, child_flags ChildFlags, window_flags WindowFlags) bool {
+ return C.igBeginChildEx(const_name, id, size_arg, child_flags, window_flags)
}
@[keep_args_alive]
-fn C.igSetActiveIdUsingAllKeyboardKeys()
+fn C.igFindFrontMostVisibleChildWindow(window &Window) &Window
@[inline]
-pub fn set_active_id_using_all_keyboard_keys() {
- C.igSetActiveIdUsingAllKeyboardKeys()
+pub fn find_front_most_visible_child_window(window &Window) &Window {
+ return C.igFindFrontMostVisibleChildWindow(window)
}
@[keep_args_alive]
-fn C.igIsActiveIdUsingNavDir(dir Dir) bool
+fn C.igBeginPopupEx(id ID, extra_window_flags WindowFlags) bool
@[inline]
-pub fn is_active_id_using_nav_dir(dir Dir) bool {
- return C.igIsActiveIdUsingNavDir(dir)
+pub fn begin_popup_ex(id ID, extra_window_flags WindowFlags) bool {
+ return C.igBeginPopupEx(id, extra_window_flags)
}
@[keep_args_alive]
-fn C.igGetKeyOwner(key Key) ID
+fn C.igBeginPopupMenuEx(id ID, const_label &char, extra_window_flags WindowFlags) bool
@[inline]
-pub fn get_key_owner(key Key) ID {
- return C.igGetKeyOwner(key)
+pub fn begin_popup_menu_ex(id ID, const_label &char, extra_window_flags WindowFlags) bool {
+ return C.igBeginPopupMenuEx(id, const_label, extra_window_flags)
}
@[keep_args_alive]
-fn C.igSetKeyOwner(key Key, owner_id ID, flags InputFlags)
+fn C.igOpenPopupEx(id ID, popup_flags PopupFlags) bool
@[inline]
-pub fn set_key_owner(key Key, owner_id ID, flags InputFlags) {
- C.igSetKeyOwner(key, owner_id, flags)
+pub fn open_popup_ex(id ID, popup_flags PopupFlags) bool {
+ return C.igOpenPopupEx(id, popup_flags)
}
@[keep_args_alive]
-fn C.igSetKeyOwnersForKeyChord(key KeyChord, owner_id ID, flags InputFlags)
+fn C.igClosePopupToLevel(remaining i32, restore_focus_to_window_under_popup bool)
@[inline]
-pub fn set_key_owners_for_key_chord(key KeyChord, owner_id ID, flags InputFlags) {
- C.igSetKeyOwnersForKeyChord(key, owner_id, flags)
+pub fn close_popup_to_level(remaining i32, restore_focus_to_window_under_popup bool) {
+ C.igClosePopupToLevel(remaining, restore_focus_to_window_under_popup)
}
@[keep_args_alive]
-fn C.igSetItemKeyOwner_InputFlags(key Key, flags InputFlags)
+fn C.igClosePopupsOverWindow(ref_window &Window, restore_focus_to_window_under_popup bool)
@[inline]
-pub fn set_item_key_owner_input_flags(key Key, flags InputFlags) {
- C.igSetItemKeyOwner_InputFlags(key, flags)
+pub fn close_popups_over_window(ref_window &Window, restore_focus_to_window_under_popup bool) {
+ C.igClosePopupsOverWindow(ref_window, restore_focus_to_window_under_popup)
}
@[keep_args_alive]
-fn C.igTestKeyOwner(key Key, owner_id ID) bool
+fn C.igClosePopupsExceptModals()
@[inline]
-pub fn test_key_owner(key Key, owner_id ID) bool {
- return C.igTestKeyOwner(key, owner_id)
+pub fn close_popups_except_modals() {
+ C.igClosePopupsExceptModals()
}
@[keep_args_alive]
-fn C.igGetKeyOwnerData(ctx &Context, key Key) &KeyOwnerData
+fn C.igIsPopupOpen_ID(id ID, popup_flags PopupFlags) bool
@[inline]
-pub fn get_key_owner_data(ctx &Context, key Key) &KeyOwnerData {
- return C.igGetKeyOwnerData(ctx, key)
+pub fn is_popup_open_id(id ID, popup_flags PopupFlags) bool {
+ return C.igIsPopupOpen_ID(id, popup_flags)
}
@[keep_args_alive]
-fn C.igIsKeyDown_ID(key Key, owner_id ID) bool
+fn C.igGetPopupAllowedExtentRect(window &Window) ImRect_c
@[inline]
-pub fn is_key_down_id(key Key, owner_id ID) bool {
- return C.igIsKeyDown_ID(key, owner_id)
+pub fn get_popup_allowed_extent_rect(window &Window) ImRect_c {
+ return C.igGetPopupAllowedExtentRect(window)
}
@[keep_args_alive]
-fn C.igIsKeyPressed_InputFlags(key Key, flags InputFlags, owner_id ID) bool
+fn C.igGetTopMostPopupModal() &Window
@[inline]
-pub fn is_key_pressed_input_flags(key Key, flags InputFlags, owner_id ID) bool {
- return C.igIsKeyPressed_InputFlags(key, flags, owner_id)
+pub fn get_top_most_popup_modal() &Window {
+ return C.igGetTopMostPopupModal()
}
@[keep_args_alive]
-fn C.igIsKeyReleased_ID(key Key, owner_id ID) bool
+fn C.igGetTopMostAndVisiblePopupModal() &Window
@[inline]
-pub fn is_key_released_id(key Key, owner_id ID) bool {
- return C.igIsKeyReleased_ID(key, owner_id)
+pub fn get_top_most_and_visible_popup_modal() &Window {
+ return C.igGetTopMostAndVisiblePopupModal()
}
@[keep_args_alive]
-fn C.igIsKeyChordPressed_InputFlags(key_chord KeyChord, flags InputFlags, owner_id ID) bool
+fn C.igFindBlockingModal(window &Window) &Window
@[inline]
-pub fn is_key_chord_pressed_input_flags(key_chord KeyChord, flags InputFlags, owner_id ID) bool {
- return C.igIsKeyChordPressed_InputFlags(key_chord, flags, owner_id)
+pub fn find_blocking_modal(window &Window) &Window {
+ return C.igFindBlockingModal(window)
}
@[keep_args_alive]
-fn C.igIsMouseDown_ID(button MouseButton, owner_id ID) bool
+fn C.igFindBestWindowPosForPopup(window &Window) ImVec2_c
@[inline]
-pub fn is_mouse_down_id(button MouseButton, owner_id ID) bool {
- return C.igIsMouseDown_ID(button, owner_id)
+pub fn find_best_window_pos_for_popup(window &Window) ImVec2_c {
+ return C.igFindBestWindowPosForPopup(window)
}
@[keep_args_alive]
-fn C.igIsMouseClicked_InputFlags(button MouseButton, flags InputFlags, owner_id ID) bool
+fn C.igFindBestWindowPosForPopupEx(ref_pos ImVec2_c, size ImVec2_c, last_dir &i32, r_outer ImRect_c, r_avoid ImRect_c, policy i32) ImVec2_c
@[inline]
-pub fn is_mouse_clicked_input_flags(button MouseButton, flags InputFlags, owner_id ID) bool {
- return C.igIsMouseClicked_InputFlags(button, flags, owner_id)
+pub fn find_best_window_pos_for_popup_ex(ref_pos ImVec2_c, size ImVec2_c, last_dir &i32, r_outer ImRect_c, r_avoid ImRect_c, policy i32) ImVec2_c {
+ return C.igFindBestWindowPosForPopupEx(ref_pos, size, last_dir, r_outer, r_avoid, policy)
}
@[keep_args_alive]
-fn C.igIsMouseReleased_ID(button MouseButton, owner_id ID) bool
+fn C.igGetMouseButtonFromPopupFlags(flags PopupFlags) MouseButton
@[inline]
-pub fn is_mouse_released_id(button MouseButton, owner_id ID) bool {
- return C.igIsMouseReleased_ID(button, owner_id)
+pub fn get_mouse_button_from_popup_flags(flags PopupFlags) MouseButton {
+ return C.igGetMouseButtonFromPopupFlags(flags)
}
@[keep_args_alive]
-fn C.igIsMouseDoubleClicked_ID(button MouseButton, owner_id ID) bool
+fn C.igIsPopupOpenRequestForItem(flags PopupFlags, id ID) bool
@[inline]
-pub fn is_mouse_double_clicked_id(button MouseButton, owner_id ID) bool {
- return C.igIsMouseDoubleClicked_ID(button, owner_id)
+pub fn is_popup_open_request_for_item(flags PopupFlags, id ID) bool {
+ return C.igIsPopupOpenRequestForItem(flags, id)
}
@[keep_args_alive]
-fn C.igShortcut_ID(key_chord KeyChord, flags InputFlags, owner_id ID) bool
+fn C.igIsPopupOpenRequestForWindow(flags PopupFlags) bool
@[inline]
-pub fn shortcut_id(key_chord KeyChord, flags InputFlags, owner_id ID) bool {
- return C.igShortcut_ID(key_chord, flags, owner_id)
+pub fn is_popup_open_request_for_window(flags PopupFlags) bool {
+ return C.igIsPopupOpenRequestForWindow(flags)
}
@[keep_args_alive]
-fn C.igSetShortcutRouting(key_chord KeyChord, flags InputFlags, owner_id ID) bool
+fn C.igBeginTooltipEx(tooltip_flags TooltipFlags, extra_window_flags WindowFlags) bool
@[inline]
-pub fn set_shortcut_routing(key_chord KeyChord, flags InputFlags, owner_id ID) bool {
- return C.igSetShortcutRouting(key_chord, flags, owner_id)
+pub fn begin_tooltip_ex(tooltip_flags TooltipFlags, extra_window_flags WindowFlags) bool {
+ return C.igBeginTooltipEx(tooltip_flags, extra_window_flags)
}
@[keep_args_alive]
-fn C.igTestShortcutRouting(key_chord KeyChord, owner_id ID) bool
+fn C.igBeginTooltipHidden() bool
@[inline]
-pub fn test_shortcut_routing(key_chord KeyChord, owner_id ID) bool {
- return C.igTestShortcutRouting(key_chord, owner_id)
+pub fn begin_tooltip_hidden() bool {
+ return C.igBeginTooltipHidden()
}
@[keep_args_alive]
-fn C.igGetShortcutRoutingData(key_chord KeyChord) &KeyRoutingData
+fn C.igBeginViewportSideBar(const_name &char, viewport &Viewport, dir i32, size f32, window_flags WindowFlags) bool
@[inline]
-pub fn get_shortcut_routing_data(key_chord KeyChord) &KeyRoutingData {
- return C.igGetShortcutRoutingData(key_chord)
+pub fn begin_viewport_side_bar(const_name &char, viewport &Viewport, dir i32, size f32, window_flags WindowFlags) bool {
+ return C.igBeginViewportSideBar(const_name, viewport, dir, size, window_flags)
}
@[keep_args_alive]
-fn C.igDockContextInitialize(ctx &Context)
+fn C.igBeginMenuEx(const_label &char, icon &char, enabled bool) bool
@[inline]
-pub fn dock_context_initialize(ctx &Context) {
- C.igDockContextInitialize(ctx)
+pub fn begin_menu_ex(const_label &char, icon &char, enabled bool) bool {
+ return C.igBeginMenuEx(const_label, icon, enabled)
}
@[keep_args_alive]
-fn C.igDockContextShutdown(ctx &Context)
+fn C.igMenuItemEx(const_label &char, icon &char, const_shortcut &char, selected bool, enabled bool) bool
@[inline]
-pub fn dock_context_shutdown(ctx &Context) {
- C.igDockContextShutdown(ctx)
+pub fn menu_item_ex(const_label &char, icon &char, const_shortcut &char, selected bool, enabled bool) bool {
+ return C.igMenuItemEx(const_label, icon, const_shortcut, selected, enabled)
}
@[keep_args_alive]
-fn C.igDockContextClearNodes(ctx &Context, root_id ID, clear_settings_refs bool)
+fn C.igBeginComboPopup(popup_id ID, bb ImRect_c, flags ComboFlags) bool
@[inline]
-pub fn dock_context_clear_nodes(ctx &Context, root_id ID, clear_settings_refs bool) {
- C.igDockContextClearNodes(ctx, root_id, clear_settings_refs)
+pub fn begin_combo_popup(popup_id ID, bb ImRect_c, flags ComboFlags) bool {
+ return C.igBeginComboPopup(popup_id, bb, flags)
}
@[keep_args_alive]
-fn C.igDockContextRebuildNodes(ctx &Context)
+fn C.igBeginComboPreview() bool
@[inline]
-pub fn dock_context_rebuild_nodes(ctx &Context) {
- C.igDockContextRebuildNodes(ctx)
+pub fn begin_combo_preview() bool {
+ return C.igBeginComboPreview()
}
@[keep_args_alive]
-fn C.igDockContextNewFrameUpdateUndocking(ctx &Context)
+fn C.igEndComboPreview()
@[inline]
-pub fn dock_context_new_frame_update_undocking(ctx &Context) {
- C.igDockContextNewFrameUpdateUndocking(ctx)
+pub fn end_combo_preview() {
+ C.igEndComboPreview()
}
@[keep_args_alive]
-fn C.igDockContextNewFrameUpdateDocking(ctx &Context)
+fn C.igNavInitWindow(window &Window, force_reinit bool)
@[inline]
-pub fn dock_context_new_frame_update_docking(ctx &Context) {
- C.igDockContextNewFrameUpdateDocking(ctx)
+pub fn nav_init_window(window &Window, force_reinit bool) {
+ C.igNavInitWindow(window, force_reinit)
}
@[keep_args_alive]
-fn C.igDockContextEndFrame(ctx &Context)
+fn C.igNavInitRequestApplyResult()
@[inline]
-pub fn dock_context_end_frame(ctx &Context) {
- C.igDockContextEndFrame(ctx)
+pub fn nav_init_request_apply_result() {
+ C.igNavInitRequestApplyResult()
}
@[keep_args_alive]
-fn C.igDockContextGenNodeID(ctx &Context) ID
+fn C.igNavMoveRequestButNoResultYet() bool
@[inline]
-pub fn dock_context_gen_node_id(ctx &Context) ID {
- return C.igDockContextGenNodeID(ctx)
+pub fn nav_move_request_but_no_result_yet() bool {
+ return C.igNavMoveRequestButNoResultYet()
}
@[keep_args_alive]
-fn C.igDockContextQueueDock(ctx &Context, target &Window, target_node &DockNode, payload &Window, split_dir Dir, split_ratio f32, split_outer bool)
+fn C.igNavMoveRequestSubmit(move_dir i32, clip_dir i32, move_flags NavMoveFlags, scroll_flags ScrollFlags)
@[inline]
-pub fn dock_context_queue_dock(ctx &Context, target &Window, target_node &DockNode, payload &Window, split_dir Dir, split_ratio f32, split_outer bool) {
- C.igDockContextQueueDock(ctx, target, target_node, payload, split_dir, split_ratio, split_outer)
+pub fn nav_move_request_submit(move_dir i32, clip_dir i32, move_flags NavMoveFlags, scroll_flags ScrollFlags) {
+ C.igNavMoveRequestSubmit(move_dir, clip_dir, move_flags, scroll_flags)
}
@[keep_args_alive]
-fn C.igDockContextQueueUndockWindow(ctx &Context, window &Window)
+fn C.igNavMoveRequestForward(move_dir i32, clip_dir i32, move_flags NavMoveFlags, scroll_flags ScrollFlags)
@[inline]
-pub fn dock_context_queue_undock_window(ctx &Context, window &Window) {
- C.igDockContextQueueUndockWindow(ctx, window)
+pub fn nav_move_request_forward(move_dir i32, clip_dir i32, move_flags NavMoveFlags, scroll_flags ScrollFlags) {
+ C.igNavMoveRequestForward(move_dir, clip_dir, move_flags, scroll_flags)
}
@[keep_args_alive]
-fn C.igDockContextQueueUndockNode(ctx &Context, node &DockNode)
+fn C.igNavMoveRequestResolveWithLastItem(result &NavItemData)
@[inline]
-pub fn dock_context_queue_undock_node(ctx &Context, node &DockNode) {
- C.igDockContextQueueUndockNode(ctx, node)
+pub fn nav_move_request_resolve_with_last_item(result &NavItemData) {
+ C.igNavMoveRequestResolveWithLastItem(result)
}
@[keep_args_alive]
-fn C.igDockContextProcessUndockWindow(ctx &Context, window &Window, clear_persistent_docking_ref bool)
+fn C.igNavMoveRequestResolveWithPastTreeNode(result &NavItemData, tree_node_data &TreeNodeStackData)
@[inline]
-pub fn dock_context_process_undock_window(ctx &Context, window &Window, clear_persistent_docking_ref bool) {
- C.igDockContextProcessUndockWindow(ctx, window, clear_persistent_docking_ref)
+pub fn nav_move_request_resolve_with_past_tree_node(result &NavItemData, tree_node_data &TreeNodeStackData) {
+ C.igNavMoveRequestResolveWithPastTreeNode(result, tree_node_data)
}
@[keep_args_alive]
-fn C.igDockContextProcessUndockNode(ctx &Context, node &DockNode)
+fn C.igNavMoveRequestCancel()
@[inline]
-pub fn dock_context_process_undock_node(ctx &Context, node &DockNode) {
- C.igDockContextProcessUndockNode(ctx, node)
+pub fn nav_move_request_cancel() {
+ C.igNavMoveRequestCancel()
}
@[keep_args_alive]
-fn C.igDockContextCalcDropPosForDocking(target &Window, target_node &DockNode, payload_window &Window, payload_node &DockNode, split_dir Dir, split_outer bool, out_pos &ImVec2_c) bool
+fn C.igNavMoveRequestApplyResult()
@[inline]
-pub fn dock_context_calc_drop_pos_for_docking(target &Window, target_node &DockNode, payload_window &Window, payload_node &DockNode, split_dir Dir, split_outer bool, out_pos &ImVec2_c) bool {
- return C.igDockContextCalcDropPosForDocking(target, target_node, payload_window, payload_node,
- split_dir, split_outer, out_pos)
+pub fn nav_move_request_apply_result() {
+ C.igNavMoveRequestApplyResult()
}
@[keep_args_alive]
-fn C.igDockContextFindNodeByID(ctx &Context, id ID) &DockNode
+fn C.igNavMoveRequestTryWrapping(window &Window, move_flags NavMoveFlags)
@[inline]
-pub fn dock_context_find_node_by_id(ctx &Context, id ID) &DockNode {
- return C.igDockContextFindNodeByID(ctx, id)
+pub fn nav_move_request_try_wrapping(window &Window, move_flags NavMoveFlags) {
+ C.igNavMoveRequestTryWrapping(window, move_flags)
}
@[keep_args_alive]
-fn C.igDockNodeWindowMenuHandler_Default(ctx &Context, node &DockNode, tab_bar &TabBar)
+fn C.igNavHighlightActivated(id ID)
@[inline]
-pub fn dock_node_window_menu_handler_default(ctx &Context, node &DockNode, tab_bar &TabBar) {
- C.igDockNodeWindowMenuHandler_Default(ctx, node, tab_bar)
+pub fn nav_highlight_activated(id ID) {
+ C.igNavHighlightActivated(id)
}
@[keep_args_alive]
-fn C.igDockNodeBeginAmendTabBar(node &DockNode) bool
+fn C.igNavClearPreferredPosForAxis(axis i32)
@[inline]
-pub fn dock_node_begin_amend_tab_bar(node &DockNode) bool {
- return C.igDockNodeBeginAmendTabBar(node)
+pub fn nav_clear_preferred_pos_for_axis(axis i32) {
+ C.igNavClearPreferredPosForAxis(axis)
}
@[keep_args_alive]
-fn C.igDockNodeEndAmendTabBar()
+fn C.igSetNavCursorVisibleAfterMove()
@[inline]
-pub fn dock_node_end_amend_tab_bar() {
- C.igDockNodeEndAmendTabBar()
+pub fn set_nav_cursor_visible_after_move() {
+ C.igSetNavCursorVisibleAfterMove()
}
@[keep_args_alive]
-fn C.igDockNodeGetRootNode(node &DockNode) &DockNode
+fn C.igNavUpdateCurrentWindowIsScrollPushableX()
@[inline]
-pub fn dock_node_get_root_node(node &DockNode) &DockNode {
- return C.igDockNodeGetRootNode(node)
+pub fn nav_update_current_window_is_scroll_pushable_x() {
+ C.igNavUpdateCurrentWindowIsScrollPushableX()
}
@[keep_args_alive]
-fn C.igDockNodeIsInHierarchyOf(node &DockNode, parent &DockNode) bool
+fn C.igSetNavWindow(window &Window)
@[inline]
-pub fn dock_node_is_in_hierarchy_of(node &DockNode, parent &DockNode) bool {
- return C.igDockNodeIsInHierarchyOf(node, parent)
+pub fn set_nav_window(window &Window) {
+ C.igSetNavWindow(window)
}
@[keep_args_alive]
-fn C.igDockNodeGetDepth(node &DockNode) i32
+fn C.igSetNavID(id ID, nav_layer i32, focus_scope_id ID, rect_rel ImRect_c)
@[inline]
-pub fn dock_node_get_depth(node &DockNode) i32 {
- return C.igDockNodeGetDepth(node)
+pub fn set_nav_id(id ID, nav_layer i32, focus_scope_id ID, rect_rel ImRect_c) {
+ C.igSetNavID(id, nav_layer, focus_scope_id, rect_rel)
}
@[keep_args_alive]
-fn C.igDockNodeGetWindowMenuButtonId(node &DockNode) ID
+fn C.igSetNavFocusScope(focus_scope_id ID)
@[inline]
-pub fn dock_node_get_window_menu_button_id(node &DockNode) ID {
- return C.igDockNodeGetWindowMenuButtonId(node)
+pub fn set_nav_focus_scope(focus_scope_id ID) {
+ C.igSetNavFocusScope(focus_scope_id)
}
@[keep_args_alive]
-fn C.igGetWindowDockNode() &DockNode
+fn C.igFocusItem()
@[inline]
-pub fn get_window_dock_node() &DockNode {
- return C.igGetWindowDockNode()
+pub fn focus_item() {
+ C.igFocusItem()
}
@[keep_args_alive]
-fn C.igGetWindowAlwaysWantOwnTabBar(window &Window) bool
+fn C.igActivateItemByID(id ID)
@[inline]
-pub fn get_window_always_want_own_tab_bar(window &Window) bool {
- return C.igGetWindowAlwaysWantOwnTabBar(window)
+pub fn activate_item_by_id(id ID) {
+ C.igActivateItemByID(id)
}
@[keep_args_alive]
-fn C.igBeginDocked(window &Window, p_open &bool)
+fn C.igIsNamedKey(key i32) bool
@[inline]
-pub fn begin_docked(window &Window, p_open &bool) {
- C.igBeginDocked(window, p_open)
+pub fn is_named_key(key i32) bool {
+ return C.igIsNamedKey(key)
}
@[keep_args_alive]
-fn C.igBeginDockableDragDropSource(window &Window)
+fn C.igIsNamedKeyOrMod(key i32) bool
@[inline]
-pub fn begin_dockable_drag_drop_source(window &Window) {
- C.igBeginDockableDragDropSource(window)
+pub fn is_named_key_or_mod(key i32) bool {
+ return C.igIsNamedKeyOrMod(key)
}
@[keep_args_alive]
-fn C.igBeginDockableDragDropTarget(window &Window)
+fn C.igIsLegacyKey(key i32) bool
@[inline]
-pub fn begin_dockable_drag_drop_target(window &Window) {
- C.igBeginDockableDragDropTarget(window)
+pub fn is_legacy_key(key i32) bool {
+ return C.igIsLegacyKey(key)
}
@[keep_args_alive]
-fn C.igSetWindowDock(window &Window, dock_id ID, cond Cond)
+fn C.igIsKeyboardKey(key i32) bool
@[inline]
-pub fn set_window_dock(window &Window, dock_id ID, cond Cond) {
- C.igSetWindowDock(window, dock_id, cond)
+pub fn is_keyboard_key(key i32) bool {
+ return C.igIsKeyboardKey(key)
}
@[keep_args_alive]
-fn C.igDockBuilderDockWindow(window_name &char, node_id ID)
+fn C.igIsGamepadKey(key i32) bool
@[inline]
-pub fn dock_builder_dock_window(window_name &char, node_id ID) {
- C.igDockBuilderDockWindow(window_name, node_id)
+pub fn is_gamepad_key(key i32) bool {
+ return C.igIsGamepadKey(key)
}
@[keep_args_alive]
-fn C.igDockBuilderGetNode(node_id ID) &DockNode
+fn C.igIsMouseKey(key i32) bool
@[inline]
-pub fn dock_builder_get_node(node_id ID) &DockNode {
- return C.igDockBuilderGetNode(node_id)
+pub fn is_mouse_key(key i32) bool {
+ return C.igIsMouseKey(key)
}
@[keep_args_alive]
-fn C.igDockBuilderGetCentralNode(node_id ID) &DockNode
+fn C.igIsAliasKey(key i32) bool
@[inline]
-pub fn dock_builder_get_central_node(node_id ID) &DockNode {
- return C.igDockBuilderGetCentralNode(node_id)
+pub fn is_alias_key(key i32) bool {
+ return C.igIsAliasKey(key)
}
@[keep_args_alive]
-fn C.igDockBuilderAddNode(node_id ID, flags DockNodeFlags) ID
+fn C.igIsLRModKey(key i32) bool
@[inline]
-pub fn dock_builder_add_node(node_id ID, flags DockNodeFlags) ID {
- return C.igDockBuilderAddNode(node_id, flags)
+pub fn is_lr_mod_key(key i32) bool {
+ return C.igIsLRModKey(key)
}
@[keep_args_alive]
-fn C.igDockBuilderRemoveNode(node_id ID)
+fn C.igFixupKeyChord(key_chord KeyChord) KeyChord
@[inline]
-pub fn dock_builder_remove_node(node_id ID) {
- C.igDockBuilderRemoveNode(node_id)
+pub fn fixup_key_chord(key_chord KeyChord) KeyChord {
+ return C.igFixupKeyChord(key_chord)
}
@[keep_args_alive]
-fn C.igDockBuilderRemoveNodeDockedWindows(node_id ID, clear_settings_refs bool)
+fn C.igConvertSingleModFlagToKey(key i32) i32
@[inline]
-pub fn dock_builder_remove_node_docked_windows(node_id ID, clear_settings_refs bool) {
- C.igDockBuilderRemoveNodeDockedWindows(node_id, clear_settings_refs)
+pub fn convert_single_mod_flag_to_key(key i32) i32 {
+ return C.igConvertSingleModFlagToKey(key)
}
@[keep_args_alive]
-fn C.igDockBuilderRemoveNodeChildNodes(node_id ID)
+fn C.igGetKeyData_ContextPtr(ctx &Context, key i32) &KeyData
@[inline]
-pub fn dock_builder_remove_node_child_nodes(node_id ID) {
- C.igDockBuilderRemoveNodeChildNodes(node_id)
+pub fn get_key_data_context_ptr(ctx &Context, key i32) &KeyData {
+ return C.igGetKeyData_ContextPtr(ctx, key)
}
@[keep_args_alive]
-fn C.igDockBuilderSetNodePos(node_id ID, pos ImVec2_c)
+fn C.igGetKeyData_Key(key i32) &KeyData
@[inline]
-pub fn dock_builder_set_node_pos(node_id ID, pos ImVec2_c) {
- C.igDockBuilderSetNodePos(node_id, pos)
+pub fn get_key_data_key(key i32) &KeyData {
+ return C.igGetKeyData_Key(key)
}
@[keep_args_alive]
-fn C.igDockBuilderSetNodeSize(node_id ID, size ImVec2_c)
+fn C.igGetKeyChordName(key_chord KeyChord) &char
@[inline]
-pub fn dock_builder_set_node_size(node_id ID, size ImVec2_c) {
- C.igDockBuilderSetNodeSize(node_id, size)
+pub fn get_key_chord_name(key_chord KeyChord) &char {
+ return C.igGetKeyChordName(key_chord)
}
@[keep_args_alive]
-fn C.igDockBuilderSplitNode(node_id ID, split_dir Dir, size_ratio_for_node_at_dir f32, out_id_at_dir &ID, out_id_at_opposite_dir &ID) ID
+fn C.igMouseButtonToKey(button MouseButton) i32
@[inline]
-pub fn dock_builder_split_node(node_id ID, split_dir Dir, size_ratio_for_node_at_dir f32, out_id_at_dir &ID, out_id_at_opposite_dir &ID) ID {
- return C.igDockBuilderSplitNode(node_id, split_dir, size_ratio_for_node_at_dir, out_id_at_dir,
- out_id_at_opposite_dir)
+pub fn mouse_button_to_key(button MouseButton) i32 {
+ return C.igMouseButtonToKey(button)
}
@[keep_args_alive]
-fn C.igDockBuilderCopyDockSpace(src_dockspace_id ID, dst_dockspace_id ID, in_window_remap_pairs &ImVector_const_charPtr)
+fn C.igIsMouseDragPastThreshold(button MouseButton, lock_threshold f32) bool
@[inline]
-pub fn dock_builder_copy_dock_space(src_dockspace_id ID, dst_dockspace_id ID, in_window_remap_pairs &ImVector_const_charPtr) {
- C.igDockBuilderCopyDockSpace(src_dockspace_id, dst_dockspace_id, in_window_remap_pairs)
+pub fn is_mouse_drag_past_threshold(button MouseButton, lock_threshold f32) bool {
+ return C.igIsMouseDragPastThreshold(button, lock_threshold)
}
@[keep_args_alive]
-fn C.igDockBuilderCopyNode(src_node_id ID, dst_node_id ID, out_node_remap_pairs &ImVector_ID)
+fn C.igGetKeyMagnitude2d(key_left i32, key_right i32, key_up i32, key_down i32) ImVec2_c
@[inline]
-pub fn dock_builder_copy_node(src_node_id ID, dst_node_id ID, out_node_remap_pairs &ImVector_ID) {
- C.igDockBuilderCopyNode(src_node_id, dst_node_id, out_node_remap_pairs)
+pub fn get_key_magnitude2d(key_left i32, key_right i32, key_up i32, key_down i32) ImVec2_c {
+ return C.igGetKeyMagnitude2d(key_left, key_right, key_up, key_down)
}
@[keep_args_alive]
-fn C.igDockBuilderCopyWindowSettings(src_name &char, dst_name &char)
+fn C.igGetNavTweakPressedAmount(axis i32) f32
@[inline]
-pub fn dock_builder_copy_window_settings(src_name &char, dst_name &char) {
- C.igDockBuilderCopyWindowSettings(src_name, dst_name)
+pub fn get_nav_tweak_pressed_amount(axis i32) f32 {
+ return C.igGetNavTweakPressedAmount(axis)
}
@[keep_args_alive]
-fn C.igDockBuilderFinish(node_id ID)
+fn C.igCalcTypematicRepeatAmount(t0 f32, t1 f32, repeat_delay f32, repeat_rate f32) i32
@[inline]
-pub fn dock_builder_finish(node_id ID) {
- C.igDockBuilderFinish(node_id)
+pub fn calc_typematic_repeat_amount(t0 f32, t1 f32, repeat_delay f32, repeat_rate f32) i32 {
+ return C.igCalcTypematicRepeatAmount(t0, t1, repeat_delay, repeat_rate)
}
@[keep_args_alive]
-fn C.igPushFocusScope(id ID)
+fn C.igGetTypematicRepeatRate(flags InputFlags, repeat_delay &f32, repeat_rate &f32)
@[inline]
-pub fn push_focus_scope(id ID) {
- C.igPushFocusScope(id)
+pub fn get_typematic_repeat_rate(flags InputFlags, repeat_delay &f32, repeat_rate &f32) {
+ C.igGetTypematicRepeatRate(flags, repeat_delay, repeat_rate)
}
@[keep_args_alive]
-fn C.igPopFocusScope()
+fn C.igTeleportMousePos(pos ImVec2_c)
@[inline]
-pub fn pop_focus_scope() {
- C.igPopFocusScope()
+pub fn teleport_mouse_pos(pos ImVec2_c) {
+ C.igTeleportMousePos(pos)
}
@[keep_args_alive]
-fn C.igGetCurrentFocusScope() ID
+fn C.igSetActiveIdUsingAllKeyboardKeys()
@[inline]
-pub fn get_current_focus_scope() ID {
- return C.igGetCurrentFocusScope()
+pub fn set_active_id_using_all_keyboard_keys() {
+ C.igSetActiveIdUsingAllKeyboardKeys()
}
@[keep_args_alive]
-fn C.igIsDragDropActive() bool
+fn C.igIsActiveIdUsingNavDir(dir i32) bool
@[inline]
-pub fn is_drag_drop_active() bool {
- return C.igIsDragDropActive()
+pub fn is_active_id_using_nav_dir(dir i32) bool {
+ return C.igIsActiveIdUsingNavDir(dir)
}
@[keep_args_alive]
-fn C.igBeginDragDropTargetCustom(bb ImRect_c, id ID) bool
+fn C.igGetKeyOwner(key i32) ID
@[inline]
-pub fn begin_drag_drop_target_custom(bb ImRect_c, id ID) bool {
- return C.igBeginDragDropTargetCustom(bb, id)
+pub fn get_key_owner(key i32) ID {
+ return C.igGetKeyOwner(key)
}
@[keep_args_alive]
-fn C.igBeginDragDropTargetViewport(viewport &Viewport, p_bb &ImRect) bool
+fn C.igSetKeyOwner(key i32, owner_id ID, flags InputFlags)
@[inline]
-pub fn begin_drag_drop_target_viewport(viewport &Viewport, p_bb &ImRect) bool {
- return C.igBeginDragDropTargetViewport(viewport, p_bb)
+pub fn set_key_owner(key i32, owner_id ID, flags InputFlags) {
+ C.igSetKeyOwner(key, owner_id, flags)
}
@[keep_args_alive]
-fn C.igClearDragDrop()
+fn C.igSetKeyOwnersForKeyChord(key KeyChord, owner_id ID, flags InputFlags)
@[inline]
-pub fn clear_drag_drop() {
- C.igClearDragDrop()
+pub fn set_key_owners_for_key_chord(key KeyChord, owner_id ID, flags InputFlags) {
+ C.igSetKeyOwnersForKeyChord(key, owner_id, flags)
}
@[keep_args_alive]
-fn C.igIsDragDropPayloadBeingAccepted() bool
+fn C.igSetItemKeyOwner_InputFlags(key i32, flags InputFlags) bool
@[inline]
-pub fn is_drag_drop_payload_being_accepted() bool {
- return C.igIsDragDropPayloadBeingAccepted()
+pub fn set_item_key_owner_input_flags(key i32, flags InputFlags) bool {
+ return C.igSetItemKeyOwner_InputFlags(key, flags)
}
@[keep_args_alive]
-fn C.igRenderDragDropTargetRectForItem(bb ImRect_c)
+fn C.igTestKeyOwner(key i32, owner_id ID) bool
@[inline]
-pub fn render_drag_drop_target_rect_for_item(bb ImRect_c) {
- C.igRenderDragDropTargetRectForItem(bb)
+pub fn test_key_owner(key i32, owner_id ID) bool {
+ return C.igTestKeyOwner(key, owner_id)
}
@[keep_args_alive]
-fn C.igRenderDragDropTargetRectEx(draw_list &ImDrawList, bb ImRect_c)
+fn C.igGetKeyOwnerData(ctx &Context, key i32) &KeyOwnerData
@[inline]
-pub fn render_drag_drop_target_rect_ex(draw_list &ImDrawList, bb ImRect_c) {
- C.igRenderDragDropTargetRectEx(draw_list, bb)
+pub fn get_key_owner_data(ctx &Context, key i32) &KeyOwnerData {
+ return C.igGetKeyOwnerData(ctx, key)
}
@[keep_args_alive]
-fn C.igGetTypingSelectRequest(flags TypingSelectFlags) &TypingSelectRequest
+fn C.igIsKeyDown_ID(key i32, owner_id ID) bool
@[inline]
-pub fn get_typing_select_request(flags TypingSelectFlags) &TypingSelectRequest {
- return C.igGetTypingSelectRequest(flags)
+pub fn is_key_down_id(key i32, owner_id ID) bool {
+ return C.igIsKeyDown_ID(key, owner_id)
}
@[keep_args_alive]
-fn C.igTypingSelectFindMatch(req &TypingSelectRequest, items_count i32, get_item_name_func fn (voidptr, i32) &char, user_data voidptr, nav_item_idx i32) i32
+fn C.igIsKeyPressed_InputFlags(key i32, flags InputFlags, owner_id ID) bool
@[inline]
-pub fn typing_select_find_match(req &TypingSelectRequest, items_count i32, get_item_name_func fn (voidptr, i32) &char, user_data voidptr, nav_item_idx i32) i32 {
- return C.igTypingSelectFindMatch(req, items_count, get_item_name_func, user_data, nav_item_idx)
+pub fn is_key_pressed_input_flags(key i32, flags InputFlags, owner_id ID) bool {
+ return C.igIsKeyPressed_InputFlags(key, flags, owner_id)
}
@[keep_args_alive]
-fn C.igTypingSelectFindNextSingleCharMatch(req &TypingSelectRequest, items_count i32, get_item_name_func fn (voidptr, i32) &char, user_data voidptr, nav_item_idx i32) i32
+fn C.igIsKeyReleased_ID(key i32, owner_id ID) bool
@[inline]
-pub fn typing_select_find_next_single_char_match(req &TypingSelectRequest, items_count i32, get_item_name_func fn (voidptr, i32) &char, user_data voidptr, nav_item_idx i32) i32 {
- return C.igTypingSelectFindNextSingleCharMatch(req, items_count, get_item_name_func, user_data,
- nav_item_idx)
+pub fn is_key_released_id(key i32, owner_id ID) bool {
+ return C.igIsKeyReleased_ID(key, owner_id)
}
@[keep_args_alive]
-fn C.igTypingSelectFindBestLeadingMatch(req &TypingSelectRequest, items_count i32, get_item_name_func fn (voidptr, i32) &char, user_data voidptr) i32
+fn C.igIsKeyChordPressed_InputFlags(key_chord KeyChord, flags InputFlags, owner_id ID) bool
@[inline]
-pub fn typing_select_find_best_leading_match(req &TypingSelectRequest, items_count i32, get_item_name_func fn (voidptr, i32) &char, user_data voidptr) i32 {
- return C.igTypingSelectFindBestLeadingMatch(req, items_count, get_item_name_func, user_data)
+pub fn is_key_chord_pressed_input_flags(key_chord KeyChord, flags InputFlags, owner_id ID) bool {
+ return C.igIsKeyChordPressed_InputFlags(key_chord, flags, owner_id)
}
@[keep_args_alive]
-fn C.igBeginBoxSelect(scope_rect ImRect_c, window &Window, box_select_id ID, ms_flags MultiSelectFlags) bool
+fn C.igIsMouseDown_ID(button MouseButton, owner_id ID) bool
@[inline]
-pub fn begin_box_select(scope_rect ImRect_c, window &Window, box_select_id ID, ms_flags MultiSelectFlags) bool {
- return C.igBeginBoxSelect(scope_rect, window, box_select_id, ms_flags)
+pub fn is_mouse_down_id(button MouseButton, owner_id ID) bool {
+ return C.igIsMouseDown_ID(button, owner_id)
}
@[keep_args_alive]
-fn C.igEndBoxSelect(scope_rect ImRect_c, ms_flags MultiSelectFlags)
+fn C.igIsMouseClicked_InputFlags(button MouseButton, flags InputFlags, owner_id ID) bool
@[inline]
-pub fn end_box_select(scope_rect ImRect_c, ms_flags MultiSelectFlags) {
- C.igEndBoxSelect(scope_rect, ms_flags)
+pub fn is_mouse_clicked_input_flags(button MouseButton, flags InputFlags, owner_id ID) bool {
+ return C.igIsMouseClicked_InputFlags(button, flags, owner_id)
}
@[keep_args_alive]
-fn C.igMultiSelectItemHeader(id ID, p_selected &bool, p_button_flags &ButtonFlags)
+fn C.igIsMouseReleased_ID(button MouseButton, owner_id ID) bool
@[inline]
-pub fn multi_select_item_header(id ID, p_selected &bool, p_button_flags &ButtonFlags) {
- C.igMultiSelectItemHeader(id, p_selected, p_button_flags)
+pub fn is_mouse_released_id(button MouseButton, owner_id ID) bool {
+ return C.igIsMouseReleased_ID(button, owner_id)
}
@[keep_args_alive]
-fn C.igMultiSelectItemFooter(id ID, p_selected &bool, p_pressed &bool)
+fn C.igIsMouseDoubleClicked_ID(button MouseButton, owner_id ID) bool
@[inline]
-pub fn multi_select_item_footer(id ID, p_selected &bool, p_pressed &bool) {
- C.igMultiSelectItemFooter(id, p_selected, p_pressed)
+pub fn is_mouse_double_clicked_id(button MouseButton, owner_id ID) bool {
+ return C.igIsMouseDoubleClicked_ID(button, owner_id)
}
@[keep_args_alive]
-fn C.igMultiSelectAddSetAll(ms &MultiSelectTempData, selected bool)
+fn C.igShortcut_ID(key_chord KeyChord, flags InputFlags, owner_id ID) bool
@[inline]
-pub fn multi_select_add_set_all(ms &MultiSelectTempData, selected bool) {
- C.igMultiSelectAddSetAll(ms, selected)
+pub fn shortcut_id(key_chord KeyChord, flags InputFlags, owner_id ID) bool {
+ return C.igShortcut_ID(key_chord, flags, owner_id)
}
@[keep_args_alive]
-fn C.igMultiSelectAddSetRange(ms &MultiSelectTempData, selected bool, range_dir i32, first_item SelectionUserData, last_item SelectionUserData)
+fn C.igSetShortcutRouting(key_chord KeyChord, flags InputFlags, owner_id ID) bool
@[inline]
-pub fn multi_select_add_set_range(ms &MultiSelectTempData, selected bool, range_dir i32, first_item SelectionUserData, last_item SelectionUserData) {
- C.igMultiSelectAddSetRange(ms, selected, range_dir, first_item, last_item)
+pub fn set_shortcut_routing(key_chord KeyChord, flags InputFlags, owner_id ID) bool {
+ return C.igSetShortcutRouting(key_chord, flags, owner_id)
}
@[keep_args_alive]
-fn C.igGetBoxSelectState(id ID) &BoxSelectState
+fn C.igTestShortcutRouting(key_chord KeyChord, owner_id ID) bool
@[inline]
-pub fn get_box_select_state(id ID) &BoxSelectState {
- return C.igGetBoxSelectState(id)
+pub fn test_shortcut_routing(key_chord KeyChord, owner_id ID) bool {
+ return C.igTestShortcutRouting(key_chord, owner_id)
}
@[keep_args_alive]
-fn C.igGetMultiSelectState(id ID) &MultiSelectState
+fn C.igGetShortcutRoutingData(key_chord KeyChord) &KeyRoutingData
@[inline]
-pub fn get_multi_select_state(id ID) &MultiSelectState {
- return C.igGetMultiSelectState(id)
+pub fn get_shortcut_routing_data(key_chord KeyChord) &KeyRoutingData {
+ return C.igGetShortcutRoutingData(key_chord)
}
@[keep_args_alive]
-fn C.igSetWindowClipRectBeforeSetChannel(window &Window, clip_rect ImRect_c)
+fn C.igDockContextInitialize(ctx &Context)
@[inline]
-pub fn set_window_clip_rect_before_set_channel(window &Window, clip_rect ImRect_c) {
- C.igSetWindowClipRectBeforeSetChannel(window, clip_rect)
+pub fn dock_context_initialize(ctx &Context) {
+ C.igDockContextInitialize(ctx)
}
@[keep_args_alive]
-fn C.igBeginColumns(const_str_id &char, count i32, flags OldColumnFlags)
+fn C.igDockContextShutdown(ctx &Context)
@[inline]
-pub fn begin_columns(const_str_id &char, count i32, flags OldColumnFlags) {
- C.igBeginColumns(const_str_id, count, flags)
+pub fn dock_context_shutdown(ctx &Context) {
+ C.igDockContextShutdown(ctx)
}
@[keep_args_alive]
-fn C.igEndColumns()
+fn C.igDockContextClearNodes(ctx &Context, root_id ID, clear_settings_refs bool)
@[inline]
-pub fn end_columns() {
- C.igEndColumns()
+pub fn dock_context_clear_nodes(ctx &Context, root_id ID, clear_settings_refs bool) {
+ C.igDockContextClearNodes(ctx, root_id, clear_settings_refs)
}
@[keep_args_alive]
-fn C.igPushColumnClipRect(column_index i32)
+fn C.igDockContextRebuildNodes(ctx &Context)
@[inline]
-pub fn push_column_clip_rect(column_index i32) {
- C.igPushColumnClipRect(column_index)
+pub fn dock_context_rebuild_nodes(ctx &Context) {
+ C.igDockContextRebuildNodes(ctx)
}
@[keep_args_alive]
-fn C.igPushColumnsBackground()
+fn C.igDockContextNewFrameUpdateUndocking(ctx &Context)
@[inline]
-pub fn push_columns_background() {
- C.igPushColumnsBackground()
+pub fn dock_context_new_frame_update_undocking(ctx &Context) {
+ C.igDockContextNewFrameUpdateUndocking(ctx)
}
@[keep_args_alive]
-fn C.igPopColumnsBackground()
+fn C.igDockContextNewFrameUpdateDocking(ctx &Context)
@[inline]
-pub fn pop_columns_background() {
- C.igPopColumnsBackground()
+pub fn dock_context_new_frame_update_docking(ctx &Context) {
+ C.igDockContextNewFrameUpdateDocking(ctx)
}
@[keep_args_alive]
-fn C.igGetColumnsID(const_str_id &char, count i32) ID
+fn C.igDockContextEndFrame(ctx &Context)
@[inline]
-pub fn get_columns_id(const_str_id &char, count i32) ID {
- return C.igGetColumnsID(const_str_id, count)
+pub fn dock_context_end_frame(ctx &Context) {
+ C.igDockContextEndFrame(ctx)
}
@[keep_args_alive]
-fn C.igFindOrCreateColumns(window &Window, id ID) &OldColumns
+fn C.igDockContextGenNodeID(ctx &Context) ID
@[inline]
-pub fn find_or_create_columns(window &Window, id ID) &OldColumns {
- return C.igFindOrCreateColumns(window, id)
+pub fn dock_context_gen_node_id(ctx &Context) ID {
+ return C.igDockContextGenNodeID(ctx)
}
@[keep_args_alive]
-fn C.igGetColumnOffsetFromNorm(columns &OldColumns, offset_norm f32) f32
+fn C.igDockContextQueueDock(ctx &Context, target &Window, target_node &DockNode, payload &Window, split_dir i32, split_ratio f32, split_outer bool)
@[inline]
-pub fn get_column_offset_from_norm(columns &OldColumns, offset_norm f32) f32 {
- return C.igGetColumnOffsetFromNorm(columns, offset_norm)
+pub fn dock_context_queue_dock(ctx &Context, target &Window, target_node &DockNode, payload &Window, split_dir i32, split_ratio f32, split_outer bool) {
+ C.igDockContextQueueDock(ctx, target, target_node, payload, split_dir, split_ratio, split_outer)
}
@[keep_args_alive]
-fn C.igGetColumnNormFromOffset(columns &OldColumns, offset f32) f32
+fn C.igDockContextQueueUndockWindow(ctx &Context, window &Window)
@[inline]
-pub fn get_column_norm_from_offset(columns &OldColumns, offset f32) f32 {
- return C.igGetColumnNormFromOffset(columns, offset)
+pub fn dock_context_queue_undock_window(ctx &Context, window &Window) {
+ C.igDockContextQueueUndockWindow(ctx, window)
}
@[keep_args_alive]
-fn C.igTableOpenContextMenu(column_n i32)
+fn C.igDockContextQueueUndockNode(ctx &Context, node &DockNode)
@[inline]
-pub fn table_open_context_menu(column_n i32) {
- C.igTableOpenContextMenu(column_n)
+pub fn dock_context_queue_undock_node(ctx &Context, node &DockNode) {
+ C.igDockContextQueueUndockNode(ctx, node)
}
@[keep_args_alive]
-fn C.igTableSetColumnWidth(column_n i32, width f32)
+fn C.igDockContextProcessUndockWindow(ctx &Context, window &Window, clear_persistent_docking_ref bool)
@[inline]
-pub fn table_set_column_width(column_n i32, width f32) {
- C.igTableSetColumnWidth(column_n, width)
+pub fn dock_context_process_undock_window(ctx &Context, window &Window, clear_persistent_docking_ref bool) {
+ C.igDockContextProcessUndockWindow(ctx, window, clear_persistent_docking_ref)
}
@[keep_args_alive]
-fn C.igTableSetColumnSortDirection(column_n i32, sort_direction SortDirection, append_to_sort_specs bool)
+fn C.igDockContextProcessUndockNode(ctx &Context, node &DockNode)
@[inline]
-pub fn table_set_column_sort_direction(column_n i32, sort_direction SortDirection, append_to_sort_specs bool) {
- C.igTableSetColumnSortDirection(column_n, sort_direction, append_to_sort_specs)
+pub fn dock_context_process_undock_node(ctx &Context, node &DockNode) {
+ C.igDockContextProcessUndockNode(ctx, node)
}
@[keep_args_alive]
-fn C.igTableGetHoveredRow() i32
+fn C.igDockContextCalcDropPosForDocking(target &Window, target_node &DockNode, payload_window &Window, payload_node &DockNode, split_dir i32, split_outer bool, out_pos &ImVec2_c) bool
@[inline]
-pub fn table_get_hovered_row() i32 {
- return C.igTableGetHoveredRow()
+pub fn dock_context_calc_drop_pos_for_docking(target &Window, target_node &DockNode, payload_window &Window, payload_node &DockNode, split_dir i32, split_outer bool, out_pos &ImVec2_c) bool {
+ return C.igDockContextCalcDropPosForDocking(target, target_node, payload_window, payload_node, split_dir, split_outer, out_pos)
}
@[keep_args_alive]
-fn C.igTableGetHeaderRowHeight() f32
+fn C.igDockContextFindNodeByID(ctx &Context, id ID) &DockNode
@[inline]
-pub fn table_get_header_row_height() f32 {
- return C.igTableGetHeaderRowHeight()
+pub fn dock_context_find_node_by_id(ctx &Context, id ID) &DockNode {
+ return C.igDockContextFindNodeByID(ctx, id)
}
@[keep_args_alive]
-fn C.igTableGetHeaderAngledMaxLabelWidth() f32
+fn C.igDockNodeWindowMenuHandler_Default(ctx &Context, node &DockNode, tab_bar &TabBar)
@[inline]
-pub fn table_get_header_angled_max_label_width() f32 {
- return C.igTableGetHeaderAngledMaxLabelWidth()
+pub fn dock_node_window_menu_handler_default(ctx &Context, node &DockNode, tab_bar &TabBar) {
+ C.igDockNodeWindowMenuHandler_Default(ctx, node, tab_bar)
}
@[keep_args_alive]
-fn C.igTablePushBackgroundChannel()
+fn C.igDockNodeBeginAmendTabBar(node &DockNode) bool
@[inline]
-pub fn table_push_background_channel() {
- C.igTablePushBackgroundChannel()
+pub fn dock_node_begin_amend_tab_bar(node &DockNode) bool {
+ return C.igDockNodeBeginAmendTabBar(node)
}
@[keep_args_alive]
-fn C.igTablePopBackgroundChannel()
+fn C.igDockNodeEndAmendTabBar()
@[inline]
-pub fn table_pop_background_channel() {
- C.igTablePopBackgroundChannel()
+pub fn dock_node_end_amend_tab_bar() {
+ C.igDockNodeEndAmendTabBar()
}
@[keep_args_alive]
-fn C.igTablePushColumnChannel(column_n i32)
+fn C.igDockNodeGetRootNode(node &DockNode) &DockNode
@[inline]
-pub fn table_push_column_channel(column_n i32) {
- C.igTablePushColumnChannel(column_n)
+pub fn dock_node_get_root_node(node &DockNode) &DockNode {
+ return C.igDockNodeGetRootNode(node)
}
@[keep_args_alive]
-fn C.igTablePopColumnChannel()
+fn C.igDockNodeIsInHierarchyOf(node &DockNode, parent &DockNode) bool
@[inline]
-pub fn table_pop_column_channel() {
- C.igTablePopColumnChannel()
+pub fn dock_node_is_in_hierarchy_of(node &DockNode, parent &DockNode) bool {
+ return C.igDockNodeIsInHierarchyOf(node, parent)
}
@[keep_args_alive]
-fn C.igTableAngledHeadersRowEx(row_id ID, angle f32, max_label_width f32, data &TableHeaderData, data_count i32)
+fn C.igDockNodeGetDepth(node &DockNode) i32
@[inline]
-pub fn table_angled_headers_row_ex(row_id ID, angle f32, max_label_width f32, data &TableHeaderData, data_count i32) {
- C.igTableAngledHeadersRowEx(row_id, angle, max_label_width, data, data_count)
+pub fn dock_node_get_depth(node &DockNode) i32 {
+ return C.igDockNodeGetDepth(node)
}
@[keep_args_alive]
-fn C.igGetCurrentTable() &Table
+fn C.igDockNodeGetWindowMenuButtonId(node &DockNode) ID
@[inline]
-pub fn get_current_table() &Table {
- return C.igGetCurrentTable()
+pub fn dock_node_get_window_menu_button_id(node &DockNode) ID {
+ return C.igDockNodeGetWindowMenuButtonId(node)
}
@[keep_args_alive]
-fn C.igTableFindByID(id ID) &Table
+fn C.igGetWindowDockNode() &DockNode
@[inline]
-pub fn table_find_by_id(id ID) &Table {
- return C.igTableFindByID(id)
+pub fn get_window_dock_node() &DockNode {
+ return C.igGetWindowDockNode()
}
@[keep_args_alive]
-fn C.igBeginTableEx(const_name &char, id ID, columns_count i32, flags TableFlags, outer_size ImVec2_c, inner_width f32) bool
+fn C.igGetWindowAlwaysWantOwnTabBar(window &Window) bool
@[inline]
-pub fn begin_table_ex(const_name &char, id ID, columns_count i32, flags TableFlags, outer_size ImVec2_c, inner_width f32) bool {
- return C.igBeginTableEx(const_name, id, columns_count, flags, outer_size, inner_width)
+pub fn get_window_always_want_own_tab_bar(window &Window) bool {
+ return C.igGetWindowAlwaysWantOwnTabBar(window)
}
@[keep_args_alive]
-fn C.igTableBeginInitMemory(table &Table, columns_count i32)
+fn C.igBeginDocked(window &Window, p_open &bool)
@[inline]
-pub fn table_begin_init_memory(table &Table, columns_count i32) {
- C.igTableBeginInitMemory(table, columns_count)
+pub fn begin_docked(window &Window, p_open &bool) {
+ C.igBeginDocked(window, p_open)
}
@[keep_args_alive]
-fn C.igTableBeginApplyRequests(table &Table)
+fn C.igBeginDockableDragDropSource(window &Window)
@[inline]
-pub fn table_begin_apply_requests(table &Table) {
- C.igTableBeginApplyRequests(table)
+pub fn begin_dockable_drag_drop_source(window &Window) {
+ C.igBeginDockableDragDropSource(window)
}
@[keep_args_alive]
-fn C.igTableSetupDrawChannels(table &Table)
+fn C.igBeginDockableDragDropTarget(window &Window)
@[inline]
-pub fn table_setup_draw_channels(table &Table) {
- C.igTableSetupDrawChannels(table)
+pub fn begin_dockable_drag_drop_target(window &Window) {
+ C.igBeginDockableDragDropTarget(window)
}
@[keep_args_alive]
-fn C.igTableUpdateLayout(table &Table)
+fn C.igSetWindowDock(window &Window, dock_id ID, cond Cond)
@[inline]
-pub fn table_update_layout(table &Table) {
- C.igTableUpdateLayout(table)
+pub fn set_window_dock(window &Window, dock_id ID, cond Cond) {
+ C.igSetWindowDock(window, dock_id, cond)
}
@[keep_args_alive]
-fn C.igTableUpdateBorders(table &Table)
+fn C.igDockBuilderDockWindow(window_name &char, node_id ID)
@[inline]
-pub fn table_update_borders(table &Table) {
- C.igTableUpdateBorders(table)
+pub fn dock_builder_dock_window(window_name &char, node_id ID) {
+ C.igDockBuilderDockWindow(window_name, node_id)
}
@[keep_args_alive]
-fn C.igTableUpdateColumnsWeightFromWidth(table &Table)
+fn C.igDockBuilderGetNode(node_id ID) &DockNode
@[inline]
-pub fn table_update_columns_weight_from_width(table &Table) {
- C.igTableUpdateColumnsWeightFromWidth(table)
+pub fn dock_builder_get_node(node_id ID) &DockNode {
+ return C.igDockBuilderGetNode(node_id)
}
@[keep_args_alive]
-fn C.igTableDrawBorders(table &Table)
+fn C.igDockBuilderGetCentralNode(node_id ID) &DockNode
@[inline]
-pub fn table_draw_borders(table &Table) {
- C.igTableDrawBorders(table)
+pub fn dock_builder_get_central_node(node_id ID) &DockNode {
+ return C.igDockBuilderGetCentralNode(node_id)
}
@[keep_args_alive]
-fn C.igTableDrawDefaultContextMenu(table &Table, flags_for_section_to_display TableFlags)
+fn C.igDockBuilderAddNode(node_id ID, flags DockNodeFlags) ID
@[inline]
-pub fn table_draw_default_context_menu(table &Table, flags_for_section_to_display TableFlags) {
- C.igTableDrawDefaultContextMenu(table, flags_for_section_to_display)
+pub fn dock_builder_add_node(node_id ID, flags DockNodeFlags) ID {
+ return C.igDockBuilderAddNode(node_id, flags)
}
@[keep_args_alive]
-fn C.igTableBeginContextMenuPopup(table &Table) bool
+fn C.igDockBuilderRemoveNode(node_id ID)
@[inline]
-pub fn table_begin_context_menu_popup(table &Table) bool {
- return C.igTableBeginContextMenuPopup(table)
+pub fn dock_builder_remove_node(node_id ID) {
+ C.igDockBuilderRemoveNode(node_id)
}
@[keep_args_alive]
-fn C.igTableMergeDrawChannels(table &Table)
+fn C.igDockBuilderRemoveNodeDockedWindows(node_id ID, clear_settings_refs bool)
@[inline]
-pub fn table_merge_draw_channels(table &Table) {
- C.igTableMergeDrawChannels(table)
+pub fn dock_builder_remove_node_docked_windows(node_id ID, clear_settings_refs bool) {
+ C.igDockBuilderRemoveNodeDockedWindows(node_id, clear_settings_refs)
}
@[keep_args_alive]
-fn C.igTableGetInstanceData(table &Table, instance_no i32) &TableInstanceData
+fn C.igDockBuilderRemoveNodeChildNodes(node_id ID)
@[inline]
-pub fn table_get_instance_data(table &Table, instance_no i32) &TableInstanceData {
- return C.igTableGetInstanceData(table, instance_no)
+pub fn dock_builder_remove_node_child_nodes(node_id ID) {
+ C.igDockBuilderRemoveNodeChildNodes(node_id)
}
@[keep_args_alive]
-fn C.igTableGetInstanceID(table &Table, instance_no i32) ID
+fn C.igDockBuilderSetNodePos(node_id ID, pos ImVec2_c)
@[inline]
-pub fn table_get_instance_id(table &Table, instance_no i32) ID {
- return C.igTableGetInstanceID(table, instance_no)
+pub fn dock_builder_set_node_pos(node_id ID, pos ImVec2_c) {
+ C.igDockBuilderSetNodePos(node_id, pos)
}
@[keep_args_alive]
-fn C.igTableFixDisplayOrder(table &Table)
+fn C.igDockBuilderSetNodeSize(node_id ID, size ImVec2_c)
@[inline]
-pub fn table_fix_display_order(table &Table) {
- C.igTableFixDisplayOrder(table)
+pub fn dock_builder_set_node_size(node_id ID, size ImVec2_c) {
+ C.igDockBuilderSetNodeSize(node_id, size)
}
@[keep_args_alive]
-fn C.igTableSortSpecsSanitize(table &Table)
+fn C.igDockBuilderSplitNode(node_id ID, split_dir i32, size_ratio_for_node_at_dir f32, out_id_at_dir &ID, out_id_at_opposite_dir &ID) ID
@[inline]
-pub fn table_sort_specs_sanitize(table &Table) {
- C.igTableSortSpecsSanitize(table)
+pub fn dock_builder_split_node(node_id ID, split_dir i32, size_ratio_for_node_at_dir f32, out_id_at_dir &ID, out_id_at_opposite_dir &ID) ID {
+ return C.igDockBuilderSplitNode(node_id, split_dir, size_ratio_for_node_at_dir, out_id_at_dir, out_id_at_opposite_dir)
}
@[keep_args_alive]
-fn C.igTableSortSpecsBuild(table &Table)
+fn C.igDockBuilderCopyDockSpace(src_dockspace_id ID, dst_dockspace_id ID, in_window_remap_pairs &ImVector_const_charPtr)
@[inline]
-pub fn table_sort_specs_build(table &Table) {
- C.igTableSortSpecsBuild(table)
+pub fn dock_builder_copy_dock_space(src_dockspace_id ID, dst_dockspace_id ID, in_window_remap_pairs &ImVector_const_charPtr) {
+ C.igDockBuilderCopyDockSpace(src_dockspace_id, dst_dockspace_id, in_window_remap_pairs)
}
@[keep_args_alive]
-fn C.igTableGetColumnNextSortDirection(column &TableColumn) SortDirection
+fn C.igDockBuilderCopyNode(src_node_id ID, dst_node_id ID, out_node_remap_pairs &ImVector_ID)
@[inline]
-pub fn table_get_column_next_sort_direction(column &TableColumn) SortDirection {
- return C.igTableGetColumnNextSortDirection(column)
+pub fn dock_builder_copy_node(src_node_id ID, dst_node_id ID, out_node_remap_pairs &ImVector_ID) {
+ C.igDockBuilderCopyNode(src_node_id, dst_node_id, out_node_remap_pairs)
}
@[keep_args_alive]
-fn C.igTableFixColumnSortDirection(table &Table, column &TableColumn)
+fn C.igDockBuilderCopyWindowSettings(src_name &char, dst_name &char)
@[inline]
-pub fn table_fix_column_sort_direction(table &Table, column &TableColumn) {
- C.igTableFixColumnSortDirection(table, column)
+pub fn dock_builder_copy_window_settings(src_name &char, dst_name &char) {
+ C.igDockBuilderCopyWindowSettings(src_name, dst_name)
}
@[keep_args_alive]
-fn C.igTableGetColumnWidthAuto(table &Table, column &TableColumn) f32
+fn C.igDockBuilderFinish(node_id ID)
@[inline]
-pub fn table_get_column_width_auto(table &Table, column &TableColumn) f32 {
- return C.igTableGetColumnWidthAuto(table, column)
+pub fn dock_builder_finish(node_id ID) {
+ C.igDockBuilderFinish(node_id)
}
@[keep_args_alive]
-fn C.igTableBeginRow(table &Table)
+fn C.igPushFocusScope(id ID)
@[inline]
-pub fn table_begin_row(table &Table) {
- C.igTableBeginRow(table)
+pub fn push_focus_scope(id ID) {
+ C.igPushFocusScope(id)
}
@[keep_args_alive]
-fn C.igTableEndRow(table &Table)
+fn C.igPopFocusScope()
@[inline]
-pub fn table_end_row(table &Table) {
- C.igTableEndRow(table)
+pub fn pop_focus_scope() {
+ C.igPopFocusScope()
}
@[keep_args_alive]
-fn C.igTableBeginCell(table &Table, column_n i32)
+fn C.igIsInNavFocusRoute(focus_scope_id ID) bool
@[inline]
-pub fn table_begin_cell(table &Table, column_n i32) {
- C.igTableBeginCell(table, column_n)
+pub fn is_in_nav_focus_route(focus_scope_id ID) bool {
+ return C.igIsInNavFocusRoute(focus_scope_id)
}
@[keep_args_alive]
-fn C.igTableEndCell(table &Table)
+fn C.igGetCurrentFocusScope() ID
@[inline]
-pub fn table_end_cell(table &Table) {
- C.igTableEndCell(table)
+pub fn get_current_focus_scope() ID {
+ return C.igGetCurrentFocusScope()
}
@[keep_args_alive]
-fn C.igTableGetCellBgRect(table &Table, column_n i32) ImRect_c
+fn C.igIsDragDropActive() bool
@[inline]
-pub fn table_get_cell_bg_rect(table &Table, column_n i32) ImRect_c {
- return C.igTableGetCellBgRect(table, column_n)
+pub fn is_drag_drop_active() bool {
+ return C.igIsDragDropActive()
}
@[keep_args_alive]
-fn C.igTableGetColumnName_TablePtr(table &Table, column_n i32) &char
+fn C.igBeginDragDropTargetCustom(bb ImRect_c, id ID) bool
@[inline]
-pub fn table_get_column_name_table_ptr(table &Table, column_n i32) &char {
- return C.igTableGetColumnName_TablePtr(table, column_n)
+pub fn begin_drag_drop_target_custom(bb ImRect_c, id ID) bool {
+ return C.igBeginDragDropTargetCustom(bb, id)
}
@[keep_args_alive]
-fn C.igTableGetColumnResizeID(table &Table, column_n i32, instance_no i32) ID
+fn C.igBeginDragDropTargetViewport(viewport &Viewport, p_bb &ImRect) bool
@[inline]
-pub fn table_get_column_resize_id(table &Table, column_n i32, instance_no i32) ID {
- return C.igTableGetColumnResizeID(table, column_n, instance_no)
+pub fn begin_drag_drop_target_viewport(viewport &Viewport, p_bb &ImRect) bool {
+ return C.igBeginDragDropTargetViewport(viewport, p_bb)
}
@[keep_args_alive]
-fn C.igTableCalcMaxColumnWidth(table &Table, column_n i32) f32
+fn C.igClearDragDrop()
@[inline]
-pub fn table_calc_max_column_width(table &Table, column_n i32) f32 {
- return C.igTableCalcMaxColumnWidth(table, column_n)
+pub fn clear_drag_drop() {
+ C.igClearDragDrop()
}
@[keep_args_alive]
-fn C.igTableSetColumnWidthAutoSingle(table &Table, column_n i32)
+fn C.igIsDragDropPayloadBeingAccepted() bool
@[inline]
-pub fn table_set_column_width_auto_single(table &Table, column_n i32) {
- C.igTableSetColumnWidthAutoSingle(table, column_n)
+pub fn is_drag_drop_payload_being_accepted() bool {
+ return C.igIsDragDropPayloadBeingAccepted()
}
@[keep_args_alive]
-fn C.igTableSetColumnWidthAutoAll(table &Table)
+fn C.igRenderDragDropTargetRectForItem(bb ImRect_c)
@[inline]
-pub fn table_set_column_width_auto_all(table &Table) {
- C.igTableSetColumnWidthAutoAll(table)
+pub fn render_drag_drop_target_rect_for_item(bb ImRect_c) {
+ C.igRenderDragDropTargetRectForItem(bb)
}
@[keep_args_alive]
-fn C.igTableSetColumnDisplayOrder(table &Table, column_n i32, dst_order i32)
+fn C.igRenderDragDropTargetRectEx(draw_list &ImDrawList, bb ImRect_c, rounding f32)
@[inline]
-pub fn table_set_column_display_order(table &Table, column_n i32, dst_order i32) {
- C.igTableSetColumnDisplayOrder(table, column_n, dst_order)
+pub fn render_drag_drop_target_rect_ex(draw_list &ImDrawList, bb ImRect_c, rounding f32) {
+ C.igRenderDragDropTargetRectEx(draw_list, bb, rounding)
}
@[keep_args_alive]
-fn C.igTableQueueSetColumnDisplayOrder(table &Table, column_n i32, dst_order i32)
+fn C.igGetTypingSelectRequest(flags TypingSelectFlags) &TypingSelectRequest
@[inline]
-pub fn table_queue_set_column_display_order(table &Table, column_n i32, dst_order i32) {
- C.igTableQueueSetColumnDisplayOrder(table, column_n, dst_order)
+pub fn get_typing_select_request(flags TypingSelectFlags) &TypingSelectRequest {
+ return C.igGetTypingSelectRequest(flags)
}
@[keep_args_alive]
-fn C.igTableRemove(table &Table)
+fn C.igTypingSelectFindMatch(req &TypingSelectRequest, items_count i32, get_item_name_func fn (voidptr, i32) &char, user_data voidptr, nav_item_idx i32) i32
@[inline]
-pub fn table_remove(table &Table) {
- C.igTableRemove(table)
+pub fn typing_select_find_match(req &TypingSelectRequest, items_count i32, get_item_name_func fn (voidptr, i32) &char, user_data voidptr, nav_item_idx i32) i32 {
+ return C.igTypingSelectFindMatch(req, items_count, get_item_name_func, user_data, nav_item_idx)
}
@[keep_args_alive]
-fn C.igTableGcCompactTransientBuffers_TablePtr(table &Table)
+fn C.igTypingSelectFindNextSingleCharMatch(req &TypingSelectRequest, items_count i32, get_item_name_func fn (voidptr, i32) &char, user_data voidptr, nav_item_idx i32) i32
@[inline]
-pub fn table_gc_compact_transient_buffers_table_ptr(table &Table) {
- C.igTableGcCompactTransientBuffers_TablePtr(table)
+pub fn typing_select_find_next_single_char_match(req &TypingSelectRequest, items_count i32, get_item_name_func fn (voidptr, i32) &char, user_data voidptr, nav_item_idx i32) i32 {
+ return C.igTypingSelectFindNextSingleCharMatch(req, items_count, get_item_name_func, user_data, nav_item_idx)
}
@[keep_args_alive]
-fn C.igTableGcCompactTransientBuffers_TableTempDataPtr(table &TableTempData)
+fn C.igTypingSelectFindBestLeadingMatch(req &TypingSelectRequest, items_count i32, get_item_name_func fn (voidptr, i32) &char, user_data voidptr) i32
@[inline]
-pub fn table_gc_compact_transient_buffers_table_temp_data_ptr(table &TableTempData) {
- C.igTableGcCompactTransientBuffers_TableTempDataPtr(table)
+pub fn typing_select_find_best_leading_match(req &TypingSelectRequest, items_count i32, get_item_name_func fn (voidptr, i32) &char, user_data voidptr) i32 {
+ return C.igTypingSelectFindBestLeadingMatch(req, items_count, get_item_name_func, user_data)
}
@[keep_args_alive]
-fn C.igTableGcCompactSettings()
+fn C.igBeginBoxSelect(scope_rect ImRect_c, window &Window, box_select_id ID, ms_flags MultiSelectFlags) bool
@[inline]
-pub fn table_gc_compact_settings() {
- C.igTableGcCompactSettings()
+pub fn begin_box_select(scope_rect ImRect_c, window &Window, box_select_id ID, ms_flags MultiSelectFlags) bool {
+ return C.igBeginBoxSelect(scope_rect, window, box_select_id, ms_flags)
}
@[keep_args_alive]
-fn C.igTableLoadSettings(table &Table)
+fn C.igEndBoxSelect(scope_rect ImRect_c, ms_flags MultiSelectFlags)
@[inline]
-pub fn table_load_settings(table &Table) {
- C.igTableLoadSettings(table)
+pub fn end_box_select(scope_rect ImRect_c, ms_flags MultiSelectFlags) {
+ C.igEndBoxSelect(scope_rect, ms_flags)
}
@[keep_args_alive]
-fn C.igTableSaveSettings(table &Table)
+fn C.igMultiSelectItemHeader(id ID, p_selected &bool, p_button_flags &ButtonFlags)
@[inline]
-pub fn table_save_settings(table &Table) {
- C.igTableSaveSettings(table)
+pub fn multi_select_item_header(id ID, p_selected &bool, p_button_flags &ButtonFlags) {
+ C.igMultiSelectItemHeader(id, p_selected, p_button_flags)
}
@[keep_args_alive]
-fn C.igTableResetSettings(table &Table)
+fn C.igMultiSelectItemFooter(id ID, p_selected &bool, p_pressed &bool, extra_flags MultiSelectFlags)
@[inline]
-pub fn table_reset_settings(table &Table) {
- C.igTableResetSettings(table)
+pub fn multi_select_item_footer(id ID, p_selected &bool, p_pressed &bool, extra_flags MultiSelectFlags) {
+ C.igMultiSelectItemFooter(id, p_selected, p_pressed, extra_flags)
}
@[keep_args_alive]
-fn C.igTableGetBoundSettings(table &Table) &TableSettings
+fn C.igMultiSelectAddSetAll(ms &MultiSelectTempData, selected bool)
@[inline]
-pub fn table_get_bound_settings(table &Table) &TableSettings {
- return C.igTableGetBoundSettings(table)
+pub fn multi_select_add_set_all(ms &MultiSelectTempData, selected bool) {
+ C.igMultiSelectAddSetAll(ms, selected)
}
@[keep_args_alive]
-fn C.igTableSettingsAddSettingsHandler()
+fn C.igMultiSelectAddSetRange(ms &MultiSelectTempData, selected bool, range_dir i32, first_item SelectionUserData, last_item SelectionUserData)
@[inline]
-pub fn table_settings_add_settings_handler() {
- C.igTableSettingsAddSettingsHandler()
+pub fn multi_select_add_set_range(ms &MultiSelectTempData, selected bool, range_dir i32, first_item SelectionUserData, last_item SelectionUserData) {
+ C.igMultiSelectAddSetRange(ms, selected, range_dir, first_item, last_item)
}
@[keep_args_alive]
-fn C.igTableSettingsCreate(id ID, columns_count i32) &TableSettings
+fn C.igGetBoxSelectState(id ID) &BoxSelectState
@[inline]
-pub fn table_settings_create(id ID, columns_count i32) &TableSettings {
- return C.igTableSettingsCreate(id, columns_count)
+pub fn get_box_select_state(id ID) &BoxSelectState {
+ return C.igGetBoxSelectState(id)
}
@[keep_args_alive]
-fn C.igTableSettingsFindByID(id ID) &TableSettings
+fn C.igGetMultiSelectState(id ID) &MultiSelectState
@[inline]
-pub fn table_settings_find_by_id(id ID) &TableSettings {
- return C.igTableSettingsFindByID(id)
+pub fn get_multi_select_state(id ID) &MultiSelectState {
+ return C.igGetMultiSelectState(id)
}
@[keep_args_alive]
@@ -15979,8 +16346,7 @@ fn C.igTabItemLabelAndCloseButton(draw_list &ImDrawList, bb ImRect_c, flags TabI
@[inline]
pub fn tab_item_label_and_close_button(draw_list &ImDrawList, bb ImRect_c, flags TabItemFlags, frame_padding ImVec2_c, const_label &char, tab_id ID, close_button_id ID, is_contents_visible bool, out_just_closed &bool, out_text_clipped &bool) {
- C.igTabItemLabelAndCloseButton(draw_list, bb, flags, frame_padding, const_label, tab_id,
- close_button_id, is_contents_visible, out_just_closed, out_text_clipped)
+ C.igTabItemLabelAndCloseButton(draw_list, bb, flags, frame_padding, const_label, tab_id, close_button_id, is_contents_visible, out_just_closed, out_text_clipped)
}
@[keep_args_alive]
@@ -16004,8 +16370,7 @@ fn C.igRenderTextClipped(pos_min ImVec2_c, pos_max ImVec2_c, const_text &char, c
@[inline]
pub fn render_text_clipped(pos_min ImVec2_c, pos_max ImVec2_c, const_text &char, const_text_end &char, text_size_if_known &ImVec2_c, align ImVec2_c, clip_rect &ImRect) {
- C.igRenderTextClipped(pos_min, pos_max, const_text, const_text_end, text_size_if_known, align,
- clip_rect)
+ C.igRenderTextClipped(pos_min, pos_max, const_text, const_text_end, text_size_if_known, align, clip_rect)
}
@[keep_args_alive]
@@ -16013,8 +16378,7 @@ fn C.igRenderTextClippedEx(draw_list &ImDrawList, pos_min ImVec2_c, pos_max ImVe
@[inline]
pub fn render_text_clipped_ex(draw_list &ImDrawList, pos_min ImVec2_c, pos_max ImVec2_c, const_text &char, const_text_end &char, text_size_if_known &ImVec2_c, align ImVec2_c, clip_rect &ImRect) {
- C.igRenderTextClippedEx(draw_list, pos_min, pos_max, const_text, const_text_end,
- text_size_if_known, align, clip_rect)
+ C.igRenderTextClippedEx(draw_list, pos_min, pos_max, const_text, const_text_end, text_size_if_known, align, clip_rect)
}
@[keep_args_alive]
@@ -16022,8 +16386,7 @@ fn C.igRenderTextEllipsis(draw_list &ImDrawList, pos_min ImVec2_c, pos_max ImVec
@[inline]
pub fn render_text_ellipsis(draw_list &ImDrawList, pos_min ImVec2_c, pos_max ImVec2_c, ellipsis_max_x f32, const_text &char, const_text_end &char, text_size_if_known &ImVec2_c) {
- C.igRenderTextEllipsis(draw_list, pos_min, pos_max, ellipsis_max_x, const_text, const_text_end,
- text_size_if_known)
+ C.igRenderTextEllipsis(draw_list, pos_min, pos_max, ellipsis_max_x, const_text, const_text_end, text_size_if_known)
}
@[keep_args_alive]
@@ -16055,16 +16418,15 @@ fn C.igRenderColorRectWithAlphaCheckerboard(draw_list &ImDrawList, p_min ImVec2_
@[inline]
pub fn render_color_rect_with_alpha_checkerboard(draw_list &ImDrawList, p_min ImVec2_c, p_max ImVec2_c, fill_col ImU32, grid_step f32, grid_off ImVec2_c, rounding f32, flags ImDrawFlags) {
- C.igRenderColorRectWithAlphaCheckerboard(draw_list, p_min, p_max, fill_col, grid_step,
- grid_off, rounding, flags)
+ C.igRenderColorRectWithAlphaCheckerboard(draw_list, p_min, p_max, fill_col, grid_step, grid_off, rounding, flags)
}
@[keep_args_alive]
-fn C.igRenderNavCursor(bb ImRect_c, id ID, flags NavRenderCursorFlags)
+fn C.igRenderNavCursor(bb ImRect_c, id ID, flags NavRenderCursorFlags, rounding f32)
@[inline]
-pub fn render_nav_cursor(bb ImRect_c, id ID, flags NavRenderCursorFlags) {
- C.igRenderNavCursor(bb, id, flags)
+pub fn render_nav_cursor(bb ImRect_c, id ID, flags NavRenderCursorFlags, rounding f32) {
+ C.igRenderNavCursor(bb, id, flags, rounding)
}
@[keep_args_alive]
@@ -16084,10 +16446,10 @@ pub fn render_mouse_cursor(pos ImVec2_c, scale f32, mouse_cursor MouseCursor, co
}
@[keep_args_alive]
-fn C.igRenderArrow(draw_list &ImDrawList, pos ImVec2_c, col ImU32, dir Dir, scale f32)
+fn C.igRenderArrow(draw_list &ImDrawList, pos ImVec2_c, col ImU32, dir i32, scale f32)
@[inline]
-pub fn render_arrow(draw_list &ImDrawList, pos ImVec2_c, col ImU32, dir Dir, scale f32) {
+pub fn render_arrow(draw_list &ImDrawList, pos ImVec2_c, col ImU32, dir i32, scale f32) {
C.igRenderArrow(draw_list, pos, col, dir, scale)
}
@@ -16108,10 +16470,10 @@ pub fn render_check_mark(draw_list &ImDrawList, pos ImVec2_c, col ImU32, sz f32)
}
@[keep_args_alive]
-fn C.igRenderArrowPointingAt(draw_list &ImDrawList, pos ImVec2_c, half_sz ImVec2_c, direction Dir, col ImU32)
+fn C.igRenderArrowPointingAt(draw_list &ImDrawList, pos ImVec2_c, half_sz ImVec2_c, direction i32, col ImU32)
@[inline]
-pub fn render_arrow_pointing_at(draw_list &ImDrawList, pos ImVec2_c, half_sz ImVec2_c, direction Dir, col ImU32) {
+pub fn render_arrow_pointing_at(draw_list &ImDrawList, pos ImVec2_c, half_sz ImVec2_c, direction i32, col ImU32) {
C.igRenderArrowPointingAt(draw_list, pos, half_sz, direction, col)
}
@@ -16164,10 +16526,10 @@ pub fn text_aligned(align_x f32, size_x f32, const_fmt &char) {
}
@[keep_args_alive]
-fn C.igTextAlignedV(align_x f32, size_x f32, const_fmt &char, args Va_list)
+fn C.igTextAlignedV(align_x f32, size_x f32, const_fmt &char, args C.va_list)
@[inline]
-pub fn text_aligned_v(align_x f32, size_x f32, const_fmt &char, args Va_list) {
+pub fn text_aligned_v(align_x f32, size_x f32, const_fmt &char, args C.va_list) {
C.igTextAlignedV(align_x, size_x, const_fmt, args)
}
@@ -16180,10 +16542,10 @@ pub fn button_ex(const_label &char, size_arg ImVec2_c, flags ButtonFlags) bool {
}
@[keep_args_alive]
-fn C.igArrowButtonEx(const_str_id &char, dir Dir, size_arg ImVec2_c, flags ButtonFlags) bool
+fn C.igArrowButtonEx(const_str_id &char, dir i32, size_arg ImVec2_c, flags ButtonFlags) bool
@[inline]
-pub fn arrow_button_ex(const_str_id &char, dir Dir, size_arg ImVec2_c, flags ButtonFlags) bool {
+pub fn arrow_button_ex(const_str_id &char, dir i32, size_arg ImVec2_c, flags ButtonFlags) bool {
return C.igArrowButtonEx(const_str_id, dir, size_arg, flags)
}
@@ -16244,34 +16606,34 @@ pub fn collapse_button(id ID, pos ImVec2_c, dock_node &DockNode) bool {
}
@[keep_args_alive]
-fn C.igScrollbar(axis Axis)
+fn C.igScrollbar(axis i32)
@[inline]
-pub fn scrollbar(axis Axis) {
+pub fn scrollbar(axis i32) {
C.igScrollbar(axis)
}
@[keep_args_alive]
-fn C.igScrollbarEx(bb ImRect_c, id ID, axis Axis, p_scroll_v &ImS64, avail_v ImS64, contents_v ImS64, draw_rounding_flags ImDrawFlags) bool
+fn C.igScrollbarEx(bb ImRect_c, id ID, axis i32, p_scroll_v &ImS64, avail_v ImS64, contents_v ImS64, draw_rounding_flags ImDrawFlags) bool
@[inline]
-pub fn scrollbar_ex(bb ImRect_c, id ID, axis Axis, p_scroll_v &ImS64, avail_v ImS64, contents_v ImS64, draw_rounding_flags ImDrawFlags) bool {
+pub fn scrollbar_ex(bb ImRect_c, id ID, axis i32, p_scroll_v &ImS64, avail_v ImS64, contents_v ImS64, draw_rounding_flags ImDrawFlags) bool {
return C.igScrollbarEx(bb, id, axis, p_scroll_v, avail_v, contents_v, draw_rounding_flags)
}
@[keep_args_alive]
-fn C.igGetWindowScrollbarRect(window &Window, axis Axis) ImRect_c
+fn C.igGetWindowScrollbarRect(window &Window, axis i32) ImRect_c
@[inline]
-pub fn get_window_scrollbar_rect(window &Window, axis Axis) ImRect_c {
+pub fn get_window_scrollbar_rect(window &Window, axis i32) ImRect_c {
return C.igGetWindowScrollbarRect(window, axis)
}
@[keep_args_alive]
-fn C.igGetWindowScrollbarID(window &Window, axis Axis) ID
+fn C.igGetWindowScrollbarID(window &Window, axis i32) ID
@[inline]
-pub fn get_window_scrollbar_id(window &Window, axis Axis) ID {
+pub fn get_window_scrollbar_id(window &Window, axis i32) ID {
return C.igGetWindowScrollbarID(window, axis)
}
@@ -16284,18 +16646,18 @@ pub fn get_window_resize_corner_id(window &Window, n i32) ID {
}
@[keep_args_alive]
-fn C.igGetWindowResizeBorderID(window &Window, dir Dir) ID
+fn C.igGetWindowResizeBorderID(window &Window, dir i32) ID
@[inline]
-pub fn get_window_resize_border_id(window &Window, dir Dir) ID {
+pub fn get_window_resize_border_id(window &Window, dir i32) ID {
return C.igGetWindowResizeBorderID(window, dir)
}
@[keep_args_alive]
-fn C.igExtendHitBoxWhenNearViewportEdge(window &Window, bb &ImRect, threshold f32, axis Axis)
+fn C.igExtendHitBoxWhenNearViewportEdge(window &Window, bb &ImRect, threshold f32, axis i32)
@[inline]
-pub fn extend_hit_box_when_near_viewport_edge(window &Window, bb &ImRect, threshold f32, axis Axis) {
+pub fn extend_hit_box_when_near_viewport_edge(window &Window, bb &ImRect, threshold f32, axis i32) {
C.igExtendHitBoxWhenNearViewportEdge(window, bb, threshold, axis)
}
@@ -16324,12 +16686,11 @@ pub fn slider_behavior(bb ImRect_c, id ID, data_type DataType, p_v voidptr, p_mi
}
@[keep_args_alive]
-fn C.igSplitterBehavior(bb ImRect_c, id ID, axis Axis, size1 &f32, size2 &f32, min_size1 f32, min_size2 f32, hover_extend f32, hover_visibility_delay f32, bg_col ImU32) bool
+fn C.igSplitterBehavior(bb ImRect_c, id ID, axis i32, size1 &f32, size2 &f32, min_size1 f32, min_size2 f32, hover_extend f32, hover_visibility_delay f32, bg_col ImU32) bool
@[inline]
-pub fn splitter_behavior(bb ImRect_c, id ID, axis Axis, size1 &f32, size2 &f32, min_size1 f32, min_size2 f32, hover_extend f32, hover_visibility_delay f32, bg_col ImU32) bool {
- return C.igSplitterBehavior(bb, id, axis, size1, size2, min_size1, min_size2, hover_extend,
- hover_visibility_delay, bg_col)
+pub fn splitter_behavior(bb ImRect_c, id ID, axis i32, size1 &f32, size2 &f32, min_size1 f32, min_size2 f32, hover_extend f32, hover_visibility_delay f32, bg_col ImU32) bool {
+ return C.igSplitterBehavior(bb, id, axis, size1, size2, min_size1, min_size2, hover_extend, hover_visibility_delay, bg_col)
}
@[keep_args_alive]
@@ -16465,8 +16826,7 @@ fn C.igTempInputScalar(bb ImRect_c, id ID, const_label &char, data_type DataType
@[inline]
pub fn temp_input_scalar(bb ImRect_c, id ID, const_label &char, data_type DataType, p_data voidptr, format &char, p_clamp_min voidptr, p_clamp_max voidptr) bool {
- return C.igTempInputScalar(bb, id, const_label, data_type, p_data, format, p_clamp_min,
- p_clamp_max)
+ return C.igTempInputScalar(bb, id, const_label, data_type, p_data, format, p_clamp_min, p_clamp_max)
}
@[keep_args_alive]
@@ -16534,12 +16894,11 @@ pub fn set_next_item_color_marker(col ImU32) {
}
@[keep_args_alive]
-fn C.igPlotEx(plot_type PlotType, const_label &char, values_getter fn (voidptr, i32) f32, data voidptr, values_count i32, values_offset i32, overlay_text &char, scale_min f32, scale_max f32, size_arg ImVec2_c) i32
+fn C.igPlotEx(plot_type i32, const_label &char, values_getter fn (voidptr, i32) f32, data voidptr, values_count i32, values_offset i32, overlay_text &char, scale_min f32, scale_max f32, size_arg ImVec2_c) i32
@[inline]
-pub fn plot_ex(plot_type PlotType, const_label &char, values_getter fn (voidptr, i32) f32, data voidptr, values_count i32, values_offset i32, overlay_text &char, scale_min f32, scale_max f32, size_arg ImVec2_c) i32 {
- return C.igPlotEx(plot_type, const_label, values_getter, data, values_count, values_offset,
- overlay_text, scale_min, scale_max, size_arg)
+pub fn plot_ex(plot_type i32, const_label &char, values_getter fn (voidptr, i32) f32, data voidptr, values_count i32, values_offset i32, overlay_text &char, scale_min f32, scale_max f32, size_arg ImVec2_c) i32 {
+ return C.igPlotEx(plot_type, const_label, values_getter, data, values_count, values_offset, overlay_text, scale_min, scale_max, size_arg)
}
@[keep_args_alive]
@@ -16547,8 +16906,7 @@ fn C.igShadeVertsLinearColorGradientKeepAlpha(draw_list &ImDrawList, vert_start_
@[inline]
pub fn shade_verts_linear_color_gradient_keep_alpha(draw_list &ImDrawList, vert_start_idx i32, vert_end_idx i32, gradient_p0 ImVec2_c, gradient_p1 ImVec2_c, col0 ImU32, col1 ImU32) {
- C.igShadeVertsLinearColorGradientKeepAlpha(draw_list, vert_start_idx, vert_end_idx,
- gradient_p0, gradient_p1, col0, col1)
+ C.igShadeVertsLinearColorGradientKeepAlpha(draw_list, vert_start_idx, vert_end_idx, gradient_p0, gradient_p1, col0, col1)
}
@[keep_args_alive]
@@ -16564,8 +16922,7 @@ fn C.igShadeVertsTransformPos(draw_list &ImDrawList, vert_start_idx i32, vert_en
@[inline]
pub fn shade_verts_transform_pos(draw_list &ImDrawList, vert_start_idx i32, vert_end_idx i32, pivot_in ImVec2_c, cos_a f32, sin_a f32, pivot_out ImVec2_c) {
- C.igShadeVertsTransformPos(draw_list, vert_start_idx, vert_end_idx, pivot_in, cos_a, sin_a,
- pivot_out)
+ C.igShadeVertsTransformPos(draw_list, vert_start_idx, vert_end_idx, pivot_in, cos_a, sin_a, pivot_out)
}
@[keep_args_alive]
@@ -16764,7 +17121,7 @@ pub fn show_font_atlas(atlas &ImFontAtlas) {
fn C.igDebugTextureIDToU64(tex_id ImTextureID) ImU64
@[inline]
-pub fn debug_texture_idt_o_u64(tex_id ImTextureID) ImU64 {
+pub fn debug_texture_id_to_u64(tex_id ImTextureID) ImU64 {
return C.igDebugTextureIDToU64(tex_id)
}
@@ -16805,8 +17162,7 @@ fn C.igDebugNodeDrawCmdShowMeshAndBoundingBox(out_draw_list &ImDrawList, draw_li
@[inline]
pub fn debug_node_draw_cmd_show_mesh_and_bounding_box(out_draw_list &ImDrawList, draw_list &ImDrawList, draw_cmd &ImDrawCmd, show_mesh bool, show_aabb bool) {
- C.igDebugNodeDrawCmdShowMeshAndBoundingBox(out_draw_list, draw_list, draw_cmd, show_mesh,
- show_aabb)
+ C.igDebugNodeDrawCmdShowMeshAndBoundingBox(out_draw_list, draw_list, draw_cmd, show_mesh, show_aabb)
}
@[keep_args_alive]
@@ -16866,11 +17222,11 @@ pub fn debug_node_table(table &Table) {
}
@[keep_args_alive]
-fn C.igDebugNodeTableSettings(settings &TableSettings)
+fn C.igDebugNodeTableSettings(settings &TableSettings, table &Table)
@[inline]
-pub fn debug_node_table_settings(settings &TableSettings) {
- C.igDebugNodeTableSettings(settings)
+pub fn debug_node_table_settings(settings &TableSettings, table &Table) {
+ C.igDebugNodeTableSettings(settings, table)
}
@[keep_args_alive]
@@ -17290,12 +17646,11 @@ pub fn im_font_atlas_baked_discard_font_glyph(atlas &ImFontAtlas, font &ImFont,
}
@[keep_args_alive]
-fn C.igImFontAtlasBakedSetFontGlyphBitmap(atlas &ImFontAtlas, baked &ImFontBaked, src &ImFontConfig, glyph &ImFontGlyph, r &ImTextureRect, src_pixels &u8, src_fmt ImTextureFormat, src_pitch i32)
+fn C.igImFontAtlasBakedSetFontGlyphBitmap(atlas &ImFontAtlas, baked &ImFontBaked, src &ImFontConfig, glyph &ImFontGlyph, r &ImTextureRect, src_pixels &u8, src_fmt i32, src_pitch i32)
@[inline]
-pub fn im_font_atlas_baked_set_font_glyph_bitmap(atlas &ImFontAtlas, baked &ImFontBaked, src &ImFontConfig, glyph &ImFontGlyph, r &ImTextureRect, src_pixels &u8, src_fmt ImTextureFormat, src_pitch i32) {
- C.igImFontAtlasBakedSetFontGlyphBitmap(atlas, baked, src, glyph, r, src_pixels, src_fmt,
- src_pitch)
+pub fn im_font_atlas_baked_set_font_glyph_bitmap(atlas &ImFontAtlas, baked &ImFontBaked, src &ImFontConfig, glyph &ImFontGlyph, r &ImTextureRect, src_pixels &u8, src_fmt i32, src_pitch i32) {
+ C.igImFontAtlasBakedSetFontGlyphBitmap(atlas, baked, src, glyph, r, src_pixels, src_fmt, src_pitch)
}
@[keep_args_alive]
@@ -17379,12 +17734,11 @@ pub fn im_font_atlas_update_draw_lists_shared_data(atlas &ImFontAtlas) {
}
@[keep_args_alive]
-fn C.igImFontAtlasTextureBlockConvert(src_pixels &u8, src_fmt ImTextureFormat, src_pitch i32, dst_pixels &u8, dst_fmt ImTextureFormat, dst_pitch i32, w i32, h i32)
+fn C.igImFontAtlasTextureBlockConvert(src_pixels &u8, src_fmt i32, src_pitch i32, dst_pixels &u8, dst_fmt i32, dst_pitch i32, w i32, h i32)
@[inline]
-pub fn im_font_atlas_texture_block_convert(src_pixels &u8, src_fmt ImTextureFormat, src_pitch i32, dst_pixels &u8, dst_fmt ImTextureFormat, dst_pitch i32, w i32, h i32) {
- C.igImFontAtlasTextureBlockConvert(src_pixels, src_fmt, src_pitch, dst_pixels, dst_fmt,
- dst_pitch, w, h)
+pub fn im_font_atlas_texture_block_convert(src_pixels &u8, src_fmt i32, src_pitch i32, dst_pixels &u8, dst_fmt i32, dst_pitch i32, w i32, h i32) {
+ C.igImFontAtlasTextureBlockConvert(src_pixels, src_fmt, src_pitch, dst_pixels, dst_fmt, dst_pitch, w, h)
}
@[keep_args_alive]
@@ -17428,26 +17782,42 @@ pub fn im_font_atlas_texture_block_queue_upload(atlas &ImFontAtlas, tex &ImTextu
}
@[keep_args_alive]
-fn C.igImTextureDataGetFormatBytesPerPixel(format ImTextureFormat) i32
+fn C.igImTextureDataUpdateNewFrame(tex &ImTextureData) bool
+
+@[inline]
+pub fn im_texture_data_update_new_frame(tex &ImTextureData) bool {
+ return C.igImTextureDataUpdateNewFrame(tex)
+}
+
+@[keep_args_alive]
+fn C.igImTextureDataQueueUpload(tex &ImTextureData, x i32, y i32, w i32, h i32)
+
+@[inline]
+pub fn im_texture_data_queue_upload(tex &ImTextureData, x i32, y i32, w i32, h i32) {
+ C.igImTextureDataQueueUpload(tex, x, y, w, h)
+}
+
+@[keep_args_alive]
+fn C.igImTextureDataGetFormatBytesPerPixel(format i32) i32
@[inline]
-pub fn im_texture_data_get_format_bytes_per_pixel(format ImTextureFormat) i32 {
+pub fn im_texture_data_get_format_bytes_per_pixel(format i32) i32 {
return C.igImTextureDataGetFormatBytesPerPixel(format)
}
@[keep_args_alive]
-fn C.igImTextureDataGetStatusName(status ImTextureStatus) &char
+fn C.igImTextureDataGetStatusName(status i32) &char
@[inline]
-pub fn im_texture_data_get_status_name(status ImTextureStatus) &char {
+pub fn im_texture_data_get_status_name(status i32) &char {
return C.igImTextureDataGetStatusName(status)
}
@[keep_args_alive]
-fn C.igImTextureDataGetFormatName(format ImTextureFormat) &char
+fn C.igImTextureDataGetFormatName(format i32) &char
@[inline]
-pub fn im_texture_data_get_format_name(format ImTextureFormat) &char {
+pub fn im_texture_data_get_format_name(format i32) &char {
return C.igImTextureDataGetFormatName(format)
}
@@ -17464,8 +17834,7 @@ fn C.igImFontAtlasGetMouseCursorTexData(atlas &ImFontAtlas, cursor_type MouseCur
@[inline]
pub fn im_font_atlas_get_mouse_cursor_tex_data(atlas &ImFontAtlas, cursor_type MouseCursor, out_offset &ImVec2_c, out_size &ImVec2_c, out_uv_border &ImVec2, out_uv_fill &ImVec2) bool {
- return C.igImFontAtlasGetMouseCursorTexData(atlas, cursor_type, out_offset, out_size,
- out_uv_border, out_uv_fill)
+ return C.igImFontAtlasGetMouseCursorTexData(atlas, cursor_type, out_offset, out_size, out_uv_border, out_uv_fill)
}
/////////////////////////hand written functions
diff --git a/impl_vulkan/imgui_impl_vulkan.c.v b/impl_vulkan/imgui_impl_vulkan.c.v
index e8996e8..97f05ae 100644
--- a/impl_vulkan/imgui_impl_vulkan.c.v
+++ b/impl_vulkan/imgui_impl_vulkan.c.v
@@ -5,11 +5,14 @@ import antono2.vulkan as vk
import antono2.imgui
#flag -I @VMODROOT/include/imgui/backends
+
#define IMGUI_DISABLE
+
#define IMGUI_IMPL_VULKAN_USE_VOLK
//#define IMGUI_IMPL_VULKAN_HAS_DYNAMIC_RENDERING
#define IMGUI_IMPL_VULKAN_USE_LOADER
+
#include "imgui_impl_vulkan.h"
pub type PFN_LoaderFunc = fn (function_name &char, user_data voidptr) voidptr
@@ -33,27 +36,31 @@ pub mut:
msaa_samples vk.SampleCountFlagBits
extra_dynamic_states DynamicStateVector
pipeline_rendering_create_info vk.PipelineRenderingCreateInfoKHR
- swap_chain_image_usage vk.ImageUsageFlags
+ // VIMGUI_DOCKING_PIPELINE_BEGIN
+ swap_chain_image_usage vk.ImageUsageFlags
+ // VIMGUI_DOCKING_PIPELINE_END
}
pub struct InitInfo {
pub mut:
- api_version u32
- instance vk.Instance
- physical_device vk.PhysicalDevice
- device vk.Device
- queue_family u32
- queue vk.Queue
- descriptor_pool vk.DescriptorPool
- descriptor_pool_size u32
- min_image_count u32
- image_count u32
- pipeline_cache vk.PipelineCache
- pipeline_info_main PipelineInfo
- pipeline_info_for_viewports PipelineInfo
+ api_version u32
+ instance vk.Instance
+ physical_device vk.PhysicalDevice
+ device vk.Device
+ queue_family u32
+ queue vk.Queue
+ descriptor_pool vk.DescriptorPool
+ descriptor_pool_size u32
+ min_image_count u32
+ image_count u32
+ pipeline_cache vk.PipelineCache
+ pipeline_info_main PipelineInfo
+ // VIMGUI_DOCKING_INIT_BEGIN
+ pipeline_info_for_viewports PipelineInfo
+ // VIMGUI_DOCKING_INIT_END
use_dynamic_rendering bool
allocator &vk.AllocationCallbacks = unsafe { nil }
- check_vk_result_fn PFN_CheckVkResult = unsafe { nil }
+ check_vk_result_fn PFN_CheckVkResult = unsafe { nil }
min_allocation_size vk.DeviceSize
custom_shader_vert_create_info vk.ShaderModuleCreateInfo
custom_shader_frag_create_info vk.ShaderModuleCreateInfo
@@ -194,8 +201,7 @@ pub fn set_min_image_count(min_image_count u32)
pub fn shutdown()
pub fn create_or_resize_window(instance vk.Instance, physical_device vk.PhysicalDevice, device vk.Device, wd &Window, queue_family u32, allocator &vk.AllocationCallbacks, width i32, height i32, min_image_count u32) {
- create_window_swap_chain(physical_device, device, mut wd, allocator, width, height,
- min_image_count)
+ create_window_swap_chain(physical_device, device, mut wd, allocator, width, height, min_image_count)
create_window_command_buffers(physical_device, device, wd, queue_family, allocator)
}
@@ -380,17 +386,16 @@ pub fn create_window_swap_chain(physical_device vk.PhysicalDevice, device vk.Dev
image_view_ci.components.b = vk.ComponentSwizzle.b
image_view_ci.components.a = vk.ComponentSwizzle.a
image_range := vk.ImageSubresourceRange{
- aspectMask: vk.ImageAspectFlags(vk.ImageAspectFlagBits.color)
- baseMipLevel: 0
- levelCount: 1
+ aspectMask: vk.ImageAspectFlags(vk.ImageAspectFlagBits.color)
+ baseMipLevel: 0
+ levelCount: 1
baseArrayLayer: 0
- layerCount: 1
+ layerCount: 1
}
image_view_ci.subresourceRange = image_range
for i in 0 .. wd.image_count {
image_view_ci.image = wd.frames[i].backbuffer
- res = vk.create_image_view(device, &image_view_ci, const_allocator,
- &wd.frames[i].backbuffer_view)
+ res = vk.create_image_view(device, &image_view_ci, const_allocator, &wd.frames[i].backbuffer_view)
assert res == vk.Result.success
}
@@ -406,8 +411,7 @@ pub fn create_window_swap_chain(physical_device vk.PhysicalDevice, device vk.Dev
frame_buffer_ci.layers = 1
for i in 0 .. wd.image_count {
image_view_att = wd.frames[i].backbuffer_view
- res = vk.create_framebuffer(device, &frame_buffer_ci, const_allocator,
- &wd.frames[i].framebuffer)
+ res = vk.create_framebuffer(device, &frame_buffer_ci, const_allocator, &wd.frames[i].framebuffer)
assert res == vk.Result.success
}
}
@@ -421,8 +425,7 @@ pub fn create_window_command_buffers(physical_device vk.PhysicalDevice, device v
mut command_pool_ci := vk.CommandPoolCreateInfo{}
command_pool_ci.flags = 0
command_pool_ci.queueFamilyIndex = queue_family
- res = vk.create_command_pool(device, &command_pool_ci, const_allocator,
- &wd.frames[i].command_pool)
+ res = vk.create_command_pool(device, &command_pool_ci, const_allocator, &wd.frames[i].command_pool)
assert res == vk.Result.success
mut command_buffer_ci := vk.CommandBufferAllocateInfo{}
@@ -440,17 +443,16 @@ pub fn create_window_command_buffers(physical_device vk.PhysicalDevice, device v
for i in 0 .. wd.semaphore_count {
mut semaphore_ci := vk.SemaphoreCreateInfo{}
- res = vk.create_semaphore(device, &semaphore_ci, const_allocator,
- &wd.frame_semaphores[i].image_acquired_semaphore)
+ res = vk.create_semaphore(device, &semaphore_ci, const_allocator, &wd.frame_semaphores[i].image_acquired_semaphore)
assert res == vk.Result.success
- res = vk.create_semaphore(device, &semaphore_ci, const_allocator,
- &wd.frame_semaphores[i].render_complete_semaphore)
+ res = vk.create_semaphore(device, &semaphore_ci, const_allocator, &wd.frame_semaphores[i].render_complete_semaphore)
assert res == vk.Result.success
}
}
pub fn destroy_window(instance vk.Instance, device vk.Device, mut wd Window, const_allocator &vk.AllocationCallbacks) {
vk.device_wait_idle(device)
+
// Could wait on the Queue if we had the queue in wd-> (otherwise VulkanH functions can't use globals)
// vk.queue_wait_idle(wd.queue)
diff --git a/implot/implot.v b/implot/implot.v
index c01c486..7d7d268 100644
--- a/implot/implot.v
+++ b/implot/implot.v
@@ -25,11 +25,11 @@ Covered cases and examples:
Vector fields remain lowercase x/y/z/w for V literals.
5. Remove self-module prefixes: imgui.v must not refer to imgui.Type; implot.v
must not refer to Type, because each file is already inside that module.
-6. STB rectpack names are intentionally preserved from C when c2v produces
- aliases like:
+6. STB rectpack names are intentionally preserved from C when c2v title-cases
+ lower-case C identifiers in aliases like:
example: `pub type Stbrp_node_im = Stbrp_node`
- Normalize the RHS to C.stbrp_node and emit an opaque C.stbrp_node typedef
- generically through C-backed alias handling.
+ Normalize those references to C.stbrp_node/C.stbrp_context_opaque and emit
+ their C-backed declarations with the identifiers used by the headers.
7. Enum aliases are handled dynamically, never by member-name lists. V enums
reject duplicate integer values, while C/C++ enums often define aliases:
any_popup = 1 << 10 | 1 << 11
@@ -67,29 +67,64 @@ SOFTWARE.
*/
-pub const version = '1.92.7'
-pub const version_num = 19270
+pub const version = '1.1 WIP'
+pub const version_num = 10100
-pub type Axis = imgui.Axis
+@[typedef]
+pub struct C.ImBitArray_ImGuiKey_NamedKey_COUNT__lessImGuiKey_NamedKey_BEGIN {}
-pub type ImRect = imgui.ImRect
+@[typedef]
+pub struct C.STB_TexteditState {}
-pub type Point = C.ImPlotPoint_c
+@[typedef]
+pub struct C.stbrp_node {}
-pub type Range = C.ImPlotRange_c
+pub type Va_list = imgui.Va_list
-pub type Rect = C.ImPlotRect_c
+@[typedef]
+pub struct C.DateTimeSpec_c {}
-pub type Spec = C.ImPlotSpec_c
+@[typedef]
+pub struct C.Spec_c {}
-pub type Tick = C.ImPlotTick_c
+// External C type declarations (from headers)
-pub type Time = C.ImPlotTime_c
-pub type Va_list = imgui.Va_list
+pub type DateTimeSpec_c = C.ImPlotDateTimeSpec_c
+@[typedef]
+pub struct C.ImPlotDateTimeSpec_c {}
+
+
+pub type Spec_c = C.ImPlotSpec_c
+@[typedef]
+pub struct C.ImPlotSpec_c {}
+
+pub type ImVec2_c = imgui.ImVec2_c
// docking branch
-pub type ImVector_const_charPtr = imgui.ImVector_const_charPtr
+pub type ImColor = ImColor_c
+
+pub type ImRect = ImRect_c
+
+pub type ImTextureRef = ImTextureRef_c
+
+pub type ImVec2 = imgui.ImVec2_c
+
+pub type ImVec2i = ImVec2i_c
+
+pub type ImVec4 = ImVec4_c
+
+pub type Stbrp_node = imgui.Stbrp_node_im
+
+
+pub type ImVector_const_charPtr = C.ImVector_const_charPtr
+@[typedef]
+pub struct C.ImVector_const_charPtr {
+pub mut:
+ Size i32
+ Capacity i32
+ Data &&u8
+}
pub type ImGuiID = u32
@@ -193,11 +228,9 @@ pub type ImWchar16 = u16
pub type ImGuiSelectionUserData = i64
-pub type ImGuiMemAllocFunc = fn(usize, voidptr) voidptr
+pub type ImGuiMemAllocFunc = fn (usize, voidptr) voidptr
-pub type ImGuiMemFreeFunc = fn(voidptr, voidptr)
-
-pub type ImVec2_c = imgui.ImVec2_c
+pub type ImGuiMemFreeFunc = fn (voidptr, voidptr)
pub type ImVec4_c = imgui.ImVec4_c
@@ -263,6 +296,9 @@ pub enum ImGuiItemFlags_ {
auto_close_popups = 1 << 4
allow_duplicate_id = 1 << 5
disabled = 1 << 6
+ live_edit_on_input_text = 1 << 7
+ live_edit_on_input_scalar = 1 << 8
+ live_edit_on_input = 1 << 7 | 1 << 8
}
@@ -728,6 +764,7 @@ pub enum ImGuiCol_ {
scrollbar_grab_hovered
scrollbar_grab_active
check_mark
+ checkbox_selected_bg
slider_grab
slider_grab_active
button
@@ -811,6 +848,9 @@ pub enum ImGuiStyleVar_ {
table_angled_headers_text_align
tree_lines_size
tree_lines_rounding
+ menu_item_rounding
+ selectable_rounding
+ drag_drop_target_rounding
button_text_align
selectable_text_align
separator_size
@@ -858,14 +898,15 @@ pub enum ImGuiColorEditFlags_ {
float = 1 << 24
picker_hue_bar = 1 << 25
picker_hue_wheel = 1 << 26
- input_rgb = 1 << 27
- input_hsv = 1 << 28
- default_options_ = 1 << 20 | 1 << 23 | 1 << 25 | 1 << 27
+ picker_no_rotate = 1 << 27
+ input_rgb = 1 << 28
+ input_hsv = 1 << 29
+ default_options_ = 1 << 20 | 1 << 23 | 1 << 25 | 1 << 28
alpha_mask_ = 1 << 1 | 1 << 12 | 1 << 13 | 1 << 14
display_mask_ = 1 << 20 | 1 << 21 | 1 << 22
data_type_mask_ = 1 << 23 | 1 << 24
picker_mask_ = 1 << 25 | 1 << 26
- input_mask_ = 1 << 27 | 1 << 28
+ input_mask_ = 1 << 28 | 1 << 29
}
@@ -1012,50 +1053,20 @@ pub enum ImGuiTableBgTarget_ {
cell_bg = 3
}
-pub type ImGuiTableSortSpecs = imgui.TableSortSpecs
-
-pub type ImGuiTableColumnSortSpecs = imgui.TableColumnSortSpecs
-
-pub type ImGuiStyle = imgui.Style
-
-pub type ImGuiKeyData = imgui.KeyData
-
pub type ImVector_ImWchar = imgui.ImVector_ImWchar
-pub type ImGuiIO = imgui.IO
-
-pub type ImGuiInputTextCallbackData = imgui.InputTextCallbackData
-
-pub type ImGuiSizeCallbackData = imgui.SizeCallbackData
-
-pub type ImGuiWindowClass = imgui.WindowClass
-
-pub type ImGuiPayload = imgui.Payload
-
-pub type ImGuiOnceUponAFrame = imgui.OnceUponAFrame
-
-pub type ImGuiTextRange = imgui.TextRange
-
pub type ImVector_ImGuiTextRange = imgui.ImVector_TextRange
pub type ImVector_char = imgui.ImVector_char
-pub type ImGuiTextBuffer = imgui.TextBuffer
-
-pub type ImGuiStoragePair = imgui.StoragePair
-
pub type ImVector_ImGuiStoragePair = imgui.ImVector_StoragePair
-pub type ImGuiStorage = imgui.Storage
-
pub enum ImGuiListClipperFlags_ {
none = 0
no_set_table_row_counters = 1 << 0
}
-pub type ImGuiListClipper = imgui.ListClipper
-
pub type ImColor_c = imgui.ImColor_c
@@ -1080,12 +1091,11 @@ pub enum ImGuiMultiSelectFlags_ {
nav_wrap_x = 1 << 16
no_select_on_right_click = 1 << 17
select_on_mask_ = 1 << 13 | 1 << 14 | 1 << 15
+ checkbox_mode_ = 1 << 20
}
pub type ImVector_ImGuiSelectionRequest = imgui.ImVector_SelectionRequest
-pub type ImGuiMultiSelectIO = imgui.MultiSelectIO
-
pub enum ImGuiSelectionRequestType {
none = 0
@@ -1093,15 +1103,9 @@ pub enum ImGuiSelectionRequestType {
set_range
}
-pub type ImGuiSelectionRequest = imgui.SelectionRequest
-
-pub type ImGuiSelectionBasicStorage = imgui.SelectionBasicStorage
-
-pub type ImGuiSelectionExternalStorage = imgui.SelectionExternalStorage
-
pub type ImDrawIdx = u16
-pub type ImDrawCallback = fn(&imgui.ImDrawList, &imgui.ImDrawCmd)
+pub type ImDrawCallback = fn (&imgui.ImDrawList, &imgui.ImDrawCmd)
pub type ImDrawCmd = imgui.ImDrawCmd
@@ -1122,19 +1126,20 @@ pub type ImDrawListSplitter = imgui.ImDrawListSplitter
pub enum ImDrawFlags_ {
none = 0
- closed = 1 << 0
round_corners_top_left = 1 << 4
round_corners_top_right = 1 << 5
round_corners_bottom_left = 1 << 6
round_corners_bottom_right = 1 << 7
round_corners_none = 1 << 8
+ round_corners_all = 1 << 4 | 1 << 5 | 1 << 6 | 1 << 7
+ //round_corners_default_ = 1 << 4 | 1 << 5 | 1 << 6 | 1 << 7
round_corners_top = 1 << 4 | 1 << 5
round_corners_bottom = 1 << 6 | 1 << 7
round_corners_left = 1 << 4 | 1 << 6
round_corners_right = 1 << 5 | 1 << 7
- round_corners_all = 1 << 4 | 1 << 5 | 1 << 6 | 1 << 7
- //round_corners_default_ = 1 << 4 | 1 << 5 | 1 << 6 | 1 << 7
round_corners_mask_ = 1 << 4 | 1 << 5 | 1 << 6 | 1 << 7 | 1 << 8
+ closed = 1 << 9
+ invalid_mask_ = -2147483633
}
@@ -1144,6 +1149,7 @@ pub enum ImDrawListFlags_ {
anti_aliased_lines_use_tex = 1 << 1
anti_aliased_fill = 1 << 2
allow_vtx_offset = 1 << 3
+ text_no_pixel_snap = 1 << 4
}
pub type ImVector_ImDrawVert = imgui.ImVector_ImDrawVert
@@ -1227,6 +1233,7 @@ pub enum ImFontFlags_ {
no_load_error = 1 << 1
no_load_glyphs = 1 << 2
lock_baked_sizes = 1 << 3
+ implicit_ref_size = 1 << 4
}
pub type ImVector_ImFontConfigPtr = imgui.ImVector_ImFontConfigPtr
@@ -1252,19 +1259,11 @@ pub enum ImGuiViewportFlags_ {
is_focused = 1 << 13
}
-pub type ImGuiViewport = imgui.Viewport
-
pub type ImVector_ImGuiPlatformMonitor = imgui.ImVector_PlatformMonitor
pub type ImVector_ImGuiViewportPtr = imgui.ImVector_ViewportPtr
-pub type ImGuiPlatformIO = imgui.PlatformIO
-
-pub type ImGuiPlatformMonitor = imgui.PlatformMonitor
-
-pub type ImGuiPlatformImeData = imgui.PlatformImeData
-
-pub type ImGuiDataAuthority = i32
+pub type ImGuiDataAuthority = u32
pub type ImGuiLayoutType = i32
@@ -1339,24 +1338,12 @@ pub type ImPoolIdx = i32
pub type ImVector_int = imgui.ImVector_int
-pub type ImGuiTextIndex = imgui.TextIndex
-
pub type ImDrawListSharedData = imgui.ImDrawListSharedData
pub type ImDrawDataBuilder = imgui.ImDrawDataBuilder
pub type ImFontStackData = imgui.ImFontStackData
-pub type ImGuiStyleVarInfo = imgui.StyleVarInfo
-
-pub type ImGuiColorMod = imgui.ColorMod
-
-pub type ImGuiStyleMod = imgui.StyleMod
-
-pub type ImGuiDataTypeStorage = imgui.DataTypeStorage
-
-pub type ImGuiDataTypeInfo = imgui.DataTypeInfo
-
pub enum ImGuiDataTypePrivate_ {
pointer = 12
@@ -1375,7 +1362,7 @@ pub enum ImGuiItemFlagsPrivate_ {
inputable = 1 << 20
has_selection_user_data = 1 << 21
is_multi_select = 1 << 22
- default_ = 1 << 4
+ default_ = 1 << 4 | 1 << 7
}
@@ -1392,6 +1379,7 @@ pub enum ImGuiItemStatusFlags_ {
visible = 1 << 8
has_clip_rect = 1 << 9
has_shortcut = 1 << 10
+ edited_internal = 1 << 11
}
@@ -1516,18 +1504,8 @@ pub enum ImGuiPlotType {
histogram
}
-pub type ImGuiComboPreviewData = imgui.ComboPreviewData
-
-pub type ImGuiGroupData = imgui.GroupData
-
-pub type ImGuiMenuColumns = imgui.MenuColumns
-
-pub type ImGuiInputTextDeactivatedState = imgui.InputTextDeactivatedState
-
pub type ImStbTexteditState = C.STB_TexteditState
-pub type ImGuiInputTextState = imgui.InputTextState
-
pub enum ImGuiWindowRefreshFlags_ {
none = 0
@@ -1561,8 +1539,6 @@ pub enum ImGuiNextWindowDataFlags_ {
has_window_class = 1 << 13
}
-pub type ImGuiNextWindowData = imgui.NextWindowData
-
pub enum ImGuiNextItemDataFlags_ {
none = 0
@@ -1574,22 +1550,6 @@ pub enum ImGuiNextItemDataFlags_ {
has_color_marker = 1 << 5
}
-pub type ImGuiNextItemData = imgui.NextItemData
-
-pub type ImGuiLastItemData = imgui.LastItemData
-
-pub type ImGuiTreeNodeStackData = imgui.TreeNodeStackData
-
-pub type ImGuiErrorRecoveryState = imgui.ErrorRecoveryState
-
-pub type ImGuiWindowStackData = imgui.WindowStackData
-
-pub type ImGuiShrinkWidthItem = imgui.ShrinkWidthItem
-
-pub type ImGuiPtrOrIndex = imgui.PtrOrIndex
-
-pub type ImGuiDeactivatedItemData = imgui.DeactivatedItemData
-
pub enum ImGuiPopupPositionPolicy {
default
@@ -1597,8 +1557,6 @@ pub enum ImGuiPopupPositionPolicy {
tooltip
}
-pub type ImGuiPopupData = imgui.PopupData
-
pub type ImBitArray_ImGuiKey_NamedKey_COUNT__lessImGuiKey_NamedKey_BEGIN = imgui.ImBitArrayForNamedKeys
pub type ImBitArrayForNamedKeys = C.ImBitArray_ImGuiKey_NamedKey_COUNT__lessImGuiKey_NamedKey_BEGIN
@@ -1625,32 +1583,10 @@ pub enum ImGuiInputSource {
count = 4
}
-pub type ImGuiInputEventMousePos = imgui.InputEventMousePos
-
-pub type ImGuiInputEventMouseWheel = imgui.InputEventMouseWheel
-
-pub type ImGuiInputEventMouseButton = imgui.InputEventMouseButton
-
-pub type ImGuiInputEventMouseViewport = imgui.InputEventMouseViewport
-
-pub type ImGuiInputEventKey = imgui.InputEventKey
-
-pub type ImGuiInputEventText = imgui.InputEventText
-
-pub type ImGuiInputEventAppFocused = imgui.InputEventAppFocused
-
-pub type ImGuiInputEvent = imgui.InputEvent
-
pub type ImGuiKeyRoutingIndex = i16
-pub type ImGuiKeyRoutingData = imgui.KeyRoutingData
-
pub type ImVector_ImGuiKeyRoutingData = imgui.ImVector_KeyRoutingData
-pub type ImGuiKeyRoutingTable = imgui.KeyRoutingTable
-
-pub type ImGuiKeyOwnerData = imgui.KeyOwnerData
-
pub enum ImGuiInputFlagsPrivate_ {
repeat_rate_default = 1 << 1
@@ -1679,12 +1615,8 @@ pub enum ImGuiInputFlagsPrivate_ {
supported_by_set_item_key_owner = 1 << 20 | 1 << 21 | 1 << 22 | 1 << 23
}
-pub type ImGuiListClipperRange = imgui.ListClipperRange
-
pub type ImVector_ImGuiListClipperRange = imgui.ImVector_ListClipperRange
-pub type ImGuiListClipperData = imgui.ListClipperData
-
pub enum ImGuiActivateFlags_ {
none = 0
@@ -1715,7 +1647,6 @@ pub enum ImGuiNavRenderCursorFlags_ {
none = 0
compact = 1 << 1
always_draw = 1 << 2
- no_rounding = 1 << 3
}
@@ -1747,10 +1678,6 @@ pub enum ImGuiNavLayer {
count
}
-pub type ImGuiNavItemData = imgui.NavItemData
-
-pub type ImGuiFocusScopeData = imgui.FocusScopeData
-
pub enum ImGuiTypingSelectFlags_ {
none = 0
@@ -1758,10 +1685,6 @@ pub enum ImGuiTypingSelectFlags_ {
allow_single_char_mode = 1 << 1
}
-pub type ImGuiTypingSelectRequest = imgui.TypingSelectRequest
-
-pub type ImGuiTypingSelectState = imgui.TypingSelectState
-
pub enum ImGuiOldColumnFlags_ {
none = 0
@@ -1772,18 +1695,8 @@ pub enum ImGuiOldColumnFlags_ {
grow_parent_contents_size = 1 << 4
}
-pub type ImGuiOldColumnData = imgui.OldColumnData
-
pub type ImVector_ImGuiOldColumnData = imgui.ImVector_OldColumnData
-pub type ImGuiOldColumns = imgui.OldColumns
-
-pub type ImGuiBoxSelectState = imgui.BoxSelectState
-
-pub type ImGuiMultiSelectTempData = imgui.MultiSelectTempData
-
-pub type ImGuiMultiSelectState = imgui.MultiSelectState
-
pub enum ImGuiDockNodeFlagsPrivate_ {
dock_space = 1 << 10
@@ -1823,8 +1736,6 @@ pub enum ImGuiDockNodeState {
pub type ImVector_ImGuiWindowPtr = imgui.ImVector_WindowPtr
-pub type ImGuiDockNode = imgui.DockNode
-
pub enum ImGuiWindowDockStyleCol {
text
@@ -1839,41 +1750,31 @@ pub enum ImGuiWindowDockStyleCol {
count
}
-pub type ImGuiWindowDockStyle = imgui.WindowDockStyle
-
pub type ImVector_ImGuiDockRequest = imgui.ImVector_DockRequest
pub type ImVector_ImGuiDockNodeSettings = imgui.ImVector_DockNodeSettings
-pub type ImGuiDockContext = imgui.DockContext
-
-pub type ImGuiViewportP = imgui.ViewportP
-
-pub type ImGuiWindowSettings = imgui.WindowSettings
-
-pub type ImGuiSettingsHandler = imgui.SettingsHandler
-
pub enum ImGuiLocKey {
version_str = 0
table_size_one = 1
table_size_all_fit = 2
table_size_all_default = 3
- table_reset_order = 4
- windowing_main_menu_bar = 5
- windowing_popup = 6
- windowing_untitled = 7
- open_link_s = 8
- copy_link = 9
- docking_hide_tab_bar = 10
- docking_hold_shift_to_dock = 11
- docking_drag_to_undock_or_move_node = 12
- count = 13
+ table_reset = 4
+ table_reset_order = 5
+ table_reset_visibility = 6
+ windowing_main_menu_bar = 7
+ windowing_popup = 8
+ windowing_untitled = 9
+ open_link_s = 10
+ copy_link = 11
+ docking_hide_tab_bar = 12
+ docking_hold_shift_to_dock = 13
+ docking_drag_to_undock_or_move_node = 14
+ count = 15
}
-pub type ImGuiLocEntry = imgui.LocEntry
-
-pub type ImGuiErrorCallback = fn(&imgui.Context, voidptr, &char)
+pub type ImGuiErrorCallback = fn (&imgui.Context, voidptr, &char)
pub enum ImGuiDebugLogFlags_ {
@@ -1890,27 +1791,16 @@ pub enum ImGuiDebugLogFlags_ {
event_input_routing = 1 << 9
event_docking = 1 << 10
event_viewport = 1 << 11
- event_mask_ = 1 << 0 | 1 << 1 | 1 << 2 | 1 << 3 | 1 << 4 | 1 << 5 | 1 << 6 | 1 << 7 | 1 << 8 | 1 << 9 | 1 << 10 | 1 << 11
+ event_table = 1 << 12
+ event_mask_ = 1 << 0 | 1 << 1 | 1 << 2 | 1 << 3 | 1 << 4 | 1 << 5 | 1 << 6 | 1 << 7 | 1 << 8 | 1 << 9 | 1 << 10 | 1 << 11 | 1 << 12
output_to_tty = 1 << 20
output_to_debugger = 1 << 21
output_to_test_engine = 1 << 22
}
-pub type ImGuiDebugAllocEntry = imgui.DebugAllocEntry
-
-pub type ImGuiDebugAllocInfo = imgui.DebugAllocInfo
-
-pub type ImGuiMetricsConfig = imgui.MetricsConfig
-
-pub type ImGuiStackLevelInfo = imgui.StackLevelInfo
-
pub type ImVector_ImGuiStackLevelInfo = imgui.ImVector_StackLevelInfo
-pub type ImGuiDebugItemPathQuery = imgui.DebugItemPathQuery
-
-pub type ImGuiIDStackTool = imgui.IDStackTool
-
-pub type ImGuiContextHookCallback = fn(&imgui.Context, &imgui.ContextHook)
+pub type ImGuiContextHookCallback = fn (&imgui.Context, &imgui.ContextHook)
pub enum ImGuiContextHookType {
@@ -1924,9 +1814,7 @@ pub enum ImGuiContextHookType {
pending_removal_
}
-pub type ImGuiContextHook = imgui.ContextHook
-
-pub type ImGuiDemoMarkerCallback = fn(&char, i32, &char)
+pub type ImGuiDemoMarkerCallback = fn (&char, i32, &char)
pub type ImVector_ImFontAtlasPtr = imgui.ImVector_ImFontAtlasPtr
@@ -1986,14 +1874,8 @@ pub type ImChunkStream_ImGuiTableSettings = imgui.ImChunkStream_TableSettings
pub type ImVector_ImGuiContextHook = imgui.ImVector_ContextHook
-pub type ImGuiContext = imgui.Context
-
-pub type ImGuiWindowTempData = imgui.WindowTempData
-
pub type ImVector_ImGuiOldColumns = imgui.ImVector_OldColumns
-pub type ImGuiWindow = imgui.Window
-
pub enum ImGuiTabBarFlagsPrivate_ {
dock_node = 1 << 20
@@ -2010,20 +1892,8 @@ pub enum ImGuiTabItemFlagsPrivate_ {
unsorted = 1 << 23
}
-pub type ImGuiTabItem = imgui.TabItem
-
pub type ImVector_ImGuiTabItem = imgui.ImVector_TabItem
-pub type ImGuiTabBar = imgui.TabBar
-
-pub type ImGuiTableColumn = imgui.TableColumn
-
-pub type ImGuiTableCellData = imgui.TableCellData
-
-pub type ImGuiTableHeaderData = imgui.TableHeaderData
-
-pub type ImGuiTableInstanceData = imgui.TableInstanceData
-
pub type ImSpan_ImGuiTableColumn = imgui.ImSpan_TableColumn
pub type ImSpan_ImGuiTableColumnIdx = imgui.ImSpan_TableColumnIdx
@@ -2034,15 +1904,9 @@ pub type ImVector_ImGuiTableInstanceData = imgui.ImVector_TableInstanceData
pub type ImVector_ImGuiTableColumnSortSpecs = imgui.ImVector_TableColumnSortSpecs
-pub type ImGuiTable = imgui.Table
-
pub type ImVector_ImGuiTableHeaderData = imgui.ImVector_TableHeaderData
-pub type ImGuiTableTempData = imgui.TableTempData
-
-pub type ImGuiTableColumnSettings = imgui.TableColumnSettings
-
-pub type ImGuiTableSettings = imgui.TableSettings
+pub type ImVector_ImGuiTableReconcileColumnData = imgui.ImVector_TableReconcileColumnData
pub type ImFontLoader = imgui.ImFontLoader
@@ -2062,141 +1926,2293 @@ pub type ImVector_ImFontBakedPtr = imgui.ImVector_ImFontBakedPtr
pub type ImStableVector_ImFontBaked__32 = imgui.ImStableVector_ImFontBaked__32
-pub type ImTextureRef = imgui.ImTextureRef
+pub type ImFontAtlasBuilder = imgui.ImFontAtlasBuilder
-/////////////////////////hand written functions
-// no appendfV
-// for getting FLT_MAX in bindings
-// for getting FLT_MIN in bindings
-// CIMGUI_INCLUDED
+pub type StbUndoRecord = imgui.StbUndoRecord
+pub type StbUndoState = imgui.StbUndoState
-pub type ImVector_ImS16 = C.ImVector_ImS16
-@[typedef]
-pub struct C.ImVector_ImS16 {
-pub mut:
- Size i32
- Capacity i32
- Data &i16
-}
+pub type STB_TexteditState = imgui.STB_TexteditState
+pub type StbTexteditRow = imgui.StbTexteditRow
-pub type ImVector_ImS32 = C.ImVector_ImS32
-@[typedef]
-pub struct C.ImVector_ImS32 {
-pub mut:
- Size i32
- Capacity i32
- Data &i32
+
+@[keep_args_alive]
+fn C.ImVec2_ImVec2_Nil() &imgui.ImVec2
+
+@[inline]
+pub fn im_vec2_im_vec2_nil() &imgui.ImVec2 {
+ return C.ImVec2_ImVec2_Nil()
}
-pub type ImVector_ImS64 = C.ImVector_ImS64
-@[typedef]
-pub struct C.ImVector_ImS64 {
-pub mut:
- Size i32
- Capacity i32
- Data &i64
+@[keep_args_alive]
+fn C.ImVec2_destroy(self &imgui.ImVec2)
+
+@[inline]
+pub fn im_vec2_destroy(self &imgui.ImVec2) {
+ C.ImVec2_destroy(self)
}
-pub type ImVector_ImS8 = C.ImVector_ImS8
-@[typedef]
-pub struct C.ImVector_ImS8 {
-pub mut:
- Size i32
- Capacity i32
- Data &char
+@[keep_args_alive]
+fn C.ImVec2_ImVec2_Float(_x f32, _y f32) &imgui.ImVec2
+
+@[inline]
+pub fn im_vec2_im_vec2_float(_x f32, _y f32) &imgui.ImVec2 {
+ return C.ImVec2_ImVec2_Float(_x, _y)
}
-pub type ImVector_ImU64 = C.ImVector_ImU64
-@[typedef]
-pub struct C.ImVector_ImU64 {
-pub mut:
- Size i32
- Capacity i32
- Data &u64
+@[keep_args_alive]
+fn C.ImVec4_ImVec4_Nil() &imgui.ImVec4
+
+@[inline]
+pub fn im_vec4_im_vec4_nil() &imgui.ImVec4 {
+ return C.ImVec4_ImVec4_Nil()
}
-pub const implot_auto = -1
-pub type ImAxis = i32
+@[keep_args_alive]
+fn C.ImVec4_destroy(self &imgui.ImVec4)
-pub type Prop = i32
+@[inline]
+pub fn im_vec4_destroy(self &imgui.ImVec4) {
+ C.ImVec4_destroy(self)
+}
-pub type Flags = i32
-pub type AxisFlags = i32
+@[keep_args_alive]
+fn C.ImVec4_ImVec4_Float(_x f32, _y f32, _z f32, _w f32) &imgui.ImVec4
-pub type SubplotFlags = i32
+@[inline]
+pub fn im_vec4_im_vec4_float(_x f32, _y f32, _z f32, _w f32) &imgui.ImVec4 {
+ return C.ImVec4_ImVec4_Float(_x, _y, _z, _w)
+}
-pub type LegendFlags = i32
-pub type MouseTextFlags = i32
+@[keep_args_alive]
+fn C.ImTextureRef_ImTextureRef_Nil() &ImTextureRef
-pub type DragToolFlags = i32
+@[inline]
+pub fn im_texture_ref_im_texture_ref_nil() &ImTextureRef {
+ return C.ImTextureRef_ImTextureRef_Nil()
+}
-pub type ColormapScaleFlags = i32
-pub type ItemFlags = i32
+@[keep_args_alive]
+fn C.ImTextureRef_destroy(self &ImTextureRef)
-pub type LineFlags = i32
+@[inline]
+pub fn im_texture_ref_destroy(self &ImTextureRef) {
+ C.ImTextureRef_destroy(self)
+}
-pub type ScatterFlags = i32
-pub type BubblesFlags = i32
+@[keep_args_alive]
+fn C.ImTextureRef_ImTextureRef_TextureID(tex_id imgui.ImTextureID) &ImTextureRef
-pub type PolygonFlags = i32
+@[inline]
+pub fn im_texture_ref_im_texture_ref_texture_id(tex_id imgui.ImTextureID) &ImTextureRef {
+ return C.ImTextureRef_ImTextureRef_TextureID(tex_id)
+}
-pub type StairsFlags = i32
-pub type ShadedFlags = i32
+@[keep_args_alive]
+fn C.ImTextureRef_GetTexID(self &ImTextureRef) imgui.ImTextureID
-pub type BarsFlags = i32
+@[inline]
+pub fn im_texture_ref_get_tex_id(self &ImTextureRef) imgui.ImTextureID {
+ return C.ImTextureRef_GetTexID(self)
+}
-pub type BarGroupsFlags = i32
-pub type ErrorBarsFlags = i32
+@[keep_args_alive]
+fn C.ImColor_ImColor_Nil() &ImColor
-pub type StemsFlags = i32
+@[inline]
+pub fn im_color_im_color_nil() &ImColor {
+ return C.ImColor_ImColor_Nil()
+}
-pub type InfLinesFlags = i32
-pub type PieChartFlags = i32
+@[keep_args_alive]
+fn C.ImColor_destroy(self &ImColor)
-pub type HeatmapFlags = i32
+@[inline]
+pub fn im_color_destroy(self &ImColor) {
+ C.ImColor_destroy(self)
+}
-pub type HistogramFlags = i32
-pub type DigitalFlags = i32
+@[keep_args_alive]
+fn C.ImColor_ImColor_Float(r f32, g f32, b f32, a f32) &ImColor
-pub type ImageFlags = i32
+@[inline]
+pub fn im_color_im_color_float(r f32, g f32, b f32, a f32) &ImColor {
+ return C.ImColor_ImColor_Float(r, g, b, a)
+}
-pub type TextFlags = i32
-pub type DummyFlags = i32
+@[keep_args_alive]
+fn C.ImColor_ImColor_Vec4(col ImVec4_c) &ImColor
-pub type Cond = i32
+@[inline]
+pub fn im_color_im_color_vec4(col ImVec4_c) &ImColor {
+ return C.ImColor_ImColor_Vec4(col)
+}
-pub type Col = i32
-pub type StyleVar = i32
+@[keep_args_alive]
+fn C.ImColor_ImColor_Int(r i32, g i32, b i32, a i32) &ImColor
-pub type Scale = i32
+@[inline]
+pub fn im_color_im_color_int(r i32, g i32, b i32, a i32) &ImColor {
+ return C.ImColor_ImColor_Int(r, g, b, a)
+}
-pub type Marker = i32
-pub type Colormap = i32
+@[keep_args_alive]
+fn C.ImColor_ImColor_U32(rgba u32) &ImColor
-pub type Location = i32
+@[inline]
+pub fn im_color_im_color_u32(rgba u32) &ImColor {
+ return C.ImColor_ImColor_U32(rgba)
+}
-pub type Bin = i32
+@[keep_args_alive]
+fn C.ImColor_SetHSV(self &ImColor, h f32, s f32, v f32, a f32)
-pub enum ImAxis_ {
- x1 = 0
+@[inline]
+pub fn im_color_set_hsv(self &ImColor, h f32, s f32, v f32, a f32) {
+ C.ImColor_SetHSV(self, h, s, v, a)
+}
+
+
+@[keep_args_alive]
+fn C.ImColor_HSV(h f32, s f32, v f32, a f32) ImColor_c
+
+@[inline]
+pub fn im_color_hsv(h f32, s f32, v f32, a f32) ImColor_c {
+ return C.ImColor_HSV(h, s, v, a)
+}
+
+
+@[keep_args_alive]
+fn C.ImDrawCmd_ImDrawCmd() &imgui.ImDrawCmd
+
+@[inline]
+pub fn im_draw_cmd_im_draw_cmd() &imgui.ImDrawCmd {
+ return C.ImDrawCmd_ImDrawCmd()
+}
+
+
+@[keep_args_alive]
+fn C.ImDrawCmd_destroy(self &imgui.ImDrawCmd)
+
+@[inline]
+pub fn im_draw_cmd_destroy(self &imgui.ImDrawCmd) {
+ C.ImDrawCmd_destroy(self)
+}
+
+
+@[keep_args_alive]
+fn C.ImDrawCmd_GetTexID(self &imgui.ImDrawCmd) imgui.ImTextureID
+
+@[inline]
+pub fn im_draw_cmd_get_tex_id(self &imgui.ImDrawCmd) imgui.ImTextureID {
+ return C.ImDrawCmd_GetTexID(self)
+}
+
+
+@[keep_args_alive]
+fn C.ImDrawListSplitter_ImDrawListSplitter() &imgui.ImDrawListSplitter
+
+@[inline]
+pub fn im_draw_list_splitter_im_draw_list_splitter() &imgui.ImDrawListSplitter {
+ return C.ImDrawListSplitter_ImDrawListSplitter()
+}
+
+
+@[keep_args_alive]
+fn C.ImDrawListSplitter_destroy(self &imgui.ImDrawListSplitter)
+
+@[inline]
+pub fn im_draw_list_splitter_destroy(self &imgui.ImDrawListSplitter) {
+ C.ImDrawListSplitter_destroy(self)
+}
+
+
+@[keep_args_alive]
+fn C.ImDrawListSplitter_Clear(self &imgui.ImDrawListSplitter)
+
+@[inline]
+pub fn im_draw_list_splitter_clear(self &imgui.ImDrawListSplitter) {
+ C.ImDrawListSplitter_Clear(self)
+}
+
+
+@[keep_args_alive]
+fn C.ImDrawListSplitter_ClearFreeMemory(self &imgui.ImDrawListSplitter)
+
+@[inline]
+pub fn im_draw_list_splitter_clear_free_memory(self &imgui.ImDrawListSplitter) {
+ C.ImDrawListSplitter_ClearFreeMemory(self)
+}
+
+
+@[keep_args_alive]
+fn C.ImDrawListSplitter_Split(self &imgui.ImDrawListSplitter, draw_list &imgui.ImDrawList, count i32)
+
+@[inline]
+pub fn im_draw_list_splitter_split(self &imgui.ImDrawListSplitter, draw_list &imgui.ImDrawList, count i32) {
+ C.ImDrawListSplitter_Split(self, draw_list, count)
+}
+
+
+@[keep_args_alive]
+fn C.ImDrawListSplitter_Merge(self &imgui.ImDrawListSplitter, draw_list &imgui.ImDrawList)
+
+@[inline]
+pub fn im_draw_list_splitter_merge(self &imgui.ImDrawListSplitter, draw_list &imgui.ImDrawList) {
+ C.ImDrawListSplitter_Merge(self, draw_list)
+}
+
+
+@[keep_args_alive]
+fn C.ImDrawListSplitter_SetCurrentChannel(self &imgui.ImDrawListSplitter, draw_list &imgui.ImDrawList, channel_idx i32)
+
+@[inline]
+pub fn im_draw_list_splitter_set_current_channel(self &imgui.ImDrawListSplitter, draw_list &imgui.ImDrawList, channel_idx i32) {
+ C.ImDrawListSplitter_SetCurrentChannel(self, draw_list, channel_idx)
+}
+
+
+@[keep_args_alive]
+fn C.ImDrawList_ImDrawList(shared_data &imgui.ImDrawListSharedData) &imgui.ImDrawList
+
+@[inline]
+pub fn im_draw_list_im_draw_list(shared_data &imgui.ImDrawListSharedData) &imgui.ImDrawList {
+ return C.ImDrawList_ImDrawList(shared_data)
+}
+
+
+@[keep_args_alive]
+fn C.ImDrawList_destroy(self &imgui.ImDrawList)
+
+@[inline]
+pub fn im_draw_list_destroy(self &imgui.ImDrawList) {
+ C.ImDrawList_destroy(self)
+}
+
+
+@[keep_args_alive]
+fn C.ImDrawList_PushClipRect(self &imgui.ImDrawList, clip_rect_min ImVec2_c, clip_rect_max ImVec2_c, intersect_with_current_clip_rect bool)
+
+@[inline]
+pub fn im_draw_list_push_clip_rect(self &imgui.ImDrawList, clip_rect_min ImVec2_c, clip_rect_max ImVec2_c, intersect_with_current_clip_rect bool) {
+ C.ImDrawList_PushClipRect(self, clip_rect_min, clip_rect_max, intersect_with_current_clip_rect)
+}
+
+
+@[keep_args_alive]
+fn C.ImDrawList_PushClipRectFullScreen(self &imgui.ImDrawList)
+
+@[inline]
+pub fn im_draw_list_push_clip_rect_full_screen(self &imgui.ImDrawList) {
+ C.ImDrawList_PushClipRectFullScreen(self)
+}
+
+
+@[keep_args_alive]
+fn C.ImDrawList_PopClipRect(self &imgui.ImDrawList)
+
+@[inline]
+pub fn im_draw_list_pop_clip_rect(self &imgui.ImDrawList) {
+ C.ImDrawList_PopClipRect(self)
+}
+
+
+@[keep_args_alive]
+fn C.ImDrawList_PushTexture(self &imgui.ImDrawList, tex_ref ImTextureRef_c)
+
+@[inline]
+pub fn im_draw_list_push_texture(self &imgui.ImDrawList, tex_ref ImTextureRef_c) {
+ C.ImDrawList_PushTexture(self, tex_ref)
+}
+
+
+@[keep_args_alive]
+fn C.ImDrawList_PopTexture(self &imgui.ImDrawList)
+
+@[inline]
+pub fn im_draw_list_pop_texture(self &imgui.ImDrawList) {
+ C.ImDrawList_PopTexture(self)
+}
+
+
+@[keep_args_alive]
+fn C.ImDrawList_GetClipRectMin(self &imgui.ImDrawList) ImVec2_c
+
+@[inline]
+pub fn im_draw_list_get_clip_rect_min(self &imgui.ImDrawList) ImVec2_c {
+ return C.ImDrawList_GetClipRectMin(self)
+}
+
+
+@[keep_args_alive]
+fn C.ImDrawList_GetClipRectMax(self &imgui.ImDrawList) ImVec2_c
+
+@[inline]
+pub fn im_draw_list_get_clip_rect_max(self &imgui.ImDrawList) ImVec2_c {
+ return C.ImDrawList_GetClipRectMax(self)
+}
+
+
+@[keep_args_alive]
+fn C.ImDrawList_AddLine(self &imgui.ImDrawList, p1 ImVec2_c, p2 ImVec2_c, col u32, thickness f32)
+
+@[inline]
+pub fn im_draw_list_add_line(self &imgui.ImDrawList, p1 ImVec2_c, p2 ImVec2_c, col u32, thickness f32) {
+ C.ImDrawList_AddLine(self, p1, p2, col, thickness)
+}
+
+
+@[keep_args_alive]
+fn C.ImDrawList_AddLineH(self &imgui.ImDrawList, min_x f32, max_x f32, y f32, col u32, thickness f32)
+
+@[inline]
+pub fn im_draw_list_add_line_h(self &imgui.ImDrawList, min_x f32, max_x f32, y f32, col u32, thickness f32) {
+ C.ImDrawList_AddLineH(self, min_x, max_x, y, col, thickness)
+}
+
+
+@[keep_args_alive]
+fn C.ImDrawList_AddLineV(self &imgui.ImDrawList, x f32, min_y f32, max_y f32, col u32, thickness f32)
+
+@[inline]
+pub fn im_draw_list_add_line_v(self &imgui.ImDrawList, x f32, min_y f32, max_y f32, col u32, thickness f32) {
+ C.ImDrawList_AddLineV(self, x, min_y, max_y, col, thickness)
+}
+
+
+@[keep_args_alive]
+fn C.ImDrawList_AddRect(self &imgui.ImDrawList, p_min ImVec2_c, p_max ImVec2_c, col u32, rounding f32, thickness f32, flags imgui.ImDrawFlags)
+
+@[inline]
+pub fn im_draw_list_add_rect(self &imgui.ImDrawList, p_min ImVec2_c, p_max ImVec2_c, col u32, rounding f32, thickness f32, flags imgui.ImDrawFlags) {
+ C.ImDrawList_AddRect(self, p_min, p_max, col, rounding, thickness, flags)
+}
+
+
+@[keep_args_alive]
+fn C.ImDrawList_AddRectFilled(self &imgui.ImDrawList, p_min ImVec2_c, p_max ImVec2_c, col u32, rounding f32, flags imgui.ImDrawFlags)
+
+@[inline]
+pub fn im_draw_list_add_rect_filled(self &imgui.ImDrawList, p_min ImVec2_c, p_max ImVec2_c, col u32, rounding f32, flags imgui.ImDrawFlags) {
+ C.ImDrawList_AddRectFilled(self, p_min, p_max, col, rounding, flags)
+}
+
+
+@[keep_args_alive]
+fn C.ImDrawList_AddRectFilledMultiColor(self &imgui.ImDrawList, p_min ImVec2_c, p_max ImVec2_c, col_upr_left u32, col_upr_right u32, col_bot_right u32, col_bot_left u32)
+
+@[inline]
+pub fn im_draw_list_add_rect_filled_multi_color(self &imgui.ImDrawList, p_min ImVec2_c, p_max ImVec2_c, col_upr_left u32, col_upr_right u32, col_bot_right u32, col_bot_left u32) {
+ C.ImDrawList_AddRectFilledMultiColor(self, p_min, p_max, col_upr_left, col_upr_right, col_bot_right, col_bot_left)
+}
+
+
+@[keep_args_alive]
+fn C.ImDrawList_AddQuad(self &imgui.ImDrawList, p1 ImVec2_c, p2 ImVec2_c, p3 ImVec2_c, p4 ImVec2_c, col u32, thickness f32)
+
+@[inline]
+pub fn im_draw_list_add_quad(self &imgui.ImDrawList, p1 ImVec2_c, p2 ImVec2_c, p3 ImVec2_c, p4 ImVec2_c, col u32, thickness f32) {
+ C.ImDrawList_AddQuad(self, p1, p2, p3, p4, col, thickness)
+}
+
+
+@[keep_args_alive]
+fn C.ImDrawList_AddQuadFilled(self &imgui.ImDrawList, p1 ImVec2_c, p2 ImVec2_c, p3 ImVec2_c, p4 ImVec2_c, col u32)
+
+@[inline]
+pub fn im_draw_list_add_quad_filled(self &imgui.ImDrawList, p1 ImVec2_c, p2 ImVec2_c, p3 ImVec2_c, p4 ImVec2_c, col u32) {
+ C.ImDrawList_AddQuadFilled(self, p1, p2, p3, p4, col)
+}
+
+
+@[keep_args_alive]
+fn C.ImDrawList_AddTriangle(self &imgui.ImDrawList, p1 ImVec2_c, p2 ImVec2_c, p3 ImVec2_c, col u32, thickness f32)
+
+@[inline]
+pub fn im_draw_list_add_triangle(self &imgui.ImDrawList, p1 ImVec2_c, p2 ImVec2_c, p3 ImVec2_c, col u32, thickness f32) {
+ C.ImDrawList_AddTriangle(self, p1, p2, p3, col, thickness)
+}
+
+
+@[keep_args_alive]
+fn C.ImDrawList_AddTriangleFilled(self &imgui.ImDrawList, p1 ImVec2_c, p2 ImVec2_c, p3 ImVec2_c, col u32)
+
+@[inline]
+pub fn im_draw_list_add_triangle_filled(self &imgui.ImDrawList, p1 ImVec2_c, p2 ImVec2_c, p3 ImVec2_c, col u32) {
+ C.ImDrawList_AddTriangleFilled(self, p1, p2, p3, col)
+}
+
+
+@[keep_args_alive]
+fn C.ImDrawList_AddCircle(self &imgui.ImDrawList, center ImVec2_c, radius f32, col u32, num_segments i32, thickness f32)
+
+@[inline]
+pub fn im_draw_list_add_circle(self &imgui.ImDrawList, center ImVec2_c, radius f32, col u32, num_segments i32, thickness f32) {
+ C.ImDrawList_AddCircle(self, center, radius, col, num_segments, thickness)
+}
+
+
+@[keep_args_alive]
+fn C.ImDrawList_AddCircleFilled(self &imgui.ImDrawList, center ImVec2_c, radius f32, col u32, num_segments i32)
+
+@[inline]
+pub fn im_draw_list_add_circle_filled(self &imgui.ImDrawList, center ImVec2_c, radius f32, col u32, num_segments i32) {
+ C.ImDrawList_AddCircleFilled(self, center, radius, col, num_segments)
+}
+
+
+@[keep_args_alive]
+fn C.ImDrawList_AddNgon(self &imgui.ImDrawList, center ImVec2_c, radius f32, col u32, num_segments i32, thickness f32)
+
+@[inline]
+pub fn im_draw_list_add_ngon(self &imgui.ImDrawList, center ImVec2_c, radius f32, col u32, num_segments i32, thickness f32) {
+ C.ImDrawList_AddNgon(self, center, radius, col, num_segments, thickness)
+}
+
+
+@[keep_args_alive]
+fn C.ImDrawList_AddNgonFilled(self &imgui.ImDrawList, center ImVec2_c, radius f32, col u32, num_segments i32)
+
+@[inline]
+pub fn im_draw_list_add_ngon_filled(self &imgui.ImDrawList, center ImVec2_c, radius f32, col u32, num_segments i32) {
+ C.ImDrawList_AddNgonFilled(self, center, radius, col, num_segments)
+}
+
+
+@[keep_args_alive]
+fn C.ImDrawList_AddEllipse(self &imgui.ImDrawList, center ImVec2_c, radius ImVec2_c, col u32, rot f32, num_segments i32, thickness f32)
+
+@[inline]
+pub fn im_draw_list_add_ellipse(self &imgui.ImDrawList, center ImVec2_c, radius ImVec2_c, col u32, rot f32, num_segments i32, thickness f32) {
+ C.ImDrawList_AddEllipse(self, center, radius, col, rot, num_segments, thickness)
+}
+
+
+@[keep_args_alive]
+fn C.ImDrawList_AddEllipseFilled(self &imgui.ImDrawList, center ImVec2_c, radius ImVec2_c, col u32, rot f32, num_segments i32)
+
+@[inline]
+pub fn im_draw_list_add_ellipse_filled(self &imgui.ImDrawList, center ImVec2_c, radius ImVec2_c, col u32, rot f32, num_segments i32) {
+ C.ImDrawList_AddEllipseFilled(self, center, radius, col, rot, num_segments)
+}
+
+
+@[keep_args_alive]
+fn C.ImDrawList_AddText_Vec2(self &imgui.ImDrawList, pos ImVec2_c, col u32, text_begin &char, const_text_end &char)
+
+@[inline]
+pub fn im_draw_list_add_text_vec2(self &imgui.ImDrawList, pos ImVec2_c, col u32, text_begin &char, const_text_end &char) {
+ C.ImDrawList_AddText_Vec2(self, pos, col, text_begin, const_text_end)
+}
+
+
+@[keep_args_alive]
+fn C.ImDrawList_AddText_FontPtr(self &imgui.ImDrawList, font &imgui.ImFont, font_size f32, pos ImVec2_c, col u32, text_begin &char, const_text_end &char, wrap_width f32, cpu_fine_clip_rect &imgui.ImVec4)
+
+@[inline]
+pub fn im_draw_list_add_text_font_ptr(self &imgui.ImDrawList, font &imgui.ImFont, font_size f32, pos ImVec2_c, col u32, text_begin &char, const_text_end &char, wrap_width f32, cpu_fine_clip_rect &imgui.ImVec4) {
+ C.ImDrawList_AddText_FontPtr(self, font, font_size, pos, col, text_begin, const_text_end, wrap_width, cpu_fine_clip_rect)
+}
+
+
+@[keep_args_alive]
+fn C.ImDrawList_AddBezierCubic(self &imgui.ImDrawList, p1 ImVec2_c, p2 ImVec2_c, p3 ImVec2_c, p4 ImVec2_c, col u32, thickness f32, num_segments i32)
+
+@[inline]
+pub fn im_draw_list_add_bezier_cubic(self &imgui.ImDrawList, p1 ImVec2_c, p2 ImVec2_c, p3 ImVec2_c, p4 ImVec2_c, col u32, thickness f32, num_segments i32) {
+ C.ImDrawList_AddBezierCubic(self, p1, p2, p3, p4, col, thickness, num_segments)
+}
+
+
+@[keep_args_alive]
+fn C.ImDrawList_AddBezierQuadratic(self &imgui.ImDrawList, p1 ImVec2_c, p2 ImVec2_c, p3 ImVec2_c, col u32, thickness f32, num_segments i32)
+
+@[inline]
+pub fn im_draw_list_add_bezier_quadratic(self &imgui.ImDrawList, p1 ImVec2_c, p2 ImVec2_c, p3 ImVec2_c, col u32, thickness f32, num_segments i32) {
+ C.ImDrawList_AddBezierQuadratic(self, p1, p2, p3, col, thickness, num_segments)
+}
+
+
+@[keep_args_alive]
+fn C.ImDrawList_AddPolyline(self &imgui.ImDrawList, points &ImVec2_c, num_points i32, col u32, thickness f32, flags imgui.ImDrawFlags)
+
+@[inline]
+pub fn im_draw_list_add_polyline(self &imgui.ImDrawList, points &ImVec2_c, num_points i32, col u32, thickness f32, flags imgui.ImDrawFlags) {
+ C.ImDrawList_AddPolyline(self, points, num_points, col, thickness, flags)
+}
+
+
+@[keep_args_alive]
+fn C.ImDrawList_AddConvexPolyFilled(self &imgui.ImDrawList, points &ImVec2_c, num_points i32, col u32)
+
+@[inline]
+pub fn im_draw_list_add_convex_poly_filled(self &imgui.ImDrawList, points &ImVec2_c, num_points i32, col u32) {
+ C.ImDrawList_AddConvexPolyFilled(self, points, num_points, col)
+}
+
+
+@[keep_args_alive]
+fn C.ImDrawList_AddConcavePolyFilled(self &imgui.ImDrawList, points &ImVec2_c, num_points i32, col u32)
+
+@[inline]
+pub fn im_draw_list_add_concave_poly_filled(self &imgui.ImDrawList, points &ImVec2_c, num_points i32, col u32) {
+ C.ImDrawList_AddConcavePolyFilled(self, points, num_points, col)
+}
+
+
+@[keep_args_alive]
+fn C.ImDrawList_AddImage(self &imgui.ImDrawList, tex_ref ImTextureRef_c, p_min ImVec2_c, p_max ImVec2_c, uv_min ImVec2_c, uv_max ImVec2_c, col u32)
+
+@[inline]
+pub fn im_draw_list_add_image(self &imgui.ImDrawList, tex_ref ImTextureRef_c, p_min ImVec2_c, p_max ImVec2_c, uv_min ImVec2_c, uv_max ImVec2_c, col u32) {
+ C.ImDrawList_AddImage(self, tex_ref, p_min, p_max, uv_min, uv_max, col)
+}
+
+
+@[keep_args_alive]
+fn C.ImDrawList_AddImageQuad(self &imgui.ImDrawList, tex_ref ImTextureRef_c, p1 ImVec2_c, p2 ImVec2_c, p3 ImVec2_c, p4 ImVec2_c, uv1 ImVec2_c, uv2 ImVec2_c, uv3 ImVec2_c, uv4 ImVec2_c, col u32)
+
+@[inline]
+pub fn im_draw_list_add_image_quad(self &imgui.ImDrawList, tex_ref ImTextureRef_c, p1 ImVec2_c, p2 ImVec2_c, p3 ImVec2_c, p4 ImVec2_c, uv1 ImVec2_c, uv2 ImVec2_c, uv3 ImVec2_c, uv4 ImVec2_c, col u32) {
+ C.ImDrawList_AddImageQuad(self, tex_ref, p1, p2, p3, p4, uv1, uv2, uv3, uv4, col)
+}
+
+
+@[keep_args_alive]
+fn C.ImDrawList_AddImageRounded(self &imgui.ImDrawList, tex_ref ImTextureRef_c, p_min ImVec2_c, p_max ImVec2_c, uv_min ImVec2_c, uv_max ImVec2_c, col u32, rounding f32, flags imgui.ImDrawFlags)
+
+@[inline]
+pub fn im_draw_list_add_image_rounded(self &imgui.ImDrawList, tex_ref ImTextureRef_c, p_min ImVec2_c, p_max ImVec2_c, uv_min ImVec2_c, uv_max ImVec2_c, col u32, rounding f32, flags imgui.ImDrawFlags) {
+ C.ImDrawList_AddImageRounded(self, tex_ref, p_min, p_max, uv_min, uv_max, col, rounding, flags)
+}
+
+
+@[keep_args_alive]
+fn C.ImDrawList_PathClear(self &imgui.ImDrawList)
+
+@[inline]
+pub fn im_draw_list_path_clear(self &imgui.ImDrawList) {
+ C.ImDrawList_PathClear(self)
+}
+
+
+@[keep_args_alive]
+fn C.ImDrawList_PathLineTo(self &imgui.ImDrawList, pos ImVec2_c)
+
+@[inline]
+pub fn im_draw_list_path_line_to(self &imgui.ImDrawList, pos ImVec2_c) {
+ C.ImDrawList_PathLineTo(self, pos)
+}
+
+
+@[keep_args_alive]
+fn C.ImDrawList_PathLineToMergeDuplicate(self &imgui.ImDrawList, pos ImVec2_c)
+
+@[inline]
+pub fn im_draw_list_path_line_to_merge_duplicate(self &imgui.ImDrawList, pos ImVec2_c) {
+ C.ImDrawList_PathLineToMergeDuplicate(self, pos)
+}
+
+
+@[keep_args_alive]
+fn C.ImDrawList_PathFillConvex(self &imgui.ImDrawList, col u32)
+
+@[inline]
+pub fn im_draw_list_path_fill_convex(self &imgui.ImDrawList, col u32) {
+ C.ImDrawList_PathFillConvex(self, col)
+}
+
+
+@[keep_args_alive]
+fn C.ImDrawList_PathFillConcave(self &imgui.ImDrawList, col u32)
+
+@[inline]
+pub fn im_draw_list_path_fill_concave(self &imgui.ImDrawList, col u32) {
+ C.ImDrawList_PathFillConcave(self, col)
+}
+
+
+@[keep_args_alive]
+fn C.ImDrawList_PathStroke(self &imgui.ImDrawList, col u32, thickness f32, flags imgui.ImDrawFlags)
+
+@[inline]
+pub fn im_draw_list_path_stroke(self &imgui.ImDrawList, col u32, thickness f32, flags imgui.ImDrawFlags) {
+ C.ImDrawList_PathStroke(self, col, thickness, flags)
+}
+
+
+@[keep_args_alive]
+fn C.ImDrawList_PathArcTo(self &imgui.ImDrawList, center ImVec2_c, radius f32, a_min f32, a_max f32, num_segments i32)
+
+@[inline]
+pub fn im_draw_list_path_arc_to(self &imgui.ImDrawList, center ImVec2_c, radius f32, a_min f32, a_max f32, num_segments i32) {
+ C.ImDrawList_PathArcTo(self, center, radius, a_min, a_max, num_segments)
+}
+
+
+@[keep_args_alive]
+fn C.ImDrawList_PathArcToFast(self &imgui.ImDrawList, center ImVec2_c, radius f32, a_min_of_12 i32, a_max_of_12 i32)
+
+@[inline]
+pub fn im_draw_list_path_arc_to_fast(self &imgui.ImDrawList, center ImVec2_c, radius f32, a_min_of_12 i32, a_max_of_12 i32) {
+ C.ImDrawList_PathArcToFast(self, center, radius, a_min_of_12, a_max_of_12)
+}
+
+
+@[keep_args_alive]
+fn C.ImDrawList_PathEllipticalArcTo(self &imgui.ImDrawList, center ImVec2_c, radius ImVec2_c, rot f32, a_min f32, a_max f32, num_segments i32)
+
+@[inline]
+pub fn im_draw_list_path_elliptical_arc_to(self &imgui.ImDrawList, center ImVec2_c, radius ImVec2_c, rot f32, a_min f32, a_max f32, num_segments i32) {
+ C.ImDrawList_PathEllipticalArcTo(self, center, radius, rot, a_min, a_max, num_segments)
+}
+
+
+@[keep_args_alive]
+fn C.ImDrawList_PathBezierCubicCurveTo(self &imgui.ImDrawList, p2 ImVec2_c, p3 ImVec2_c, p4 ImVec2_c, num_segments i32)
+
+@[inline]
+pub fn im_draw_list_path_bezier_cubic_curve_to(self &imgui.ImDrawList, p2 ImVec2_c, p3 ImVec2_c, p4 ImVec2_c, num_segments i32) {
+ C.ImDrawList_PathBezierCubicCurveTo(self, p2, p3, p4, num_segments)
+}
+
+
+@[keep_args_alive]
+fn C.ImDrawList_PathBezierQuadraticCurveTo(self &imgui.ImDrawList, p2 ImVec2_c, p3 ImVec2_c, num_segments i32)
+
+@[inline]
+pub fn im_draw_list_path_bezier_quadratic_curve_to(self &imgui.ImDrawList, p2 ImVec2_c, p3 ImVec2_c, num_segments i32) {
+ C.ImDrawList_PathBezierQuadraticCurveTo(self, p2, p3, num_segments)
+}
+
+
+@[keep_args_alive]
+fn C.ImDrawList_PathRect(self &imgui.ImDrawList, rect_min ImVec2_c, rect_max ImVec2_c, rounding f32, flags imgui.ImDrawFlags)
+
+@[inline]
+pub fn im_draw_list_path_rect(self &imgui.ImDrawList, rect_min ImVec2_c, rect_max ImVec2_c, rounding f32, flags imgui.ImDrawFlags) {
+ C.ImDrawList_PathRect(self, rect_min, rect_max, rounding, flags)
+}
+
+
+@[keep_args_alive]
+fn C.ImDrawList_AddCallback(self &imgui.ImDrawList, callback imgui.ImDrawCallback, userdata voidptr, userdata_size usize)
+
+@[inline]
+pub fn im_draw_list_add_callback(self &imgui.ImDrawList, callback imgui.ImDrawCallback, userdata voidptr, userdata_size usize) {
+ C.ImDrawList_AddCallback(self, callback, userdata, userdata_size)
+}
+
+
+@[keep_args_alive]
+fn C.ImDrawList_AddDrawCmd(self &imgui.ImDrawList)
+
+@[inline]
+pub fn im_draw_list_add_draw_cmd(self &imgui.ImDrawList) {
+ C.ImDrawList_AddDrawCmd(self)
+}
+
+
+@[keep_args_alive]
+fn C.ImDrawList_CloneOutput(self &imgui.ImDrawList) &imgui.ImDrawList
+
+@[inline]
+pub fn im_draw_list_clone_output(self &imgui.ImDrawList) &imgui.ImDrawList {
+ return C.ImDrawList_CloneOutput(self)
+}
+
+
+@[keep_args_alive]
+fn C.ImDrawList_ChannelsSplit(self &imgui.ImDrawList, count i32)
+
+@[inline]
+pub fn im_draw_list_channels_split(self &imgui.ImDrawList, count i32) {
+ C.ImDrawList_ChannelsSplit(self, count)
+}
+
+
+@[keep_args_alive]
+fn C.ImDrawList_ChannelsMerge(self &imgui.ImDrawList)
+
+@[inline]
+pub fn im_draw_list_channels_merge(self &imgui.ImDrawList) {
+ C.ImDrawList_ChannelsMerge(self)
+}
+
+
+@[keep_args_alive]
+fn C.ImDrawList_ChannelsSetCurrent(self &imgui.ImDrawList, n i32)
+
+@[inline]
+pub fn im_draw_list_channels_set_current(self &imgui.ImDrawList, n i32) {
+ C.ImDrawList_ChannelsSetCurrent(self, n)
+}
+
+
+@[keep_args_alive]
+fn C.ImDrawList_PrimReserve(self &imgui.ImDrawList, idx_count i32, vtx_count i32)
+
+@[inline]
+pub fn im_draw_list_prim_reserve(self &imgui.ImDrawList, idx_count i32, vtx_count i32) {
+ C.ImDrawList_PrimReserve(self, idx_count, vtx_count)
+}
+
+
+@[keep_args_alive]
+fn C.ImDrawList_PrimUnreserve(self &imgui.ImDrawList, idx_count i32, vtx_count i32)
+
+@[inline]
+pub fn im_draw_list_prim_unreserve(self &imgui.ImDrawList, idx_count i32, vtx_count i32) {
+ C.ImDrawList_PrimUnreserve(self, idx_count, vtx_count)
+}
+
+
+@[keep_args_alive]
+fn C.ImDrawList_PrimRect(self &imgui.ImDrawList, a ImVec2_c, b ImVec2_c, col u32)
+
+@[inline]
+pub fn im_draw_list_prim_rect(self &imgui.ImDrawList, a ImVec2_c, b ImVec2_c, col u32) {
+ C.ImDrawList_PrimRect(self, a, b, col)
+}
+
+
+@[keep_args_alive]
+fn C.ImDrawList_PrimRectUV(self &imgui.ImDrawList, a ImVec2_c, b ImVec2_c, uv_a ImVec2_c, uv_b ImVec2_c, col u32)
+
+@[inline]
+pub fn im_draw_list_prim_rect_uv(self &imgui.ImDrawList, a ImVec2_c, b ImVec2_c, uv_a ImVec2_c, uv_b ImVec2_c, col u32) {
+ C.ImDrawList_PrimRectUV(self, a, b, uv_a, uv_b, col)
+}
+
+
+@[keep_args_alive]
+fn C.ImDrawList_PrimQuadUV(self &imgui.ImDrawList, a ImVec2_c, b ImVec2_c, c ImVec2_c, d ImVec2_c, uv_a ImVec2_c, uv_b ImVec2_c, uv_c ImVec2_c, uv_d ImVec2_c, col u32)
+
+@[inline]
+pub fn im_draw_list_prim_quad_uv(self &imgui.ImDrawList, a ImVec2_c, b ImVec2_c, c ImVec2_c, d ImVec2_c, uv_a ImVec2_c, uv_b ImVec2_c, uv_c ImVec2_c, uv_d ImVec2_c, col u32) {
+ C.ImDrawList_PrimQuadUV(self, a, b, c, d, uv_a, uv_b, uv_c, uv_d, col)
+}
+
+
+@[keep_args_alive]
+fn C.ImDrawList_PrimWriteVtx(self &imgui.ImDrawList, pos ImVec2_c, uv ImVec2_c, col u32)
+
+@[inline]
+pub fn im_draw_list_prim_write_vtx(self &imgui.ImDrawList, pos ImVec2_c, uv ImVec2_c, col u32) {
+ C.ImDrawList_PrimWriteVtx(self, pos, uv, col)
+}
+
+
+@[keep_args_alive]
+fn C.ImDrawList_PrimWriteIdx(self &imgui.ImDrawList, idx imgui.ImDrawIdx)
+
+@[inline]
+pub fn im_draw_list_prim_write_idx(self &imgui.ImDrawList, idx imgui.ImDrawIdx) {
+ C.ImDrawList_PrimWriteIdx(self, idx)
+}
+
+
+@[keep_args_alive]
+fn C.ImDrawList_PrimVtx(self &imgui.ImDrawList, pos ImVec2_c, uv ImVec2_c, col u32)
+
+@[inline]
+pub fn im_draw_list_prim_vtx(self &imgui.ImDrawList, pos ImVec2_c, uv ImVec2_c, col u32) {
+ C.ImDrawList_PrimVtx(self, pos, uv, col)
+}
+
+
+@[keep_args_alive]
+fn C.ImDrawList__SetDrawListSharedData(self &imgui.ImDrawList, data &imgui.ImDrawListSharedData)
+
+@[inline]
+pub fn im_draw_list__set_draw_list_shared_data(self &imgui.ImDrawList, data &imgui.ImDrawListSharedData) {
+ C.ImDrawList__SetDrawListSharedData(self, data)
+}
+
+
+@[keep_args_alive]
+fn C.ImDrawList__ResetForNewFrame(self &imgui.ImDrawList)
+
+@[inline]
+pub fn im_draw_list__reset_for_new_frame(self &imgui.ImDrawList) {
+ C.ImDrawList__ResetForNewFrame(self)
+}
+
+
+@[keep_args_alive]
+fn C.ImDrawList__ClearFreeMemory(self &imgui.ImDrawList)
+
+@[inline]
+pub fn im_draw_list__clear_free_memory(self &imgui.ImDrawList) {
+ C.ImDrawList__ClearFreeMemory(self)
+}
+
+
+@[keep_args_alive]
+fn C.ImDrawList__PopUnusedDrawCmd(self &imgui.ImDrawList)
+
+@[inline]
+pub fn im_draw_list__pop_unused_draw_cmd(self &imgui.ImDrawList) {
+ C.ImDrawList__PopUnusedDrawCmd(self)
+}
+
+
+@[keep_args_alive]
+fn C.ImDrawList__TryMergeDrawCmds(self &imgui.ImDrawList)
+
+@[inline]
+pub fn im_draw_list__try_merge_draw_cmds(self &imgui.ImDrawList) {
+ C.ImDrawList__TryMergeDrawCmds(self)
+}
+
+
+@[keep_args_alive]
+fn C.ImDrawList__OnChangedClipRect(self &imgui.ImDrawList)
+
+@[inline]
+pub fn im_draw_list__on_changed_clip_rect(self &imgui.ImDrawList) {
+ C.ImDrawList__OnChangedClipRect(self)
+}
+
+
+@[keep_args_alive]
+fn C.ImDrawList__OnChangedTexture(self &imgui.ImDrawList)
+
+@[inline]
+pub fn im_draw_list__on_changed_texture(self &imgui.ImDrawList) {
+ C.ImDrawList__OnChangedTexture(self)
+}
+
+
+@[keep_args_alive]
+fn C.ImDrawList__OnChangedVtxOffset(self &imgui.ImDrawList)
+
+@[inline]
+pub fn im_draw_list__on_changed_vtx_offset(self &imgui.ImDrawList) {
+ C.ImDrawList__OnChangedVtxOffset(self)
+}
+
+
+@[keep_args_alive]
+fn C.ImDrawList__SetTexture(self &imgui.ImDrawList, tex_ref ImTextureRef_c)
+
+@[inline]
+pub fn im_draw_list__set_texture(self &imgui.ImDrawList, tex_ref ImTextureRef_c) {
+ C.ImDrawList__SetTexture(self, tex_ref)
+}
+
+
+@[keep_args_alive]
+fn C.ImDrawList__CalcCircleAutoSegmentCount(self &imgui.ImDrawList, radius f32) i32
+
+@[inline]
+pub fn im_draw_list__calc_circle_auto_segment_count(self &imgui.ImDrawList, radius f32) i32 {
+ return C.ImDrawList__CalcCircleAutoSegmentCount(self, radius)
+}
+
+
+@[keep_args_alive]
+fn C.ImDrawList__PathArcToFastEx(self &imgui.ImDrawList, center ImVec2_c, radius f32, a_min_sample i32, a_max_sample i32, a_step i32)
+
+@[inline]
+pub fn im_draw_list__path_arc_to_fast_ex(self &imgui.ImDrawList, center ImVec2_c, radius f32, a_min_sample i32, a_max_sample i32, a_step i32) {
+ C.ImDrawList__PathArcToFastEx(self, center, radius, a_min_sample, a_max_sample, a_step)
+}
+
+
+@[keep_args_alive]
+fn C.ImDrawList__PathArcToN(self &imgui.ImDrawList, center ImVec2_c, radius f32, a_min f32, a_max f32, num_segments i32)
+
+@[inline]
+pub fn im_draw_list__path_arc_to_n(self &imgui.ImDrawList, center ImVec2_c, radius f32, a_min f32, a_max f32, num_segments i32) {
+ C.ImDrawList__PathArcToN(self, center, radius, a_min, a_max, num_segments)
+}
+
+
+@[keep_args_alive]
+fn C.ImDrawData_ImDrawData() &imgui.ImDrawData
+
+@[inline]
+pub fn im_draw_data_im_draw_data() &imgui.ImDrawData {
+ return C.ImDrawData_ImDrawData()
+}
+
+
+@[keep_args_alive]
+fn C.ImDrawData_destroy(self &imgui.ImDrawData)
+
+@[inline]
+pub fn im_draw_data_destroy(self &imgui.ImDrawData) {
+ C.ImDrawData_destroy(self)
+}
+
+
+@[keep_args_alive]
+fn C.ImDrawData_Clear(self &imgui.ImDrawData)
+
+@[inline]
+pub fn im_draw_data_clear(self &imgui.ImDrawData) {
+ C.ImDrawData_Clear(self)
+}
+
+
+@[keep_args_alive]
+fn C.ImDrawData_AddDrawList(self &imgui.ImDrawData, draw_list &imgui.ImDrawList)
+
+@[inline]
+pub fn im_draw_data_add_draw_list(self &imgui.ImDrawData, draw_list &imgui.ImDrawList) {
+ C.ImDrawData_AddDrawList(self, draw_list)
+}
+
+
+@[keep_args_alive]
+fn C.ImDrawData_DeIndexAllBuffers(self &imgui.ImDrawData)
+
+@[inline]
+pub fn im_draw_data_de_index_all_buffers(self &imgui.ImDrawData) {
+ C.ImDrawData_DeIndexAllBuffers(self)
+}
+
+
+@[keep_args_alive]
+fn C.ImDrawData_ScaleClipRects(self &imgui.ImDrawData, fb_scale ImVec2_c)
+
+@[inline]
+pub fn im_draw_data_scale_clip_rects(self &imgui.ImDrawData, fb_scale ImVec2_c) {
+ C.ImDrawData_ScaleClipRects(self, fb_scale)
+}
+
+
+@[keep_args_alive]
+fn C.ImTextureData_ImTextureData() &ImTextureData
+
+@[inline]
+pub fn im_texture_data_im_texture_data() &ImTextureData {
+ return C.ImTextureData_ImTextureData()
+}
+
+
+@[keep_args_alive]
+fn C.ImTextureData_destroy(self &ImTextureData)
+
+@[inline]
+pub fn im_texture_data_destroy(self &ImTextureData) {
+ C.ImTextureData_destroy(self)
+}
+
+
+@[keep_args_alive]
+fn C.ImTextureData_Create(self &ImTextureData, format i32, w i32, h i32)
+
+@[inline]
+pub fn im_texture_data_create(self &ImTextureData, format i32, w i32, h i32) {
+ C.ImTextureData_Create(self, format, w, h)
+}
+
+
+@[keep_args_alive]
+fn C.ImTextureData_DestroyPixels(self &ImTextureData)
+
+@[inline]
+pub fn im_texture_data_destroy_pixels(self &ImTextureData) {
+ C.ImTextureData_DestroyPixels(self)
+}
+
+
+@[keep_args_alive]
+fn C.ImTextureData_GetPixels(self &ImTextureData) voidptr
+
+@[inline]
+pub fn im_texture_data_get_pixels(self &ImTextureData) voidptr {
+ return C.ImTextureData_GetPixels(self)
+}
+
+
+@[keep_args_alive]
+fn C.ImTextureData_GetPixelsAt(self &ImTextureData, x i32, y i32) voidptr
+
+@[inline]
+pub fn im_texture_data_get_pixels_at(self &ImTextureData, x i32, y i32) voidptr {
+ return C.ImTextureData_GetPixelsAt(self, x, y)
+}
+
+
+@[keep_args_alive]
+fn C.ImTextureData_GetSizeInBytes(self &ImTextureData) i32
+
+@[inline]
+pub fn im_texture_data_get_size_in_bytes(self &ImTextureData) i32 {
+ return C.ImTextureData_GetSizeInBytes(self)
+}
+
+
+@[keep_args_alive]
+fn C.ImTextureData_GetPitch(self &ImTextureData) i32
+
+@[inline]
+pub fn im_texture_data_get_pitch(self &ImTextureData) i32 {
+ return C.ImTextureData_GetPitch(self)
+}
+
+
+@[keep_args_alive]
+fn C.ImTextureData_GetTexRef(self &ImTextureData) ImTextureRef_c
+
+@[inline]
+pub fn im_texture_data_get_tex_ref(self &ImTextureData) ImTextureRef_c {
+ return C.ImTextureData_GetTexRef(self)
+}
+
+
+@[keep_args_alive]
+fn C.ImTextureData_GetTexID(self &ImTextureData) imgui.ImTextureID
+
+@[inline]
+pub fn im_texture_data_get_tex_id(self &ImTextureData) imgui.ImTextureID {
+ return C.ImTextureData_GetTexID(self)
+}
+
+
+@[keep_args_alive]
+fn C.ImTextureData_SetTexID(self &ImTextureData, tex_id imgui.ImTextureID)
+
+@[inline]
+pub fn im_texture_data_set_tex_id(self &ImTextureData, tex_id imgui.ImTextureID) {
+ C.ImTextureData_SetTexID(self, tex_id)
+}
+
+
+@[keep_args_alive]
+fn C.ImTextureData_SetStatus(self &ImTextureData, status i32)
+
+@[inline]
+pub fn im_texture_data_set_status(self &ImTextureData, status i32) {
+ C.ImTextureData_SetStatus(self, status)
+}
+
+
+@[keep_args_alive]
+fn C.ImFontConfig_ImFontConfig() &imgui.ImFontConfig
+
+@[inline]
+pub fn im_font_config_im_font_config() &imgui.ImFontConfig {
+ return C.ImFontConfig_ImFontConfig()
+}
+
+
+@[keep_args_alive]
+fn C.ImFontConfig_destroy(self &imgui.ImFontConfig)
+
+@[inline]
+pub fn im_font_config_destroy(self &imgui.ImFontConfig) {
+ C.ImFontConfig_destroy(self)
+}
+
+
+@[keep_args_alive]
+fn C.ImFontGlyph_ImFontGlyph() &imgui.ImFontGlyph
+
+@[inline]
+pub fn im_font_glyph_im_font_glyph() &imgui.ImFontGlyph {
+ return C.ImFontGlyph_ImFontGlyph()
+}
+
+
+@[keep_args_alive]
+fn C.ImFontGlyph_destroy(self &imgui.ImFontGlyph)
+
+@[inline]
+pub fn im_font_glyph_destroy(self &imgui.ImFontGlyph) {
+ C.ImFontGlyph_destroy(self)
+}
+
+
+@[keep_args_alive]
+fn C.ImFontGlyphRangesBuilder_ImFontGlyphRangesBuilder() &imgui.ImFontGlyphRangesBuilder
+
+@[inline]
+pub fn im_font_glyph_ranges_builder_im_font_glyph_ranges_builder() &imgui.ImFontGlyphRangesBuilder {
+ return C.ImFontGlyphRangesBuilder_ImFontGlyphRangesBuilder()
+}
+
+
+@[keep_args_alive]
+fn C.ImFontGlyphRangesBuilder_destroy(self &imgui.ImFontGlyphRangesBuilder)
+
+@[inline]
+pub fn im_font_glyph_ranges_builder_destroy(self &imgui.ImFontGlyphRangesBuilder) {
+ C.ImFontGlyphRangesBuilder_destroy(self)
+}
+
+
+@[keep_args_alive]
+fn C.ImFontGlyphRangesBuilder_Clear(self &imgui.ImFontGlyphRangesBuilder)
+
+@[inline]
+pub fn im_font_glyph_ranges_builder_clear(self &imgui.ImFontGlyphRangesBuilder) {
+ C.ImFontGlyphRangesBuilder_Clear(self)
+}
+
+
+@[keep_args_alive]
+fn C.ImFontGlyphRangesBuilder_GetBit(self &imgui.ImFontGlyphRangesBuilder, n usize) bool
+
+@[inline]
+pub fn im_font_glyph_ranges_builder_get_bit(self &imgui.ImFontGlyphRangesBuilder, n usize) bool {
+ return C.ImFontGlyphRangesBuilder_GetBit(self, n)
+}
+
+
+@[keep_args_alive]
+fn C.ImFontGlyphRangesBuilder_SetBit(self &imgui.ImFontGlyphRangesBuilder, n usize)
+
+@[inline]
+pub fn im_font_glyph_ranges_builder_set_bit(self &imgui.ImFontGlyphRangesBuilder, n usize) {
+ C.ImFontGlyphRangesBuilder_SetBit(self, n)
+}
+
+
+@[keep_args_alive]
+fn C.ImFontGlyphRangesBuilder_AddChar(self &imgui.ImFontGlyphRangesBuilder, c u32)
+
+@[inline]
+pub fn im_font_glyph_ranges_builder_add_char(self &imgui.ImFontGlyphRangesBuilder, c u32) {
+ C.ImFontGlyphRangesBuilder_AddChar(self, c)
+}
+
+
+@[keep_args_alive]
+fn C.ImFontGlyphRangesBuilder_AddText(self &imgui.ImFontGlyphRangesBuilder, const_text &char, const_text_end &char)
+
+@[inline]
+pub fn im_font_glyph_ranges_builder_add_text(self &imgui.ImFontGlyphRangesBuilder, const_text &char, const_text_end &char) {
+ C.ImFontGlyphRangesBuilder_AddText(self, const_text, const_text_end)
+}
+
+
+@[keep_args_alive]
+fn C.ImFontGlyphRangesBuilder_AddRanges(self &imgui.ImFontGlyphRangesBuilder, ranges &u32)
+
+@[inline]
+pub fn im_font_glyph_ranges_builder_add_ranges(self &imgui.ImFontGlyphRangesBuilder, ranges &u32) {
+ C.ImFontGlyphRangesBuilder_AddRanges(self, ranges)
+}
+
+
+@[keep_args_alive]
+fn C.ImFontGlyphRangesBuilder_BuildRanges(self &imgui.ImFontGlyphRangesBuilder, out_ranges &ImVector_ImWchar)
+
+@[inline]
+pub fn im_font_glyph_ranges_builder_build_ranges(self &imgui.ImFontGlyphRangesBuilder, out_ranges &ImVector_ImWchar) {
+ C.ImFontGlyphRangesBuilder_BuildRanges(self, out_ranges)
+}
+
+
+@[keep_args_alive]
+fn C.ImFontAtlasRect_ImFontAtlasRect() &imgui.ImFontAtlasRect
+
+@[inline]
+pub fn im_font_atlas_rect_im_font_atlas_rect() &imgui.ImFontAtlasRect {
+ return C.ImFontAtlasRect_ImFontAtlasRect()
+}
+
+
+@[keep_args_alive]
+fn C.ImFontAtlasRect_destroy(self &imgui.ImFontAtlasRect)
+
+@[inline]
+pub fn im_font_atlas_rect_destroy(self &imgui.ImFontAtlasRect) {
+ C.ImFontAtlasRect_destroy(self)
+}
+
+
+@[keep_args_alive]
+fn C.ImFontAtlas_ImFontAtlas() &imgui.ImFontAtlas
+
+@[inline]
+pub fn im_font_atlas_im_font_atlas() &imgui.ImFontAtlas {
+ return C.ImFontAtlas_ImFontAtlas()
+}
+
+
+@[keep_args_alive]
+fn C.ImFontAtlas_destroy(self &imgui.ImFontAtlas)
+
+@[inline]
+pub fn im_font_atlas_destroy(self &imgui.ImFontAtlas) {
+ C.ImFontAtlas_destroy(self)
+}
+
+
+@[keep_args_alive]
+fn C.ImFontAtlas_AddFont(self &imgui.ImFontAtlas, font_cfg &imgui.ImFontConfig) &imgui.ImFont
+
+@[inline]
+pub fn im_font_atlas_add_font(self &imgui.ImFontAtlas, font_cfg &imgui.ImFontConfig) &imgui.ImFont {
+ return C.ImFontAtlas_AddFont(self, font_cfg)
+}
+
+
+@[keep_args_alive]
+fn C.ImFontAtlas_AddFontDefault(self &imgui.ImFontAtlas, font_cfg &imgui.ImFontConfig) &imgui.ImFont
+
+@[inline]
+pub fn im_font_atlas_add_font_default(self &imgui.ImFontAtlas, font_cfg &imgui.ImFontConfig) &imgui.ImFont {
+ return C.ImFontAtlas_AddFontDefault(self, font_cfg)
+}
+
+
+@[keep_args_alive]
+fn C.ImFontAtlas_AddFontDefaultVector(self &imgui.ImFontAtlas, font_cfg &imgui.ImFontConfig) &imgui.ImFont
+
+@[inline]
+pub fn im_font_atlas_add_font_default_vector(self &imgui.ImFontAtlas, font_cfg &imgui.ImFontConfig) &imgui.ImFont {
+ return C.ImFontAtlas_AddFontDefaultVector(self, font_cfg)
+}
+
+
+@[keep_args_alive]
+fn C.ImFontAtlas_AddFontDefaultBitmap(self &imgui.ImFontAtlas, font_cfg &imgui.ImFontConfig) &imgui.ImFont
+
+@[inline]
+pub fn im_font_atlas_add_font_default_bitmap(self &imgui.ImFontAtlas, font_cfg &imgui.ImFontConfig) &imgui.ImFont {
+ return C.ImFontAtlas_AddFontDefaultBitmap(self, font_cfg)
+}
+
+
+@[keep_args_alive]
+fn C.ImFontAtlas_AddFontFromFileTTF(self &imgui.ImFontAtlas, filename &char, size_pixels f32, font_cfg &imgui.ImFontConfig, glyph_ranges &u32) &imgui.ImFont
+
+@[inline]
+pub fn im_font_atlas_add_font_from_file_ttf(self &imgui.ImFontAtlas, filename &char, size_pixels f32, font_cfg &imgui.ImFontConfig, glyph_ranges &u32) &imgui.ImFont {
+ return C.ImFontAtlas_AddFontFromFileTTF(self, filename, size_pixels, font_cfg, glyph_ranges)
+}
+
+
+@[keep_args_alive]
+fn C.ImFontAtlas_AddFontFromMemoryTTF(self &imgui.ImFontAtlas, font_data voidptr, font_data_size i32, size_pixels f32, font_cfg &imgui.ImFontConfig, glyph_ranges &u32) &imgui.ImFont
+
+@[inline]
+pub fn im_font_atlas_add_font_from_memory_ttf(self &imgui.ImFontAtlas, font_data voidptr, font_data_size i32, size_pixels f32, font_cfg &imgui.ImFontConfig, glyph_ranges &u32) &imgui.ImFont {
+ return C.ImFontAtlas_AddFontFromMemoryTTF(self, font_data, font_data_size, size_pixels, font_cfg, glyph_ranges)
+}
+
+
+@[keep_args_alive]
+fn C.ImFontAtlas_AddFontFromMemoryCompressedTTF(self &imgui.ImFontAtlas, compressed_font_data voidptr, compressed_font_data_size i32, size_pixels f32, font_cfg &imgui.ImFontConfig, glyph_ranges &u32) &imgui.ImFont
+
+@[inline]
+pub fn im_font_atlas_add_font_from_memory_compressed_ttf(self &imgui.ImFontAtlas, compressed_font_data voidptr, compressed_font_data_size i32, size_pixels f32, font_cfg &imgui.ImFontConfig, glyph_ranges &u32) &imgui.ImFont {
+ return C.ImFontAtlas_AddFontFromMemoryCompressedTTF(self, compressed_font_data, compressed_font_data_size, size_pixels, font_cfg, glyph_ranges)
+}
+
+
+@[keep_args_alive]
+fn C.ImFontAtlas_AddFontFromMemoryCompressedBase85TTF(self &imgui.ImFontAtlas, compressed_font_data_base85 &char, size_pixels f32, font_cfg &imgui.ImFontConfig, glyph_ranges &u32) &imgui.ImFont
+
+@[inline]
+pub fn im_font_atlas_add_font_from_memory_compressed_base85_ttf(self &imgui.ImFontAtlas, compressed_font_data_base85 &char, size_pixels f32, font_cfg &imgui.ImFontConfig, glyph_ranges &u32) &imgui.ImFont {
+ return C.ImFontAtlas_AddFontFromMemoryCompressedBase85TTF(self, compressed_font_data_base85, size_pixels, font_cfg, glyph_ranges)
+}
+
+
+@[keep_args_alive]
+fn C.ImFontAtlas_RemoveFont(self &imgui.ImFontAtlas, font &imgui.ImFont)
+
+@[inline]
+pub fn im_font_atlas_remove_font(self &imgui.ImFontAtlas, font &imgui.ImFont) {
+ C.ImFontAtlas_RemoveFont(self, font)
+}
+
+
+@[keep_args_alive]
+fn C.ImFontAtlas_CompactCache(self &imgui.ImFontAtlas)
+
+@[inline]
+pub fn im_font_atlas_compact_cache(self &imgui.ImFontAtlas) {
+ C.ImFontAtlas_CompactCache(self)
+}
+
+
+@[keep_args_alive]
+fn C.ImFontAtlas_SetFontLoader(self &imgui.ImFontAtlas, font_loader &imgui.ImFontLoader)
+
+@[inline]
+pub fn im_font_atlas_set_font_loader(self &imgui.ImFontAtlas, font_loader &imgui.ImFontLoader) {
+ C.ImFontAtlas_SetFontLoader(self, font_loader)
+}
+
+
+@[keep_args_alive]
+fn C.ImFontAtlas_Clear(self &imgui.ImFontAtlas)
+
+@[inline]
+pub fn im_font_atlas_clear(self &imgui.ImFontAtlas) {
+ C.ImFontAtlas_Clear(self)
+}
+
+
+@[keep_args_alive]
+fn C.ImFontAtlas_ClearFonts(self &imgui.ImFontAtlas)
+
+@[inline]
+pub fn im_font_atlas_clear_fonts(self &imgui.ImFontAtlas) {
+ C.ImFontAtlas_ClearFonts(self)
+}
+
+
+@[keep_args_alive]
+fn C.ImFontAtlas_ClearInputData(self &imgui.ImFontAtlas)
+
+@[inline]
+pub fn im_font_atlas_clear_input_data(self &imgui.ImFontAtlas) {
+ C.ImFontAtlas_ClearInputData(self)
+}
+
+
+@[keep_args_alive]
+fn C.ImFontAtlas_ClearTexData(self &imgui.ImFontAtlas)
+
+@[inline]
+pub fn im_font_atlas_clear_tex_data(self &imgui.ImFontAtlas) {
+ C.ImFontAtlas_ClearTexData(self)
+}
+
+
+@[keep_args_alive]
+fn C.ImFontAtlas_GetGlyphRangesDefault(self &imgui.ImFontAtlas) &u32
+
+@[inline]
+pub fn im_font_atlas_get_glyph_ranges_default(self &imgui.ImFontAtlas) &u32 {
+ return C.ImFontAtlas_GetGlyphRangesDefault(self)
+}
+
+
+@[keep_args_alive]
+fn C.ImFontAtlas_AddCustomRect(self &imgui.ImFontAtlas, width i32, height i32, out_r &imgui.ImFontAtlasRect) imgui.ImFontAtlasRectId
+
+@[inline]
+pub fn im_font_atlas_add_custom_rect(self &imgui.ImFontAtlas, width i32, height i32, out_r &imgui.ImFontAtlasRect) imgui.ImFontAtlasRectId {
+ return C.ImFontAtlas_AddCustomRect(self, width, height, out_r)
+}
+
+
+@[keep_args_alive]
+fn C.ImFontAtlas_RemoveCustomRect(self &imgui.ImFontAtlas, id imgui.ImFontAtlasRectId)
+
+@[inline]
+pub fn im_font_atlas_remove_custom_rect(self &imgui.ImFontAtlas, id imgui.ImFontAtlasRectId) {
+ C.ImFontAtlas_RemoveCustomRect(self, id)
+}
+
+
+@[keep_args_alive]
+fn C.ImFontAtlas_GetCustomRect(self &imgui.ImFontAtlas, id imgui.ImFontAtlasRectId, out_r &imgui.ImFontAtlasRect) bool
+
+@[inline]
+pub fn im_font_atlas_get_custom_rect(self &imgui.ImFontAtlas, id imgui.ImFontAtlasRectId, out_r &imgui.ImFontAtlasRect) bool {
+ return C.ImFontAtlas_GetCustomRect(self, id, out_r)
+}
+
+
+@[keep_args_alive]
+fn C.ImFontBaked_ImFontBaked() &imgui.ImFontBaked
+
+@[inline]
+pub fn im_font_baked_im_font_baked() &imgui.ImFontBaked {
+ return C.ImFontBaked_ImFontBaked()
+}
+
+
+@[keep_args_alive]
+fn C.ImFontBaked_destroy(self &imgui.ImFontBaked)
+
+@[inline]
+pub fn im_font_baked_destroy(self &imgui.ImFontBaked) {
+ C.ImFontBaked_destroy(self)
+}
+
+
+@[keep_args_alive]
+fn C.ImFontBaked_ClearOutputData(self &imgui.ImFontBaked)
+
+@[inline]
+pub fn im_font_baked_clear_output_data(self &imgui.ImFontBaked) {
+ C.ImFontBaked_ClearOutputData(self)
+}
+
+
+@[keep_args_alive]
+fn C.ImFontBaked_FindGlyph(self &imgui.ImFontBaked, c u32) &imgui.ImFontGlyph
+
+@[inline]
+pub fn im_font_baked_find_glyph(self &imgui.ImFontBaked, c u32) &imgui.ImFontGlyph {
+ return C.ImFontBaked_FindGlyph(self, c)
+}
+
+
+@[keep_args_alive]
+fn C.ImFontBaked_FindGlyphNoFallback(self &imgui.ImFontBaked, c u32) &imgui.ImFontGlyph
+
+@[inline]
+pub fn im_font_baked_find_glyph_no_fallback(self &imgui.ImFontBaked, c u32) &imgui.ImFontGlyph {
+ return C.ImFontBaked_FindGlyphNoFallback(self, c)
+}
+
+
+@[keep_args_alive]
+fn C.ImFontBaked_GetCharAdvance(self &imgui.ImFontBaked, c u32) f32
+
+@[inline]
+pub fn im_font_baked_get_char_advance(self &imgui.ImFontBaked, c u32) f32 {
+ return C.ImFontBaked_GetCharAdvance(self, c)
+}
+
+
+@[keep_args_alive]
+fn C.ImFontBaked_IsGlyphLoaded(self &imgui.ImFontBaked, c u32) bool
+
+@[inline]
+pub fn im_font_baked_is_glyph_loaded(self &imgui.ImFontBaked, c u32) bool {
+ return C.ImFontBaked_IsGlyphLoaded(self, c)
+}
+
+
+@[keep_args_alive]
+fn C.ImFont_ImFont() &imgui.ImFont
+
+@[inline]
+pub fn im_font_im_font() &imgui.ImFont {
+ return C.ImFont_ImFont()
+}
+
+
+@[keep_args_alive]
+fn C.ImFont_destroy(self &imgui.ImFont)
+
+@[inline]
+pub fn im_font_destroy(self &imgui.ImFont) {
+ C.ImFont_destroy(self)
+}
+
+
+@[keep_args_alive]
+fn C.ImFont_IsGlyphInFont(self &imgui.ImFont, c u32) bool
+
+@[inline]
+pub fn im_font_is_glyph_in_font(self &imgui.ImFont, c u32) bool {
+ return C.ImFont_IsGlyphInFont(self, c)
+}
+
+
+@[keep_args_alive]
+fn C.ImFont_IsLoaded(self &imgui.ImFont) bool
+
+@[inline]
+pub fn im_font_is_loaded(self &imgui.ImFont) bool {
+ return C.ImFont_IsLoaded(self)
+}
+
+
+@[keep_args_alive]
+fn C.ImFont_GetDebugName(self &imgui.ImFont) &char
+
+@[inline]
+pub fn im_font_get_debug_name(self &imgui.ImFont) &char {
+ return C.ImFont_GetDebugName(self)
+}
+
+
+@[keep_args_alive]
+fn C.ImFont_GetFontBaked(self &imgui.ImFont, font_size f32, density f32) &imgui.ImFontBaked
+
+@[inline]
+pub fn im_font_get_font_baked(self &imgui.ImFont, font_size f32, density f32) &imgui.ImFontBaked {
+ return C.ImFont_GetFontBaked(self, font_size, density)
+}
+
+
+@[keep_args_alive]
+fn C.ImFont_CalcTextSizeA(self &imgui.ImFont, size f32, max_width f32, wrap_width f32, text_begin &char, const_text_end &char, out_remaining &&u8) ImVec2_c
+
+@[inline]
+pub fn im_font_calc_text_size_a(self &imgui.ImFont, size f32, max_width f32, wrap_width f32, text_begin &char, const_text_end &char, out_remaining &&u8) ImVec2_c {
+ return C.ImFont_CalcTextSizeA(self, size, max_width, wrap_width, text_begin, const_text_end, out_remaining)
+}
+
+
+@[keep_args_alive]
+fn C.ImFont_CalcWordWrapPosition(self &imgui.ImFont, size f32, const_text &char, const_text_end &char, wrap_width f32) &char
+
+@[inline]
+pub fn im_font_calc_word_wrap_position(self &imgui.ImFont, size f32, const_text &char, const_text_end &char, wrap_width f32) &char {
+ return C.ImFont_CalcWordWrapPosition(self, size, const_text, const_text_end, wrap_width)
+}
+
+
+@[keep_args_alive]
+fn C.ImFont_RenderChar(self &imgui.ImFont, draw_list &imgui.ImDrawList, size f32, pos ImVec2_c, col u32, c u32, cpu_fine_clip &imgui.ImVec4)
+
+@[inline]
+pub fn im_font_render_char(self &imgui.ImFont, draw_list &imgui.ImDrawList, size f32, pos ImVec2_c, col u32, c u32, cpu_fine_clip &imgui.ImVec4) {
+ C.ImFont_RenderChar(self, draw_list, size, pos, col, c, cpu_fine_clip)
+}
+
+
+@[keep_args_alive]
+fn C.ImFont_RenderText(self &imgui.ImFont, draw_list &imgui.ImDrawList, size f32, pos ImVec2_c, col u32, clip_rect ImVec4_c, text_begin &char, const_text_end &char, wrap_width f32, flags imgui.ImDrawTextFlags)
+
+@[inline]
+pub fn im_font_render_text(self &imgui.ImFont, draw_list &imgui.ImDrawList, size f32, pos ImVec2_c, col u32, clip_rect ImVec4_c, text_begin &char, const_text_end &char, wrap_width f32, flags imgui.ImDrawTextFlags) {
+ C.ImFont_RenderText(self, draw_list, size, pos, col, clip_rect, text_begin, const_text_end, wrap_width, flags)
+}
+
+
+@[keep_args_alive]
+fn C.ImFont_ClearOutputData(self &imgui.ImFont)
+
+@[inline]
+pub fn im_font_clear_output_data(self &imgui.ImFont) {
+ C.ImFont_ClearOutputData(self)
+}
+
+
+@[keep_args_alive]
+fn C.ImFont_AddRemapChar(self &imgui.ImFont, from_codepoint u32, to_codepoint u32)
+
+@[inline]
+pub fn im_font_add_remap_char(self &imgui.ImFont, from_codepoint u32, to_codepoint u32) {
+ C.ImFont_AddRemapChar(self, from_codepoint, to_codepoint)
+}
+
+
+@[keep_args_alive]
+fn C.ImFont_IsGlyphRangeUnused(self &imgui.ImFont, c_begin u32, c_last u32) bool
+
+@[inline]
+pub fn im_font_is_glyph_range_unused(self &imgui.ImFont, c_begin u32, c_last u32) bool {
+ return C.ImFont_IsGlyphRangeUnused(self, c_begin, c_last)
+}
+
+
+@[keep_args_alive]
+fn C.ImVec1_ImVec1_Nil() &ImVec1
+
+@[inline]
+pub fn im_vec1_im_vec1_nil() &ImVec1 {
+ return C.ImVec1_ImVec1_Nil()
+}
+
+
+@[keep_args_alive]
+fn C.ImVec1_destroy(self &ImVec1)
+
+@[inline]
+pub fn im_vec1_destroy(self &ImVec1) {
+ C.ImVec1_destroy(self)
+}
+
+
+@[keep_args_alive]
+fn C.ImVec1_ImVec1_Float(_x f32) &ImVec1
+
+@[inline]
+pub fn im_vec1_im_vec1_float(_x f32) &ImVec1 {
+ return C.ImVec1_ImVec1_Float(_x)
+}
+
+
+@[keep_args_alive]
+fn C.ImVec2i_ImVec2i_Nil() &ImVec2i
+
+@[inline]
+pub fn im_vec2i_im_vec2i_nil() &ImVec2i {
+ return C.ImVec2i_ImVec2i_Nil()
+}
+
+
+@[keep_args_alive]
+fn C.ImVec2i_destroy(self &ImVec2i)
+
+@[inline]
+pub fn im_vec2i_destroy(self &ImVec2i) {
+ C.ImVec2i_destroy(self)
+}
+
+
+@[keep_args_alive]
+fn C.ImVec2i_ImVec2i_Int(_x i32, _y i32) &ImVec2i
+
+@[inline]
+pub fn im_vec2i_im_vec2i_int(_x i32, _y i32) &ImVec2i {
+ return C.ImVec2i_ImVec2i_Int(_x, _y)
+}
+
+
+@[keep_args_alive]
+fn C.ImVec2ih_ImVec2ih_Nil() &ImVec2ih
+
+@[inline]
+pub fn im_vec2ih_im_vec2ih_nil() &ImVec2ih {
+ return C.ImVec2ih_ImVec2ih_Nil()
+}
+
+
+@[keep_args_alive]
+fn C.ImVec2ih_destroy(self &ImVec2ih)
+
+@[inline]
+pub fn im_vec2ih_destroy(self &ImVec2ih) {
+ C.ImVec2ih_destroy(self)
+}
+
+
+@[keep_args_alive]
+fn C.ImVec2ih_ImVec2ih_short(_x i16, _y i16) &ImVec2ih
+
+@[inline]
+pub fn im_vec2ih_im_vec2ih_short(_x i16, _y i16) &ImVec2ih {
+ return C.ImVec2ih_ImVec2ih_short(_x, _y)
+}
+
+
+@[keep_args_alive]
+fn C.ImVec2ih_ImVec2ih_Vec2(rhs ImVec2_c) &ImVec2ih
+
+@[inline]
+pub fn im_vec2ih_im_vec2ih_vec2(rhs ImVec2_c) &ImVec2ih {
+ return C.ImVec2ih_ImVec2ih_Vec2(rhs)
+}
+
+
+@[keep_args_alive]
+fn C.ImRect_ImRect_Nil() &ImRect
+
+@[inline]
+pub fn im_rect_im_rect_nil() &ImRect {
+ return C.ImRect_ImRect_Nil()
+}
+
+
+@[keep_args_alive]
+fn C.ImRect_destroy(self &ImRect)
+
+@[inline]
+pub fn im_rect_destroy(self &ImRect) {
+ C.ImRect_destroy(self)
+}
+
+
+@[keep_args_alive]
+fn C.ImRect_ImRect_Vec2(min ImVec2_c, max ImVec2_c) &ImRect
+
+@[inline]
+pub fn im_rect_im_rect_vec2(min ImVec2_c, max ImVec2_c) &ImRect {
+ return C.ImRect_ImRect_Vec2(min, max)
+}
+
+
+@[keep_args_alive]
+fn C.ImRect_ImRect_Vec4(v ImVec4_c) &ImRect
+
+@[inline]
+pub fn im_rect_im_rect_vec4(v ImVec4_c) &ImRect {
+ return C.ImRect_ImRect_Vec4(v)
+}
+
+
+@[keep_args_alive]
+fn C.ImRect_ImRect_Float(x1 f32, y1 f32, x2 f32, y2 f32) &ImRect
+
+@[inline]
+pub fn im_rect_im_rect_float(x1 f32, y1 f32, x2 f32, y2 f32) &ImRect {
+ return C.ImRect_ImRect_Float(x1, y1, x2, y2)
+}
+
+
+@[keep_args_alive]
+fn C.ImRect_GetCenter(self &ImRect) ImVec2_c
+
+@[inline]
+pub fn im_rect_get_center(self &ImRect) ImVec2_c {
+ return C.ImRect_GetCenter(self)
+}
+
+
+@[keep_args_alive]
+fn C.ImRect_GetSize(self &ImRect) ImVec2_c
+
+@[inline]
+pub fn im_rect_get_size(self &ImRect) ImVec2_c {
+ return C.ImRect_GetSize(self)
+}
+
+
+@[keep_args_alive]
+fn C.ImRect_GetWidth(self &ImRect) f32
+
+@[inline]
+pub fn im_rect_get_width(self &ImRect) f32 {
+ return C.ImRect_GetWidth(self)
+}
+
+
+@[keep_args_alive]
+fn C.ImRect_GetHeight(self &ImRect) f32
+
+@[inline]
+pub fn im_rect_get_height(self &ImRect) f32 {
+ return C.ImRect_GetHeight(self)
+}
+
+
+@[keep_args_alive]
+fn C.ImRect_GetArea(self &ImRect) f32
+
+@[inline]
+pub fn im_rect_get_area(self &ImRect) f32 {
+ return C.ImRect_GetArea(self)
+}
+
+
+@[keep_args_alive]
+fn C.ImRect_GetTL(self &ImRect) ImVec2_c
+
+@[inline]
+pub fn im_rect_get_tl(self &ImRect) ImVec2_c {
+ return C.ImRect_GetTL(self)
+}
+
+
+@[keep_args_alive]
+fn C.ImRect_GetTR(self &ImRect) ImVec2_c
+
+@[inline]
+pub fn im_rect_get_tr(self &ImRect) ImVec2_c {
+ return C.ImRect_GetTR(self)
+}
+
+
+@[keep_args_alive]
+fn C.ImRect_GetBL(self &ImRect) ImVec2_c
+
+@[inline]
+pub fn im_rect_get_bl(self &ImRect) ImVec2_c {
+ return C.ImRect_GetBL(self)
+}
+
+
+@[keep_args_alive]
+fn C.ImRect_GetBR(self &ImRect) ImVec2_c
+
+@[inline]
+pub fn im_rect_get_br(self &ImRect) ImVec2_c {
+ return C.ImRect_GetBR(self)
+}
+
+
+@[keep_args_alive]
+fn C.ImRect_Contains_Vec2(self &ImRect, p ImVec2_c) bool
+
+@[inline]
+pub fn im_rect_contains_vec2(self &ImRect, p ImVec2_c) bool {
+ return C.ImRect_Contains_Vec2(self, p)
+}
+
+
+@[keep_args_alive]
+fn C.ImRect_Contains_Rect(self &ImRect, r ImRect_c) bool
+
+@[inline]
+pub fn im_rect_contains_rect(self &ImRect, r ImRect_c) bool {
+ return C.ImRect_Contains_Rect(self, r)
+}
+
+
+@[keep_args_alive]
+fn C.ImRect_ContainsWithPad(self &ImRect, p ImVec2_c, pad ImVec2_c) bool
+
+@[inline]
+pub fn im_rect_contains_with_pad(self &ImRect, p ImVec2_c, pad ImVec2_c) bool {
+ return C.ImRect_ContainsWithPad(self, p, pad)
+}
+
+
+@[keep_args_alive]
+fn C.ImRect_Overlaps(self &ImRect, r ImRect_c) bool
+
+@[inline]
+pub fn im_rect_overlaps(self &ImRect, r ImRect_c) bool {
+ return C.ImRect_Overlaps(self, r)
+}
+
+
+@[keep_args_alive]
+fn C.ImRect_Add_Vec2(self &ImRect, p ImVec2_c)
+
+@[inline]
+pub fn im_rect_add_vec2(self &ImRect, p ImVec2_c) {
+ C.ImRect_Add_Vec2(self, p)
+}
+
+
+@[keep_args_alive]
+fn C.ImRect_Add_Rect(self &ImRect, r ImRect_c)
+
+@[inline]
+pub fn im_rect_add_rect(self &ImRect, r ImRect_c) {
+ C.ImRect_Add_Rect(self, r)
+}
+
+
+@[keep_args_alive]
+fn C.ImRect_AddX(self &ImRect, x f32)
+
+@[inline]
+pub fn im_rect_add_x(self &ImRect, x f32) {
+ C.ImRect_AddX(self, x)
+}
+
+
+@[keep_args_alive]
+fn C.ImRect_AddY(self &ImRect, y f32)
+
+@[inline]
+pub fn im_rect_add_y(self &ImRect, y f32) {
+ C.ImRect_AddY(self, y)
+}
+
+
+@[keep_args_alive]
+fn C.ImRect_Expand_Float(self &ImRect, amount f32)
+
+@[inline]
+pub fn im_rect_expand_float(self &ImRect, amount f32) {
+ C.ImRect_Expand_Float(self, amount)
+}
+
+
+@[keep_args_alive]
+fn C.ImRect_Expand_Vec2(self &ImRect, amount ImVec2_c)
+
+@[inline]
+pub fn im_rect_expand_vec2(self &ImRect, amount ImVec2_c) {
+ C.ImRect_Expand_Vec2(self, amount)
+}
+
+
+@[keep_args_alive]
+fn C.ImRect_Translate(self &ImRect, d ImVec2_c)
+
+@[inline]
+pub fn im_rect_translate(self &ImRect, d ImVec2_c) {
+ C.ImRect_Translate(self, d)
+}
+
+
+@[keep_args_alive]
+fn C.ImRect_TranslateX(self &ImRect, dx f32)
+
+@[inline]
+pub fn im_rect_translate_x(self &ImRect, dx f32) {
+ C.ImRect_TranslateX(self, dx)
+}
+
+
+@[keep_args_alive]
+fn C.ImRect_TranslateY(self &ImRect, dy f32)
+
+@[inline]
+pub fn im_rect_translate_y(self &ImRect, dy f32) {
+ C.ImRect_TranslateY(self, dy)
+}
+
+
+@[keep_args_alive]
+fn C.ImRect_ClipWith(self &ImRect, r ImRect_c)
+
+@[inline]
+pub fn im_rect_clip_with(self &ImRect, r ImRect_c) {
+ C.ImRect_ClipWith(self, r)
+}
+
+
+@[keep_args_alive]
+fn C.ImRect_ClipWithFull(self &ImRect, r ImRect_c)
+
+@[inline]
+pub fn im_rect_clip_with_full(self &ImRect, r ImRect_c) {
+ C.ImRect_ClipWithFull(self, r)
+}
+
+
+@[keep_args_alive]
+fn C.ImRect_IsInverted(self &ImRect) bool
+
+@[inline]
+pub fn im_rect_is_inverted(self &ImRect) bool {
+ return C.ImRect_IsInverted(self)
+}
+
+
+@[keep_args_alive]
+fn C.ImRect_ToVec4(self &ImRect) ImVec4_c
+
+@[inline]
+pub fn im_rect_to_vec4(self &ImRect) ImVec4_c {
+ return C.ImRect_ToVec4(self)
+}
+
+
+@[keep_args_alive]
+fn C.ImRect_AsVec4(self &ImRect) &ImVec4_c
+
+@[inline]
+pub fn im_rect_as_vec4(self &ImRect) &ImVec4_c {
+ return C.ImRect_AsVec4(self)
+}
+
+
+@[keep_args_alive]
+fn C.ImBitVector_Create(self &ImBitVector, sz i32)
+
+@[inline]
+pub fn im_bit_vector_create(self &ImBitVector, sz i32) {
+ C.ImBitVector_Create(self, sz)
+}
+
+
+@[keep_args_alive]
+fn C.ImBitVector_Clear(self &ImBitVector)
+
+@[inline]
+pub fn im_bit_vector_clear(self &ImBitVector) {
+ C.ImBitVector_Clear(self)
+}
+
+
+@[keep_args_alive]
+fn C.ImBitVector_TestBit(self &ImBitVector, n i32) bool
+
+@[inline]
+pub fn im_bit_vector_test_bit(self &ImBitVector, n i32) bool {
+ return C.ImBitVector_TestBit(self, n)
+}
+
+
+@[keep_args_alive]
+fn C.ImBitVector_SetBit(self &ImBitVector, n i32)
+
+@[inline]
+pub fn im_bit_vector_set_bit(self &ImBitVector, n i32) {
+ C.ImBitVector_SetBit(self, n)
+}
+
+
+@[keep_args_alive]
+fn C.ImBitVector_ClearBit(self &ImBitVector, n i32)
+
+@[inline]
+pub fn im_bit_vector_clear_bit(self &ImBitVector, n i32) {
+ C.ImBitVector_ClearBit(self, n)
+}
+
+
+@[keep_args_alive]
+fn C.ImDrawListSharedData_ImDrawListSharedData() &imgui.ImDrawListSharedData
+
+@[inline]
+pub fn im_draw_list_shared_data_im_draw_list_shared_data() &imgui.ImDrawListSharedData {
+ return C.ImDrawListSharedData_ImDrawListSharedData()
+}
+
+
+@[keep_args_alive]
+fn C.ImDrawListSharedData_destroy(self &imgui.ImDrawListSharedData)
+
+@[inline]
+pub fn im_draw_list_shared_data_destroy(self &imgui.ImDrawListSharedData) {
+ C.ImDrawListSharedData_destroy(self)
+}
+
+
+@[keep_args_alive]
+fn C.ImDrawListSharedData_SetCircleTessellationMaxError(self &imgui.ImDrawListSharedData, max_error f32)
+
+@[inline]
+pub fn im_draw_list_shared_data_set_circle_tessellation_max_error(self &imgui.ImDrawListSharedData, max_error f32) {
+ C.ImDrawListSharedData_SetCircleTessellationMaxError(self, max_error)
+}
+
+
+@[keep_args_alive]
+fn C.ImDrawDataBuilder_ImDrawDataBuilder() &imgui.ImDrawDataBuilder
+
+@[inline]
+pub fn im_draw_data_builder_im_draw_data_builder() &imgui.ImDrawDataBuilder {
+ return C.ImDrawDataBuilder_ImDrawDataBuilder()
+}
+
+
+@[keep_args_alive]
+fn C.ImDrawDataBuilder_destroy(self &imgui.ImDrawDataBuilder)
+
+@[inline]
+pub fn im_draw_data_builder_destroy(self &imgui.ImDrawDataBuilder) {
+ C.ImDrawDataBuilder_destroy(self)
+}
+
+
+@[keep_args_alive]
+fn C.ImFontLoader_ImFontLoader() &imgui.ImFontLoader
+
+@[inline]
+pub fn im_font_loader_im_font_loader() &imgui.ImFontLoader {
+ return C.ImFontLoader_ImFontLoader()
+}
+
+
+@[keep_args_alive]
+fn C.ImFontLoader_destroy(self &imgui.ImFontLoader)
+
+@[inline]
+pub fn im_font_loader_destroy(self &imgui.ImFontLoader) {
+ C.ImFontLoader_destroy(self)
+}
+
+
+@[keep_args_alive]
+fn C.ImFontAtlasBuilder_ImFontAtlasBuilder() &imgui.ImFontAtlasBuilder
+
+@[inline]
+pub fn im_font_atlas_builder_im_font_atlas_builder() &imgui.ImFontAtlasBuilder {
+ return C.ImFontAtlasBuilder_ImFontAtlasBuilder()
+}
+
+
+@[keep_args_alive]
+fn C.ImFontAtlasBuilder_destroy(self &imgui.ImFontAtlasBuilder)
+
+@[inline]
+pub fn im_font_atlas_builder_destroy(self &imgui.ImFontAtlasBuilder) {
+ C.ImFontAtlasBuilder_destroy(self)
+}
+
+/////////////////////////hand written functions
+// no appendfV
+
+// for getting FLT_MAX in bindings
+
+// for getting FLT_MIN in bindings
+
+
+@[keep_args_alive]
+fn C.ImVector_ImWchar_create() &ImVector_ImWchar
+
+@[inline]
+pub fn im_vector_im_wchar_create() &ImVector_ImWchar {
+ return C.ImVector_ImWchar_create()
+}
+
+
+@[keep_args_alive]
+fn C.ImVector_ImWchar_destroy(self &ImVector_ImWchar)
+
+@[inline]
+pub fn im_vector_im_wchar_destroy(self &ImVector_ImWchar) {
+ C.ImVector_ImWchar_destroy(self)
+}
+
+
+@[keep_args_alive]
+fn C.ImVector_ImWchar_Init(p &ImVector_ImWchar)
+
+@[inline]
+pub fn im_vector_im_wchar_init(p &ImVector_ImWchar) {
+ C.ImVector_ImWchar_Init(p)
+}
+
+
+@[keep_args_alive]
+fn C.ImVector_ImWchar_UnInit(p &ImVector_ImWchar)
+
+@[inline]
+pub fn im_vector_im_wchar_un_init(p &ImVector_ImWchar) {
+ C.ImVector_ImWchar_UnInit(p)
+}
+
+// CIMGUI_INCLUDED
+
+
+pub type Tm = C.Tm
+@[typedef]
+pub struct C.Tm {}
+
+pub type Axis = Axis_c
+
+pub type DateTimeSpec = C.DateTimeSpec_c
+
+pub type Point = Point_c
+
+pub type Range = Range_c
+
+pub type Rect = Rect_c
+
+pub type Spec = C.Spec_c
+
+pub type Tick = Tick_c
+
+pub type Time = Time_c
+
+
+pub type AxisColor = C.ImPlotAxisColor
+@[typedef]
+pub struct C.ImPlotAxisColor {}
+
+
+pub type ImVector_ImS16 = C.ImVector_ImS16
+@[typedef]
+pub struct C.ImVector_ImS16 {
+pub mut:
+ Size i32
+ Capacity i32
+ Data &i16
+}
+
+
+pub type ImVector_ImS32 = C.ImVector_ImS32
+@[typedef]
+pub struct C.ImVector_ImS32 {
+pub mut:
+ Size i32
+ Capacity i32
+ Data &i32
+}
+
+
+pub type ImVector_ImS64 = C.ImVector_ImS64
+@[typedef]
+pub struct C.ImVector_ImS64 {
+pub mut:
+ Size i32
+ Capacity i32
+ Data &i64
+}
+
+
+pub type ImVector_ImS8 = C.ImVector_ImS8
+@[typedef]
+pub struct C.ImVector_ImS8 {
+pub mut:
+ Size i32
+ Capacity i32
+ Data &char
+}
+
+
+pub type ImVector_ImU64 = C.ImVector_ImU64
+@[typedef]
+pub struct C.ImVector_ImU64 {
+pub mut:
+ Size i32
+ Capacity i32
+ Data &u64
+}
+
+pub const implot_auto = -1
+
+pub type ImAxis = i32
+
+pub type Prop = i32
+
+pub type Flags = i32
+
+pub type AxisFlags = i32
+
+pub type SubplotFlags = i32
+
+pub type LegendFlags = i32
+
+pub type MouseTextFlags = i32
+
+pub type DragToolFlags = i32
+
+pub type ColormapScaleFlags = i32
+
+pub type ItemFlags = i32
+
+pub type LineFlags = i32
+
+pub type ScatterFlags = i32
+
+pub type BubblesFlags = i32
+
+pub type PolygonFlags = i32
+
+pub type StairsFlags = i32
+
+pub type ShadedFlags = i32
+
+pub type BarsFlags = i32
+
+pub type BarGroupsFlags = i32
+
+pub type ErrorBarsFlags = i32
+
+pub type StemsFlags = i32
+
+pub type InfLinesFlags = i32
+
+pub type PieChartFlags = i32
+
+pub type HeatmapFlags = i32
+
+pub type HistogramFlags = i32
+
+pub type DigitalFlags = i32
+
+pub type ImageFlags = i32
+
+pub type TextFlags = i32
+
+pub type DummyFlags = i32
+
+pub type Cond = i32
+
+pub type Col = i32
+
+pub type StyleVar = i32
+
+pub type Scale = i32
+
+pub type Marker = i32
+
+pub type Colormap = i32
+
+pub type Location = i32
+
+pub type Bin = i32
+
+
+pub enum ImAxis_ {
+ x1 = 0
x2
x3
y1
@@ -2562,9 +4578,9 @@ pub enum Bin_ {
}
-pub type Spec_c = C.ImPlotSpec_c
+pub type Point_c = C.ImPlotPoint_c
@[typedef]
-pub struct C.ImPlotSpec_c {
+pub struct C.ImPlotPoint_c {
pub mut:
LineColor ImVec4_c
LineColors &u32
@@ -2586,21 +4602,12 @@ pub mut:
}
-pub type Point_c = C.ImPlotPoint_c
-@[typedef]
-pub struct C.ImPlotPoint_c {
-pub mut:
- X f64
- Y f64
-}
-
-
pub type Range_c = C.ImPlotRange_c
@[typedef]
pub struct C.ImPlotRange_c {
pub mut:
- Min f64
- Max f64
+ X f64
+ Y f64
}
@@ -2608,8 +4615,8 @@ pub type Rect_c = C.ImPlotRect_c
@[typedef]
pub struct C.ImPlotRect_c {
pub mut:
- X Range_c
- Y Range_c
+ Min f64
+ Max f64
}
@@ -2663,11 +4670,11 @@ pub mut:
ZoomRate f32
}
-pub type Formatter = fn(f64, &char, i32, voidptr) i32
+pub type Formatter = fn (f64, &char, i32, voidptr) i32
-pub type Getter = fn(i32, voidptr) Point_c
+pub type Getter = fn (i32, voidptr) Point_c
-pub type Transform = fn(f64, voidptr) f64
+pub type Transform = fn (f64, voidptr) f64
pub const implot_min_time = f64(0)
@@ -2725,12 +4732,12 @@ pub enum MarkerInternal_ {
marker_invalid = -3
}
-pub type Locator = fn(&Ticker, Range_c, f32, bool, Formatter, voidptr)
+pub type Locator = fn (&Ticker, Range_c, f32, bool, Formatter, voidptr)
-pub type DateTimeSpec_c = C.ImPlotDateTimeSpec_c
+pub type Time_c = C.ImPlotTime_c
@[typedef]
-pub struct C.ImPlotDateTimeSpec_c {
+pub struct C.ImPlotTime_c {
pub mut:
Date DateFmt
Time TimeFmt
@@ -2739,15 +4746,6 @@ pub mut:
}
-pub type Time_c = C.ImPlotTime_c
-@[typedef]
-pub struct C.ImPlotTime_c {
-pub mut:
- S i64
- Us i32
-}
-
-
pub type ImVector_bool = C.ImVector_bool
@[typedef]
pub struct C.ImVector_bool {
@@ -3241,7 +5239,11 @@ pub mut:
}
-pub type DateTimeSpec = C.ImPlotDateTimeSpec
+pub type Formatter_Time_Data = C.Formatter_Time_Data
+@[typedef]
+pub struct C.Formatter_Time_Data {}
+
+
@[typedef]
pub struct C.ImPlotDateTimeSpec {
pub mut:
@@ -3252,7 +5254,7 @@ pub mut:
}
// Point getters manually wrapped use this
-pub type Point_getter = fn(voidptr, i32, &Point_c) voidptr
+pub type Point_getter = fn (voidptr, i32, &Point_c) voidptr
@[keep_args_alive]
@@ -6412,10 +8414,10 @@ pub fn annotation_str(x f64, y f64, col ImVec4_c, pix_offset ImVec2_c, clamp boo
@[keep_args_alive]
-fn C.ImPlot_AnnotationV(x f64, y f64, col ImVec4_c, pix_offset ImVec2_c, clamp bool, const_fmt &char, args Va_list)
+fn C.ImPlot_AnnotationV(x f64, y f64, col ImVec4_c, pix_offset ImVec2_c, clamp bool, const_fmt &char, args C.va_list)
@[inline]
-pub fn annotation_v(x f64, y f64, col ImVec4_c, pix_offset ImVec2_c, clamp bool, const_fmt &char, args Va_list) {
+pub fn annotation_v(x f64, y f64, col ImVec4_c, pix_offset ImVec2_c, clamp bool, const_fmt &char, args C.va_list) {
C.ImPlot_AnnotationV(x, y, col, pix_offset, clamp, const_fmt, args)
}
@@ -6439,10 +8441,10 @@ pub fn tag_x_str(x f64, col ImVec4_c, const_fmt &char) {
@[keep_args_alive]
-fn C.ImPlot_TagXV(x f64, col ImVec4_c, const_fmt &char, args Va_list)
+fn C.ImPlot_TagXV(x f64, col ImVec4_c, const_fmt &char, args C.va_list)
@[inline]
-pub fn tag_xv(x f64, col ImVec4_c, const_fmt &char, args Va_list) {
+pub fn tag_xv(x f64, col ImVec4_c, const_fmt &char, args C.va_list) {
C.ImPlot_TagXV(x, col, const_fmt, args)
}
@@ -6466,10 +8468,10 @@ pub fn tag_y_str(y f64, col ImVec4_c, const_fmt &char) {
@[keep_args_alive]
-fn C.ImPlot_TagYV(y f64, col ImVec4_c, const_fmt &char, args Va_list)
+fn C.ImPlot_TagYV(y f64, col ImVec4_c, const_fmt &char, args C.va_list)
@[inline]
-pub fn tag_yv(y f64, col ImVec4_c, const_fmt &char, args Va_list) {
+pub fn tag_yv(y f64, col ImVec4_c, const_fmt &char, args C.va_list) {
C.ImPlot_TagYV(y, col, const_fmt, args)
}
@@ -8428,10 +10430,10 @@ pub fn annotation_collection_destroy(self &AnnotationCollection) {
@[keep_args_alive]
-fn C.ImPlotAnnotationCollection_AppendV(self &AnnotationCollection, pos ImVec2_c, off ImVec2_c, bg u32, fg u32, clamp bool, const_fmt &char, args Va_list)
+fn C.ImPlotAnnotationCollection_AppendV(self &AnnotationCollection, pos ImVec2_c, off ImVec2_c, bg u32, fg u32, clamp bool, const_fmt &char, args C.va_list)
@[inline]
-pub fn annotation_collection_append_v(self &AnnotationCollection, pos ImVec2_c, off ImVec2_c, bg u32, fg u32, clamp bool, const_fmt &char, args Va_list) {
+pub fn annotation_collection_append_v(self &AnnotationCollection, pos ImVec2_c, off ImVec2_c, bg u32, fg u32, clamp bool, const_fmt &char, args C.va_list) {
C.ImPlotAnnotationCollection_AppendV(self, pos, off, bg, fg, clamp, const_fmt, args)
}
@@ -8500,10 +10502,10 @@ pub fn tag_collection_destroy(self &TagCollection) {
@[keep_args_alive]
-fn C.ImPlotTagCollection_AppendV(self &TagCollection, axis ImAxis, value f64, bg u32, fg u32, const_fmt &char, args Va_list)
+fn C.ImPlotTagCollection_AppendV(self &TagCollection, axis ImAxis, value f64, bg u32, fg u32, const_fmt &char, args C.va_list)
@[inline]
-pub fn tag_collection_append_v(self &TagCollection, axis ImAxis, value f64, bg u32, fg u32, const_fmt &char, args Va_list) {
+pub fn tag_collection_append_v(self &TagCollection, axis ImAxis, value f64, bg u32, fg u32, const_fmt &char, args C.va_list) {
C.ImPlotTagCollection_AppendV(self, axis, value, bg, fg, const_fmt, args)
}
diff --git a/include/cimgui.cpp b/include/cimgui.cpp
index 6bfae71..eeadfec 100644
--- a/include/cimgui.cpp
+++ b/include/cimgui.cpp
@@ -1,5 +1,5 @@
//This file is automatically generated by generator.lua from https://github.com/cimgui/cimgui
-//based on imgui.h file version "1.92.7" 19270 from Dear ImGui https://github.com/ocornut/imgui
+//based on imgui.h file version "1.92.9b" 19291 from Dear ImGui https://github.com/ocornut/imgui
//with imgui_internal.h api
//with imgui_freetype.h api
//docking branch
@@ -663,7 +663,7 @@ CIMGUI_API void igText(const char* fmt,...)
#ifdef CIMGUI_VARGS0
CIMGUI_API void igText0(const char* fmt)
{
- return igText(fmt);
+ igText(fmt);
}
#endif
CIMGUI_API void igTextV(const char* fmt,va_list args)
@@ -680,7 +680,7 @@ CIMGUI_API void igTextColored(const ImVec4_c col,const char* fmt,...)
#ifdef CIMGUI_VARGS0
CIMGUI_API void igTextColored0(const ImVec4_c col,const char* fmt)
{
- return igTextColored(col,fmt);
+ igTextColored(col,fmt);
}
#endif
CIMGUI_API void igTextColoredV(const ImVec4_c col,const char* fmt,va_list args)
@@ -697,7 +697,7 @@ CIMGUI_API void igTextDisabled(const char* fmt,...)
#ifdef CIMGUI_VARGS0
CIMGUI_API void igTextDisabled0(const char* fmt)
{
- return igTextDisabled(fmt);
+ igTextDisabled(fmt);
}
#endif
CIMGUI_API void igTextDisabledV(const char* fmt,va_list args)
@@ -714,7 +714,7 @@ CIMGUI_API void igTextWrapped(const char* fmt,...)
#ifdef CIMGUI_VARGS0
CIMGUI_API void igTextWrapped0(const char* fmt)
{
- return igTextWrapped(fmt);
+ igTextWrapped(fmt);
}
#endif
CIMGUI_API void igTextWrappedV(const char* fmt,va_list args)
@@ -731,7 +731,7 @@ CIMGUI_API void igLabelText(const char* label,const char* fmt,...)
#ifdef CIMGUI_VARGS0
CIMGUI_API void igLabelText0(const char* label,const char* fmt)
{
- return igLabelText(label,fmt);
+ igLabelText(label,fmt);
}
#endif
CIMGUI_API void igLabelTextV(const char* label,const char* fmt,va_list args)
@@ -748,7 +748,7 @@ CIMGUI_API void igBulletText(const char* fmt,...)
#ifdef CIMGUI_VARGS0
CIMGUI_API void igBulletText0(const char* fmt)
{
- return igBulletText(fmt);
+ igBulletText(fmt);
}
#endif
CIMGUI_API void igBulletTextV(const char* fmt,va_list args)
@@ -1023,10 +1023,6 @@ CIMGUI_API bool igColorButton(const char* desc_id,const ImVec4_c col,ImGuiColorE
{
return ImGui::ColorButton(desc_id,ConvertToCPP_ImVec4(col),flags,ConvertToCPP_ImVec2(size));
}
-CIMGUI_API void igSetColorEditOptions(ImGuiColorEditFlags flags)
-{
- return ImGui::SetColorEditOptions(flags);
-}
CIMGUI_API bool igTreeNode_Str(const char* label)
{
return ImGui::TreeNode(label);
@@ -1265,7 +1261,7 @@ CIMGUI_API void igSetTooltip(const char* fmt,...)
#ifdef CIMGUI_VARGS0
CIMGUI_API void igSetTooltip0(const char* fmt)
{
- return igSetTooltip(fmt);
+ igSetTooltip(fmt);
}
#endif
CIMGUI_API void igSetTooltipV(const char* fmt,va_list args)
@@ -1286,7 +1282,7 @@ CIMGUI_API void igSetItemTooltip(const char* fmt,...)
#ifdef CIMGUI_VARGS0
CIMGUI_API void igSetItemTooltip0(const char* fmt)
{
- return igSetItemTooltip(fmt);
+ igSetItemTooltip(fmt);
}
#endif
CIMGUI_API void igSetItemTooltipV(const char* fmt,va_list args)
@@ -1305,15 +1301,15 @@ CIMGUI_API void igEndPopup()
{
return ImGui::EndPopup();
}
-CIMGUI_API void igOpenPopup_Str(const char* str_id,ImGuiPopupFlags popup_flags)
+CIMGUI_API bool igOpenPopup_Str(const char* str_id,ImGuiPopupFlags popup_flags)
{
return ImGui::OpenPopup(str_id,popup_flags);
}
-CIMGUI_API void igOpenPopup_ID(ImGuiID id,ImGuiPopupFlags popup_flags)
+CIMGUI_API bool igOpenPopup_ID(ImGuiID id,ImGuiPopupFlags popup_flags)
{
return ImGui::OpenPopup(id,popup_flags);
}
-CIMGUI_API void igOpenPopupOnItemClick(const char* str_id,ImGuiPopupFlags popup_flags)
+CIMGUI_API bool igOpenPopupOnItemClick(const char* str_id,ImGuiPopupFlags popup_flags)
{
return ImGui::OpenPopupOnItemClick(str_id,popup_flags);
}
@@ -1357,9 +1353,9 @@ CIMGUI_API bool igTableSetColumnIndex(int column_n)
{
return ImGui::TableSetColumnIndex(column_n);
}
-CIMGUI_API void igTableSetupColumn(const char* label,ImGuiTableColumnFlags flags,float init_width_or_weight,ImGuiID user_id)
+CIMGUI_API void igTableSetupColumn(const char* label,ImGuiTableColumnFlags flags,float init_width_or_weight,ImGuiID user_data)
{
- return ImGui::TableSetupColumn(label,flags,init_width_or_weight,user_id);
+ return ImGui::TableSetupColumn(label,flags,init_width_or_weight,user_data);
}
CIMGUI_API void igTableSetupScrollFreeze(int cols,int rows)
{
@@ -1523,7 +1519,7 @@ CIMGUI_API void igLogText(const char* fmt,...)
#ifdef CIMGUI_VARGS0
CIMGUI_API void igLogText0(const char* fmt)
{
- return igLogText(fmt);
+ igLogText(fmt);
}
#endif
CIMGUI_API void igLogTextV(const char* fmt,va_list args)
@@ -1662,6 +1658,10 @@ CIMGUI_API ImGuiItemFlags igGetItemFlags()
{
return ImGui::GetItemFlags();
}
+CIMGUI_API int igGetItemClickedCountWithSingleClickDelay(ImGuiMouseButton mouse_button,float delay)
+{
+ return ImGui::GetItemClickedCountWithSingleClickDelay(mouse_button,delay);
+}
CIMGUI_API ImGuiViewport* igGetMainViewport()
{
return ImGui::GetMainViewport();
@@ -1762,7 +1762,7 @@ CIMGUI_API void igSetNextItemShortcut(ImGuiKeyChord key_chord,ImGuiInputFlags fl
{
return ImGui::SetNextItemShortcut(key_chord,flags);
}
-CIMGUI_API void igSetItemKeyOwner_Nil(ImGuiKey key)
+CIMGUI_API bool igSetItemKeyOwner_Nil(ImGuiKey key)
{
return ImGui::SetItemKeyOwner(key);
}
@@ -1884,7 +1884,7 @@ CIMGUI_API void igDebugLog(const char* fmt,...)
#ifdef CIMGUI_VARGS0
CIMGUI_API void igDebugLog0(const char* fmt)
{
- return igDebugLog(fmt);
+ igDebugLog(fmt);
}
#endif
CIMGUI_API void igDebugLogV(const char* fmt,va_list args)
@@ -2463,9 +2463,17 @@ CIMGUI_API void ImDrawList_AddLine(ImDrawList* self,const ImVec2_c p1,const ImVe
{
return self->AddLine(ConvertToCPP_ImVec2(p1),ConvertToCPP_ImVec2(p2),col,thickness);
}
-CIMGUI_API void ImDrawList_AddRect(ImDrawList* self,const ImVec2_c p_min,const ImVec2_c p_max,ImU32 col,float rounding,ImDrawFlags flags,float thickness)
+CIMGUI_API void ImDrawList_AddLineH(ImDrawList* self,float min_x,float max_x,float y,ImU32 col,float thickness)
+{
+ return self->AddLineH(min_x,max_x,y,col,thickness);
+}
+CIMGUI_API void ImDrawList_AddLineV(ImDrawList* self,float x,float min_y,float max_y,ImU32 col,float thickness)
+{
+ return self->AddLineV(x,min_y,max_y,col,thickness);
+}
+CIMGUI_API void ImDrawList_AddRect(ImDrawList* self,const ImVec2_c p_min,const ImVec2_c p_max,ImU32 col,float rounding,float thickness,ImDrawFlags flags)
{
- return self->AddRect(ConvertToCPP_ImVec2(p_min),ConvertToCPP_ImVec2(p_max),col,rounding,flags,thickness);
+ return self->AddRect(ConvertToCPP_ImVec2(p_min),ConvertToCPP_ImVec2(p_max),col,rounding,thickness,flags);
}
CIMGUI_API void ImDrawList_AddRectFilled(ImDrawList* self,const ImVec2_c p_min,const ImVec2_c p_max,ImU32 col,float rounding,ImDrawFlags flags)
{
@@ -2531,9 +2539,9 @@ CIMGUI_API void ImDrawList_AddBezierQuadratic(ImDrawList* self,const ImVec2_c p1
{
return self->AddBezierQuadratic(ConvertToCPP_ImVec2(p1),ConvertToCPP_ImVec2(p2),ConvertToCPP_ImVec2(p3),col,thickness,num_segments);
}
-CIMGUI_API void ImDrawList_AddPolyline(ImDrawList* self,const ImVec2_c* points,int num_points,ImU32 col,ImDrawFlags flags,float thickness)
+CIMGUI_API void ImDrawList_AddPolyline(ImDrawList* self,const ImVec2_c* points,int num_points,ImU32 col,float thickness,ImDrawFlags flags)
{
- return self->AddPolyline(reinterpret_cast(points),num_points,col,flags,thickness);
+ return self->AddPolyline(reinterpret_cast(points),num_points,col,thickness,flags);
}
CIMGUI_API void ImDrawList_AddConvexPolyFilled(ImDrawList* self,const ImVec2_c* points,int num_points,ImU32 col)
{
@@ -2575,9 +2583,9 @@ CIMGUI_API void ImDrawList_PathFillConcave(ImDrawList* self,ImU32 col)
{
return self->PathFillConcave(col);
}
-CIMGUI_API void ImDrawList_PathStroke(ImDrawList* self,ImU32 col,ImDrawFlags flags,float thickness)
+CIMGUI_API void ImDrawList_PathStroke(ImDrawList* self,ImU32 col,float thickness,ImDrawFlags flags)
{
- return self->PathStroke(col,flags,thickness);
+ return self->PathStroke(col,thickness,flags);
}
CIMGUI_API void ImDrawList_PathArcTo(ImDrawList* self,const ImVec2_c center,float radius,float a_min,float a_max,int num_segments)
{
@@ -2883,10 +2891,6 @@ CIMGUI_API void ImFontAtlas_RemoveFont(ImFontAtlas* self,ImFont* font)
{
return self->RemoveFont(font);
}
-CIMGUI_API void ImFontAtlas_Clear(ImFontAtlas* self)
-{
- return self->Clear();
-}
CIMGUI_API void ImFontAtlas_CompactCache(ImFontAtlas* self)
{
return self->CompactCache();
@@ -2895,14 +2899,18 @@ CIMGUI_API void ImFontAtlas_SetFontLoader(ImFontAtlas* self,const ImFontLoader*
{
return self->SetFontLoader(font_loader);
}
-CIMGUI_API void ImFontAtlas_ClearInputData(ImFontAtlas* self)
+CIMGUI_API void ImFontAtlas_Clear(ImFontAtlas* self)
{
- return self->ClearInputData();
+ return self->Clear();
}
CIMGUI_API void ImFontAtlas_ClearFonts(ImFontAtlas* self)
{
return self->ClearFonts();
}
+CIMGUI_API void ImFontAtlas_ClearInputData(ImFontAtlas* self)
+{
+ return self->ClearInputData();
+}
CIMGUI_API void ImFontAtlas_ClearTexData(ImFontAtlas* self)
{
return self->ClearTexData();
@@ -3187,7 +3195,7 @@ CIMGUI_API void igImFormatStringToTempBuffer(const char** out_buf,const char** o
#ifdef CIMGUI_VARGS0
CIMGUI_API void igImFormatStringToTempBuffer0(const char** out_buf,const char** out_buf_end,const char* fmt)
{
- return igImFormatStringToTempBuffer(out_buf,out_buf_end,fmt);
+ igImFormatStringToTempBuffer(out_buf,out_buf_end,fmt);
}
#endif
CIMGUI_API void igImFormatStringToTempBufferV(const char** out_buf,const char** out_buf_end,const char* fmt,va_list args)
@@ -3418,6 +3426,10 @@ CIMGUI_API float igImRound64(float f)
{
return ImRound64(f);
}
+CIMGUI_API float igImCeilFast(float f)
+{
+ return ImCeilFast(f);
+}
CIMGUI_API int igImModPositive(int a,int b)
{
return ImModPositive(a,b);
@@ -3610,6 +3622,14 @@ CIMGUI_API void ImRect_Add_Rect(ImRect* self,const ImRect_c r)
{
return self->Add(ConvertToCPP_ImRect(r));
}
+CIMGUI_API void ImRect_AddX(ImRect* self,float x)
+{
+ return self->AddX(x);
+}
+CIMGUI_API void ImRect_AddY(ImRect* self,float y)
+{
+ return self->AddY(y);
+}
CIMGUI_API void ImRect_Expand_Float(ImRect* self,const float amount)
{
return self->Expand(amount);
@@ -3714,6 +3734,30 @@ CIMGUI_API void ImGuiTextIndex_append(ImGuiTextIndex* self,const char* base,int
{
return self->append(base,old_size,new_size);
}
+CIMGUI_API ImGuiPackedDate* ImGuiPackedDate_ImGuiPackedDate_Nil(void)
+{
+ return IM_NEW(ImGuiPackedDate)();
+}
+CIMGUI_API void ImGuiPackedDate_destroy(ImGuiPackedDate* self)
+{
+ IM_DELETE(self);
+}
+CIMGUI_API ImGuiPackedDate* ImGuiPackedDate_ImGuiPackedDate_Int(int yyyymmdd)
+{
+ return IM_NEW(ImGuiPackedDate)(yyyymmdd);
+}
+CIMGUI_API bool ImGuiPackedDate_IsValid(ImGuiPackedDate* self)
+{
+ return self->IsValid();
+}
+CIMGUI_API int ImGuiPackedDate_Unpack(ImGuiPackedDate* self)
+{
+ return self->Unpack();
+}
+CIMGUI_API void ImGuiPackedDate_SubtractMonths(ImGuiPackedDate* self,int m)
+{
+ return self->SubtractMonths(m);
+}
CIMGUI_API ImGuiStoragePair* igImLowerBound(ImGuiStoragePair* in_begin,ImGuiStoragePair* in_end,ImGuiID key)
{
return ImLowerBound(in_begin,in_end,key);
@@ -4342,235 +4386,515 @@ CIMGUI_API ImGuiTableColumnSettings* ImGuiTableSettings_GetColumnSettings(ImGuiT
{
return self->GetColumnSettings();
}
-CIMGUI_API ImGuiIO* igGetIO_ContextPtr(ImGuiContext* ctx)
+CIMGUI_API void igTableOpenContextMenu(int column_n)
{
- return &ImGui::GetIO(ctx);
+ return ImGui::TableOpenContextMenu(column_n);
}
-CIMGUI_API ImGuiPlatformIO* igGetPlatformIO_ContextPtr(ImGuiContext* ctx)
+CIMGUI_API void igTableSetColumnWidth(int column_n,float width)
{
- return &ImGui::GetPlatformIO(ctx);
+ return ImGui::TableSetColumnWidth(column_n,width);
}
-CIMGUI_API float igGetScale()
+CIMGUI_API void igTableSetColumnSortDirection(int column_n,ImGuiSortDirection sort_direction,bool append_to_sort_specs)
{
- return ImGui::GetScale();
+ return ImGui::TableSetColumnSortDirection(column_n,sort_direction,append_to_sort_specs);
}
-CIMGUI_API ImGuiWindow* igGetCurrentWindowRead()
+CIMGUI_API int igTableGetHoveredRow()
{
- return ImGui::GetCurrentWindowRead();
+ return ImGui::TableGetHoveredRow();
}
-CIMGUI_API ImGuiWindow* igGetCurrentWindow()
+CIMGUI_API float igTableGetHeaderRowHeight()
{
- return ImGui::GetCurrentWindow();
+ return ImGui::TableGetHeaderRowHeight();
}
-CIMGUI_API ImGuiWindow* igFindWindowByID(ImGuiID id)
+CIMGUI_API float igTableGetHeaderAngledMaxLabelWidth()
{
- return ImGui::FindWindowByID(id);
+ return ImGui::TableGetHeaderAngledMaxLabelWidth();
}
-CIMGUI_API ImGuiWindow* igFindWindowByName(const char* name)
+CIMGUI_API void igTablePushBackgroundChannel()
{
- return ImGui::FindWindowByName(name);
+ return ImGui::TablePushBackgroundChannel();
}
-CIMGUI_API void igUpdateWindowParentAndRootLinks(ImGuiWindow* window,ImGuiWindowFlags flags,ImGuiWindow* parent_window)
+CIMGUI_API void igTablePopBackgroundChannel()
{
- return ImGui::UpdateWindowParentAndRootLinks(window,flags,parent_window);
+ return ImGui::TablePopBackgroundChannel();
}
-CIMGUI_API void igUpdateWindowSkipRefresh(ImGuiWindow* window)
+CIMGUI_API void igTablePushColumnChannel(int column_n)
{
- return ImGui::UpdateWindowSkipRefresh(window);
+ return ImGui::TablePushColumnChannel(column_n);
}
-CIMGUI_API ImVec2_c igCalcWindowNextAutoFitSize(ImGuiWindow* window)
+CIMGUI_API void igTablePopColumnChannel()
{
- return ConvertFromCPP_ImVec2(ImGui::CalcWindowNextAutoFitSize(window));
+ return ImGui::TablePopColumnChannel();
}
-CIMGUI_API bool igIsWindowChildOf(ImGuiWindow* window,ImGuiWindow* potential_parent,bool popup_hierarchy,bool dock_hierarchy)
+CIMGUI_API void igTableAngledHeadersRowEx(ImGuiID row_id,float angle,float max_label_width,const ImGuiTableHeaderData* data,int data_count)
{
- return ImGui::IsWindowChildOf(window,potential_parent,popup_hierarchy,dock_hierarchy);
+ return ImGui::TableAngledHeadersRowEx(row_id,angle,max_label_width,data,data_count);
}
-CIMGUI_API bool igIsWindowInBeginStack(ImGuiWindow* window)
+CIMGUI_API ImGuiTable* igGetCurrentTable()
{
- return ImGui::IsWindowInBeginStack(window);
+ return ImGui::GetCurrentTable();
}
-CIMGUI_API bool igIsWindowWithinBeginStackOf(ImGuiWindow* window,ImGuiWindow* potential_parent)
+CIMGUI_API ImGuiTable* igTableFindByID(ImGuiID id)
{
- return ImGui::IsWindowWithinBeginStackOf(window,potential_parent);
+ return ImGui::TableFindByID(id);
}
-CIMGUI_API bool igIsWindowAbove(ImGuiWindow* potential_above,ImGuiWindow* potential_below)
+CIMGUI_API bool igBeginTableEx(const char* name,ImGuiID id,int columns_count,ImGuiTableFlags flags,const ImVec2_c outer_size,float inner_width)
{
- return ImGui::IsWindowAbove(potential_above,potential_below);
+ return ImGui::BeginTableEx(name,id,columns_count,flags,ConvertToCPP_ImVec2(outer_size),inner_width);
}
-CIMGUI_API bool igIsWindowNavFocusable(ImGuiWindow* window)
+CIMGUI_API void igTableBeginInitMemory(ImGuiTable* table,int columns_count)
{
- return ImGui::IsWindowNavFocusable(window);
+ return ImGui::TableBeginInitMemory(table,columns_count);
}
-CIMGUI_API void igSetWindowPos_WindowPtr(ImGuiWindow* window,const ImVec2_c pos,ImGuiCond cond)
+CIMGUI_API void igTableApplyQueuedRequests(ImGuiTable* table)
{
- return ImGui::SetWindowPos(window,ConvertToCPP_ImVec2(pos),cond);
+ return ImGui::TableApplyQueuedRequests(table);
}
-CIMGUI_API void igSetWindowSize_WindowPtr(ImGuiWindow* window,const ImVec2_c size,ImGuiCond cond)
+CIMGUI_API void igTableSetupDrawChannels(ImGuiTable* table)
{
- return ImGui::SetWindowSize(window,ConvertToCPP_ImVec2(size),cond);
+ return ImGui::TableSetupDrawChannels(table);
}
-CIMGUI_API void igSetWindowCollapsed_WindowPtr(ImGuiWindow* window,bool collapsed,ImGuiCond cond)
+CIMGUI_API void igTableReconcileColumns(ImGuiTable* table)
{
- return ImGui::SetWindowCollapsed(window,collapsed,cond);
+ return ImGui::TableReconcileColumns(table);
}
-CIMGUI_API void igSetWindowHitTestHole(ImGuiWindow* window,const ImVec2_c pos,const ImVec2_c size)
+CIMGUI_API void igTableUpdateLayout(ImGuiTable* table)
{
- return ImGui::SetWindowHitTestHole(window,ConvertToCPP_ImVec2(pos),ConvertToCPP_ImVec2(size));
+ return ImGui::TableUpdateLayout(table);
}
-CIMGUI_API void igSetWindowHiddenAndSkipItemsForCurrentFrame(ImGuiWindow* window)
+CIMGUI_API void igTableUpdateBorders(ImGuiTable* table)
{
- return ImGui::SetWindowHiddenAndSkipItemsForCurrentFrame(window);
+ return ImGui::TableUpdateBorders(table);
}
-CIMGUI_API void igSetWindowParentWindowForFocusRoute(ImGuiWindow* window,ImGuiWindow* parent_window)
+CIMGUI_API void igTableUpdateColumnsWeightFromWidth(ImGuiTable* table)
{
- return ImGui::SetWindowParentWindowForFocusRoute(window,parent_window);
+ return ImGui::TableUpdateColumnsWeightFromWidth(table);
}
-CIMGUI_API ImRect_c igWindowRectAbsToRel(ImGuiWindow* window,const ImRect_c r)
+CIMGUI_API void igTableApplyExternalUnclipRect(ImGuiTable* table,ImRect* rect)
{
- return ConvertFromCPP_ImRect(ImGui::WindowRectAbsToRel(window,ConvertToCPP_ImRect(r)));
+ return ImGui::TableApplyExternalUnclipRect(table,*rect);
}
-CIMGUI_API ImRect_c igWindowRectRelToAbs(ImGuiWindow* window,const ImRect_c r)
+CIMGUI_API void igTableDrawBorders(ImGuiTable* table)
{
- return ConvertFromCPP_ImRect(ImGui::WindowRectRelToAbs(window,ConvertToCPP_ImRect(r)));
+ return ImGui::TableDrawBorders(table);
}
-CIMGUI_API ImVec2_c igWindowPosAbsToRel(ImGuiWindow* window,const ImVec2_c p)
+CIMGUI_API void igTableDrawDefaultContextMenu(ImGuiTable* table,ImGuiTableFlags flags_for_section_to_display)
{
- return ConvertFromCPP_ImVec2(ImGui::WindowPosAbsToRel(window,ConvertToCPP_ImVec2(p)));
+ return ImGui::TableDrawDefaultContextMenu(table,flags_for_section_to_display);
}
-CIMGUI_API ImVec2_c igWindowPosRelToAbs(ImGuiWindow* window,const ImVec2_c p)
+CIMGUI_API bool igTableBeginContextMenuPopup(ImGuiTable* table)
{
- return ConvertFromCPP_ImVec2(ImGui::WindowPosRelToAbs(window,ConvertToCPP_ImVec2(p)));
+ return ImGui::TableBeginContextMenuPopup(table);
}
-CIMGUI_API void igFocusWindow(ImGuiWindow* window,ImGuiFocusRequestFlags flags)
+CIMGUI_API void igTableMergeDrawChannels(ImGuiTable* table)
{
- return ImGui::FocusWindow(window,flags);
+ return ImGui::TableMergeDrawChannels(table);
}
-CIMGUI_API void igFocusTopMostWindowUnderOne(ImGuiWindow* under_this_window,ImGuiWindow* ignore_window,ImGuiViewport* filter_viewport,ImGuiFocusRequestFlags flags)
+CIMGUI_API ImGuiTableInstanceData* igTableGetInstanceData(ImGuiTable* table,int instance_no)
{
- return ImGui::FocusTopMostWindowUnderOne(under_this_window,ignore_window,filter_viewport,flags);
+ return ImGui::TableGetInstanceData(table,instance_no);
}
-CIMGUI_API void igBringWindowToFocusFront(ImGuiWindow* window)
+CIMGUI_API ImGuiID igTableGetInstanceID(ImGuiTable* table,int instance_no)
{
- return ImGui::BringWindowToFocusFront(window);
+ return ImGui::TableGetInstanceID(table,instance_no);
}
-CIMGUI_API void igBringWindowToDisplayFront(ImGuiWindow* window)
+CIMGUI_API void igTableFixDisplayOrder(ImGuiTable* table)
{
- return ImGui::BringWindowToDisplayFront(window);
+ return ImGui::TableFixDisplayOrder(table);
}
-CIMGUI_API void igBringWindowToDisplayBack(ImGuiWindow* window)
+CIMGUI_API void igTableSortSpecsSanitize(ImGuiTable* table)
{
- return ImGui::BringWindowToDisplayBack(window);
+ return ImGui::TableSortSpecsSanitize(table);
}
-CIMGUI_API void igBringWindowToDisplayBehind(ImGuiWindow* window,ImGuiWindow* above_window)
+CIMGUI_API void igTableSortSpecsBuild(ImGuiTable* table)
{
- return ImGui::BringWindowToDisplayBehind(window,above_window);
+ return ImGui::TableSortSpecsBuild(table);
}
-CIMGUI_API int igFindWindowDisplayIndex(ImGuiWindow* window)
+CIMGUI_API void igTableInitColumnDefaults(ImGuiTable* table,ImGuiTableColumn* column,ImGuiTableColumnFlags init_mask)
{
- return ImGui::FindWindowDisplayIndex(window);
+ return ImGui::TableInitColumnDefaults(table,column,init_mask);
}
-CIMGUI_API ImGuiWindow* igFindBottomMostVisibleWindowWithinBeginStack(ImGuiWindow* window)
+CIMGUI_API ImGuiSortDirection igTableGetColumnNextSortDirection(ImGuiTableColumn* column)
{
- return ImGui::FindBottomMostVisibleWindowWithinBeginStack(window);
+ return ImGui::TableGetColumnNextSortDirection(column);
}
-CIMGUI_API void igSetNextWindowRefreshPolicy(ImGuiWindowRefreshFlags flags)
+CIMGUI_API void igTableFixColumnSortDirection(ImGuiTable* table,ImGuiTableColumn* column)
{
- return ImGui::SetNextWindowRefreshPolicy(flags);
+ return ImGui::TableFixColumnSortDirection(table,column);
}
-CIMGUI_API void igRegisterUserTexture(ImTextureData* tex)
+CIMGUI_API float igTableGetColumnWidthAuto(ImGuiTable* table,ImGuiTableColumn* column)
{
- return ImGui::RegisterUserTexture(tex);
+ return ImGui::TableGetColumnWidthAuto(table,column);
}
-CIMGUI_API void igUnregisterUserTexture(ImTextureData* tex)
+CIMGUI_API void igTableBeginRow(ImGuiTable* table)
{
- return ImGui::UnregisterUserTexture(tex);
+ return ImGui::TableBeginRow(table);
}
-CIMGUI_API void igRegisterFontAtlas(ImFontAtlas* atlas)
+CIMGUI_API void igTableEndRow(ImGuiTable* table)
{
- return ImGui::RegisterFontAtlas(atlas);
+ return ImGui::TableEndRow(table);
}
-CIMGUI_API void igUnregisterFontAtlas(ImFontAtlas* atlas)
+CIMGUI_API void igTableBeginCell(ImGuiTable* table,int column_n)
{
- return ImGui::UnregisterFontAtlas(atlas);
+ return ImGui::TableBeginCell(table,column_n);
}
-CIMGUI_API void igSetCurrentFont(ImFont* font,float font_size_before_scaling,float font_size_after_scaling)
+CIMGUI_API void igTableEndCell(ImGuiTable* table)
{
- return ImGui::SetCurrentFont(font,font_size_before_scaling,font_size_after_scaling);
+ return ImGui::TableEndCell(table);
}
-CIMGUI_API void igUpdateCurrentFontSize(float restore_font_size_after_scaling)
+CIMGUI_API ImRect_c igTableGetCellBgRect(const ImGuiTable* table,int column_n)
{
- return ImGui::UpdateCurrentFontSize(restore_font_size_after_scaling);
+ return ConvertFromCPP_ImRect(ImGui::TableGetCellBgRect(table,column_n));
}
-CIMGUI_API void igSetFontRasterizerDensity(float rasterizer_density)
+CIMGUI_API const char* igTableGetColumnName_TablePtr(const ImGuiTable* table,int column_n)
{
- return ImGui::SetFontRasterizerDensity(rasterizer_density);
+ return ImGui::TableGetColumnName(table,column_n);
}
-CIMGUI_API float igGetFontRasterizerDensity()
+CIMGUI_API ImGuiID igTableGetColumnResizeID(ImGuiTable* table,int column_n,int instance_no)
{
- return ImGui::GetFontRasterizerDensity();
+ return ImGui::TableGetColumnResizeID(table,column_n,instance_no);
}
-CIMGUI_API float igGetRoundedFontSize(float size)
+CIMGUI_API float igTableCalcMaxColumnWidth(const ImGuiTable* table,int column_n)
{
- return ImGui::GetRoundedFontSize(size);
+ return ImGui::TableCalcMaxColumnWidth(table,column_n);
}
-CIMGUI_API ImFont* igGetDefaultFont()
+CIMGUI_API void igTableSetColumnWidthAutoSingle(ImGuiTable* table,int column_n)
{
- return ImGui::GetDefaultFont();
+ return ImGui::TableSetColumnWidthAutoSingle(table,column_n);
}
-CIMGUI_API void igPushPasswordFont()
+CIMGUI_API void igTableSetColumnWidthAutoAll(ImGuiTable* table)
{
- return ImGui::PushPasswordFont();
+ return ImGui::TableSetColumnWidthAutoAll(table);
}
-CIMGUI_API void igPopPasswordFont()
+CIMGUI_API void igTableSetColumnDisplayOrder(ImGuiTable* table,int column_n,int dst_order)
{
- return ImGui::PopPasswordFont();
+ return ImGui::TableSetColumnDisplayOrder(table,column_n,dst_order);
}
-CIMGUI_API ImDrawList* igGetForegroundDrawList_WindowPtr(ImGuiWindow* window)
+CIMGUI_API void igTableQueueSetColumnDisplayOrder(ImGuiTable* table,int column_n,int dst_order)
{
- return ImGui::GetForegroundDrawList(window);
+ return ImGui::TableQueueSetColumnDisplayOrder(table,column_n,dst_order);
}
-CIMGUI_API void igAddDrawListToDrawDataEx(ImDrawData* draw_data,ImVector_ImDrawListPtr* out_list,ImDrawList* draw_list)
+CIMGUI_API void igTableRemove(ImGuiTable* table)
{
- return ImGui::AddDrawListToDrawDataEx(draw_data,out_list,draw_list);
+ return ImGui::TableRemove(table);
}
-CIMGUI_API void igInitialize()
+CIMGUI_API void igTableGcCompactTransientBuffers_TablePtr(ImGuiTable* table)
{
- return ImGui::Initialize();
+ return ImGui::TableGcCompactTransientBuffers(table);
}
-CIMGUI_API void igShutdown()
+CIMGUI_API void igTableGcCompactTransientBuffers_TableTempDataPtr(ImGuiTableTempData* table)
{
- return ImGui::Shutdown();
+ return ImGui::TableGcCompactTransientBuffers(table);
}
-CIMGUI_API void igSetContextName(ImGuiContext* ctx,const char* name)
+CIMGUI_API void igTableGcCompactSettings()
{
- return ImGui::SetContextName(ctx,name);
+ return ImGui::TableGcCompactSettings();
}
-CIMGUI_API ImGuiID igAddContextHook(ImGuiContext* ctx,const ImGuiContextHook* hook)
+CIMGUI_API void igTableLoadSettings(ImGuiTable* table)
{
- return ImGui::AddContextHook(ctx,hook);
+ return ImGui::TableLoadSettings(table);
}
-CIMGUI_API void igRemoveContextHook(ImGuiContext* ctx,ImGuiID hook_to_remove)
+CIMGUI_API void igTableLoadSettingsForColumns(ImGuiTable* table)
{
- return ImGui::RemoveContextHook(ctx,hook_to_remove);
+ return ImGui::TableLoadSettingsForColumns(table);
}
-CIMGUI_API void igCallContextHooks(ImGuiContext* ctx,ImGuiContextHookType type)
+CIMGUI_API void igTableLoadSettingsForColumn(ImGuiTableColumn* column,ImGuiTableColumnSettings* column_settings,ImGuiTableFlags load_flags)
{
- return ImGui::CallContextHooks(ctx,type);
+ return ImGui::TableLoadSettingsForColumn(column,column_settings,load_flags);
}
-CIMGUI_API void igUpdateInputEvents(bool trickle_fast_inputs)
+CIMGUI_API void igTableSaveSettings(ImGuiTable* table)
{
- return ImGui::UpdateInputEvents(trickle_fast_inputs);
+ return ImGui::TableSaveSettings(table);
}
-CIMGUI_API void igUpdateHoveredWindowAndCaptureFlags(const ImVec2_c mouse_pos)
+CIMGUI_API void igTableResetSettings(ImGuiTable* table)
{
- return ImGui::UpdateHoveredWindowAndCaptureFlags(ConvertToCPP_ImVec2(mouse_pos));
+ return ImGui::TableResetSettings(table);
}
-CIMGUI_API void igFindHoveredWindowEx(const ImVec2_c pos,bool find_first_and_in_any_viewport,ImGuiWindow** out_hovered_window,ImGuiWindow** out_hovered_window_under_moving_window)
+CIMGUI_API ImGuiTableSettings* igTableGetBoundSettings(ImGuiTable* table)
{
- return ImGui::FindHoveredWindowEx(ConvertToCPP_ImVec2(pos),find_first_and_in_any_viewport,out_hovered_window,out_hovered_window_under_moving_window);
+ return ImGui::TableGetBoundSettings(table);
}
-CIMGUI_API void igStartMouseMovingWindow(ImGuiWindow* window)
+CIMGUI_API void igTableSettingsAddSettingsHandler()
+{
+ return ImGui::TableSettingsAddSettingsHandler();
+}
+CIMGUI_API ImGuiTableSettings* igTableSettingsCreate(ImGuiID id,int columns_count)
+{
+ return ImGui::TableSettingsCreate(id,columns_count);
+}
+CIMGUI_API ImGuiTableSettings* igTableSettingsFindByID(ImGuiID id)
+{
+ return ImGui::TableSettingsFindByID(id);
+}
+CIMGUI_API void igSetWindowClipRectBeforeSetChannel(ImGuiWindow* window,const ImRect_c clip_rect)
+{
+ return ImGui::SetWindowClipRectBeforeSetChannel(window,ConvertToCPP_ImRect(clip_rect));
+}
+CIMGUI_API void igBeginColumns(const char* str_id,int count,ImGuiOldColumnFlags flags)
+{
+ return ImGui::BeginColumns(str_id,count,flags);
+}
+CIMGUI_API void igEndColumns()
+{
+ return ImGui::EndColumns();
+}
+CIMGUI_API void igPushColumnClipRect(int column_index)
+{
+ return ImGui::PushColumnClipRect(column_index);
+}
+CIMGUI_API void igPushColumnsBackground()
+{
+ return ImGui::PushColumnsBackground();
+}
+CIMGUI_API void igPopColumnsBackground()
+{
+ return ImGui::PopColumnsBackground();
+}
+CIMGUI_API ImGuiID igGetColumnsID(const char* str_id,int count)
+{
+ return ImGui::GetColumnsID(str_id,count);
+}
+CIMGUI_API ImGuiOldColumns* igFindOrCreateColumns(ImGuiWindow* window,ImGuiID id)
+{
+ return ImGui::FindOrCreateColumns(window,id);
+}
+CIMGUI_API float igGetColumnOffsetFromNorm(const ImGuiOldColumns* columns,float offset_norm)
+{
+ return ImGui::GetColumnOffsetFromNorm(columns,offset_norm);
+}
+CIMGUI_API float igGetColumnNormFromOffset(const ImGuiOldColumns* columns,float offset)
+{
+ return ImGui::GetColumnNormFromOffset(columns,offset);
+}
+CIMGUI_API ImGuiIO* igGetIO_ContextPtr(ImGuiContext* ctx)
+{
+ return &ImGui::GetIO(ctx);
+}
+CIMGUI_API ImGuiPlatformIO* igGetPlatformIO_ContextPtr(ImGuiContext* ctx)
+{
+ return &ImGui::GetPlatformIO(ctx);
+}
+CIMGUI_API float igGetScale()
+{
+ return ImGui::GetScale();
+}
+CIMGUI_API ImGuiWindow* igGetCurrentWindowRead()
+{
+ return ImGui::GetCurrentWindowRead();
+}
+CIMGUI_API ImGuiWindow* igGetCurrentWindow()
+{
+ return ImGui::GetCurrentWindow();
+}
+CIMGUI_API ImGuiWindow* igFindWindowByID(ImGuiID id)
+{
+ return ImGui::FindWindowByID(id);
+}
+CIMGUI_API ImGuiWindow* igFindWindowByName(const char* name)
+{
+ return ImGui::FindWindowByName(name);
+}
+CIMGUI_API void igUpdateWindowParentAndRootLinks(ImGuiWindow* window,ImGuiWindowFlags flags,ImGuiWindow* parent_window)
+{
+ return ImGui::UpdateWindowParentAndRootLinks(window,flags,parent_window);
+}
+CIMGUI_API void igUpdateWindowSkipRefresh(ImGuiWindow* window)
+{
+ return ImGui::UpdateWindowSkipRefresh(window);
+}
+CIMGUI_API ImVec2_c igCalcWindowNextAutoFitSize(ImGuiWindow* window)
+{
+ return ConvertFromCPP_ImVec2(ImGui::CalcWindowNextAutoFitSize(window));
+}
+CIMGUI_API bool igIsWindowChildOf(ImGuiWindow* window,ImGuiWindow* potential_parent,bool popup_hierarchy,bool dock_hierarchy)
+{
+ return ImGui::IsWindowChildOf(window,potential_parent,popup_hierarchy,dock_hierarchy);
+}
+CIMGUI_API bool igIsWindowInBeginStack(ImGuiWindow* window)
+{
+ return ImGui::IsWindowInBeginStack(window);
+}
+CIMGUI_API bool igIsWindowWithinBeginStackOf(ImGuiWindow* window,ImGuiWindow* potential_parent)
+{
+ return ImGui::IsWindowWithinBeginStackOf(window,potential_parent);
+}
+CIMGUI_API bool igIsWindowAbove(ImGuiWindow* potential_above,ImGuiWindow* potential_below)
+{
+ return ImGui::IsWindowAbove(potential_above,potential_below);
+}
+CIMGUI_API bool igIsWindowNavFocusable(ImGuiWindow* window)
+{
+ return ImGui::IsWindowNavFocusable(window);
+}
+CIMGUI_API void igSetWindowPos_WindowPtr(ImGuiWindow* window,const ImVec2_c pos,ImGuiCond cond)
+{
+ return ImGui::SetWindowPos(window,ConvertToCPP_ImVec2(pos),cond);
+}
+CIMGUI_API void igSetWindowSize_WindowPtr(ImGuiWindow* window,const ImVec2_c size,ImGuiCond cond)
+{
+ return ImGui::SetWindowSize(window,ConvertToCPP_ImVec2(size),cond);
+}
+CIMGUI_API void igSetWindowCollapsed_WindowPtr(ImGuiWindow* window,bool collapsed,ImGuiCond cond)
+{
+ return ImGui::SetWindowCollapsed(window,collapsed,cond);
+}
+CIMGUI_API void igSetWindowHitTestHole(ImGuiWindow* window,const ImVec2_c pos,const ImVec2_c size)
+{
+ return ImGui::SetWindowHitTestHole(window,ConvertToCPP_ImVec2(pos),ConvertToCPP_ImVec2(size));
+}
+CIMGUI_API void igSetWindowHiddenAndSkipItemsForCurrentFrame(ImGuiWindow* window)
+{
+ return ImGui::SetWindowHiddenAndSkipItemsForCurrentFrame(window);
+}
+CIMGUI_API void igSetWindowParentWindowForFocusRoute(ImGuiWindow* window,ImGuiWindow* parent_window)
+{
+ return ImGui::SetWindowParentWindowForFocusRoute(window,parent_window);
+}
+CIMGUI_API ImRect_c igWindowRectAbsToRel(ImGuiWindow* window,const ImRect_c r)
+{
+ return ConvertFromCPP_ImRect(ImGui::WindowRectAbsToRel(window,ConvertToCPP_ImRect(r)));
+}
+CIMGUI_API ImRect_c igWindowRectRelToAbs(ImGuiWindow* window,const ImRect_c r)
+{
+ return ConvertFromCPP_ImRect(ImGui::WindowRectRelToAbs(window,ConvertToCPP_ImRect(r)));
+}
+CIMGUI_API ImVec2_c igWindowPosAbsToRel(ImGuiWindow* window,const ImVec2_c p)
+{
+ return ConvertFromCPP_ImVec2(ImGui::WindowPosAbsToRel(window,ConvertToCPP_ImVec2(p)));
+}
+CIMGUI_API ImVec2_c igWindowPosRelToAbs(ImGuiWindow* window,const ImVec2_c p)
+{
+ return ConvertFromCPP_ImVec2(ImGui::WindowPosRelToAbs(window,ConvertToCPP_ImVec2(p)));
+}
+CIMGUI_API void igFocusWindow(ImGuiWindow* window,ImGuiFocusRequestFlags flags)
+{
+ return ImGui::FocusWindow(window,flags);
+}
+CIMGUI_API void igFocusTopMostWindowUnderOne(ImGuiWindow* under_this_window,ImGuiWindow* ignore_window,ImGuiViewport* filter_viewport,ImGuiFocusRequestFlags flags)
+{
+ return ImGui::FocusTopMostWindowUnderOne(under_this_window,ignore_window,filter_viewport,flags);
+}
+CIMGUI_API void igBringWindowToFocusFront(ImGuiWindow* window)
+{
+ return ImGui::BringWindowToFocusFront(window);
+}
+CIMGUI_API void igBringWindowToDisplayFront(ImGuiWindow* window)
+{
+ return ImGui::BringWindowToDisplayFront(window);
+}
+CIMGUI_API void igBringWindowToDisplayBack(ImGuiWindow* window)
+{
+ return ImGui::BringWindowToDisplayBack(window);
+}
+CIMGUI_API void igBringWindowToDisplayBehind(ImGuiWindow* window,ImGuiWindow* above_window)
+{
+ return ImGui::BringWindowToDisplayBehind(window,above_window);
+}
+CIMGUI_API int igFindWindowDisplayIndex(ImGuiWindow* window)
+{
+ return ImGui::FindWindowDisplayIndex(window);
+}
+CIMGUI_API ImGuiWindow* igFindBottomMostVisibleWindowWithinBeginStack(ImGuiWindow* window)
+{
+ return ImGui::FindBottomMostVisibleWindowWithinBeginStack(window);
+}
+CIMGUI_API void igSetNextWindowRefreshPolicy(ImGuiWindowRefreshFlags flags)
+{
+ return ImGui::SetNextWindowRefreshPolicy(flags);
+}
+CIMGUI_API void igRegisterUserTexture(ImTextureData* tex)
+{
+ return ImGui::RegisterUserTexture(tex);
+}
+CIMGUI_API void igUnregisterUserTexture(ImTextureData* tex)
+{
+ return ImGui::UnregisterUserTexture(tex);
+}
+CIMGUI_API void igRegisterFontAtlas(ImFontAtlas* atlas)
+{
+ return ImGui::RegisterFontAtlas(atlas);
+}
+CIMGUI_API void igUnregisterFontAtlas(ImFontAtlas* atlas)
+{
+ return ImGui::UnregisterFontAtlas(atlas);
+}
+CIMGUI_API void igSetCurrentFont(ImFont* font,float font_size_before_scaling,float font_size_after_scaling)
+{
+ return ImGui::SetCurrentFont(font,font_size_before_scaling,font_size_after_scaling);
+}
+CIMGUI_API void igUpdateCurrentFontSize(float restore_font_size_after_scaling)
+{
+ return ImGui::UpdateCurrentFontSize(restore_font_size_after_scaling);
+}
+CIMGUI_API void igSetFontRasterizerDensity(float rasterizer_density)
+{
+ return ImGui::SetFontRasterizerDensity(rasterizer_density);
+}
+CIMGUI_API float igGetFontRasterizerDensity()
+{
+ return ImGui::GetFontRasterizerDensity();
+}
+CIMGUI_API float igGetRoundedFontSize(float size)
+{
+ return ImGui::GetRoundedFontSize(size);
+}
+CIMGUI_API ImFont* igGetDefaultFont()
+{
+ return ImGui::GetDefaultFont();
+}
+CIMGUI_API void igPushPasswordFont()
+{
+ return ImGui::PushPasswordFont();
+}
+CIMGUI_API void igPopPasswordFont()
+{
+ return ImGui::PopPasswordFont();
+}
+CIMGUI_API ImDrawList* igGetForegroundDrawList_WindowPtr(ImGuiWindow* window)
+{
+ return ImGui::GetForegroundDrawList(window);
+}
+CIMGUI_API void igAddDrawListToDrawDataEx(ImDrawData* draw_data,ImVector_ImDrawListPtr* out_list,ImDrawList* draw_list)
+{
+ return ImGui::AddDrawListToDrawDataEx(draw_data,out_list,draw_list);
+}
+CIMGUI_API void igInitialize()
+{
+ return ImGui::Initialize();
+}
+CIMGUI_API void igShutdown()
+{
+ return ImGui::Shutdown();
+}
+CIMGUI_API void igSetContextName(ImGuiContext* ctx,const char* name)
+{
+ return ImGui::SetContextName(ctx,name);
+}
+CIMGUI_API ImGuiID igAddContextHook(ImGuiContext* ctx,const ImGuiContextHook* hook)
+{
+ return ImGui::AddContextHook(ctx,hook);
+}
+CIMGUI_API void igRemoveContextHook(ImGuiContext* ctx,ImGuiID hook_to_remove)
+{
+ return ImGui::RemoveContextHook(ctx,hook_to_remove);
+}
+CIMGUI_API void igCallContextHooks(ImGuiContext* ctx,ImGuiContextHookType type)
+{
+ return ImGui::CallContextHooks(ctx,type);
+}
+CIMGUI_API void igUpdateInputEvents(bool trickle_fast_inputs)
+{
+ return ImGui::UpdateInputEvents(trickle_fast_inputs);
+}
+CIMGUI_API void igUpdateHoveredWindowAndCaptureFlags(const ImVec2_c mouse_pos)
+{
+ return ImGui::UpdateHoveredWindowAndCaptureFlags(ConvertToCPP_ImVec2(mouse_pos));
+}
+CIMGUI_API void igFindHoveredWindowEx(const ImVec2_c pos,bool find_first_and_in_any_viewport,ImGuiWindow** out_hovered_window,ImGuiWindow** out_hovered_window_under_moving_window)
+{
+ return ImGui::FindHoveredWindowEx(ConvertToCPP_ImVec2(pos),find_first_and_in_any_viewport,out_hovered_window,out_hovered_window_under_moving_window);
+}
+CIMGUI_API void igStartMouseMovingWindow(ImGuiWindow* window)
{
return ImGui::StartMouseMovingWindow(window);
}
@@ -4630,6 +4954,10 @@ CIMGUI_API void igClearIniSettings()
{
return ImGui::ClearIniSettings();
}
+CIMGUI_API void igCleanupIniSettings(ImGuiSettingsCleanupArgs* args)
+{
+ return ImGui::CleanupIniSettings(args);
+}
CIMGUI_API void igAddSettingsHandler(const ImGuiSettingsHandler* handler)
{
return ImGui::AddSettingsHandler(handler);
@@ -4830,6 +5158,10 @@ CIMGUI_API bool igBeginChildEx(const char* name,ImGuiID id,const ImVec2_c size_a
{
return ImGui::BeginChildEx(name,id,ConvertToCPP_ImVec2(size_arg),child_flags,window_flags);
}
+CIMGUI_API ImGuiWindow* igFindFrontMostVisibleChildWindow(ImGuiWindow* window)
+{
+ return ImGui::FindFrontMostVisibleChildWindow(window);
+}
CIMGUI_API bool igBeginPopupEx(ImGuiID id,ImGuiWindowFlags extra_window_flags)
{
return ImGui::BeginPopupEx(id,extra_window_flags);
@@ -4838,7 +5170,7 @@ CIMGUI_API bool igBeginPopupMenuEx(ImGuiID id,const char* label,ImGuiWindowFlags
{
return ImGui::BeginPopupMenuEx(id,label,extra_window_flags);
}
-CIMGUI_API void igOpenPopupEx(ImGuiID id,ImGuiPopupFlags popup_flags)
+CIMGUI_API bool igOpenPopupEx(ImGuiID id,ImGuiPopupFlags popup_flags)
{
return ImGui::OpenPopupEx(id,popup_flags);
}
@@ -5102,7 +5434,7 @@ CIMGUI_API void igSetKeyOwnersForKeyChord(ImGuiKeyChord key,ImGuiID owner_id,ImG
{
return ImGui::SetKeyOwnersForKeyChord(key,owner_id,flags);
}
-CIMGUI_API void igSetItemKeyOwner_InputFlags(ImGuiKey key,ImGuiInputFlags flags)
+CIMGUI_API bool igSetItemKeyOwner_InputFlags(ImGuiKey key,ImGuiInputFlags flags)
{
return ImGui::SetItemKeyOwner(key,flags);
}
@@ -5166,517 +5498,261 @@ CIMGUI_API void igDockContextInitialize(ImGuiContext* ctx)
{
return ImGui::DockContextInitialize(ctx);
}
-CIMGUI_API void igDockContextShutdown(ImGuiContext* ctx)
-{
- return ImGui::DockContextShutdown(ctx);
-}
-CIMGUI_API void igDockContextClearNodes(ImGuiContext* ctx,ImGuiID root_id,bool clear_settings_refs)
-{
- return ImGui::DockContextClearNodes(ctx,root_id,clear_settings_refs);
-}
-CIMGUI_API void igDockContextRebuildNodes(ImGuiContext* ctx)
-{
- return ImGui::DockContextRebuildNodes(ctx);
-}
-CIMGUI_API void igDockContextNewFrameUpdateUndocking(ImGuiContext* ctx)
-{
- return ImGui::DockContextNewFrameUpdateUndocking(ctx);
-}
-CIMGUI_API void igDockContextNewFrameUpdateDocking(ImGuiContext* ctx)
-{
- return ImGui::DockContextNewFrameUpdateDocking(ctx);
-}
-CIMGUI_API void igDockContextEndFrame(ImGuiContext* ctx)
-{
- return ImGui::DockContextEndFrame(ctx);
-}
-CIMGUI_API ImGuiID igDockContextGenNodeID(ImGuiContext* ctx)
-{
- return ImGui::DockContextGenNodeID(ctx);
-}
-CIMGUI_API void igDockContextQueueDock(ImGuiContext* ctx,ImGuiWindow* target,ImGuiDockNode* target_node,ImGuiWindow* payload,ImGuiDir split_dir,float split_ratio,bool split_outer)
-{
- return ImGui::DockContextQueueDock(ctx,target,target_node,payload,split_dir,split_ratio,split_outer);
-}
-CIMGUI_API void igDockContextQueueUndockWindow(ImGuiContext* ctx,ImGuiWindow* window)
-{
- return ImGui::DockContextQueueUndockWindow(ctx,window);
-}
-CIMGUI_API void igDockContextQueueUndockNode(ImGuiContext* ctx,ImGuiDockNode* node)
-{
- return ImGui::DockContextQueueUndockNode(ctx,node);
-}
-CIMGUI_API void igDockContextProcessUndockWindow(ImGuiContext* ctx,ImGuiWindow* window,bool clear_persistent_docking_ref)
-{
- return ImGui::DockContextProcessUndockWindow(ctx,window,clear_persistent_docking_ref);
-}
-CIMGUI_API void igDockContextProcessUndockNode(ImGuiContext* ctx,ImGuiDockNode* node)
-{
- return ImGui::DockContextProcessUndockNode(ctx,node);
-}
-CIMGUI_API bool igDockContextCalcDropPosForDocking(ImGuiWindow* target,ImGuiDockNode* target_node,ImGuiWindow* payload_window,ImGuiDockNode* payload_node,ImGuiDir split_dir,bool split_outer,ImVec2_c* out_pos)
-{
- return ImGui::DockContextCalcDropPosForDocking(target,target_node,payload_window,payload_node,split_dir,split_outer,reinterpret_cast(out_pos));
-}
-CIMGUI_API ImGuiDockNode* igDockContextFindNodeByID(ImGuiContext* ctx,ImGuiID id)
-{
- return ImGui::DockContextFindNodeByID(ctx,id);
-}
-CIMGUI_API void igDockNodeWindowMenuHandler_Default(ImGuiContext* ctx,ImGuiDockNode* node,ImGuiTabBar* tab_bar)
-{
- return ImGui::DockNodeWindowMenuHandler_Default(ctx,node,tab_bar);
-}
-CIMGUI_API bool igDockNodeBeginAmendTabBar(ImGuiDockNode* node)
-{
- return ImGui::DockNodeBeginAmendTabBar(node);
-}
-CIMGUI_API void igDockNodeEndAmendTabBar()
-{
- return ImGui::DockNodeEndAmendTabBar();
-}
-CIMGUI_API ImGuiDockNode* igDockNodeGetRootNode(ImGuiDockNode* node)
-{
- return ImGui::DockNodeGetRootNode(node);
-}
-CIMGUI_API bool igDockNodeIsInHierarchyOf(ImGuiDockNode* node,ImGuiDockNode* parent)
-{
- return ImGui::DockNodeIsInHierarchyOf(node,parent);
-}
-CIMGUI_API int igDockNodeGetDepth(const ImGuiDockNode* node)
-{
- return ImGui::DockNodeGetDepth(node);
-}
-CIMGUI_API ImGuiID igDockNodeGetWindowMenuButtonId(const ImGuiDockNode* node)
-{
- return ImGui::DockNodeGetWindowMenuButtonId(node);
-}
-CIMGUI_API ImGuiDockNode* igGetWindowDockNode()
-{
- return ImGui::GetWindowDockNode();
-}
-CIMGUI_API bool igGetWindowAlwaysWantOwnTabBar(ImGuiWindow* window)
-{
- return ImGui::GetWindowAlwaysWantOwnTabBar(window);
-}
-CIMGUI_API void igBeginDocked(ImGuiWindow* window,bool* p_open)
-{
- return ImGui::BeginDocked(window,p_open);
-}
-CIMGUI_API void igBeginDockableDragDropSource(ImGuiWindow* window)
-{
- return ImGui::BeginDockableDragDropSource(window);
-}
-CIMGUI_API void igBeginDockableDragDropTarget(ImGuiWindow* window)
-{
- return ImGui::BeginDockableDragDropTarget(window);
-}
-CIMGUI_API void igSetWindowDock(ImGuiWindow* window,ImGuiID dock_id,ImGuiCond cond)
-{
- return ImGui::SetWindowDock(window,dock_id,cond);
-}
-CIMGUI_API void igDockBuilderDockWindow(const char* window_name,ImGuiID node_id)
-{
- return ImGui::DockBuilderDockWindow(window_name,node_id);
-}
-CIMGUI_API ImGuiDockNode* igDockBuilderGetNode(ImGuiID node_id)
-{
- return ImGui::DockBuilderGetNode(node_id);
-}
-CIMGUI_API ImGuiDockNode* igDockBuilderGetCentralNode(ImGuiID node_id)
-{
- return ImGui::DockBuilderGetCentralNode(node_id);
-}
-CIMGUI_API ImGuiID igDockBuilderAddNode(ImGuiID node_id,ImGuiDockNodeFlags flags)
-{
- return ImGui::DockBuilderAddNode(node_id,flags);
-}
-CIMGUI_API void igDockBuilderRemoveNode(ImGuiID node_id)
-{
- return ImGui::DockBuilderRemoveNode(node_id);
-}
-CIMGUI_API void igDockBuilderRemoveNodeDockedWindows(ImGuiID node_id,bool clear_settings_refs)
-{
- return ImGui::DockBuilderRemoveNodeDockedWindows(node_id,clear_settings_refs);
-}
-CIMGUI_API void igDockBuilderRemoveNodeChildNodes(ImGuiID node_id)
-{
- return ImGui::DockBuilderRemoveNodeChildNodes(node_id);
-}
-CIMGUI_API void igDockBuilderSetNodePos(ImGuiID node_id,ImVec2_c pos)
-{
- return ImGui::DockBuilderSetNodePos(node_id,ConvertToCPP_ImVec2(pos));
-}
-CIMGUI_API void igDockBuilderSetNodeSize(ImGuiID node_id,ImVec2_c size)
-{
- return ImGui::DockBuilderSetNodeSize(node_id,ConvertToCPP_ImVec2(size));
-}
-CIMGUI_API ImGuiID igDockBuilderSplitNode(ImGuiID node_id,ImGuiDir split_dir,float size_ratio_for_node_at_dir,ImGuiID* out_id_at_dir,ImGuiID* out_id_at_opposite_dir)
-{
- return ImGui::DockBuilderSplitNode(node_id,split_dir,size_ratio_for_node_at_dir,out_id_at_dir,out_id_at_opposite_dir);
-}
-CIMGUI_API void igDockBuilderCopyDockSpace(ImGuiID src_dockspace_id,ImGuiID dst_dockspace_id,ImVector_const_charPtr* in_window_remap_pairs)
-{
- return ImGui::DockBuilderCopyDockSpace(src_dockspace_id,dst_dockspace_id,in_window_remap_pairs);
-}
-CIMGUI_API void igDockBuilderCopyNode(ImGuiID src_node_id,ImGuiID dst_node_id,ImVector_ImGuiID* out_node_remap_pairs)
-{
- return ImGui::DockBuilderCopyNode(src_node_id,dst_node_id,out_node_remap_pairs);
-}
-CIMGUI_API void igDockBuilderCopyWindowSettings(const char* src_name,const char* dst_name)
-{
- return ImGui::DockBuilderCopyWindowSettings(src_name,dst_name);
-}
-CIMGUI_API void igDockBuilderFinish(ImGuiID node_id)
-{
- return ImGui::DockBuilderFinish(node_id);
-}
-CIMGUI_API void igPushFocusScope(ImGuiID id)
-{
- return ImGui::PushFocusScope(id);
-}
-CIMGUI_API void igPopFocusScope()
-{
- return ImGui::PopFocusScope();
-}
-CIMGUI_API ImGuiID igGetCurrentFocusScope()
-{
- return ImGui::GetCurrentFocusScope();
-}
-CIMGUI_API bool igIsDragDropActive()
-{
- return ImGui::IsDragDropActive();
-}
-CIMGUI_API bool igBeginDragDropTargetCustom(const ImRect_c bb,ImGuiID id)
-{
- return ImGui::BeginDragDropTargetCustom(ConvertToCPP_ImRect(bb),id);
-}
-CIMGUI_API bool igBeginDragDropTargetViewport(ImGuiViewport* viewport,const ImRect* p_bb)
-{
- return ImGui::BeginDragDropTargetViewport(viewport,p_bb);
-}
-CIMGUI_API void igClearDragDrop()
-{
- return ImGui::ClearDragDrop();
-}
-CIMGUI_API bool igIsDragDropPayloadBeingAccepted()
-{
- return ImGui::IsDragDropPayloadBeingAccepted();
-}
-CIMGUI_API void igRenderDragDropTargetRectForItem(const ImRect_c bb)
-{
- return ImGui::RenderDragDropTargetRectForItem(ConvertToCPP_ImRect(bb));
-}
-CIMGUI_API void igRenderDragDropTargetRectEx(ImDrawList* draw_list,const ImRect_c bb)
-{
- return ImGui::RenderDragDropTargetRectEx(draw_list,ConvertToCPP_ImRect(bb));
-}
-CIMGUI_API ImGuiTypingSelectRequest* igGetTypingSelectRequest(ImGuiTypingSelectFlags flags)
-{
- return ImGui::GetTypingSelectRequest(flags);
-}
-CIMGUI_API int igTypingSelectFindMatch(ImGuiTypingSelectRequest* req,int items_count,const char*(*get_item_name_func)(void*,int),void* user_data,int nav_item_idx)
-{
- return ImGui::TypingSelectFindMatch(req,items_count,get_item_name_func,user_data,nav_item_idx);
-}
-CIMGUI_API int igTypingSelectFindNextSingleCharMatch(ImGuiTypingSelectRequest* req,int items_count,const char*(*get_item_name_func)(void*,int),void* user_data,int nav_item_idx)
-{
- return ImGui::TypingSelectFindNextSingleCharMatch(req,items_count,get_item_name_func,user_data,nav_item_idx);
-}
-CIMGUI_API int igTypingSelectFindBestLeadingMatch(ImGuiTypingSelectRequest* req,int items_count,const char*(*get_item_name_func)(void*,int),void* user_data)
-{
- return ImGui::TypingSelectFindBestLeadingMatch(req,items_count,get_item_name_func,user_data);
-}
-CIMGUI_API bool igBeginBoxSelect(const ImRect_c scope_rect,ImGuiWindow* window,ImGuiID box_select_id,ImGuiMultiSelectFlags ms_flags)
-{
- return ImGui::BeginBoxSelect(ConvertToCPP_ImRect(scope_rect),window,box_select_id,ms_flags);
-}
-CIMGUI_API void igEndBoxSelect(const ImRect_c scope_rect,ImGuiMultiSelectFlags ms_flags)
-{
- return ImGui::EndBoxSelect(ConvertToCPP_ImRect(scope_rect),ms_flags);
-}
-CIMGUI_API void igMultiSelectItemHeader(ImGuiID id,bool* p_selected,ImGuiButtonFlags* p_button_flags)
-{
- return ImGui::MultiSelectItemHeader(id,p_selected,p_button_flags);
-}
-CIMGUI_API void igMultiSelectItemFooter(ImGuiID id,bool* p_selected,bool* p_pressed)
-{
- return ImGui::MultiSelectItemFooter(id,p_selected,p_pressed);
-}
-CIMGUI_API void igMultiSelectAddSetAll(ImGuiMultiSelectTempData* ms,bool selected)
-{
- return ImGui::MultiSelectAddSetAll(ms,selected);
-}
-CIMGUI_API void igMultiSelectAddSetRange(ImGuiMultiSelectTempData* ms,bool selected,int range_dir,ImGuiSelectionUserData first_item,ImGuiSelectionUserData last_item)
-{
- return ImGui::MultiSelectAddSetRange(ms,selected,range_dir,first_item,last_item);
-}
-CIMGUI_API ImGuiBoxSelectState* igGetBoxSelectState(ImGuiID id)
-{
- return ImGui::GetBoxSelectState(id);
-}
-CIMGUI_API ImGuiMultiSelectState* igGetMultiSelectState(ImGuiID id)
-{
- return ImGui::GetMultiSelectState(id);
-}
-CIMGUI_API void igSetWindowClipRectBeforeSetChannel(ImGuiWindow* window,const ImRect_c clip_rect)
-{
- return ImGui::SetWindowClipRectBeforeSetChannel(window,ConvertToCPP_ImRect(clip_rect));
-}
-CIMGUI_API void igBeginColumns(const char* str_id,int count,ImGuiOldColumnFlags flags)
+CIMGUI_API void igDockContextShutdown(ImGuiContext* ctx)
{
- return ImGui::BeginColumns(str_id,count,flags);
+ return ImGui::DockContextShutdown(ctx);
}
-CIMGUI_API void igEndColumns()
+CIMGUI_API void igDockContextClearNodes(ImGuiContext* ctx,ImGuiID root_id,bool clear_settings_refs)
{
- return ImGui::EndColumns();
+ return ImGui::DockContextClearNodes(ctx,root_id,clear_settings_refs);
}
-CIMGUI_API void igPushColumnClipRect(int column_index)
+CIMGUI_API void igDockContextRebuildNodes(ImGuiContext* ctx)
{
- return ImGui::PushColumnClipRect(column_index);
+ return ImGui::DockContextRebuildNodes(ctx);
}
-CIMGUI_API void igPushColumnsBackground()
+CIMGUI_API void igDockContextNewFrameUpdateUndocking(ImGuiContext* ctx)
{
- return ImGui::PushColumnsBackground();
+ return ImGui::DockContextNewFrameUpdateUndocking(ctx);
}
-CIMGUI_API void igPopColumnsBackground()
+CIMGUI_API void igDockContextNewFrameUpdateDocking(ImGuiContext* ctx)
{
- return ImGui::PopColumnsBackground();
+ return ImGui::DockContextNewFrameUpdateDocking(ctx);
}
-CIMGUI_API ImGuiID igGetColumnsID(const char* str_id,int count)
+CIMGUI_API void igDockContextEndFrame(ImGuiContext* ctx)
{
- return ImGui::GetColumnsID(str_id,count);
+ return ImGui::DockContextEndFrame(ctx);
}
-CIMGUI_API ImGuiOldColumns* igFindOrCreateColumns(ImGuiWindow* window,ImGuiID id)
+CIMGUI_API ImGuiID igDockContextGenNodeID(ImGuiContext* ctx)
{
- return ImGui::FindOrCreateColumns(window,id);
+ return ImGui::DockContextGenNodeID(ctx);
}
-CIMGUI_API float igGetColumnOffsetFromNorm(const ImGuiOldColumns* columns,float offset_norm)
+CIMGUI_API void igDockContextQueueDock(ImGuiContext* ctx,ImGuiWindow* target,ImGuiDockNode* target_node,ImGuiWindow* payload,ImGuiDir split_dir,float split_ratio,bool split_outer)
{
- return ImGui::GetColumnOffsetFromNorm(columns,offset_norm);
+ return ImGui::DockContextQueueDock(ctx,target,target_node,payload,split_dir,split_ratio,split_outer);
}
-CIMGUI_API float igGetColumnNormFromOffset(const ImGuiOldColumns* columns,float offset)
+CIMGUI_API void igDockContextQueueUndockWindow(ImGuiContext* ctx,ImGuiWindow* window)
{
- return ImGui::GetColumnNormFromOffset(columns,offset);
+ return ImGui::DockContextQueueUndockWindow(ctx,window);
}
-CIMGUI_API void igTableOpenContextMenu(int column_n)
+CIMGUI_API void igDockContextQueueUndockNode(ImGuiContext* ctx,ImGuiDockNode* node)
{
- return ImGui::TableOpenContextMenu(column_n);
+ return ImGui::DockContextQueueUndockNode(ctx,node);
}
-CIMGUI_API void igTableSetColumnWidth(int column_n,float width)
+CIMGUI_API void igDockContextProcessUndockWindow(ImGuiContext* ctx,ImGuiWindow* window,bool clear_persistent_docking_ref)
{
- return ImGui::TableSetColumnWidth(column_n,width);
+ return ImGui::DockContextProcessUndockWindow(ctx,window,clear_persistent_docking_ref);
}
-CIMGUI_API void igTableSetColumnSortDirection(int column_n,ImGuiSortDirection sort_direction,bool append_to_sort_specs)
+CIMGUI_API void igDockContextProcessUndockNode(ImGuiContext* ctx,ImGuiDockNode* node)
{
- return ImGui::TableSetColumnSortDirection(column_n,sort_direction,append_to_sort_specs);
+ return ImGui::DockContextProcessUndockNode(ctx,node);
}
-CIMGUI_API int igTableGetHoveredRow()
+CIMGUI_API bool igDockContextCalcDropPosForDocking(ImGuiWindow* target,ImGuiDockNode* target_node,ImGuiWindow* payload_window,ImGuiDockNode* payload_node,ImGuiDir split_dir,bool split_outer,ImVec2_c* out_pos)
{
- return ImGui::TableGetHoveredRow();
+ return ImGui::DockContextCalcDropPosForDocking(target,target_node,payload_window,payload_node,split_dir,split_outer,reinterpret_cast(out_pos));
}
-CIMGUI_API float igTableGetHeaderRowHeight()
+CIMGUI_API ImGuiDockNode* igDockContextFindNodeByID(ImGuiContext* ctx,ImGuiID id)
{
- return ImGui::TableGetHeaderRowHeight();
+ return ImGui::DockContextFindNodeByID(ctx,id);
}
-CIMGUI_API float igTableGetHeaderAngledMaxLabelWidth()
+CIMGUI_API void igDockNodeWindowMenuHandler_Default(ImGuiContext* ctx,ImGuiDockNode* node,ImGuiTabBar* tab_bar)
{
- return ImGui::TableGetHeaderAngledMaxLabelWidth();
+ return ImGui::DockNodeWindowMenuHandler_Default(ctx,node,tab_bar);
}
-CIMGUI_API void igTablePushBackgroundChannel()
+CIMGUI_API bool igDockNodeBeginAmendTabBar(ImGuiDockNode* node)
{
- return ImGui::TablePushBackgroundChannel();
+ return ImGui::DockNodeBeginAmendTabBar(node);
}
-CIMGUI_API void igTablePopBackgroundChannel()
+CIMGUI_API void igDockNodeEndAmendTabBar()
{
- return ImGui::TablePopBackgroundChannel();
+ return ImGui::DockNodeEndAmendTabBar();
}
-CIMGUI_API void igTablePushColumnChannel(int column_n)
+CIMGUI_API ImGuiDockNode* igDockNodeGetRootNode(ImGuiDockNode* node)
{
- return ImGui::TablePushColumnChannel(column_n);
+ return ImGui::DockNodeGetRootNode(node);
}
-CIMGUI_API void igTablePopColumnChannel()
+CIMGUI_API bool igDockNodeIsInHierarchyOf(ImGuiDockNode* node,ImGuiDockNode* parent)
{
- return ImGui::TablePopColumnChannel();
+ return ImGui::DockNodeIsInHierarchyOf(node,parent);
}
-CIMGUI_API void igTableAngledHeadersRowEx(ImGuiID row_id,float angle,float max_label_width,const ImGuiTableHeaderData* data,int data_count)
+CIMGUI_API int igDockNodeGetDepth(const ImGuiDockNode* node)
{
- return ImGui::TableAngledHeadersRowEx(row_id,angle,max_label_width,data,data_count);
+ return ImGui::DockNodeGetDepth(node);
}
-CIMGUI_API ImGuiTable* igGetCurrentTable()
+CIMGUI_API ImGuiID igDockNodeGetWindowMenuButtonId(const ImGuiDockNode* node)
{
- return ImGui::GetCurrentTable();
+ return ImGui::DockNodeGetWindowMenuButtonId(node);
}
-CIMGUI_API ImGuiTable* igTableFindByID(ImGuiID id)
+CIMGUI_API ImGuiDockNode* igGetWindowDockNode()
{
- return ImGui::TableFindByID(id);
+ return ImGui::GetWindowDockNode();
}
-CIMGUI_API bool igBeginTableEx(const char* name,ImGuiID id,int columns_count,ImGuiTableFlags flags,const ImVec2_c outer_size,float inner_width)
+CIMGUI_API bool igGetWindowAlwaysWantOwnTabBar(ImGuiWindow* window)
{
- return ImGui::BeginTableEx(name,id,columns_count,flags,ConvertToCPP_ImVec2(outer_size),inner_width);
+ return ImGui::GetWindowAlwaysWantOwnTabBar(window);
}
-CIMGUI_API void igTableBeginInitMemory(ImGuiTable* table,int columns_count)
+CIMGUI_API void igBeginDocked(ImGuiWindow* window,bool* p_open)
{
- return ImGui::TableBeginInitMemory(table,columns_count);
+ return ImGui::BeginDocked(window,p_open);
}
-CIMGUI_API void igTableBeginApplyRequests(ImGuiTable* table)
+CIMGUI_API void igBeginDockableDragDropSource(ImGuiWindow* window)
{
- return ImGui::TableBeginApplyRequests(table);
+ return ImGui::BeginDockableDragDropSource(window);
}
-CIMGUI_API void igTableSetupDrawChannels(ImGuiTable* table)
+CIMGUI_API void igBeginDockableDragDropTarget(ImGuiWindow* window)
{
- return ImGui::TableSetupDrawChannels(table);
+ return ImGui::BeginDockableDragDropTarget(window);
}
-CIMGUI_API void igTableUpdateLayout(ImGuiTable* table)
+CIMGUI_API void igSetWindowDock(ImGuiWindow* window,ImGuiID dock_id,ImGuiCond cond)
{
- return ImGui::TableUpdateLayout(table);
+ return ImGui::SetWindowDock(window,dock_id,cond);
}
-CIMGUI_API void igTableUpdateBorders(ImGuiTable* table)
+CIMGUI_API void igDockBuilderDockWindow(const char* window_name,ImGuiID node_id)
{
- return ImGui::TableUpdateBorders(table);
+ return ImGui::DockBuilderDockWindow(window_name,node_id);
}
-CIMGUI_API void igTableUpdateColumnsWeightFromWidth(ImGuiTable* table)
+CIMGUI_API ImGuiDockNode* igDockBuilderGetNode(ImGuiID node_id)
{
- return ImGui::TableUpdateColumnsWeightFromWidth(table);
+ return ImGui::DockBuilderGetNode(node_id);
}
-CIMGUI_API void igTableDrawBorders(ImGuiTable* table)
+CIMGUI_API ImGuiDockNode* igDockBuilderGetCentralNode(ImGuiID node_id)
{
- return ImGui::TableDrawBorders(table);
+ return ImGui::DockBuilderGetCentralNode(node_id);
}
-CIMGUI_API void igTableDrawDefaultContextMenu(ImGuiTable* table,ImGuiTableFlags flags_for_section_to_display)
+CIMGUI_API ImGuiID igDockBuilderAddNode(ImGuiID node_id,ImGuiDockNodeFlags flags)
{
- return ImGui::TableDrawDefaultContextMenu(table,flags_for_section_to_display);
+ return ImGui::DockBuilderAddNode(node_id,flags);
}
-CIMGUI_API bool igTableBeginContextMenuPopup(ImGuiTable* table)
+CIMGUI_API void igDockBuilderRemoveNode(ImGuiID node_id)
{
- return ImGui::TableBeginContextMenuPopup(table);
+ return ImGui::DockBuilderRemoveNode(node_id);
}
-CIMGUI_API void igTableMergeDrawChannels(ImGuiTable* table)
+CIMGUI_API void igDockBuilderRemoveNodeDockedWindows(ImGuiID node_id,bool clear_settings_refs)
{
- return ImGui::TableMergeDrawChannels(table);
+ return ImGui::DockBuilderRemoveNodeDockedWindows(node_id,clear_settings_refs);
}
-CIMGUI_API ImGuiTableInstanceData* igTableGetInstanceData(ImGuiTable* table,int instance_no)
+CIMGUI_API void igDockBuilderRemoveNodeChildNodes(ImGuiID node_id)
{
- return ImGui::TableGetInstanceData(table,instance_no);
+ return ImGui::DockBuilderRemoveNodeChildNodes(node_id);
}
-CIMGUI_API ImGuiID igTableGetInstanceID(ImGuiTable* table,int instance_no)
+CIMGUI_API void igDockBuilderSetNodePos(ImGuiID node_id,ImVec2_c pos)
{
- return ImGui::TableGetInstanceID(table,instance_no);
+ return ImGui::DockBuilderSetNodePos(node_id,ConvertToCPP_ImVec2(pos));
}
-CIMGUI_API void igTableFixDisplayOrder(ImGuiTable* table)
+CIMGUI_API void igDockBuilderSetNodeSize(ImGuiID node_id,ImVec2_c size)
{
- return ImGui::TableFixDisplayOrder(table);
+ return ImGui::DockBuilderSetNodeSize(node_id,ConvertToCPP_ImVec2(size));
}
-CIMGUI_API void igTableSortSpecsSanitize(ImGuiTable* table)
+CIMGUI_API ImGuiID igDockBuilderSplitNode(ImGuiID node_id,ImGuiDir split_dir,float size_ratio_for_node_at_dir,ImGuiID* out_id_at_dir,ImGuiID* out_id_at_opposite_dir)
{
- return ImGui::TableSortSpecsSanitize(table);
+ return ImGui::DockBuilderSplitNode(node_id,split_dir,size_ratio_for_node_at_dir,out_id_at_dir,out_id_at_opposite_dir);
}
-CIMGUI_API void igTableSortSpecsBuild(ImGuiTable* table)
+CIMGUI_API void igDockBuilderCopyDockSpace(ImGuiID src_dockspace_id,ImGuiID dst_dockspace_id,ImVector_const_charPtr* in_window_remap_pairs)
{
- return ImGui::TableSortSpecsBuild(table);
+ return ImGui::DockBuilderCopyDockSpace(src_dockspace_id,dst_dockspace_id,in_window_remap_pairs);
}
-CIMGUI_API ImGuiSortDirection igTableGetColumnNextSortDirection(ImGuiTableColumn* column)
+CIMGUI_API void igDockBuilderCopyNode(ImGuiID src_node_id,ImGuiID dst_node_id,ImVector_ImGuiID* out_node_remap_pairs)
{
- return ImGui::TableGetColumnNextSortDirection(column);
+ return ImGui::DockBuilderCopyNode(src_node_id,dst_node_id,out_node_remap_pairs);
}
-CIMGUI_API void igTableFixColumnSortDirection(ImGuiTable* table,ImGuiTableColumn* column)
+CIMGUI_API void igDockBuilderCopyWindowSettings(const char* src_name,const char* dst_name)
{
- return ImGui::TableFixColumnSortDirection(table,column);
+ return ImGui::DockBuilderCopyWindowSettings(src_name,dst_name);
}
-CIMGUI_API float igTableGetColumnWidthAuto(ImGuiTable* table,ImGuiTableColumn* column)
+CIMGUI_API void igDockBuilderFinish(ImGuiID node_id)
{
- return ImGui::TableGetColumnWidthAuto(table,column);
+ return ImGui::DockBuilderFinish(node_id);
}
-CIMGUI_API void igTableBeginRow(ImGuiTable* table)
+CIMGUI_API void igPushFocusScope(ImGuiID id)
{
- return ImGui::TableBeginRow(table);
+ return ImGui::PushFocusScope(id);
}
-CIMGUI_API void igTableEndRow(ImGuiTable* table)
+CIMGUI_API void igPopFocusScope()
{
- return ImGui::TableEndRow(table);
+ return ImGui::PopFocusScope();
}
-CIMGUI_API void igTableBeginCell(ImGuiTable* table,int column_n)
+CIMGUI_API bool igIsInNavFocusRoute(ImGuiID focus_scope_id)
{
- return ImGui::TableBeginCell(table,column_n);
+ return ImGui::IsInNavFocusRoute(focus_scope_id);
}
-CIMGUI_API void igTableEndCell(ImGuiTable* table)
+CIMGUI_API ImGuiID igGetCurrentFocusScope()
{
- return ImGui::TableEndCell(table);
+ return ImGui::GetCurrentFocusScope();
}
-CIMGUI_API ImRect_c igTableGetCellBgRect(const ImGuiTable* table,int column_n)
+CIMGUI_API bool igIsDragDropActive()
{
- return ConvertFromCPP_ImRect(ImGui::TableGetCellBgRect(table,column_n));
+ return ImGui::IsDragDropActive();
}
-CIMGUI_API const char* igTableGetColumnName_TablePtr(const ImGuiTable* table,int column_n)
+CIMGUI_API bool igBeginDragDropTargetCustom(const ImRect_c bb,ImGuiID id)
{
- return ImGui::TableGetColumnName(table,column_n);
+ return ImGui::BeginDragDropTargetCustom(ConvertToCPP_ImRect(bb),id);
}
-CIMGUI_API ImGuiID igTableGetColumnResizeID(ImGuiTable* table,int column_n,int instance_no)
+CIMGUI_API bool igBeginDragDropTargetViewport(ImGuiViewport* viewport,const ImRect* p_bb)
{
- return ImGui::TableGetColumnResizeID(table,column_n,instance_no);
+ return ImGui::BeginDragDropTargetViewport(viewport,p_bb);
}
-CIMGUI_API float igTableCalcMaxColumnWidth(const ImGuiTable* table,int column_n)
+CIMGUI_API void igClearDragDrop()
{
- return ImGui::TableCalcMaxColumnWidth(table,column_n);
+ return ImGui::ClearDragDrop();
}
-CIMGUI_API void igTableSetColumnWidthAutoSingle(ImGuiTable* table,int column_n)
+CIMGUI_API bool igIsDragDropPayloadBeingAccepted()
{
- return ImGui::TableSetColumnWidthAutoSingle(table,column_n);
+ return ImGui::IsDragDropPayloadBeingAccepted();
}
-CIMGUI_API void igTableSetColumnWidthAutoAll(ImGuiTable* table)
+CIMGUI_API void igRenderDragDropTargetRectForItem(const ImRect_c bb)
{
- return ImGui::TableSetColumnWidthAutoAll(table);
+ return ImGui::RenderDragDropTargetRectForItem(ConvertToCPP_ImRect(bb));
}
-CIMGUI_API void igTableSetColumnDisplayOrder(ImGuiTable* table,int column_n,int dst_order)
+CIMGUI_API void igRenderDragDropTargetRectEx(ImDrawList* draw_list,const ImRect_c bb,float rounding)
{
- return ImGui::TableSetColumnDisplayOrder(table,column_n,dst_order);
+ return ImGui::RenderDragDropTargetRectEx(draw_list,ConvertToCPP_ImRect(bb),rounding);
}
-CIMGUI_API void igTableQueueSetColumnDisplayOrder(ImGuiTable* table,int column_n,int dst_order)
+CIMGUI_API ImGuiTypingSelectRequest* igGetTypingSelectRequest(ImGuiTypingSelectFlags flags)
{
- return ImGui::TableQueueSetColumnDisplayOrder(table,column_n,dst_order);
+ return ImGui::GetTypingSelectRequest(flags);
}
-CIMGUI_API void igTableRemove(ImGuiTable* table)
+CIMGUI_API int igTypingSelectFindMatch(ImGuiTypingSelectRequest* req,int items_count,const char*(*get_item_name_func)(void*,int),void* user_data,int nav_item_idx)
{
- return ImGui::TableRemove(table);
+ return ImGui::TypingSelectFindMatch(req,items_count,get_item_name_func,user_data,nav_item_idx);
}
-CIMGUI_API void igTableGcCompactTransientBuffers_TablePtr(ImGuiTable* table)
+CIMGUI_API int igTypingSelectFindNextSingleCharMatch(ImGuiTypingSelectRequest* req,int items_count,const char*(*get_item_name_func)(void*,int),void* user_data,int nav_item_idx)
{
- return ImGui::TableGcCompactTransientBuffers(table);
+ return ImGui::TypingSelectFindNextSingleCharMatch(req,items_count,get_item_name_func,user_data,nav_item_idx);
}
-CIMGUI_API void igTableGcCompactTransientBuffers_TableTempDataPtr(ImGuiTableTempData* table)
+CIMGUI_API int igTypingSelectFindBestLeadingMatch(ImGuiTypingSelectRequest* req,int items_count,const char*(*get_item_name_func)(void*,int),void* user_data)
{
- return ImGui::TableGcCompactTransientBuffers(table);
+ return ImGui::TypingSelectFindBestLeadingMatch(req,items_count,get_item_name_func,user_data);
}
-CIMGUI_API void igTableGcCompactSettings()
+CIMGUI_API bool igBeginBoxSelect(const ImRect_c scope_rect,ImGuiWindow* window,ImGuiID box_select_id,ImGuiMultiSelectFlags ms_flags)
{
- return ImGui::TableGcCompactSettings();
+ return ImGui::BeginBoxSelect(ConvertToCPP_ImRect(scope_rect),window,box_select_id,ms_flags);
}
-CIMGUI_API void igTableLoadSettings(ImGuiTable* table)
+CIMGUI_API void igEndBoxSelect(const ImRect_c scope_rect,ImGuiMultiSelectFlags ms_flags)
{
- return ImGui::TableLoadSettings(table);
+ return ImGui::EndBoxSelect(ConvertToCPP_ImRect(scope_rect),ms_flags);
}
-CIMGUI_API void igTableSaveSettings(ImGuiTable* table)
+CIMGUI_API void igMultiSelectItemHeader(ImGuiID id,bool* p_selected,ImGuiButtonFlags* p_button_flags)
{
- return ImGui::TableSaveSettings(table);
+ return ImGui::MultiSelectItemHeader(id,p_selected,p_button_flags);
}
-CIMGUI_API void igTableResetSettings(ImGuiTable* table)
+CIMGUI_API void igMultiSelectItemFooter(ImGuiID id,bool* p_selected,bool* p_pressed,ImGuiMultiSelectFlags extra_flags)
{
- return ImGui::TableResetSettings(table);
+ return ImGui::MultiSelectItemFooter(id,p_selected,p_pressed,extra_flags);
}
-CIMGUI_API ImGuiTableSettings* igTableGetBoundSettings(ImGuiTable* table)
+CIMGUI_API void igMultiSelectAddSetAll(ImGuiMultiSelectTempData* ms,bool selected)
{
- return ImGui::TableGetBoundSettings(table);
+ return ImGui::MultiSelectAddSetAll(ms,selected);
}
-CIMGUI_API void igTableSettingsAddSettingsHandler()
+CIMGUI_API void igMultiSelectAddSetRange(ImGuiMultiSelectTempData* ms,bool selected,int range_dir,ImGuiSelectionUserData first_item,ImGuiSelectionUserData last_item)
{
- return ImGui::TableSettingsAddSettingsHandler();
+ return ImGui::MultiSelectAddSetRange(ms,selected,range_dir,first_item,last_item);
}
-CIMGUI_API ImGuiTableSettings* igTableSettingsCreate(ImGuiID id,int columns_count)
+CIMGUI_API ImGuiBoxSelectState* igGetBoxSelectState(ImGuiID id)
{
- return ImGui::TableSettingsCreate(id,columns_count);
+ return ImGui::GetBoxSelectState(id);
}
-CIMGUI_API ImGuiTableSettings* igTableSettingsFindByID(ImGuiID id)
+CIMGUI_API ImGuiMultiSelectState* igGetMultiSelectState(ImGuiID id)
{
- return ImGui::TableSettingsFindByID(id);
+ return ImGui::GetMultiSelectState(id);
}
CIMGUI_API ImGuiTabBar* igGetCurrentTabBar()
{
@@ -5810,9 +5886,9 @@ CIMGUI_API void igRenderColorRectWithAlphaCheckerboard(ImDrawList* draw_list,ImV
{
return ImGui::RenderColorRectWithAlphaCheckerboard(draw_list,ConvertToCPP_ImVec2(p_min),ConvertToCPP_ImVec2(p_max),fill_col,grid_step,ConvertToCPP_ImVec2(grid_off),rounding,flags);
}
-CIMGUI_API void igRenderNavCursor(const ImRect_c bb,ImGuiID id,ImGuiNavRenderCursorFlags flags)
+CIMGUI_API void igRenderNavCursor(const ImRect_c bb,ImGuiID id,ImGuiNavRenderCursorFlags flags,float rounding)
{
- return ImGui::RenderNavCursor(ConvertToCPP_ImRect(bb),id,flags);
+ return ImGui::RenderNavCursor(ConvertToCPP_ImRect(bb),id,flags,rounding);
}
CIMGUI_API const char* igFindRenderedTextEnd(const char* text,const char* text_end)
{
@@ -5868,7 +5944,7 @@ CIMGUI_API void igTextAligned(float align_x,float size_x,const char* fmt,...)
#ifdef CIMGUI_VARGS0
CIMGUI_API void igTextAligned0(float align_x,float size_x,const char* fmt)
{
- return igTextAligned(align_x,size_x,fmt);
+ igTextAligned(align_x,size_x,fmt);
}
#endif
CIMGUI_API void igTextAlignedV(float align_x,float size_x,const char* fmt,va_list args)
@@ -6219,9 +6295,9 @@ CIMGUI_API void igDebugNodeTable(ImGuiTable* table)
{
return ImGui::DebugNodeTable(table);
}
-CIMGUI_API void igDebugNodeTableSettings(ImGuiTableSettings* settings)
+CIMGUI_API void igDebugNodeTableSettings(ImGuiTableSettings* settings,ImGuiTable* table)
{
- return ImGui::DebugNodeTableSettings(settings);
+ return ImGui::DebugNodeTableSettings(settings,table);
}
CIMGUI_API void igDebugNodeInputTextState(ImGuiInputTextState* state)
{
@@ -6499,6 +6575,14 @@ CIMGUI_API void igImFontAtlasTextureBlockQueueUpload(ImFontAtlas* atlas,ImTextur
{
return ImFontAtlasTextureBlockQueueUpload(atlas,tex,x,y,w,h);
}
+CIMGUI_API bool igImTextureDataUpdateNewFrame(ImTextureData* tex)
+{
+ return ImTextureDataUpdateNewFrame(tex);
+}
+CIMGUI_API void igImTextureDataQueueUpload(ImTextureData* tex,int x,int y,int w,int h)
+{
+ return ImTextureDataQueueUpload(tex,x,y,w,h);
+}
CIMGUI_API int igImTextureDataGetFormatBytesPerPixel(ImTextureFormat format)
{
return ImTextureDataGetFormatBytesPerPixel(format);
@@ -6548,6 +6632,12 @@ CIMGUI_API void ImGuiTextBuffer_appendf(ImGuiTextBuffer *self, const char *fmt,
self->appendfv(fmt, args);
va_end(args);
}
+#ifdef CIMGUI_VARGS0
+CIMGUI_API void ImGuiTextBuffer_appendf0(ImGuiTextBuffer *self, const char *fmt)
+{
+ ImGuiTextBuffer_appendf(self,fmt);
+}
+#endif
CIMGUI_API float igGET_FLT_MAX()
{
diff --git a/include/cimgui.h b/include/cimgui.h
index 6be7500..af70eb4 100644
--- a/include/cimgui.h
+++ b/include/cimgui.h
@@ -1,5 +1,5 @@
//This file is automatically generated by generator.lua from https://github.com/cimgui/cimgui
-//based on imgui.h file version "1.92.7" 19270 from Dear ImGui https://github.com/ocornut/imgui
+//based on imgui.h file version "1.92.9b" 19291 from Dear ImGui https://github.com/ocornut/imgui
//with imgui_internal.h api
//with imgui_freetype.h api
//docking branch
@@ -47,6 +47,12 @@ typedef unsigned __int64 ImU64;
#ifdef CIMGUI_DEFINE_ENUMS_AND_STRUCTS
+typedef struct ImColor_c ImColor;
+typedef struct ImRect_c ImRect;
+typedef struct ImTextureRef_c ImTextureRef;
+typedef struct ImVec2_c ImVec2;
+typedef struct ImVec2i_c ImVec2i;
+typedef struct ImVec4_c ImVec4;
typedef struct ImDrawChannel ImDrawChannel;
typedef struct ImDrawCmd ImDrawCmd;
@@ -94,6 +100,7 @@ typedef struct ImGuiWindowClass ImGuiWindowClass;
typedef struct ImBitVector ImBitVector;
typedef struct ImRect_c ImRect_c;
typedef struct ImGuiTextIndex ImGuiTextIndex;
+typedef struct ImGuiPackedDate ImGuiPackedDate;
typedef struct ImDrawDataBuilder ImDrawDataBuilder;
typedef struct ImFontAtlasPostProcessData ImFontAtlasPostProcessData;
typedef struct ImFontAtlasRectEntry ImFontAtlasRectEntry;
@@ -328,6 +335,9 @@ typedef enum {
ImGuiItemFlags_AutoClosePopups = 1 << 4,
ImGuiItemFlags_AllowDuplicateId = 1 << 5,
ImGuiItemFlags_Disabled = 1 << 6,
+ ImGuiItemFlags_LiveEditOnInputText = 1 << 7,
+ ImGuiItemFlags_LiveEditOnInputScalar = 1 << 8,
+ ImGuiItemFlags_LiveEditOnInput = ImGuiItemFlags_LiveEditOnInputText | ImGuiItemFlags_LiveEditOnInputScalar,
}ImGuiItemFlags_;
typedef enum {
ImGuiInputTextFlags_None = 0,
@@ -755,6 +765,7 @@ typedef enum {
ImGuiCol_ScrollbarGrabHovered,
ImGuiCol_ScrollbarGrabActive,
ImGuiCol_CheckMark,
+ ImGuiCol_CheckboxSelectedBg,
ImGuiCol_SliderGrab,
ImGuiCol_SliderGrabActive,
ImGuiCol_Button,
@@ -836,6 +847,9 @@ typedef enum {
ImGuiStyleVar_TableAngledHeadersTextAlign,
ImGuiStyleVar_TreeLinesSize,
ImGuiStyleVar_TreeLinesRounding,
+ ImGuiStyleVar_MenuItemRounding,
+ ImGuiStyleVar_SelectableRounding,
+ ImGuiStyleVar_DragDropTargetRounding,
ImGuiStyleVar_ButtonTextAlign,
ImGuiStyleVar_SelectableTextAlign,
ImGuiStyleVar_SeparatorSize,
@@ -879,8 +893,9 @@ typedef enum {
ImGuiColorEditFlags_Float = 1 << 24,
ImGuiColorEditFlags_PickerHueBar = 1 << 25,
ImGuiColorEditFlags_PickerHueWheel = 1 << 26,
- ImGuiColorEditFlags_InputRGB = 1 << 27,
- ImGuiColorEditFlags_InputHSV = 1 << 28,
+ ImGuiColorEditFlags_PickerNoRotate = 1 << 27,
+ ImGuiColorEditFlags_InputRGB = 1 << 28,
+ ImGuiColorEditFlags_InputHSV = 1 << 29,
ImGuiColorEditFlags_DefaultOptions_ = ImGuiColorEditFlags_Uint8 | ImGuiColorEditFlags_DisplayRGB | ImGuiColorEditFlags_InputRGB | ImGuiColorEditFlags_PickerHueBar,
ImGuiColorEditFlags_AlphaMask_ = ImGuiColorEditFlags_NoAlpha | ImGuiColorEditFlags_AlphaOpaque | ImGuiColorEditFlags_AlphaNoBg | ImGuiColorEditFlags_AlphaPreviewHalf,
ImGuiColorEditFlags_DisplayMask_ = ImGuiColorEditFlags_DisplayRGB | ImGuiColorEditFlags_DisplayHSV | ImGuiColorEditFlags_DisplayHex,
@@ -1075,6 +1090,8 @@ struct ImGuiStyle
ImGuiTreeNodeFlags TreeLinesFlags;
float TreeLinesSize;
float TreeLinesRounding;
+ float MenuItemRounding;
+ float SelectableRounding;
float DragDropTargetRounding;
float DragDropTargetBorderSize;
float DragDropTargetPadding;
@@ -1082,6 +1099,7 @@ struct ImGuiStyle
ImGuiDir ColorButtonPosition;
ImVec2_c ButtonTextAlign;
ImVec2_c SelectableTextAlign;
+ float InputTextCursorSize;
float SeparatorSize;
float SeparatorTextBorderSize;
ImVec2_c SeparatorTextAlign;
@@ -1147,19 +1165,24 @@ struct ImGuiIO
bool ConfigViewportsPlatformFocusSetsImGuiFocus;
bool ConfigDpiScaleFonts;
bool ConfigDpiScaleViewports;
- bool MouseDrawCursor;
bool ConfigMacOSXBehaviors;
bool ConfigInputTrickleEventQueue;
bool ConfigInputTextCursorBlink;
bool ConfigInputTextEnterKeepActive;
+ ImGuiColorEditFlags ConfigColorEditFlags;
bool ConfigDragClickToInputText;
bool ConfigWindowsResizeFromEdges;
bool ConfigWindowsMoveFromTitleBarOnly;
bool ConfigWindowsCopyContentsWithCtrlC;
bool ConfigScrollbarScrollByPage;
+ bool ConfigIniSettingsSaveLastUsedDate;
+ int ConfigIniSettingsAutoDiscardMonths;
+ bool ConfigDebugIniSettings;
+ bool MouseDrawCursor;
float ConfigMemoryCompactTimer;
float MouseDoubleClickTime;
float MouseDoubleClickMaxDist;
+ float MouseSingleClickDelay;
float MouseDragThreshold;
float KeyRepeatDelay;
float KeyRepeatRate;
@@ -1173,7 +1196,6 @@ struct ImGuiIO
bool ConfigDebugBeginReturnValueOnce;
bool ConfigDebugBeginReturnValueLoop;
bool ConfigDebugIgnoreFocusLoss;
- bool ConfigDebugIniSettings;
const char* BackendPlatformName;
const char* BackendRendererName;
void* BackendPlatformUserData;
@@ -1265,6 +1287,7 @@ struct ImGuiWindowClass
ImGuiDockNodeFlags DockNodeFlagsOverrideSet;
bool DockingAlwaysTabBar;
bool DockingAllowUnclassed;
+ void* PlatformIconData;
};
struct ImGuiPayload
{
@@ -1356,6 +1379,7 @@ typedef enum {
ImGuiMultiSelectFlags_NavWrapX = 1 << 16,
ImGuiMultiSelectFlags_NoSelectOnRightClick = 1 << 17,
ImGuiMultiSelectFlags_SelectOnMask_ = ImGuiMultiSelectFlags_SelectOnAuto | ImGuiMultiSelectFlags_SelectOnClickAlways | ImGuiMultiSelectFlags_SelectOnClickRelease,
+ ImGuiMultiSelectFlags_CheckboxMode_ = 1 << 20,
}ImGuiMultiSelectFlags_;
typedef struct ImVector_ImGuiSelectionRequest {int Size;int Capacity;ImGuiSelectionRequest* Data;} ImVector_ImGuiSelectionRequest;
@@ -1444,19 +1468,20 @@ struct ImDrawListSplitter
};
typedef enum {
ImDrawFlags_None = 0,
- ImDrawFlags_Closed = 1 << 0,
ImDrawFlags_RoundCornersTopLeft = 1 << 4,
ImDrawFlags_RoundCornersTopRight = 1 << 5,
ImDrawFlags_RoundCornersBottomLeft = 1 << 6,
ImDrawFlags_RoundCornersBottomRight = 1 << 7,
ImDrawFlags_RoundCornersNone = 1 << 8,
+ ImDrawFlags_RoundCornersAll = ImDrawFlags_RoundCornersTopLeft | ImDrawFlags_RoundCornersTopRight | ImDrawFlags_RoundCornersBottomLeft | ImDrawFlags_RoundCornersBottomRight,
+ ImDrawFlags_RoundCornersDefault_ = ImDrawFlags_RoundCornersAll,
ImDrawFlags_RoundCornersTop = ImDrawFlags_RoundCornersTopLeft | ImDrawFlags_RoundCornersTopRight,
ImDrawFlags_RoundCornersBottom = ImDrawFlags_RoundCornersBottomLeft | ImDrawFlags_RoundCornersBottomRight,
ImDrawFlags_RoundCornersLeft = ImDrawFlags_RoundCornersBottomLeft | ImDrawFlags_RoundCornersTopLeft,
ImDrawFlags_RoundCornersRight = ImDrawFlags_RoundCornersBottomRight | ImDrawFlags_RoundCornersTopRight,
- ImDrawFlags_RoundCornersAll = ImDrawFlags_RoundCornersTopLeft | ImDrawFlags_RoundCornersTopRight | ImDrawFlags_RoundCornersBottomLeft | ImDrawFlags_RoundCornersBottomRight,
- ImDrawFlags_RoundCornersDefault_ = ImDrawFlags_RoundCornersAll,
ImDrawFlags_RoundCornersMask_ = ImDrawFlags_RoundCornersAll | ImDrawFlags_RoundCornersNone,
+ ImDrawFlags_Closed = 1 << 9,
+ ImDrawFlags_InvalidMask_ = ~0x7FFFFFF0,
}ImDrawFlags_;
typedef enum {
ImDrawListFlags_None = 0,
@@ -1464,6 +1489,7 @@ typedef enum {
ImDrawListFlags_AntiAliasedLinesUseTex = 1 << 1,
ImDrawListFlags_AntiAliasedFill = 1 << 2,
ImDrawListFlags_AllowVtxOffset = 1 << 3,
+ ImDrawListFlags_TextNoPixelSnap = 1 << 4,
}ImDrawListFlags_;
typedef struct ImVector_ImDrawVert {int Size;int Capacity;ImDrawVert* Data;} ImVector_ImDrawVert;
@@ -1501,7 +1527,7 @@ typedef struct ImVector_ImTextureDataPtr {int Size;int Capacity;ImTextureData**
struct ImDrawData
{
bool Valid;
- int CmdListsCount;
+ int FrameCount;
int TotalIdxCount;
int TotalVtxCount;
ImVector_ImDrawListPtr CmdLists;
@@ -1534,6 +1560,7 @@ struct ImTextureData
int UniqueID;
ImTextureStatus Status;
void* BackendUserData;
+ void* QueueUserData;
ImTextureID TexID;
ImTextureFormat Format;
int Width;
@@ -1678,6 +1705,7 @@ typedef enum {
ImFontFlags_NoLoadError = 1 << 1,
ImFontFlags_NoLoadGlyphs = 1 << 2,
ImFontFlags_LockBakedSizes = 1 << 3,
+ ImFontFlags_ImplicitRefSize = 1 << 4,
}ImFontFlags_;
typedef struct ImVector_ImFontConfigPtr {int Size;int Capacity;ImFontConfig** Data;} ImVector_ImFontConfigPtr;
@@ -1728,6 +1756,7 @@ struct ImGuiViewport
ImDrawData* DrawData;
void* RendererUserData;
void* PlatformUserData;
+ void* PlatformIconData;
void* PlatformHandle;
void* PlatformHandleRaw;
bool PlatformWindowCreated;
@@ -1749,9 +1778,13 @@ struct ImGuiPlatformIO
void (*Platform_SetImeDataFn)(ImGuiContext* ctx, ImGuiViewport* viewport, ImGuiPlatformImeData* data);
void* Platform_ImeUserData;
ImWchar Platform_LocaleDecimalPoint;
+ int Platform_SessionDate;
int Renderer_TextureMaxWidth;
int Renderer_TextureMaxHeight;
void* Renderer_RenderState;
+ ImDrawCallback DrawCallback_ResetRenderState;
+ ImDrawCallback DrawCallback_SetSamplerLinear;
+ ImDrawCallback DrawCallback_SetSamplerNearest;
void (*Platform_CreateWindow)(ImGuiViewport* vp);
void (*Platform_DestroyWindow)(ImGuiViewport* vp);
void (*Platform_ShowWindow)(ImGuiViewport* vp);
@@ -1799,6 +1832,7 @@ struct ImGuiPlatformImeData
struct ImBitVector;
struct ImRect_c;
struct ImGuiTextIndex;
+struct ImGuiPackedDate;
struct ImDrawDataBuilder;
struct ImDrawListSharedData;
struct ImFontAtlasBuilder;
@@ -1849,7 +1883,7 @@ struct ImGuiWindow;
struct ImGuiWindowDockStyle;
struct ImGuiWindowTempData;
struct ImGuiWindowSettings;
-typedef int ImGuiDataAuthority;
+typedef unsigned int ImGuiDataAuthority;
typedef int ImGuiLayoutType;
typedef int ImDrawTextFlags;
typedef int ImGuiActivateFlags;
@@ -1920,6 +1954,12 @@ struct ImGuiTextIndex
ImVector_int Offsets;
int EndOffset;
};
+struct ImGuiPackedDate
+{
+ ImU16 Year : 7;
+ ImU16 Month : 4;
+ ImU16 Day : 5;
+};
struct ImDrawListSharedData
{
ImVec2_c TexUvWhitePixel;
@@ -1929,7 +1969,7 @@ struct ImDrawListSharedData
float FontSize;
float FontScale;
float CurveTessellationTol;
- float CircleSegmentMaxError;
+ float CircleTessellationMaxError;
float InitialFringeScale;
ImDrawListFlags InitialFlags;
ImVec4_c ClipRectFullscreen;
@@ -1995,7 +2035,7 @@ typedef enum {
ImGuiItemFlags_Inputable = 1 << 20,
ImGuiItemFlags_HasSelectionUserData = 1 << 21,
ImGuiItemFlags_IsMultiSelect = 1 << 22,
- ImGuiItemFlags_Default_ = ImGuiItemFlags_AutoClosePopups,
+ ImGuiItemFlags_Default_ = ImGuiItemFlags_AutoClosePopups | ImGuiItemFlags_LiveEditOnInputText,
}ImGuiItemFlagsPrivate_;
typedef enum {
ImGuiItemStatusFlags_None = 0,
@@ -2010,6 +2050,7 @@ typedef enum {
ImGuiItemStatusFlags_Visible = 1 << 8,
ImGuiItemStatusFlags_HasClipRect = 1 << 9,
ImGuiItemStatusFlags_HasShortcut = 1 << 10,
+ ImGuiItemStatusFlags_EditedInternal = 1 << 11,
}ImGuiItemStatusFlags_;
typedef enum {
ImGuiHoveredFlags_DelayMask_ = ImGuiHoveredFlags_DelayNone | ImGuiHoveredFlags_DelayShort | ImGuiHoveredFlags_DelayNormal | ImGuiHoveredFlags_NoSharedDelay,
@@ -2124,7 +2165,7 @@ struct ImGuiGroupData
ImVec2_c BackupCurrLineSize;
float BackupCurrLineTextBaseOffset;
ImGuiID BackupActiveIdIsAlive;
- bool BackupActiveIdHasBeenEditedThisFrame;
+ bool BackupAnyIdHasBeenEditedThisFrame;
bool BackupDeactivatedIdIsAlive;
bool BackupHoveredIdIsAlive;
bool BackupIsSameLine;
@@ -2145,6 +2186,7 @@ typedef struct ImGuiInputTextDeactivatedState ImGuiInputTextDeactivatedState;
struct ImGuiInputTextDeactivatedState
{
ImGuiID ID;
+ int ElapseFrame;
ImVector_char TextA;
}; struct STB_TexteditState;
typedef STB_TexteditState ImStbTexteditState;
@@ -2239,7 +2281,7 @@ typedef enum {
struct ImGuiNextItemData
{
ImGuiNextItemDataFlags HasFlags;
- ImGuiItemFlags ItemFlags;
+ ImGuiItemFlags ItemFlagsSet;
ImGuiID FocusScopeId;
ImGuiSelectionUserData SelectionUserData;
float Width;
@@ -2500,7 +2542,6 @@ typedef enum {
ImGuiNavRenderCursorFlags_None = 0,
ImGuiNavRenderCursorFlags_Compact = 1 << 1,
ImGuiNavRenderCursorFlags_AlwaysDraw = 1 << 2,
- ImGuiNavRenderCursorFlags_NoRounding = 1 << 3,
}ImGuiNavRenderCursorFlags_;
typedef enum {
ImGuiNavMoveFlags_None = 0,
@@ -2618,6 +2659,7 @@ struct ImGuiBoxSelectState
ImGuiWindow* Window;
bool UnclipMode;
ImRect_c UnclipRect;
+ ImRect_c UnclipRects[2];
ImRect_c BoxSelectRectPrev;
ImRect_c BoxSelectRectCurr;
};
@@ -2629,7 +2671,6 @@ struct ImGuiMultiSelectTempData
ImGuiMultiSelectFlags Flags;
ImVec2_c ScopeRectMin;
ImVec2_c BackupCursorMaxPos;
- ImGuiSelectionUserData LastSubmittedItem;
ImGuiID BoxSelectId;
ImGuiKeyChord KeyMods;
ImS8 LoopRequestSetAll;
@@ -2639,6 +2680,7 @@ struct ImGuiMultiSelectTempData
bool NavIdPassedBy;
bool RangeSrcPassedBy;
bool RangeDstPassedBy;
+ bool IsSoleOrUnknownSelectionSize;
};
struct ImGuiMultiSelectState
{
@@ -2700,8 +2742,8 @@ struct ImGuiDockNode
ImVec2_c Size;
ImVec2_c SizeRef;
ImGuiAxis SplitAxis;
- ImGuiWindowClass WindowClass;
ImU32 LastBgColor;
+ ImGuiWindowClass WindowClass;
ImGuiWindow* HostWindow;
ImGuiWindow* VisibleWindow;
ImGuiDockNode* CentralNode;
@@ -2714,9 +2756,9 @@ struct ImGuiDockNode
ImGuiID SelectedTabId;
ImGuiID WantCloseTabId;
ImGuiID RefViewportId;
- ImGuiDataAuthority AuthorityForPos :3;
- ImGuiDataAuthority AuthorityForSize :3;
- ImGuiDataAuthority AuthorityForViewport :3;
+ ImU8 AuthorityForPos :3;
+ ImU8 AuthorityForSize :3;
+ ImU8 AuthorityForViewport :3;
bool IsVisible :1;
bool IsFocused :1;
bool IsBgDrawnThisFrame :1;
@@ -2793,10 +2835,22 @@ struct ImGuiWindowSettings
ImGuiID DockId;
ImGuiID ClassId;
short DockOrder;
- bool Collapsed;
- bool IsChild;
- bool WantApply;
- bool WantDelete;
+ ImGuiPackedDate LastUsedDate;
+ bool Collapsed : 1;
+ bool IsChild : 1;
+ bool WantApply : 1;
+ bool WantDelete : 1;
+};
+typedef struct ImGuiSettingsCleanupArgs ImGuiSettingsCleanupArgs;
+struct ImGuiSettingsCleanupArgs
+{
+ ImGuiID TypeHashFilter;
+ int DiscardOlderThanMonths;
+ bool DiscardWhenMissingDate;
+ bool DiscardAll;
+ bool SetCurrentSessionDateToAll;
+ bool SetCurrentSessionDateWhenMissingDate;
+ int _DiscardOlderThanDate;
};
struct ImGuiSettingsHandler
{
@@ -2815,16 +2869,18 @@ ImGuiLocKey_VersionStr=0,
ImGuiLocKey_TableSizeOne=1,
ImGuiLocKey_TableSizeAllFit=2,
ImGuiLocKey_TableSizeAllDefault=3,
-ImGuiLocKey_TableResetOrder=4,
-ImGuiLocKey_WindowingMainMenuBar=5,
-ImGuiLocKey_WindowingPopup=6,
-ImGuiLocKey_WindowingUntitled=7,
-ImGuiLocKey_OpenLink_s=8,
-ImGuiLocKey_CopyLink=9,
-ImGuiLocKey_DockingHideTabBar=10,
-ImGuiLocKey_DockingHoldShiftToDock=11,
-ImGuiLocKey_DockingDragToUndockOrMoveNode=12,
-ImGuiLocKey_COUNT=13,
+ImGuiLocKey_TableReset=4,
+ImGuiLocKey_TableResetOrder=5,
+ImGuiLocKey_TableResetVisibility=6,
+ImGuiLocKey_WindowingMainMenuBar=7,
+ImGuiLocKey_WindowingPopup=8,
+ImGuiLocKey_WindowingUntitled=9,
+ImGuiLocKey_OpenLink_s=10,
+ImGuiLocKey_CopyLink=11,
+ImGuiLocKey_DockingHideTabBar=12,
+ImGuiLocKey_DockingHoldShiftToDock=13,
+ImGuiLocKey_DockingDragToUndockOrMoveNode=14,
+ImGuiLocKey_COUNT=15,
}ImGuiLocKey;
struct ImGuiLocEntry
{
@@ -2849,7 +2905,8 @@ typedef enum {
ImGuiDebugLogFlags_EventInputRouting = 1 << 9,
ImGuiDebugLogFlags_EventDocking = 1 << 10,
ImGuiDebugLogFlags_EventViewport = 1 << 11,
- ImGuiDebugLogFlags_EventMask_ = ImGuiDebugLogFlags_EventError | ImGuiDebugLogFlags_EventActiveId | ImGuiDebugLogFlags_EventFocus | ImGuiDebugLogFlags_EventPopup | ImGuiDebugLogFlags_EventNav | ImGuiDebugLogFlags_EventClipper | ImGuiDebugLogFlags_EventSelection | ImGuiDebugLogFlags_EventIO | ImGuiDebugLogFlags_EventFont | ImGuiDebugLogFlags_EventInputRouting | ImGuiDebugLogFlags_EventDocking | ImGuiDebugLogFlags_EventViewport,
+ ImGuiDebugLogFlags_EventTable = 1 << 12,
+ ImGuiDebugLogFlags_EventMask_ = ImGuiDebugLogFlags_EventError | ImGuiDebugLogFlags_EventActiveId | ImGuiDebugLogFlags_EventFocus | ImGuiDebugLogFlags_EventPopup | ImGuiDebugLogFlags_EventNav | ImGuiDebugLogFlags_EventClipper | ImGuiDebugLogFlags_EventSelection | ImGuiDebugLogFlags_EventTable | ImGuiDebugLogFlags_EventIO | ImGuiDebugLogFlags_EventFont | ImGuiDebugLogFlags_EventInputRouting | ImGuiDebugLogFlags_EventDocking | ImGuiDebugLogFlags_EventViewport,
ImGuiDebugLogFlags_OutputToTTY = 1 << 20,
ImGuiDebugLogFlags_OutputToDebugger = 1 << 21,
ImGuiDebugLogFlags_OutputToTestEngine = 1 << 22,
@@ -2885,6 +2942,8 @@ struct ImGuiMetricsConfig
int ShowTablesRectsType;
int HighlightMonitorIdx;
ImGuiID HighlightViewportID;
+ int SettingsDiscardMonths;
+ bool SettingsHighlightOldEntries;
bool ShowFontPreview;
};
typedef struct ImGuiStackLevelInfo ImGuiStackLevelInfo;
@@ -3019,6 +3078,7 @@ struct ImGuiContext
float CurrentDpiScale;
ImDrawListSharedData DrawListSharedData;
ImGuiID WithinEndChildID;
+ ImGuiID WithinEndPopupID;
void* TestEngine;
ImVector_ImGuiInputEvent InputEventsQueue;
ImVector_ImGuiInputEvent InputEventsTrail;
@@ -3054,10 +3114,13 @@ struct ImGuiContext
bool HoveredIdAllowOverlap;
bool HoveredIdIsDisabled;
bool ItemUnclipByLog;
+ bool AnyIdHasBeenEditedThisFrame;
ImGuiID ActiveId;
ImGuiID ActiveIdIsAlive;
float ActiveIdTimer;
bool ActiveIdIsJustActivated;
+ bool ActiveIdWasSelected;
+ bool ActiveIdWasSoleSelected;
bool ActiveIdAllowOverlap;
bool ActiveIdNoClearOnFocusLoss;
bool ActiveIdHasBeenPressedBefore;
@@ -3074,6 +3137,8 @@ struct ImGuiContext
ImGuiDataTypeStorage ActiveIdValueOnActivation;
ImGuiID LastActiveId;
float LastActiveIdTimer;
+ bool LastActiveIdWasSelected;
+ bool LastActiveIdWasSoleSelected;
double LastKeyModsChangeTime;
double LastKeyModsChangeFromNoneTime;
double LastKeyboardKeyPressTime;
@@ -3234,7 +3299,6 @@ struct ImGuiContext
ImGuiDataTypeStorage DataTypeZeroValue;
int BeginMenuDepth;
int BeginComboDepth;
- ImGuiColorEditFlags ColorEditOptions;
ImGuiID ColorEditCurrentID;
ImGuiID ColorEditSavedID;
float ColorEditSavedHue;
@@ -3264,6 +3328,7 @@ struct ImGuiContext
ImVector_ImTextureDataPtr UserTextures;
ImGuiDockContext DockContext;
void (*DockNodeWindowMenuHandler)(ImGuiContext* ctx, ImGuiDockNode* node, ImGuiTabBar* tab_bar);
+ ImGuiPackedDate SessionDate;
bool SettingsLoaded;
float SettingsDirtyTimer;
ImGuiTextBuffer SettingsIniData;
@@ -3575,7 +3640,8 @@ struct ImGuiTableColumn
float StretchWeight;
float InitStretchWeightOrWidth;
ImRect_c ClipRect;
- ImGuiID UserID;
+ ImGuiID ID;
+ ImGuiID UserData;
float WorkMinX;
float WorkMaxX;
float ItemWidth;
@@ -3599,15 +3665,31 @@ struct ImGuiTableColumn
bool IsVisibleY;
bool IsRequestOutput;
bool IsSkipItems;
- bool IsPreserveWidthAuto;
+ bool IsPreserveWidthAuto : 1;
+ bool IsJustCreated : 1;
+ bool IsLoadedSettings : 1;
+ bool IsNeedReconcileSrc : 1;
+ bool IsNeedReconcileDst : 1;
ImS8 NavLayerCurrent;
- ImU8 AutoFitQueue;
- ImU8 CannotSkipItemsQueue;
+ ImU8 AutoFitQueue : 4;
+ ImU8 CannotSkipItemsQueue : 4;
ImU8 SortDirection : 2;
ImU8 SortDirectionsAvailCount : 2;
ImU8 SortDirectionsAvailMask : 4;
ImU8 SortDirectionsAvailList;
};
+typedef struct ImGuiTableReconcileColumnData ImGuiTableReconcileColumnData;
+struct ImGuiTableReconcileColumnData
+{
+ ImGuiID ID;
+ ImS16 NameOffset;
+ ImGuiTableColumnFlags Flags;
+ float InitWidthOrWeight;
+ ImGuiID UserData;
+ ImGuiTableColumnIdx ColumnNewIdx;
+ ImGuiTableColumnIdx ColumnOldIdx;
+ ImGuiTableColumn ColumnOldData;
+};
typedef struct ImGuiTableCellData ImGuiTableCellData;
struct ImGuiTableCellData
{
@@ -3739,6 +3821,7 @@ struct ImGuiTable
bool IsLayoutLocked;
bool IsInsideRow;
bool IsInitializing;
+ bool IsReconcileMode;
bool IsSortSpecsDirty;
bool IsUsingHeaders;
bool IsContextPopupOpen;
@@ -3746,8 +3829,10 @@ struct ImGuiTable
bool IsSettingsRequestLoad;
bool IsSettingsDirty;
bool IsDefaultDisplayOrder;
+ bool IsDefaultVisibility;
bool IsResetAllRequest;
bool IsResetDisplayOrderRequest;
+ bool IsResetVisibilityRequest;
bool IsUnfrozenRows;
bool IsDefaultSizingPolicy;
bool IsActiveIdAliveBeforeTable;
@@ -3759,6 +3844,8 @@ struct ImGuiTable
};
typedef struct ImVector_ImGuiTableHeaderData {int Size;int Capacity;ImGuiTableHeaderData* Data;} ImVector_ImGuiTableHeaderData;
+typedef struct ImVector_ImGuiTableReconcileColumnData {int Size;int Capacity;ImGuiTableReconcileColumnData* Data;} ImVector_ImGuiTableReconcileColumnData;
+
struct ImGuiTableTempData
{
ImGuiID WindowID;
@@ -3766,6 +3853,9 @@ struct ImGuiTableTempData
float LastTimeActive;
float AngledHeadersExtraWidth;
ImVector_ImGuiTableHeaderData AngledHeadersRequests;
+ ImVector_ImGuiTableReconcileColumnData ReconcileColumnsRequests;
+ void* OldColumnsRawData;
+ ImSpan_ImGuiTableColumn OldColumnsData;
ImVec2_c UserOuterSize;
ImDrawListSplitter DrawSplitter;
ImRect_c HostBackupWorkRect;
@@ -3781,13 +3871,14 @@ typedef struct ImGuiTableColumnSettings ImGuiTableColumnSettings;
struct ImGuiTableColumnSettings
{
float WidthOrWeight;
- ImGuiID UserID;
+ ImGuiID ID;
ImGuiTableColumnIdx Index;
ImGuiTableColumnIdx DisplayOrder;
ImGuiTableColumnIdx SortOrder;
ImU8 SortDirection : 2;
ImS8 IsEnabled : 2;
ImU8 IsStretch : 1;
+ bool IsLoaded : 1;
};
struct ImGuiTableSettings
{
@@ -3796,7 +3887,8 @@ struct ImGuiTableSettings
float RefScale;
ImGuiTableColumnIdx ColumnsCount;
ImGuiTableColumnIdx ColumnsCountMax;
- bool WantApply;
+ ImGuiPackedDate LastUsedDate;
+ bool WantApply : 1;
};
struct ImFontLoader
{
@@ -3867,6 +3959,45 @@ struct ImFontAtlasBuilder
ImFontAtlasRectId PackIdMouseCursors;
ImFontAtlasRectId PackIdLinesTexData;
};
+typedef struct StbUndoRecord StbUndoRecord;
+struct StbUndoRecord
+{
+ int where;
+ int insert_length;
+ int delete_length;
+ int char_storage;
+};
+typedef struct StbUndoState StbUndoState;
+struct StbUndoState
+{
+ StbUndoRecord undo_rec [99];
+ char undo_char[999];
+ short undo_point, redo_point;
+ int undo_char_point, redo_char_point;
+};
+struct STB_TexteditState
+{
+ int cursor;
+ int select_start;
+ int select_end;
+ unsigned char insert_mode;
+ int row_count_per_page;
+ unsigned char cursor_at_end_of_line;
+ unsigned char initialized;
+ unsigned char has_preferred_x;
+ unsigned char single_line;
+ unsigned char padding1, padding2, padding3;
+ float preferred_x;
+ StbUndoState undostate;
+};
+typedef struct StbTexteditRow StbTexteditRow;
+struct StbTexteditRow
+{
+ float x0,x1;
+ float baseline_y_delta;
+ float ymin,ymax;
+ int num_chars;
+};
#ifdef IMGUI_ENABLE_FREETYPE
struct ImFontAtlas;
struct ImFontLoader;
@@ -3886,8 +4017,6 @@ typedef enum {
#endif
#define IMGUI_HAS_DOCK 1
-#define ImDrawCallback_ResetRenderState (ImDrawCallback)(-8)
-
#define ImTextureID_Invalid ((ImTextureID)0)
#else
@@ -3992,6 +4121,7 @@ typedef ImVector ImVector_ImGuiTabItem;
typedef ImVector ImVector_ImGuiTableColumnSortSpecs;
typedef ImVector ImVector_ImGuiTableHeaderData;
typedef ImVector ImVector_ImGuiTableInstanceData;
+typedef ImVector ImVector_ImGuiTableReconcileColumnData;
typedef ImVector ImVector_ImGuiTableTempData;
typedef ImVector ImVector_ImGuiTextRange;
typedef ImVector ImVector_ImGuiTreeNodeStackData;
@@ -4249,7 +4379,6 @@ CIMGUI_API bool igColorEdit4(const char* label,float col[4],ImGuiColorEditFlags
CIMGUI_API bool igColorPicker3(const char* label,float col[3],ImGuiColorEditFlags flags);
CIMGUI_API bool igColorPicker4(const char* label,float col[4],ImGuiColorEditFlags flags,const float* ref_col);
CIMGUI_API bool igColorButton(const char* desc_id,const ImVec4_c col,ImGuiColorEditFlags flags,const ImVec2_c size);
-CIMGUI_API void igSetColorEditOptions(ImGuiColorEditFlags flags);
CIMGUI_API bool igTreeNode_Str(const char* label);
CIMGUI_API bool igTreeNode_StrStr(const char* str_id,const char* fmt,...);
#ifdef CIMGUI_VARGS0
@@ -4323,9 +4452,9 @@ CIMGUI_API void igSetItemTooltipV(const char* fmt,va_list args);
CIMGUI_API bool igBeginPopup(const char* str_id,ImGuiWindowFlags flags);
CIMGUI_API bool igBeginPopupModal(const char* name,bool* p_open,ImGuiWindowFlags flags);
CIMGUI_API void igEndPopup(void);
-CIMGUI_API void igOpenPopup_Str(const char* str_id,ImGuiPopupFlags popup_flags);
-CIMGUI_API void igOpenPopup_ID(ImGuiID id,ImGuiPopupFlags popup_flags);
-CIMGUI_API void igOpenPopupOnItemClick(const char* str_id,ImGuiPopupFlags popup_flags);
+CIMGUI_API bool igOpenPopup_Str(const char* str_id,ImGuiPopupFlags popup_flags);
+CIMGUI_API bool igOpenPopup_ID(ImGuiID id,ImGuiPopupFlags popup_flags);
+CIMGUI_API bool igOpenPopupOnItemClick(const char* str_id,ImGuiPopupFlags popup_flags);
CIMGUI_API void igCloseCurrentPopup(void);
CIMGUI_API bool igBeginPopupContextItem(const char* str_id,ImGuiPopupFlags popup_flags);
CIMGUI_API bool igBeginPopupContextWindow(const char* str_id,ImGuiPopupFlags popup_flags);
@@ -4336,7 +4465,7 @@ CIMGUI_API void igEndTable(void);
CIMGUI_API void igTableNextRow(ImGuiTableRowFlags row_flags,float min_row_height);
CIMGUI_API bool igTableNextColumn(void);
CIMGUI_API bool igTableSetColumnIndex(int column_n);
-CIMGUI_API void igTableSetupColumn(const char* label,ImGuiTableColumnFlags flags,float init_width_or_weight,ImGuiID user_id);
+CIMGUI_API void igTableSetupColumn(const char* label,ImGuiTableColumnFlags flags,float init_width_or_weight,ImGuiID user_data);
CIMGUI_API void igTableSetupScrollFreeze(int cols,int rows);
CIMGUI_API void igTableHeader(const char* label);
CIMGUI_API void igTableHeadersRow(void);
@@ -4413,6 +4542,7 @@ CIMGUI_API ImVec2_c igGetItemRectMin(void);
CIMGUI_API ImVec2_c igGetItemRectMax(void);
CIMGUI_API ImVec2_c igGetItemRectSize(void);
CIMGUI_API ImGuiItemFlags igGetItemFlags(void);
+CIMGUI_API int igGetItemClickedCountWithSingleClickDelay(ImGuiMouseButton mouse_button,float delay);
CIMGUI_API ImGuiViewport* igGetMainViewport(void);
CIMGUI_API ImDrawList* igGetBackgroundDrawList(ImGuiViewport* viewport);
CIMGUI_API ImDrawList* igGetForegroundDrawList_ViewportPtr(ImGuiViewport* viewport);
@@ -4438,7 +4568,7 @@ CIMGUI_API const char* igGetKeyName(ImGuiKey key);
CIMGUI_API void igSetNextFrameWantCaptureKeyboard(bool want_capture_keyboard);
CIMGUI_API bool igShortcut_Nil(ImGuiKeyChord key_chord,ImGuiInputFlags flags);
CIMGUI_API void igSetNextItemShortcut(ImGuiKeyChord key_chord,ImGuiInputFlags flags);
-CIMGUI_API void igSetItemKeyOwner_Nil(ImGuiKey key);
+CIMGUI_API bool igSetItemKeyOwner_Nil(ImGuiKey key);
CIMGUI_API bool igIsMouseDown_Nil(ImGuiMouseButton button);
CIMGUI_API bool igIsMouseClicked_Bool(ImGuiMouseButton button,bool repeat);
CIMGUI_API bool igIsMouseReleased_Nil(ImGuiMouseButton button);
@@ -4614,7 +4744,9 @@ CIMGUI_API void ImDrawList_PopTexture(ImDrawList* self);
CIMGUI_API ImVec2_c ImDrawList_GetClipRectMin(ImDrawList* self);
CIMGUI_API ImVec2_c ImDrawList_GetClipRectMax(ImDrawList* self);
CIMGUI_API void ImDrawList_AddLine(ImDrawList* self,const ImVec2_c p1,const ImVec2_c p2,ImU32 col,float thickness);
-CIMGUI_API void ImDrawList_AddRect(ImDrawList* self,const ImVec2_c p_min,const ImVec2_c p_max,ImU32 col,float rounding,ImDrawFlags flags,float thickness);
+CIMGUI_API void ImDrawList_AddLineH(ImDrawList* self,float min_x,float max_x,float y,ImU32 col,float thickness);
+CIMGUI_API void ImDrawList_AddLineV(ImDrawList* self,float x,float min_y,float max_y,ImU32 col,float thickness);
+CIMGUI_API void ImDrawList_AddRect(ImDrawList* self,const ImVec2_c p_min,const ImVec2_c p_max,ImU32 col,float rounding,float thickness,ImDrawFlags flags);
CIMGUI_API void ImDrawList_AddRectFilled(ImDrawList* self,const ImVec2_c p_min,const ImVec2_c p_max,ImU32 col,float rounding,ImDrawFlags flags);
CIMGUI_API void ImDrawList_AddRectFilledMultiColor(ImDrawList* self,const ImVec2_c p_min,const ImVec2_c p_max,ImU32 col_upr_left,ImU32 col_upr_right,ImU32 col_bot_right,ImU32 col_bot_left);
CIMGUI_API void ImDrawList_AddQuad(ImDrawList* self,const ImVec2_c p1,const ImVec2_c p2,const ImVec2_c p3,const ImVec2_c p4,ImU32 col,float thickness);
@@ -4631,7 +4763,7 @@ CIMGUI_API void ImDrawList_AddText_Vec2(ImDrawList* self,const ImVec2_c pos,ImU3
CIMGUI_API void ImDrawList_AddText_FontPtr(ImDrawList* self,ImFont* font,float font_size,const ImVec2_c pos,ImU32 col,const char* text_begin,const char* text_end,float wrap_width,const ImVec4* cpu_fine_clip_rect);
CIMGUI_API void ImDrawList_AddBezierCubic(ImDrawList* self,const ImVec2_c p1,const ImVec2_c p2,const ImVec2_c p3,const ImVec2_c p4,ImU32 col,float thickness,int num_segments);
CIMGUI_API void ImDrawList_AddBezierQuadratic(ImDrawList* self,const ImVec2_c p1,const ImVec2_c p2,const ImVec2_c p3,ImU32 col,float thickness,int num_segments);
-CIMGUI_API void ImDrawList_AddPolyline(ImDrawList* self,const ImVec2_c* points,int num_points,ImU32 col,ImDrawFlags flags,float thickness);
+CIMGUI_API void ImDrawList_AddPolyline(ImDrawList* self,const ImVec2_c* points,int num_points,ImU32 col,float thickness,ImDrawFlags flags);
CIMGUI_API void ImDrawList_AddConvexPolyFilled(ImDrawList* self,const ImVec2_c* points,int num_points,ImU32 col);
CIMGUI_API void ImDrawList_AddConcavePolyFilled(ImDrawList* self,const ImVec2_c* points,int num_points,ImU32 col);
CIMGUI_API void ImDrawList_AddImage(ImDrawList* self,ImTextureRef_c tex_ref,const ImVec2_c p_min,const ImVec2_c p_max,const ImVec2_c uv_min,const ImVec2_c uv_max,ImU32 col);
@@ -4642,7 +4774,7 @@ CIMGUI_API void ImDrawList_PathLineTo(ImDrawList* self,const ImVec2_c pos);
CIMGUI_API void ImDrawList_PathLineToMergeDuplicate(ImDrawList* self,const ImVec2_c pos);
CIMGUI_API void ImDrawList_PathFillConvex(ImDrawList* self,ImU32 col);
CIMGUI_API void ImDrawList_PathFillConcave(ImDrawList* self,ImU32 col);
-CIMGUI_API void ImDrawList_PathStroke(ImDrawList* self,ImU32 col,ImDrawFlags flags,float thickness);
+CIMGUI_API void ImDrawList_PathStroke(ImDrawList* self,ImU32 col,float thickness,ImDrawFlags flags);
CIMGUI_API void ImDrawList_PathArcTo(ImDrawList* self,const ImVec2_c center,float radius,float a_min,float a_max,int num_segments);
CIMGUI_API void ImDrawList_PathArcToFast(ImDrawList* self,const ImVec2_c center,float radius,int a_min_of_12,int a_max_of_12);
CIMGUI_API void ImDrawList_PathEllipticalArcTo(ImDrawList* self,const ImVec2_c center,const ImVec2_c radius,float rot,float a_min,float a_max,int num_segments);
@@ -4719,11 +4851,11 @@ CIMGUI_API ImFont* ImFontAtlas_AddFontFromMemoryTTF(ImFontAtlas* self,void* font
CIMGUI_API ImFont* ImFontAtlas_AddFontFromMemoryCompressedTTF(ImFontAtlas* self,const void* compressed_font_data,int compressed_font_data_size,float size_pixels,const ImFontConfig* font_cfg,const ImWchar* glyph_ranges);
CIMGUI_API ImFont* ImFontAtlas_AddFontFromMemoryCompressedBase85TTF(ImFontAtlas* self,const char* compressed_font_data_base85,float size_pixels,const ImFontConfig* font_cfg,const ImWchar* glyph_ranges);
CIMGUI_API void ImFontAtlas_RemoveFont(ImFontAtlas* self,ImFont* font);
-CIMGUI_API void ImFontAtlas_Clear(ImFontAtlas* self);
CIMGUI_API void ImFontAtlas_CompactCache(ImFontAtlas* self);
CIMGUI_API void ImFontAtlas_SetFontLoader(ImFontAtlas* self,const ImFontLoader* font_loader);
-CIMGUI_API void ImFontAtlas_ClearInputData(ImFontAtlas* self);
+CIMGUI_API void ImFontAtlas_Clear(ImFontAtlas* self);
CIMGUI_API void ImFontAtlas_ClearFonts(ImFontAtlas* self);
+CIMGUI_API void ImFontAtlas_ClearInputData(ImFontAtlas* self);
CIMGUI_API void ImFontAtlas_ClearTexData(ImFontAtlas* self);
CIMGUI_API const ImWchar* ImFontAtlas_GetGlyphRangesDefault(ImFontAtlas* self);
CIMGUI_API ImFontAtlasRectId ImFontAtlas_AddCustomRect(ImFontAtlas* self,int width,int height,ImFontAtlasRect* out_r);
@@ -4854,6 +4986,7 @@ CIMGUI_API float igImFloor_Float(float f);
CIMGUI_API ImVec2_c igImFloor_Vec2(const ImVec2_c v);
CIMGUI_API float igImTrunc64(float f);
CIMGUI_API float igImRound64(float f);
+CIMGUI_API float igImCeilFast(float f);
CIMGUI_API int igImModPositive(int a,int b);
CIMGUI_API float igImDot(const ImVec2_c a,const ImVec2_c b);
CIMGUI_API ImVec2_c igImRotate(const ImVec2_c v,float cos_a,float sin_a);
@@ -4902,6 +5035,8 @@ CIMGUI_API bool ImRect_ContainsWithPad(ImRect* self,const ImVec2_c p,const ImVec
CIMGUI_API bool ImRect_Overlaps(ImRect* self,const ImRect_c r);
CIMGUI_API void ImRect_Add_Vec2(ImRect* self,const ImVec2_c p);
CIMGUI_API void ImRect_Add_Rect(ImRect* self,const ImRect_c r);
+CIMGUI_API void ImRect_AddX(ImRect* self,float x);
+CIMGUI_API void ImRect_AddY(ImRect* self,float y);
CIMGUI_API void ImRect_Expand_Float(ImRect* self,const float amount);
CIMGUI_API void ImRect_Expand_Vec2(ImRect* self,const ImVec2_c amount);
CIMGUI_API void ImRect_Translate(ImRect* self,const ImVec2_c d);
@@ -4928,6 +5063,12 @@ CIMGUI_API int ImGuiTextIndex_size(ImGuiTextIndex* self);
CIMGUI_API const char* ImGuiTextIndex_get_line_begin(ImGuiTextIndex* self,const char* base,int n);
CIMGUI_API const char* ImGuiTextIndex_get_line_end(ImGuiTextIndex* self,const char* base,int n);
CIMGUI_API void ImGuiTextIndex_append(ImGuiTextIndex* self,const char* base,int old_size,int new_size);
+CIMGUI_API ImGuiPackedDate* ImGuiPackedDate_ImGuiPackedDate_Nil(void);
+CIMGUI_API void ImGuiPackedDate_destroy(ImGuiPackedDate* self);
+CIMGUI_API ImGuiPackedDate* ImGuiPackedDate_ImGuiPackedDate_Int(int yyyymmdd);
+CIMGUI_API bool ImGuiPackedDate_IsValid(ImGuiPackedDate* self);
+CIMGUI_API int ImGuiPackedDate_Unpack(ImGuiPackedDate* self);
+CIMGUI_API void ImGuiPackedDate_SubtractMonths(ImGuiPackedDate* self,int m);
CIMGUI_API ImGuiStoragePair* igImLowerBound(ImGuiStoragePair* in_begin,ImGuiStoragePair* in_end,ImGuiID key);
CIMGUI_API ImDrawListSharedData* ImDrawListSharedData_ImDrawListSharedData(void);
CIMGUI_API void ImDrawListSharedData_destroy(ImDrawListSharedData* self);
@@ -5085,6 +5226,76 @@ CIMGUI_API void ImGuiTableColumnSettings_destroy(ImGuiTableColumnSettings* self)
CIMGUI_API ImGuiTableSettings* ImGuiTableSettings_ImGuiTableSettings(void);
CIMGUI_API void ImGuiTableSettings_destroy(ImGuiTableSettings* self);
CIMGUI_API ImGuiTableColumnSettings* ImGuiTableSettings_GetColumnSettings(ImGuiTableSettings* self);
+CIMGUI_API void igTableOpenContextMenu(int column_n);
+CIMGUI_API void igTableSetColumnWidth(int column_n,float width);
+CIMGUI_API void igTableSetColumnSortDirection(int column_n,ImGuiSortDirection sort_direction,bool append_to_sort_specs);
+CIMGUI_API int igTableGetHoveredRow(void);
+CIMGUI_API float igTableGetHeaderRowHeight(void);
+CIMGUI_API float igTableGetHeaderAngledMaxLabelWidth(void);
+CIMGUI_API void igTablePushBackgroundChannel(void);
+CIMGUI_API void igTablePopBackgroundChannel(void);
+CIMGUI_API void igTablePushColumnChannel(int column_n);
+CIMGUI_API void igTablePopColumnChannel(void);
+CIMGUI_API void igTableAngledHeadersRowEx(ImGuiID row_id,float angle,float max_label_width,const ImGuiTableHeaderData* data,int data_count);
+CIMGUI_API ImGuiTable* igGetCurrentTable(void);
+CIMGUI_API ImGuiTable* igTableFindByID(ImGuiID id);
+CIMGUI_API bool igBeginTableEx(const char* name,ImGuiID id,int columns_count,ImGuiTableFlags flags,const ImVec2_c outer_size,float inner_width);
+CIMGUI_API void igTableBeginInitMemory(ImGuiTable* table,int columns_count);
+CIMGUI_API void igTableApplyQueuedRequests(ImGuiTable* table);
+CIMGUI_API void igTableSetupDrawChannels(ImGuiTable* table);
+CIMGUI_API void igTableReconcileColumns(ImGuiTable* table);
+CIMGUI_API void igTableUpdateLayout(ImGuiTable* table);
+CIMGUI_API void igTableUpdateBorders(ImGuiTable* table);
+CIMGUI_API void igTableUpdateColumnsWeightFromWidth(ImGuiTable* table);
+CIMGUI_API void igTableApplyExternalUnclipRect(ImGuiTable* table,ImRect* rect);
+CIMGUI_API void igTableDrawBorders(ImGuiTable* table);
+CIMGUI_API void igTableDrawDefaultContextMenu(ImGuiTable* table,ImGuiTableFlags flags_for_section_to_display);
+CIMGUI_API bool igTableBeginContextMenuPopup(ImGuiTable* table);
+CIMGUI_API void igTableMergeDrawChannels(ImGuiTable* table);
+CIMGUI_API ImGuiTableInstanceData* igTableGetInstanceData(ImGuiTable* table,int instance_no);
+CIMGUI_API ImGuiID igTableGetInstanceID(ImGuiTable* table,int instance_no);
+CIMGUI_API void igTableFixDisplayOrder(ImGuiTable* table);
+CIMGUI_API void igTableSortSpecsSanitize(ImGuiTable* table);
+CIMGUI_API void igTableSortSpecsBuild(ImGuiTable* table);
+CIMGUI_API void igTableInitColumnDefaults(ImGuiTable* table,ImGuiTableColumn* column,ImGuiTableColumnFlags init_mask);
+CIMGUI_API ImGuiSortDirection igTableGetColumnNextSortDirection(ImGuiTableColumn* column);
+CIMGUI_API void igTableFixColumnSortDirection(ImGuiTable* table,ImGuiTableColumn* column);
+CIMGUI_API float igTableGetColumnWidthAuto(ImGuiTable* table,ImGuiTableColumn* column);
+CIMGUI_API void igTableBeginRow(ImGuiTable* table);
+CIMGUI_API void igTableEndRow(ImGuiTable* table);
+CIMGUI_API void igTableBeginCell(ImGuiTable* table,int column_n);
+CIMGUI_API void igTableEndCell(ImGuiTable* table);
+CIMGUI_API ImRect_c igTableGetCellBgRect(const ImGuiTable* table,int column_n);
+CIMGUI_API const char* igTableGetColumnName_TablePtr(const ImGuiTable* table,int column_n);
+CIMGUI_API ImGuiID igTableGetColumnResizeID(ImGuiTable* table,int column_n,int instance_no);
+CIMGUI_API float igTableCalcMaxColumnWidth(const ImGuiTable* table,int column_n);
+CIMGUI_API void igTableSetColumnWidthAutoSingle(ImGuiTable* table,int column_n);
+CIMGUI_API void igTableSetColumnWidthAutoAll(ImGuiTable* table);
+CIMGUI_API void igTableSetColumnDisplayOrder(ImGuiTable* table,int column_n,int dst_order);
+CIMGUI_API void igTableQueueSetColumnDisplayOrder(ImGuiTable* table,int column_n,int dst_order);
+CIMGUI_API void igTableRemove(ImGuiTable* table);
+CIMGUI_API void igTableGcCompactTransientBuffers_TablePtr(ImGuiTable* table);
+CIMGUI_API void igTableGcCompactTransientBuffers_TableTempDataPtr(ImGuiTableTempData* table);
+CIMGUI_API void igTableGcCompactSettings(void);
+CIMGUI_API void igTableLoadSettings(ImGuiTable* table);
+CIMGUI_API void igTableLoadSettingsForColumns(ImGuiTable* table);
+CIMGUI_API void igTableLoadSettingsForColumn(ImGuiTableColumn* column,ImGuiTableColumnSettings* column_settings,ImGuiTableFlags load_flags);
+CIMGUI_API void igTableSaveSettings(ImGuiTable* table);
+CIMGUI_API void igTableResetSettings(ImGuiTable* table);
+CIMGUI_API ImGuiTableSettings* igTableGetBoundSettings(ImGuiTable* table);
+CIMGUI_API void igTableSettingsAddSettingsHandler(void);
+CIMGUI_API ImGuiTableSettings* igTableSettingsCreate(ImGuiID id,int columns_count);
+CIMGUI_API ImGuiTableSettings* igTableSettingsFindByID(ImGuiID id);
+CIMGUI_API void igSetWindowClipRectBeforeSetChannel(ImGuiWindow* window,const ImRect_c clip_rect);
+CIMGUI_API void igBeginColumns(const char* str_id,int count,ImGuiOldColumnFlags flags);
+CIMGUI_API void igEndColumns(void);
+CIMGUI_API void igPushColumnClipRect(int column_index);
+CIMGUI_API void igPushColumnsBackground(void);
+CIMGUI_API void igPopColumnsBackground(void);
+CIMGUI_API ImGuiID igGetColumnsID(const char* str_id,int count);
+CIMGUI_API ImGuiOldColumns* igFindOrCreateColumns(ImGuiWindow* window,ImGuiID id);
+CIMGUI_API float igGetColumnOffsetFromNorm(const ImGuiOldColumns* columns,float offset_norm);
+CIMGUI_API float igGetColumnNormFromOffset(const ImGuiOldColumns* columns,float offset);
CIMGUI_API ImGuiIO* igGetIO_ContextPtr(ImGuiContext* ctx);
CIMGUI_API ImGuiPlatformIO* igGetPlatformIO_ContextPtr(ImGuiContext* ctx);
CIMGUI_API float igGetScale(void);
@@ -5157,6 +5368,7 @@ CIMGUI_API ImGuiViewportP* igFindHoveredViewportFromPlatformWindowStack(const Im
CIMGUI_API void igMarkIniSettingsDirty_Nil(void);
CIMGUI_API void igMarkIniSettingsDirty_WindowPtr(ImGuiWindow* window);
CIMGUI_API void igClearIniSettings(void);
+CIMGUI_API void igCleanupIniSettings(ImGuiSettingsCleanupArgs* args);
CIMGUI_API void igAddSettingsHandler(const ImGuiSettingsHandler* handler);
CIMGUI_API void igRemoveSettingsHandler(const char* type_name);
CIMGUI_API ImGuiSettingsHandler* igFindSettingsHandler(const char* type_name);
@@ -5207,9 +5419,10 @@ CIMGUI_API void igLogToBuffer(int auto_open_depth);
CIMGUI_API void igLogRenderedText(const ImVec2_c* ref_pos,const char* text,const char* text_end);
CIMGUI_API void igLogSetNextTextDecoration(const char* prefix,const char* suffix);
CIMGUI_API bool igBeginChildEx(const char* name,ImGuiID id,const ImVec2_c size_arg,ImGuiChildFlags child_flags,ImGuiWindowFlags window_flags);
+CIMGUI_API ImGuiWindow* igFindFrontMostVisibleChildWindow(ImGuiWindow* window);
CIMGUI_API bool igBeginPopupEx(ImGuiID id,ImGuiWindowFlags extra_window_flags);
CIMGUI_API bool igBeginPopupMenuEx(ImGuiID id,const char* label,ImGuiWindowFlags extra_window_flags);
-CIMGUI_API void igOpenPopupEx(ImGuiID id,ImGuiPopupFlags popup_flags);
+CIMGUI_API bool igOpenPopupEx(ImGuiID id,ImGuiPopupFlags popup_flags);
CIMGUI_API void igClosePopupToLevel(int remaining,bool restore_focus_to_window_under_popup);
CIMGUI_API void igClosePopupsOverWindow(ImGuiWindow* ref_window,bool restore_focus_to_window_under_popup);
CIMGUI_API void igClosePopupsExceptModals(void);
@@ -5275,7 +5488,7 @@ CIMGUI_API bool igIsActiveIdUsingNavDir(ImGuiDir dir);
CIMGUI_API ImGuiID igGetKeyOwner(ImGuiKey key);
CIMGUI_API void igSetKeyOwner(ImGuiKey key,ImGuiID owner_id,ImGuiInputFlags flags);
CIMGUI_API void igSetKeyOwnersForKeyChord(ImGuiKeyChord key,ImGuiID owner_id,ImGuiInputFlags flags);
-CIMGUI_API void igSetItemKeyOwner_InputFlags(ImGuiKey key,ImGuiInputFlags flags);
+CIMGUI_API bool igSetItemKeyOwner_InputFlags(ImGuiKey key,ImGuiInputFlags flags);
CIMGUI_API bool igTestKeyOwner(ImGuiKey key,ImGuiID owner_id);
CIMGUI_API ImGuiKeyOwnerData* igGetKeyOwnerData(ImGuiContext* ctx,ImGuiKey key);
CIMGUI_API bool igIsKeyDown_ID(ImGuiKey key,ImGuiID owner_id);
@@ -5334,6 +5547,7 @@ CIMGUI_API void igDockBuilderCopyWindowSettings(const char* src_name,const char*
CIMGUI_API void igDockBuilderFinish(ImGuiID node_id);
CIMGUI_API void igPushFocusScope(ImGuiID id);
CIMGUI_API void igPopFocusScope(void);
+CIMGUI_API bool igIsInNavFocusRoute(ImGuiID focus_scope_id);
CIMGUI_API ImGuiID igGetCurrentFocusScope(void);
CIMGUI_API bool igIsDragDropActive(void);
CIMGUI_API bool igBeginDragDropTargetCustom(const ImRect_c bb,ImGuiID id);
@@ -5341,7 +5555,7 @@ CIMGUI_API bool igBeginDragDropTargetViewport(ImGuiViewport* viewport,const ImRe
CIMGUI_API void igClearDragDrop(void);
CIMGUI_API bool igIsDragDropPayloadBeingAccepted(void);
CIMGUI_API void igRenderDragDropTargetRectForItem(const ImRect_c bb);
-CIMGUI_API void igRenderDragDropTargetRectEx(ImDrawList* draw_list,const ImRect_c bb);
+CIMGUI_API void igRenderDragDropTargetRectEx(ImDrawList* draw_list,const ImRect_c bb,float rounding);
CIMGUI_API ImGuiTypingSelectRequest* igGetTypingSelectRequest(ImGuiTypingSelectFlags flags);
CIMGUI_API int igTypingSelectFindMatch(ImGuiTypingSelectRequest* req,int items_count,const char*(*get_item_name_func)(void*,int),void* user_data,int nav_item_idx);
CIMGUI_API int igTypingSelectFindNextSingleCharMatch(ImGuiTypingSelectRequest* req,int items_count,const char*(*get_item_name_func)(void*,int),void* user_data,int nav_item_idx);
@@ -5349,76 +5563,11 @@ CIMGUI_API int igTypingSelectFindBestLeadingMatch(ImGuiTypingSelectRequest* req,
CIMGUI_API bool igBeginBoxSelect(const ImRect_c scope_rect,ImGuiWindow* window,ImGuiID box_select_id,ImGuiMultiSelectFlags ms_flags);
CIMGUI_API void igEndBoxSelect(const ImRect_c scope_rect,ImGuiMultiSelectFlags ms_flags);
CIMGUI_API void igMultiSelectItemHeader(ImGuiID id,bool* p_selected,ImGuiButtonFlags* p_button_flags);
-CIMGUI_API void igMultiSelectItemFooter(ImGuiID id,bool* p_selected,bool* p_pressed);
+CIMGUI_API void igMultiSelectItemFooter(ImGuiID id,bool* p_selected,bool* p_pressed,ImGuiMultiSelectFlags extra_flags);
CIMGUI_API void igMultiSelectAddSetAll(ImGuiMultiSelectTempData* ms,bool selected);
CIMGUI_API void igMultiSelectAddSetRange(ImGuiMultiSelectTempData* ms,bool selected,int range_dir,ImGuiSelectionUserData first_item,ImGuiSelectionUserData last_item);
CIMGUI_API ImGuiBoxSelectState* igGetBoxSelectState(ImGuiID id);
CIMGUI_API ImGuiMultiSelectState* igGetMultiSelectState(ImGuiID id);
-CIMGUI_API void igSetWindowClipRectBeforeSetChannel(ImGuiWindow* window,const ImRect_c clip_rect);
-CIMGUI_API void igBeginColumns(const char* str_id,int count,ImGuiOldColumnFlags flags);
-CIMGUI_API void igEndColumns(void);
-CIMGUI_API void igPushColumnClipRect(int column_index);
-CIMGUI_API void igPushColumnsBackground(void);
-CIMGUI_API void igPopColumnsBackground(void);
-CIMGUI_API ImGuiID igGetColumnsID(const char* str_id,int count);
-CIMGUI_API ImGuiOldColumns* igFindOrCreateColumns(ImGuiWindow* window,ImGuiID id);
-CIMGUI_API float igGetColumnOffsetFromNorm(const ImGuiOldColumns* columns,float offset_norm);
-CIMGUI_API float igGetColumnNormFromOffset(const ImGuiOldColumns* columns,float offset);
-CIMGUI_API void igTableOpenContextMenu(int column_n);
-CIMGUI_API void igTableSetColumnWidth(int column_n,float width);
-CIMGUI_API void igTableSetColumnSortDirection(int column_n,ImGuiSortDirection sort_direction,bool append_to_sort_specs);
-CIMGUI_API int igTableGetHoveredRow(void);
-CIMGUI_API float igTableGetHeaderRowHeight(void);
-CIMGUI_API float igTableGetHeaderAngledMaxLabelWidth(void);
-CIMGUI_API void igTablePushBackgroundChannel(void);
-CIMGUI_API void igTablePopBackgroundChannel(void);
-CIMGUI_API void igTablePushColumnChannel(int column_n);
-CIMGUI_API void igTablePopColumnChannel(void);
-CIMGUI_API void igTableAngledHeadersRowEx(ImGuiID row_id,float angle,float max_label_width,const ImGuiTableHeaderData* data,int data_count);
-CIMGUI_API ImGuiTable* igGetCurrentTable(void);
-CIMGUI_API ImGuiTable* igTableFindByID(ImGuiID id);
-CIMGUI_API bool igBeginTableEx(const char* name,ImGuiID id,int columns_count,ImGuiTableFlags flags,const ImVec2_c outer_size,float inner_width);
-CIMGUI_API void igTableBeginInitMemory(ImGuiTable* table,int columns_count);
-CIMGUI_API void igTableBeginApplyRequests(ImGuiTable* table);
-CIMGUI_API void igTableSetupDrawChannels(ImGuiTable* table);
-CIMGUI_API void igTableUpdateLayout(ImGuiTable* table);
-CIMGUI_API void igTableUpdateBorders(ImGuiTable* table);
-CIMGUI_API void igTableUpdateColumnsWeightFromWidth(ImGuiTable* table);
-CIMGUI_API void igTableDrawBorders(ImGuiTable* table);
-CIMGUI_API void igTableDrawDefaultContextMenu(ImGuiTable* table,ImGuiTableFlags flags_for_section_to_display);
-CIMGUI_API bool igTableBeginContextMenuPopup(ImGuiTable* table);
-CIMGUI_API void igTableMergeDrawChannels(ImGuiTable* table);
-CIMGUI_API ImGuiTableInstanceData* igTableGetInstanceData(ImGuiTable* table,int instance_no);
-CIMGUI_API ImGuiID igTableGetInstanceID(ImGuiTable* table,int instance_no);
-CIMGUI_API void igTableFixDisplayOrder(ImGuiTable* table);
-CIMGUI_API void igTableSortSpecsSanitize(ImGuiTable* table);
-CIMGUI_API void igTableSortSpecsBuild(ImGuiTable* table);
-CIMGUI_API ImGuiSortDirection igTableGetColumnNextSortDirection(ImGuiTableColumn* column);
-CIMGUI_API void igTableFixColumnSortDirection(ImGuiTable* table,ImGuiTableColumn* column);
-CIMGUI_API float igTableGetColumnWidthAuto(ImGuiTable* table,ImGuiTableColumn* column);
-CIMGUI_API void igTableBeginRow(ImGuiTable* table);
-CIMGUI_API void igTableEndRow(ImGuiTable* table);
-CIMGUI_API void igTableBeginCell(ImGuiTable* table,int column_n);
-CIMGUI_API void igTableEndCell(ImGuiTable* table);
-CIMGUI_API ImRect_c igTableGetCellBgRect(const ImGuiTable* table,int column_n);
-CIMGUI_API const char* igTableGetColumnName_TablePtr(const ImGuiTable* table,int column_n);
-CIMGUI_API ImGuiID igTableGetColumnResizeID(ImGuiTable* table,int column_n,int instance_no);
-CIMGUI_API float igTableCalcMaxColumnWidth(const ImGuiTable* table,int column_n);
-CIMGUI_API void igTableSetColumnWidthAutoSingle(ImGuiTable* table,int column_n);
-CIMGUI_API void igTableSetColumnWidthAutoAll(ImGuiTable* table);
-CIMGUI_API void igTableSetColumnDisplayOrder(ImGuiTable* table,int column_n,int dst_order);
-CIMGUI_API void igTableQueueSetColumnDisplayOrder(ImGuiTable* table,int column_n,int dst_order);
-CIMGUI_API void igTableRemove(ImGuiTable* table);
-CIMGUI_API void igTableGcCompactTransientBuffers_TablePtr(ImGuiTable* table);
-CIMGUI_API void igTableGcCompactTransientBuffers_TableTempDataPtr(ImGuiTableTempData* table);
-CIMGUI_API void igTableGcCompactSettings(void);
-CIMGUI_API void igTableLoadSettings(ImGuiTable* table);
-CIMGUI_API void igTableSaveSettings(ImGuiTable* table);
-CIMGUI_API void igTableResetSettings(ImGuiTable* table);
-CIMGUI_API ImGuiTableSettings* igTableGetBoundSettings(ImGuiTable* table);
-CIMGUI_API void igTableSettingsAddSettingsHandler(void);
-CIMGUI_API ImGuiTableSettings* igTableSettingsCreate(ImGuiID id,int columns_count);
-CIMGUI_API ImGuiTableSettings* igTableSettingsFindByID(ImGuiID id);
CIMGUI_API ImGuiTabBar* igGetCurrentTabBar(void);
CIMGUI_API ImGuiTabBar* igTabBarFindByID(ImGuiID id);
CIMGUI_API void igTabBarRemove(ImGuiTabBar* tab_bar);
@@ -5452,7 +5601,7 @@ CIMGUI_API void igRenderFrame(ImVec2_c p_min,ImVec2_c p_max,ImU32 fill_col,bool
CIMGUI_API void igRenderFrameBorder(ImVec2_c p_min,ImVec2_c p_max,float rounding);
CIMGUI_API void igRenderColorComponentMarker(const ImRect_c bb,ImU32 col,float rounding);
CIMGUI_API void igRenderColorRectWithAlphaCheckerboard(ImDrawList* draw_list,ImVec2_c p_min,ImVec2_c p_max,ImU32 fill_col,float grid_step,ImVec2_c grid_off,float rounding,ImDrawFlags flags);
-CIMGUI_API void igRenderNavCursor(const ImRect_c bb,ImGuiID id,ImGuiNavRenderCursorFlags flags);
+CIMGUI_API void igRenderNavCursor(const ImRect_c bb,ImGuiID id,ImGuiNavRenderCursorFlags flags,float rounding);
CIMGUI_API const char* igFindRenderedTextEnd(const char* text,const char* text_end);
CIMGUI_API void igRenderMouseCursor(ImVec2_c pos,float scale,ImGuiMouseCursor mouse_cursor,ImU32 col_fill,ImU32 col_border,ImU32 col_shadow);
CIMGUI_API void igRenderArrow(ImDrawList* draw_list,ImVec2_c pos,ImU32 col,ImGuiDir dir,float scale);
@@ -5555,7 +5704,7 @@ CIMGUI_API void igDebugNodeTexture(ImTextureData* tex,int int_id,const ImFontAtl
CIMGUI_API void igDebugNodeStorage(ImGuiStorage* storage,const char* label);
CIMGUI_API void igDebugNodeTabBar(ImGuiTabBar* tab_bar,const char* label);
CIMGUI_API void igDebugNodeTable(ImGuiTable* table);
-CIMGUI_API void igDebugNodeTableSettings(ImGuiTableSettings* settings);
+CIMGUI_API void igDebugNodeTableSettings(ImGuiTableSettings* settings,ImGuiTable* table);
CIMGUI_API void igDebugNodeInputTextState(ImGuiInputTextState* state);
CIMGUI_API void igDebugNodeTypingSelectState(ImGuiTypingSelectState* state);
CIMGUI_API void igDebugNodeMultiSelectState(ImGuiMultiSelectState* state);
@@ -5625,6 +5774,8 @@ CIMGUI_API void igImFontAtlasTextureBlockPostProcessMultiply(ImFontAtlasPostProc
CIMGUI_API void igImFontAtlasTextureBlockFill(ImTextureData* dst_tex,int dst_x,int dst_y,int w,int h,ImU32 col);
CIMGUI_API void igImFontAtlasTextureBlockCopy(ImTextureData* src_tex,int src_x,int src_y,ImTextureData* dst_tex,int dst_x,int dst_y,int w,int h);
CIMGUI_API void igImFontAtlasTextureBlockQueueUpload(ImFontAtlas* atlas,ImTextureData* tex,int x,int y,int w,int h);
+CIMGUI_API bool igImTextureDataUpdateNewFrame(ImTextureData* tex);
+CIMGUI_API void igImTextureDataQueueUpload(ImTextureData* tex,int x,int y,int w,int h);
CIMGUI_API int igImTextureDataGetFormatBytesPerPixel(ImTextureFormat format);
CIMGUI_API const char* igImTextureDataGetStatusName(ImTextureStatus status);
CIMGUI_API const char* igImTextureDataGetFormatName(ImTextureFormat format);
@@ -5640,6 +5791,9 @@ CIMGUI_API bool ImGuiFreeType_DebugEditFontLoaderFlags(ImGuiFreeTypeLoaderFlags*
/////////////////////////hand written functions
//no appendfV
CIMGUI_API void ImGuiTextBuffer_appendf(ImGuiTextBuffer *self, const char *fmt, ...);
+#ifdef CIMGUI_VARGS0
+CIMGUI_API void ImGuiTextBuffer_appendf0(ImGuiTextBuffer *self, const char *fmt);
+#endif
//for getting FLT_MAX in bindings
CIMGUI_API float igGET_FLT_MAX(void);
//for getting FLT_MIN in bindings
diff --git a/include/cimgui_impl.h b/include/cimgui_impl.h
index b243cd3..aa3b982 100644
--- a/include/cimgui_impl.h
+++ b/include/cimgui_impl.h
@@ -30,8 +30,20 @@ CIMGUI_API void ImGui_ImplGlfw_WindowFocusCallback(GLFWwindow* window,int focuse
#endif
#ifdef CIMGUI_USE_OPENGL3
+#ifdef CIMGUI_DEFINE_ENUMS_AND_STRUCTS
+
+typedef struct ImGui_ImplOpenGL3_RenderState ImGui_ImplOpenGL3_RenderState;
+struct ImGui_ImplOpenGL3_RenderState
+{
+ bool UseBindSampler;
+ bool UseTexParameterFilter;
+ unsigned int CurrentSampler;
+ unsigned int CurrentTexParameterFilter;
+};
+#endif //CIMGUI_DEFINE_ENUMS_AND_STRUCTS
CIMGUI_API bool ImGui_ImplOpenGL3_CreateDeviceObjects(void);
CIMGUI_API void ImGui_ImplOpenGL3_DestroyDeviceObjects(void);
+CIMGUI_API ImGui_ImplOpenGL3_RenderState* ImGui_ImplOpenGL3_GetRenderState(void);
CIMGUI_API bool ImGui_ImplOpenGL3_Init(const char* glsl_version);
CIMGUI_API void ImGui_ImplOpenGL3_NewFrame(void);
CIMGUI_API void ImGui_ImplOpenGL3_RenderDrawData(ImDrawData* draw_data);
@@ -197,6 +209,8 @@ typedef ImVector ImVector_ImGui_ImplVulkanH_Frame;
typedef ImVector ImVector_ImGui_ImplVulkanH_FrameSemaphores;
typedef ImVector ImVector_VkDynamicState;
#endif //CIMGUI_DEFINE_ENUMS_AND_STRUCTS
+#define IMGUI_IMPL_VULKAN_MINIMUM_SAMPLED_IMAGE_POOL_SIZE (8)
+#define IMGUI_IMPL_VULKAN_MINIMUM_SAMPLER_POOL_SIZE (2)
CIMGUI_API void ImGui_ImplVulkanH_CreateOrResizeWindow(VkInstance instance,VkPhysicalDevice physical_device,VkDevice device,ImGui_ImplVulkanH_Window* wd,uint32_t queue_family,const VkAllocationCallbacks* allocator,int w,int h,uint32_t min_image_count,VkImageUsageFlags image_usage);
CIMGUI_API void ImGui_ImplVulkanH_DestroyWindow(VkInstance instance,VkDevice device,ImGui_ImplVulkanH_Window* wd,const VkAllocationCallbacks* allocator);
CIMGUI_API int ImGui_ImplVulkanH_GetMinImageCountFromPresentMode(VkPresentModeKHR present_mode);
@@ -206,7 +220,7 @@ CIMGUI_API VkPresentModeKHR ImGui_ImplVulkanH_SelectPresentMode(VkPhysicalDevice
CIMGUI_API uint32_t ImGui_ImplVulkanH_SelectQueueFamilyIndex(VkPhysicalDevice physical_device);
CIMGUI_API VkSurfaceFormatKHR ImGui_ImplVulkanH_SelectSurfaceFormat(VkPhysicalDevice physical_device,VkSurfaceKHR surface,const VkFormat* request_formats,int request_formats_count,VkColorSpaceKHR request_color_space);
CIMGUI_API ImGui_ImplVulkanH_Window* ImGui_ImplVulkanH_Window_ImGui_ImplVulkanH_Window(void);
-CIMGUI_API VkDescriptorSet ImGui_ImplVulkan_AddTexture(VkSampler sampler,VkImageView image_view,VkImageLayout image_layout);
+CIMGUI_API VkDescriptorSet ImGui_ImplVulkan_AddTexture(VkImageView image_view,VkImageLayout image_layout);
CIMGUI_API void ImGui_ImplVulkan_CreateMainPipeline(const ImGui_ImplVulkan_PipelineInfo* info);
CIMGUI_API bool ImGui_ImplVulkan_Init(ImGui_ImplVulkan_InitInfo* info);
CIMGUI_API bool ImGui_ImplVulkan_LoadFunctions(uint32_t api_version,PFN_vkVoidFunction(*loader_func)(const char* function_name,void* user_data),void* user_data);
diff --git a/include/cimplot.cpp b/include/cimplot.cpp
index 40af156..5b1c67d 100644
--- a/include/cimplot.cpp
+++ b/include/cimplot.cpp
@@ -1,5 +1,5 @@
//This file is automatically generated by generator.lua from https://github.com/cimgui/cimplot
-//based on implot.h file version 1.0 from implot https://github.com/epezent/implot
+//based on implot.h file version 1.1 WIP from implot https://github.com/epezent/implot
//with implot_internal.h api
#include "./implot/implot.h"
@@ -45,7 +45,22 @@ static inline ImPlotAxis ConvertToCPP_ImPlotAxis(const ImPlotAxis_c& src)
dest.Ticker = src.Ticker;
dest.Formatter = src.Formatter;
dest.FormatterData = src.FormatterData;
- dest.FormatSpec[16] = src.FormatSpec[16];
+ dest.FormatSpec[0] = src.FormatSpec[0];
+ dest.FormatSpec[1] = src.FormatSpec[1];
+ dest.FormatSpec[2] = src.FormatSpec[2];
+ dest.FormatSpec[3] = src.FormatSpec[3];
+ dest.FormatSpec[4] = src.FormatSpec[4];
+ dest.FormatSpec[5] = src.FormatSpec[5];
+ dest.FormatSpec[6] = src.FormatSpec[6];
+ dest.FormatSpec[7] = src.FormatSpec[7];
+ dest.FormatSpec[8] = src.FormatSpec[8];
+ dest.FormatSpec[9] = src.FormatSpec[9];
+ dest.FormatSpec[10] = src.FormatSpec[10];
+ dest.FormatSpec[11] = src.FormatSpec[11];
+ dest.FormatSpec[12] = src.FormatSpec[12];
+ dest.FormatSpec[13] = src.FormatSpec[13];
+ dest.FormatSpec[14] = src.FormatSpec[14];
+ dest.FormatSpec[15] = src.FormatSpec[15];
dest.Locator = src.Locator;
dest.LinkedMin = src.LinkedMin;
dest.LinkedMax = src.LinkedMax;
@@ -107,7 +122,22 @@ static inline ImPlotAxis_c ConvertFromCPP_ImPlotAxis(const ImPlotAxis& src)
dest.Ticker = src.Ticker;
dest.Formatter = src.Formatter;
dest.FormatterData = src.FormatterData;
- dest.FormatSpec[16] = src.FormatSpec[16];
+ dest.FormatSpec[0] = src.FormatSpec[0];
+ dest.FormatSpec[1] = src.FormatSpec[1];
+ dest.FormatSpec[2] = src.FormatSpec[2];
+ dest.FormatSpec[3] = src.FormatSpec[3];
+ dest.FormatSpec[4] = src.FormatSpec[4];
+ dest.FormatSpec[5] = src.FormatSpec[5];
+ dest.FormatSpec[6] = src.FormatSpec[6];
+ dest.FormatSpec[7] = src.FormatSpec[7];
+ dest.FormatSpec[8] = src.FormatSpec[8];
+ dest.FormatSpec[9] = src.FormatSpec[9];
+ dest.FormatSpec[10] = src.FormatSpec[10];
+ dest.FormatSpec[11] = src.FormatSpec[11];
+ dest.FormatSpec[12] = src.FormatSpec[12];
+ dest.FormatSpec[13] = src.FormatSpec[13];
+ dest.FormatSpec[14] = src.FormatSpec[14];
+ dest.FormatSpec[15] = src.FormatSpec[15];
dest.Locator = src.Locator;
dest.LinkedMin = src.LinkedMin;
dest.LinkedMax = src.LinkedMax;
@@ -1799,7 +1829,7 @@ CIMGUI_API void ImPlot_Annotation_Str(double x,double y,const ImVec4_c col,const
#ifdef CIMGUI_VARGS0
CIMGUI_API void ImPlot_Annotation_Str0(double x,double y,const ImVec4_c col,const ImVec2_c pix_offset,bool clamp,const char* fmt)
{
- return ImPlot_Annotation_Str(x,y,col,pix_offset,clamp,fmt);
+ ImPlot_Annotation_Str(x,y,col,pix_offset,clamp,fmt);
}
#endif
CIMGUI_API void ImPlot_AnnotationV(double x,double y,const ImVec4_c col,const ImVec2_c pix_offset,bool clamp,const char* fmt,va_list args)
@@ -1820,7 +1850,7 @@ CIMGUI_API void ImPlot_TagX_Str(double x,const ImVec4_c col,const char* fmt,...)
#ifdef CIMGUI_VARGS0
CIMGUI_API void ImPlot_TagX_Str0(double x,const ImVec4_c col,const char* fmt)
{
- return ImPlot_TagX_Str(x,col,fmt);
+ ImPlot_TagX_Str(x,col,fmt);
}
#endif
CIMGUI_API void ImPlot_TagXV(double x,const ImVec4_c col,const char* fmt,va_list args)
@@ -1841,7 +1871,7 @@ CIMGUI_API void ImPlot_TagY_Str(double y,const ImVec4_c col,const char* fmt,...)
#ifdef CIMGUI_VARGS0
CIMGUI_API void ImPlot_TagY_Str0(double y,const ImVec4_c col,const char* fmt)
{
- return ImPlot_TagY_Str(y,col,fmt);
+ ImPlot_TagY_Str(y,col,fmt);
}
#endif
CIMGUI_API void ImPlot_TagYV(double y,const ImVec4_c col,const char* fmt,va_list args)
@@ -2727,6 +2757,12 @@ CIMGUI_API void ImPlotAnnotationCollection_Append(ImPlotAnnotationCollection* se
self->AppendV(ConvertToCPP_ImVec2(pos),ConvertToCPP_ImVec2(off),bg,fg,clamp,fmt,args);
va_end(args);
}
+#ifdef CIMGUI_VARGS0
+CIMGUI_API void ImPlotAnnotationCollection_Append0(ImPlotAnnotationCollection* self,const ImVec2_c pos,const ImVec2_c off,ImU32 bg,ImU32 fg,bool clamp,const char* fmt)
+{
+ ImPlotAnnotationCollection_Append(self,pos,off,bg,fg,clamp,fmt);
+}
+#endif
CIMGUI_API const char* ImPlotAnnotationCollection_GetText(ImPlotAnnotationCollection* self,int idx)
{
return self->GetText(idx);
@@ -2762,6 +2798,12 @@ CIMGUI_API void ImPlotTagCollection_Append(ImPlotTagCollection* self,ImAxis axis
self->AppendV(axis,value,bg,fg,fmt,args);
va_end(args);
}
+#ifdef CIMGUI_VARGS0
+CIMGUI_API void ImPlotTagCollection_Append0(ImPlotTagCollection* self,ImAxis axis,double value,ImU32 bg,ImU32 fg,const char* fmt)
+{
+ ImPlotTagCollection_Append(self,axis,value,bg,fg,fmt);
+}
+#endif
CIMGUI_API const char* ImPlotTagCollection_GetText(ImPlotTagCollection* self,int idx)
{
return self->GetText(idx);
diff --git a/include/cimplot.h b/include/cimplot.h
index 947a842..f00377c 100644
--- a/include/cimplot.h
+++ b/include/cimplot.h
@@ -1,5 +1,5 @@
//This file is automatically generated by generator.lua from https://github.com/cimgui/cimplot
-//based on implot.h file version 1.0 from implot https://github.com/epezent/implot
+//based on implot.h file version 1.1 WIP from implot https://github.com/epezent/implot
//with implot_internal.h api
#ifndef CIMGUIPLOT_INCLUDED
#define CIMGUIPLOT_INCLUDED
@@ -10,6 +10,14 @@
#include
typedef struct tm tm;
+typedef struct ImPlotAxis_c ImPlotAxis;
+typedef struct ImPlotDateTimeSpec_c ImPlotDateTimeSpec;
+typedef struct ImPlotPoint_c ImPlotPoint;
+typedef struct ImPlotRange_c ImPlotRange;
+typedef struct ImPlotRect_c ImPlotRect;
+typedef struct ImPlotSpec_c ImPlotSpec;
+typedef struct ImPlotTick_c ImPlotTick;
+typedef struct ImPlotTime_c ImPlotTime;
typedef struct ImPlotContext ImPlotContext;
typedef struct ImPlotTick_c ImPlotTick_c;
@@ -1556,6 +1564,9 @@ CIMGUI_API ImPlotAnnotationCollection* ImPlotAnnotationCollection_ImPlotAnnotati
CIMGUI_API void ImPlotAnnotationCollection_destroy(ImPlotAnnotationCollection* self);
CIMGUI_API void ImPlotAnnotationCollection_AppendV(ImPlotAnnotationCollection* self,const ImVec2_c pos,const ImVec2_c off,ImU32 bg,ImU32 fg,bool clamp,const char* fmt,va_list args);
CIMGUI_API void ImPlotAnnotationCollection_Append(ImPlotAnnotationCollection* self,const ImVec2_c pos,const ImVec2_c off,ImU32 bg,ImU32 fg,bool clamp,const char* fmt,...);
+#ifdef CIMGUI_VARGS0
+CIMGUI_API void ImPlotAnnotationCollection_Append0(ImPlotAnnotationCollection* self,const ImVec2_c pos,const ImVec2_c off,ImU32 bg,ImU32 fg,bool clamp,const char* fmt);
+#endif
CIMGUI_API const char* ImPlotAnnotationCollection_GetText(ImPlotAnnotationCollection* self,int idx);
CIMGUI_API void ImPlotAnnotationCollection_Reset(ImPlotAnnotationCollection* self);
CIMGUI_API ImPlotTag* ImPlotTag_ImPlotTag(void);
@@ -1564,6 +1575,9 @@ CIMGUI_API ImPlotTagCollection* ImPlotTagCollection_ImPlotTagCollection(void);
CIMGUI_API void ImPlotTagCollection_destroy(ImPlotTagCollection* self);
CIMGUI_API void ImPlotTagCollection_AppendV(ImPlotTagCollection* self,ImAxis axis,double value,ImU32 bg,ImU32 fg,const char* fmt,va_list args);
CIMGUI_API void ImPlotTagCollection_Append(ImPlotTagCollection* self,ImAxis axis,double value,ImU32 bg,ImU32 fg,const char* fmt,...);
+#ifdef CIMGUI_VARGS0
+CIMGUI_API void ImPlotTagCollection_Append0(ImPlotTagCollection* self,ImAxis axis,double value,ImU32 bg,ImU32 fg,const char* fmt);
+#endif
CIMGUI_API const char* ImPlotTagCollection_GetText(ImPlotTagCollection* self,int idx);
CIMGUI_API void ImPlotTagCollection_Reset(ImPlotTagCollection* self);
CIMGUI_API ImPlotTick* ImPlotTick_ImPlotTick_Nil(void);
diff --git a/include/imgui/.github/pull_request_template.md b/include/imgui/.github/pull_request_template.md
index d40b14c..27cb3e1 100644
--- a/include/imgui/.github/pull_request_template.md
+++ b/include/imgui/.github/pull_request_template.md
@@ -6,5 +6,7 @@
3. Consider running the [imgui_test_suite](https://github.com/ocornut/imgui_test_engine) or adding new tests to test for expected behaviors.
-4. Clear this template before submitting your PR.
+4. PLEASE DO NOT SUBMIT AI SLOP OR AUTOMATED REPORTS. Submissions that are lacking proper human review/judgement before being passed to us are not welcome.
+
+5. Clear this template before submitting your PR.
diff --git a/include/imgui/.github/workflows/build.yml b/include/imgui/.github/workflows/build.yml
index 9bc81bf..5bbaefd 100644
--- a/include/imgui/.github/workflows/build.yml
+++ b/include/imgui/.github/workflows/build.yml
@@ -25,8 +25,8 @@ jobs:
working-directory: ${{ github.workspace }}/imgui
env:
- VS_PATH: C:\Program Files\Microsoft Visual Studio\2022\Enterprise\
- MSBUILD_PATH: C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Current\Bin\
+ VS_PATH: C:\Program Files\Microsoft Visual Studio\18\Enterprise
+ MSBUILD_PATH: C:\Program Files\Microsoft Visual Studio\18\Enterprise\MSBuild\Current\Bin\
steps:
- uses: actions/checkout@v6
with:
@@ -116,7 +116,7 @@ jobs:
cl.exe /D_USRDLL /D_WINDLL /I. example_single_file.cpp /LD /FeImGui.dll /link
cl.exe /DIMGUI_API=__declspec(dllimport) -DIMGUI_IMPL_API= /I. ImGui.lib /Feexample_null.exe examples/example_null/main.cpp
- # Win64 examples are more frequently compilted than the Win32 examples.
+ # Win64 examples are more frequently compiled than the Win32 examples.
# More of the Win32 examples requires 'workflow_run' to reduce waste.
- name: Build Win32 example_glfw_opengl2
shell: cmd
@@ -160,6 +160,7 @@ jobs:
- name: Build Win32 example_sdl3_opengl3
shell: cmd
run: '"%MSBUILD_PATH%\MSBuild.exe" examples/example_sdl3_opengl3/example_sdl3_opengl3.vcxproj /p:Platform=Win32 /p:Configuration=Release'
+ if: github.event_name == 'workflow_run'
- name: Build Win32 example_sdl3_sdlgpu3
shell: cmd
@@ -200,6 +201,7 @@ jobs:
- name: Build Win64 example_glfw_opengl3
shell: cmd
run: '"%MSBUILD_PATH%\MSBuild.exe" examples/example_glfw_opengl3/example_glfw_opengl3.vcxproj /p:Platform=x64 /p:Configuration=Release'
+ if: github.event_name == 'workflow_run'
- name: Build Win64 example_glfw_vulkan
shell: cmd
@@ -228,6 +230,7 @@ jobs:
- name: Build Win64 example_sdl2_directx11
shell: cmd
run: '"%MSBUILD_PATH%\MSBuild.exe" examples/example_sdl2_directx11/example_sdl2_directx11.vcxproj /p:Platform=x64 /p:Configuration=Release'
+ if: github.event_name == 'workflow_run'
- name: Build Win64 example_sdl3_opengl3
shell: cmd
@@ -506,7 +509,7 @@ jobs:
run: g++ -c -I. -std=c++11 -DIMGUI_IMPL_VULKAN_NO_PROTOTYPES=1 backends/imgui_impl_vulkan.cpp
Build-MacOS:
- runs-on: macos-latest
+ runs-on: macos-26
name: Build - MacOS
defaults:
@@ -572,6 +575,9 @@ jobs:
- name: Build macOS example_sdl2_metal
run: make -C examples/example_sdl2_metal
+ - name: Build macOS example_sdl3_metal4
+ run: make -C examples/example_sdl3_metal4
+
- name: Build macOS example_sdl2_opengl2
run: make -C examples/example_sdl2_opengl2
if: github.event_name == 'workflow_run'
@@ -587,6 +593,10 @@ jobs:
run: xcodebuild -project examples/example_apple_metal/example_apple_metal.xcodeproj -target example_apple_metal_macos
if: github.event_name == 'workflow_run'
+ - name: Build macOS example_apple_metal4
+ run: xcodebuild -project examples/example_apple_metal4/example_apple_metal4.xcodeproj -target example_apple_metal_macos
+ if: github.event_name == 'workflow_run'
+
- name: Build macOS example_apple_opengl2
run: xcodebuild -project examples/example_apple_opengl2/example_apple_opengl2.xcodeproj -target example_osx_opengl2
if: github.event_name == 'workflow_run'
@@ -651,8 +661,12 @@ jobs:
name: Build - Android
steps:
- - uses: actions/checkout@v6
+ - name: Setup Gradle 9.4.1
+ uses: gradle/actions/setup-gradle@v6
+ with:
+ gradle-version: '9.4.1'
+ - uses: actions/checkout@v6
- name: Build example_android_opengl3
run: |
cd examples/example_android_opengl3/android
@@ -667,7 +681,7 @@ jobs:
working-directory: ${{ github.workspace }}/imgui
env:
- MSBUILD_PATH: C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Current\Bin\
+ MSBUILD_PATH: C:\Program Files\Microsoft Visual Studio\18\Enterprise\MSBuild\Current\Bin\
steps:
- uses: actions/checkout@v6
diff --git a/include/imgui/.github/workflows/static-analysis.yml b/include/imgui/.github/workflows/static-analysis.yml
index 2956283..231d3a9 100644
--- a/include/imgui/.github/workflows/static-analysis.yml
+++ b/include/imgui/.github/workflows/static-analysis.yml
@@ -23,9 +23,9 @@ jobs:
run: |
if [[ "$PVS_STUDIO_LICENSE" != "" ]];
then
- wget -q https://files.viva64.com/etc/pubkey.txt
+ wget -q https://files.pvs-studio.com/etc/pubkey.txt
sudo apt-key add pubkey.txt
- sudo wget -O /etc/apt/sources.list.d/viva64.list https://files.viva64.com/etc/viva64.list
+ sudo wget -O /etc/apt/sources.list.d/viva64.list https://files.pvs-studio.com/etc/viva64.list
sudo apt-get update
sudo apt-get install -y pvs-studio
pvs-studio-analyzer credentials -o pvs-studio.lic $PVS_STUDIO_LICENSE
diff --git a/include/imgui/.gitignore b/include/imgui/.gitignore
index 1aedcf7..83c0ab4 100644
--- a/include/imgui/.gitignore
+++ b/include/imgui/.gitignore
@@ -1,5 +1,7 @@
-## OSX artifacts
+## Misc artifacts
.DS_Store
+.claude
+.vscode
## Dear ImGui artifacts
imgui.ini
@@ -55,9 +57,6 @@ examples/example_sdl3_wgpu/web/*
.idea
cmake-build-*
-## VS code artifacts
-.vscode
-
## Unix executables from our example Makefiles
examples/example_apple_metal/example_apple_metal
examples/example_apple_opengl2/example_apple_opengl2
@@ -73,6 +72,7 @@ examples/example_sdl2_opengl3/example_sdl2_opengl3
examples/example_sdl2_sdlrenderer2/example_sdl2_sdlrenderer2
examples/example_sdl2_vulkan/example_sdl2_vulkan
examples/example_sdl3_metal/example_sdl3_metal
+examples/example_sdl3_metal4/example_sdl3_metal4
examples/example_sdl3_opengl3/example_sdl3_opengl3
examples/example_sdl3_sdlgpu3/example_sdl3_sdlgpu3
examples/example_sdl3_sdlrenderer3/example_sdl3_sdlrenderer3
diff --git a/include/imgui/backends/imgui_impl_allegro5.cpp b/include/imgui/backends/imgui_impl_allegro5.cpp
index 29951b9..e352121 100644
--- a/include/imgui/backends/imgui_impl_allegro5.cpp
+++ b/include/imgui/backends/imgui_impl_allegro5.cpp
@@ -9,6 +9,7 @@
// [X] Platform: Mouse cursor shape and visibility (ImGuiBackendFlags_HasMouseCursors). Disable with 'io.ConfigFlags |= ImGuiConfigFlags_NoMouseCursorChange'.
// Missing features or Issues:
// [ ] Renderer: The renderer is suboptimal as we need to unindex our buffers and convert vertices manually.
+// [ ] Renderer: Missing support for DrawCallback_SetSamplerLinear, DrawCallback_SetSamplerNearest callbacks: Allegro5 cannot enable/disable LINEAR bitmap flags after creation.
// [ ] Platform: Missing gamepad support.
// [ ] Renderer: Multi-viewport support (multiple windows).
@@ -22,6 +23,7 @@
// CHANGELOG
// (minor and older changes stripped away, please see git history for details)
+// 2026-04-23: Added support for standard draw callbacks (in platform_io): DrawCallback_ResetRenderState (others cannot be supported by Allegro5). (#9378)
// 2025-09-18: Call platform_io.ClearRendererHandlers() and platform_io.ClearPlatformHandlers() on shutdown.
// 2025-08-12: Inputs: fixed missing support for ImGuiKey_PrintScreen under Windows, as raw Allegro 5 does not receive it.
// 2025-08-12: Added ImGui_ImplAllegro5_SetDisplay() function to change current ALLEGRO_DISPLAY, as Allegro applications often need to do that.
@@ -137,7 +139,10 @@ static void ImGui_ImplAllegro5_SetupRenderState(ImDrawData* draw_data)
}
}
-// Render function.
+// Draw callbacks
+static void ImGui_ImplAllegro5_DrawCallback_ResetRenderState(const ImDrawList*, const ImDrawCmd*) {} // Intentionally empty. Used as an identifier for rendering loop to call its code. Simpler to implement this way.
+
+// Render function
void ImGui_ImplAllegro5_RenderDrawData(ImDrawData* draw_data)
{
// Avoid rendering when minimized
@@ -153,6 +158,7 @@ void ImGui_ImplAllegro5_RenderDrawData(ImDrawData* draw_data)
// Backup Allegro state that will be modified
ImGui_ImplAllegro5_Data* bd = ImGui_ImplAllegro5_GetBackendData();
+ ImGuiPlatformIO& platform_io = ImGui::GetPlatformIO();
ALLEGRO_TRANSFORM last_transform = *al_get_current_transform();
ALLEGRO_TRANSFORM last_projection_transform = *al_get_current_projection_transform();
int last_clip_x, last_clip_y, last_clip_w, last_clip_h;
@@ -209,8 +215,7 @@ void ImGui_ImplAllegro5_RenderDrawData(ImDrawData* draw_data)
if (pcmd->UserCallback)
{
// User callback, registered via ImDrawList::AddCallback()
- // (ImDrawCallback_ResetRenderState is a special callback value used by the user to request the renderer to reset render state.)
- if (pcmd->UserCallback == ImDrawCallback_ResetRenderState)
+ if (pcmd->UserCallback == ImGui_ImplAllegro5_DrawCallback_ResetRenderState)
ImGui_ImplAllegro5_SetupRenderState(draw_data);
else
pcmd->UserCallback(draw_list, pcmd);
@@ -487,11 +492,12 @@ bool ImGui_ImplAllegro5_Init(ALLEGRO_DISPLAY* display)
ImGui_ImplAllegro5_SetDisplay(display);
-#if ALLEGRO_HAS_CLIPBOARD
ImGuiPlatformIO& platform_io = ImGui::GetPlatformIO();
+#if ALLEGRO_HAS_CLIPBOARD
platform_io.Platform_SetClipboardTextFn = ImGui_ImplAllegro5_SetClipboardText;
platform_io.Platform_GetClipboardTextFn = ImGui_ImplAllegro5_GetClipboardText;
#endif
+ platform_io.DrawCallback_ResetRenderState = ImGui_ImplAllegro5_DrawCallback_ResetRenderState;
return true;
}
diff --git a/include/imgui/backends/imgui_impl_allegro5.h b/include/imgui/backends/imgui_impl_allegro5.h
index e1f3173..8ed7793 100644
--- a/include/imgui/backends/imgui_impl_allegro5.h
+++ b/include/imgui/backends/imgui_impl_allegro5.h
@@ -9,6 +9,7 @@
// [X] Platform: Mouse cursor shape and visibility (ImGuiBackendFlags_HasMouseCursors). Disable with 'io.ConfigFlags |= ImGuiConfigFlags_NoMouseCursorChange'.
// Missing features or Issues:
// [ ] Renderer: The renderer is suboptimal as we need to unindex our buffers and convert vertices manually.
+// [ ] Renderer: Missing support for DrawCallback_SetSamplerLinear, DrawCallback_SetSamplerNearest callbacks: Allegro5 cannot enable/disable LINEAR bitmap flags after creation.
// [ ] Platform: Missing gamepad support.
// [ ] Renderer: Multi-viewport support (multiple windows).
diff --git a/include/imgui/backends/imgui_impl_android.cpp b/include/imgui/backends/imgui_impl_android.cpp
index 13294cb..1aeb57b 100644
--- a/include/imgui/backends/imgui_impl_android.cpp
+++ b/include/imgui/backends/imgui_impl_android.cpp
@@ -1,5 +1,5 @@
// dear imgui: Platform Binding for Android native app
-// This needs to be used along with the OpenGL 3 Renderer (imgui_impl_opengl3)
+// This needs to be used along with a Renderer (e.g. OpenGL3, Vulkan..)
// Implemented features:
// [X] Platform: Keyboard support. Since 1.87 we are using the io.AddKeyEvent() function. Pass ImGuiKey values to all key functions e.g. ImGui::IsKeyPressed(ImGuiKey_Space). [Legacy AKEYCODE_* values are obsolete since 1.87 and not supported since 1.91.5]
@@ -24,7 +24,9 @@
// CHANGELOG
// (minor and older changes stripped away, please see git history for details)
-// 2022-09-26: Inputs: Renamed ImGuiKey_ModXXX introduced in 1.87 to ImGuiMod_XXX (old names still supported).
+// 2026-07-15: Inputs: clear mouse position on touch release (AMOTION_EVENT_ACTION_UP) to prevent items from staying in hovered state. (#6627, #9474)
+// 2023-04-11: Inputs: calling new io.AddMouseSourceEvent() to discriminate Mouse from Touch events.
+// 2022-09-26: Inputs: renamed ImGuiKey_ModXXX introduced in 1.87 to ImGuiMod_XXX (old names still supported).
// 2022-01-26: Inputs: replaced short-lived io.AddKeyModsEvent() (added two weeks ago) with io.AddKeyEvent() using ImGuiKey_ModXXX flags. Sorry for the confusion.
// 2022-01-17: Inputs: calling new io.AddMousePosEvent(), io.AddMouseButtonEvent(), io.AddMouseWheelEvent() API (1.87+).
// 2022-01-10: Inputs: calling new io.AddKeyEvent(), io.AddKeyModsEvent() + io.SetKeyEventNativeData() API (1.87+). Support for full ImGuiKey range.
@@ -231,6 +233,8 @@ int32_t ImGui_ImplAndroid_HandleInputEvent(const AInputEvent* input_event)
{
io.AddMousePosEvent(AMotionEvent_getX(input_event, event_pointer_index), AMotionEvent_getY(input_event, event_pointer_index));
io.AddMouseButtonEvent(0, event_action == AMOTION_EVENT_ACTION_DOWN);
+ if (event_action == AMOTION_EVENT_ACTION_UP) // (#6627, #9474)
+ io.AddMousePosEvent(-FLT_MAX, -FLT_MAX);
}
break;
}
diff --git a/include/imgui/backends/imgui_impl_android.h b/include/imgui/backends/imgui_impl_android.h
index 308daa2..7240c6e 100644
--- a/include/imgui/backends/imgui_impl_android.h
+++ b/include/imgui/backends/imgui_impl_android.h
@@ -1,5 +1,5 @@
// dear imgui: Platform Binding for Android native app
-// This needs to be used along with the OpenGL 3 Renderer (imgui_impl_opengl3)
+// This needs to be used along with a Renderer (e.g. OpenGL3, Vulkan..)
// Implemented features:
// [X] Platform: Keyboard support. Since 1.87 we are using the io.AddKeyEvent() function. Pass ImGuiKey values to all key functions e.g. ImGui::IsKeyPressed(ImGuiKey_Space). [Legacy AKEYCODE_* values are obsolete since 1.87 and not supported since 1.91.5]
diff --git a/include/imgui/backends/imgui_impl_dx10.cpp b/include/imgui/backends/imgui_impl_dx10.cpp
index b053cb0..1aff44d 100644
--- a/include/imgui/backends/imgui_impl_dx10.cpp
+++ b/include/imgui/backends/imgui_impl_dx10.cpp
@@ -18,7 +18,8 @@
// CHANGELOG
// (minor and older changes stripped away, please see git history for details)
// 2026-XX-XX: Platform: Added support for multiple windows via the ImGuiPlatformIO interface.
-// 2026-01-19: DirectX11: Added 'SamplerNearest' in ImGui_ImplDX11_RenderState. Renamed 'SamplerDefault' to 'SamplerLinear'.
+// 2026-04-23: DirectX10: Added support for standard draw callbacks (in platform_io): DrawCallback_ResetRenderState, DrawCallback_SetSamplerLinear, DrawCallback_SetSamplerNearest. Obsoleting samplers from ImGui_ImplDX10_RenderState. (#9378)
+// 2026-01-19: DirectX10: Added 'SamplerNearest' in ImGui_ImplDX10_RenderState. Renamed 'SamplerDefault' to 'SamplerLinear'.
// 2025-09-18: Call platform_io.ClearRendererHandlers() on shutdown.
// 2025-06-11: DirectX10: Added support for ImGuiBackendFlags_RendererHasTextures, for dynamic font atlas.
// 2025-05-07: DirectX10: Honor draw_data->FramebufferScale to allow for custom backends and experiment using it (consistently with other renderer backends, even though in normal condition it is not set under Windows).
@@ -153,12 +154,17 @@ static void ImGui_ImplDX10_SetupRenderState(ImDrawData* draw_data, ID3D10Device*
device->GSSetShader(nullptr);
// Setup render state
- const float blend_factor[4] = { 0.f, 0.f, 0.f, 0.f };
+ const float blend_factor[4] = { 0.0f, 0.0f, 0.0f, 0.0f };
device->OMSetBlendState(bd->pBlendState, blend_factor, 0xffffffff);
device->OMSetDepthStencilState(bd->pDepthStencilState, 0);
device->RSSetState(bd->pRasterizerState);
}
+// Draw callbacks
+static void ImGui_ImplDX10_DrawCallback_ResetRenderState(const ImDrawList*, const ImDrawCmd*) {} // Intentionally empty. Used as an identifier for rendering loop to call its code. Simpler to implement this way.
+static void ImGui_ImplDX10_DrawCallback_SetSamplerLinear(const ImDrawList*, const ImDrawCmd*) { ImGui_ImplDX10_Data* bd = ImGui_ImplDX10_GetBackendData(); bd->pd3dDevice->PSSetSamplers(0, 1, &bd->pTexSamplerLinear); }
+static void ImGui_ImplDX10_DrawCallback_SetSamplerNearest(const ImDrawList*, const ImDrawCmd*) { ImGui_ImplDX10_Data* bd = ImGui_ImplDX10_GetBackendData(); bd->pd3dDevice->PSSetSamplers(0, 1, &bd->pTexSamplerNearest); }
+
// Render function
void ImGui_ImplDX10_RenderDrawData(ImDrawData* draw_data)
{
@@ -183,7 +189,7 @@ void ImGui_ImplDX10_RenderDrawData(ImDrawData* draw_data)
bd->VertexBufferSize = draw_data->TotalVtxCount + 5000;
D3D10_BUFFER_DESC desc = {};
desc.Usage = D3D10_USAGE_DYNAMIC;
- desc.ByteWidth = bd->VertexBufferSize * sizeof(ImDrawVert);
+ desc.ByteWidth = (UINT)bd->VertexBufferSize * sizeof(ImDrawVert);
desc.BindFlags = D3D10_BIND_VERTEX_BUFFER;
desc.CPUAccessFlags = D3D10_CPU_ACCESS_WRITE;
desc.MiscFlags = 0;
@@ -197,7 +203,7 @@ void ImGui_ImplDX10_RenderDrawData(ImDrawData* draw_data)
bd->IndexBufferSize = draw_data->TotalIdxCount + 10000;
D3D10_BUFFER_DESC desc = {};
desc.Usage = D3D10_USAGE_DYNAMIC;
- desc.ByteWidth = bd->IndexBufferSize * sizeof(ImDrawIdx);
+ desc.ByteWidth = (UINT)bd->IndexBufferSize * sizeof(ImDrawIdx);
desc.BindFlags = D3D10_BIND_INDEX_BUFFER;
desc.CPUAccessFlags = D3D10_CPU_ACCESS_WRITE;
if (device->CreateBuffer(&desc, nullptr, &bd->pIB) < 0)
@@ -266,8 +272,6 @@ void ImGui_ImplDX10_RenderDrawData(ImDrawData* draw_data)
ImGuiPlatformIO& platform_io = ImGui::GetPlatformIO();
ImGui_ImplDX10_RenderState render_state;
render_state.Device = bd->pd3dDevice;
- render_state.SamplerLinear = bd->pTexSamplerLinear;
- render_state.SamplerNearest = bd->pTexSamplerNearest;
render_state.VertexConstantBuffer = bd->pVertexConstantBuffer;
platform_io.Renderer_RenderState = &render_state;
@@ -285,8 +289,7 @@ void ImGui_ImplDX10_RenderDrawData(ImDrawData* draw_data)
if (pcmd->UserCallback != nullptr)
{
// User callback, registered via ImDrawList::AddCallback()
- // (ImDrawCallback_ResetRenderState is a special callback value used by the user to request the renderer to reset render state.)
- if (pcmd->UserCallback == ImDrawCallback_ResetRenderState)
+ if (pcmd->UserCallback == ImGui_ImplDX10_DrawCallback_ResetRenderState)
ImGui_ImplDX10_SetupRenderState(draw_data, device);
else
pcmd->UserCallback(draw_list, pcmd);
@@ -449,7 +452,7 @@ bool ImGui_ImplDX10_CreateDeviceObjects()
PS_INPUT main(VS_INPUT input)\
{\
PS_INPUT output;\
- output.pos = mul( ProjectionMatrix, float4(input.pos.xy, 0.f, 1.f));\
+ output.pos = mul( ProjectionMatrix, float4(input.pos.xy, 0.0f, 1.0f));\
output.col = input.col;\
output.uv = input.uv;\
return output;\
@@ -569,10 +572,10 @@ bool ImGui_ImplDX10_CreateDeviceObjects()
desc.AddressU = D3D10_TEXTURE_ADDRESS_CLAMP;
desc.AddressV = D3D10_TEXTURE_ADDRESS_CLAMP;
desc.AddressW = D3D10_TEXTURE_ADDRESS_CLAMP;
- desc.MipLODBias = 0.f;
+ desc.MipLODBias = 0.0f;
desc.ComparisonFunc = D3D10_COMPARISON_ALWAYS;
- desc.MinLOD = 0.f;
- desc.MaxLOD = 0.f;
+ desc.MinLOD = 0.0f;
+ desc.MaxLOD = 0.0f;
bd->pd3dDevice->CreateSamplerState(&desc, &bd->pTexSamplerLinear);
desc.Filter = D3D10_FILTER_MIN_MAG_MIP_POINT;
bd->pd3dDevice->CreateSamplerState(&desc, &bd->pTexSamplerNearest);
@@ -620,6 +623,9 @@ bool ImGui_ImplDX10_Init(ID3D10Device* device)
ImGuiPlatformIO& platform_io = ImGui::GetPlatformIO();
platform_io.Renderer_TextureMaxWidth = platform_io.Renderer_TextureMaxHeight = D3D10_REQ_TEXTURE2D_U_OR_V_DIMENSION;
+ platform_io.DrawCallback_ResetRenderState = ImGui_ImplDX10_DrawCallback_ResetRenderState;
+ platform_io.DrawCallback_SetSamplerLinear = ImGui_ImplDX10_DrawCallback_SetSamplerLinear;
+ platform_io.DrawCallback_SetSamplerNearest = ImGui_ImplDX10_DrawCallback_SetSamplerNearest;
// Get factory from device
IDXGIDevice* pDXGIDevice = nullptr;
diff --git a/include/imgui/backends/imgui_impl_dx10.h b/include/imgui/backends/imgui_impl_dx10.h
index 0d61065..d632d0e 100644
--- a/include/imgui/backends/imgui_impl_dx10.h
+++ b/include/imgui/backends/imgui_impl_dx10.h
@@ -42,9 +42,9 @@ IMGUI_IMPL_API void ImGui_ImplDX10_UpdateTexture(ImTextureData* tex);
struct ImGui_ImplDX10_RenderState
{
ID3D10Device* Device;
- ID3D10SamplerState* SamplerLinear;
- ID3D10SamplerState* SamplerNearest;
ID3D10Buffer* VertexConstantBuffer;
+ //ID3D10SamplerState* SamplerLinear; // Use ImDrawList::AddCallback(ImGui::GetPlatform().DrawCallback_SetSamplerLinear)
+ //ID3D10SamplerState* SamplerNearest; // Use ImDrawList::AddCallback(ImGui::GetPlatform().DrawCallback_SetSamplerNearest)
};
#endif // #ifndef IMGUI_DISABLE
diff --git a/include/imgui/backends/imgui_impl_dx11.cpp b/include/imgui/backends/imgui_impl_dx11.cpp
index 36b936e..7d45d8b 100644
--- a/include/imgui/backends/imgui_impl_dx11.cpp
+++ b/include/imgui/backends/imgui_impl_dx11.cpp
@@ -19,6 +19,7 @@
// CHANGELOG
// (minor and older changes stripped away, please see git history for details)
// 2026-XX-XX: Platform: Added support for multiple windows via the ImGuiPlatformIO interface.
+// 2026-04-23: DirectX11: Added support for standard draw callbacks (in platform_io): DrawCallback_ResetRenderState, DrawCallback_SetSamplerLinear, DrawCallback_SetSamplerNearest. Obsoleting samplers from ImGui_ImplDX11_RenderState. (#9378)
// 2026-01-19: DirectX11: Added 'SamplerNearest' in ImGui_ImplDX11_RenderState. Renamed 'SamplerDefault' to 'SamplerLinear'.
// 2025-09-18: Call platform_io.ClearRendererHandlers() on shutdown.
// 2025-06-11: DirectX11: Added support for ImGuiBackendFlags_RendererHasTextures, for dynamic font atlas.
@@ -88,6 +89,7 @@ struct ImGui_ImplDX11_Data
ID3D11DepthStencilState* pDepthStencilState;
int VertexBufferSize;
int IndexBufferSize;
+ ImGui_ImplDX11_RenderState* RenderState; // == (ImGui_ImplDX11_RenderState*)ImGui::GetPlatformIO().Renderer_RenderState during rendering.
ImVector SwapChainDescsForViewports;
ImGui_ImplDX11_Data() { memset((void*)this, 0, sizeof(*this)); VertexBufferSize = 5000; IndexBufferSize = 10000; }
@@ -161,12 +163,17 @@ static void ImGui_ImplDX11_SetupRenderState(const ImDrawData* draw_data, ID3D11D
device_ctx->CSSetShader(nullptr, nullptr, 0); // In theory we should backup and restore this as well.. very infrequently used..
// Setup render state
- const float blend_factor[4] = { 0.f, 0.f, 0.f, 0.f };
+ const float blend_factor[4] = { 0.0f, 0.0f, 0.0f, 0.0f };
device_ctx->OMSetBlendState(bd->pBlendState, blend_factor, 0xffffffff);
device_ctx->OMSetDepthStencilState(bd->pDepthStencilState, 0);
device_ctx->RSSetState(bd->pRasterizerState);
}
+// Draw callbacks
+static void ImGui_ImplDX11_DrawCallback_ResetRenderState(const ImDrawList*, const ImDrawCmd*) {} // Intentionally empty. Used as an identifier for rendering loop to call its code. Simpler to implement this way.
+static void ImGui_ImplDX11_DrawCallback_SetSamplerLinear(const ImDrawList*, const ImDrawCmd*) { ImGui_ImplDX11_Data* bd = ImGui_ImplDX11_GetBackendData(); bd->RenderState->DeviceContext->PSSetSamplers(0, 1, &bd->pTexSamplerLinear); }
+static void ImGui_ImplDX11_DrawCallback_SetSamplerNearest(const ImDrawList*, const ImDrawCmd*) { ImGui_ImplDX11_Data* bd = ImGui_ImplDX11_GetBackendData(); bd->RenderState->DeviceContext->PSSetSamplers(0, 1, &bd->pTexSamplerNearest); }
+
// Render function
void ImGui_ImplDX11_RenderDrawData(ImDrawData* draw_data)
{
@@ -191,7 +198,7 @@ void ImGui_ImplDX11_RenderDrawData(ImDrawData* draw_data)
bd->VertexBufferSize = draw_data->TotalVtxCount + 5000;
D3D11_BUFFER_DESC desc = {};
desc.Usage = D3D11_USAGE_DYNAMIC;
- desc.ByteWidth = bd->VertexBufferSize * sizeof(ImDrawVert);
+ desc.ByteWidth = (UINT)bd->VertexBufferSize * sizeof(ImDrawVert);
desc.BindFlags = D3D11_BIND_VERTEX_BUFFER;
desc.CPUAccessFlags = D3D11_CPU_ACCESS_WRITE;
desc.MiscFlags = 0;
@@ -204,7 +211,7 @@ void ImGui_ImplDX11_RenderDrawData(ImDrawData* draw_data)
bd->IndexBufferSize = draw_data->TotalIdxCount + 10000;
D3D11_BUFFER_DESC desc = {};
desc.Usage = D3D11_USAGE_DYNAMIC;
- desc.ByteWidth = bd->IndexBufferSize * sizeof(ImDrawIdx);
+ desc.ByteWidth = (UINT)bd->IndexBufferSize * sizeof(ImDrawIdx);
desc.BindFlags = D3D11_BIND_INDEX_BUFFER;
desc.CPUAccessFlags = D3D11_CPU_ACCESS_WRITE;
if (bd->pd3dDevice->CreateBuffer(&desc, nullptr, &bd->pIB) < 0)
@@ -282,10 +289,8 @@ void ImGui_ImplDX11_RenderDrawData(ImDrawData* draw_data)
ImGui_ImplDX11_RenderState render_state;
render_state.Device = bd->pd3dDevice;
render_state.DeviceContext = bd->pd3dDeviceContext;
- render_state.SamplerLinear = bd->pTexSamplerLinear;
- render_state.SamplerNearest = bd->pTexSamplerNearest;
render_state.VertexConstantBuffer = bd->pVertexConstantBuffer;
- platform_io.Renderer_RenderState = &render_state;
+ platform_io.Renderer_RenderState = bd->RenderState = &render_state;
// Render command lists
// (Because we merged all buffers into a single one, we maintain our own offset into them)
@@ -301,8 +306,7 @@ void ImGui_ImplDX11_RenderDrawData(ImDrawData* draw_data)
if (pcmd->UserCallback != nullptr)
{
// User callback, registered via ImDrawList::AddCallback()
- // (ImDrawCallback_ResetRenderState is a special callback value used by the user to request the renderer to reset render state.)
- if (pcmd->UserCallback == ImDrawCallback_ResetRenderState)
+ if (pcmd->UserCallback == ImGui_ImplDX11_DrawCallback_ResetRenderState)
ImGui_ImplDX11_SetupRenderState(draw_data, device);
else
pcmd->UserCallback(draw_list, pcmd);
@@ -328,7 +332,7 @@ void ImGui_ImplDX11_RenderDrawData(ImDrawData* draw_data)
global_idx_offset += draw_list->IdxBuffer.Size;
global_vtx_offset += draw_list->VtxBuffer.Size;
}
- platform_io.Renderer_RenderState = nullptr;
+ platform_io.Renderer_RenderState = bd->RenderState = nullptr;
// Restore modified DX state
device->RSSetScissorRects(old.ScissorRectsCount, old.ScissorRects);
@@ -466,7 +470,7 @@ bool ImGui_ImplDX11_CreateDeviceObjects()
PS_INPUT main(VS_INPUT input)\
{\
PS_INPUT output;\
- output.pos = mul( ProjectionMatrix, float4(input.pos.xy, 0.f, 1.f));\
+ output.pos = mul( ProjectionMatrix, float4(input.pos.xy, 0.0f, 1.0f));\
output.col = input.col;\
output.uv = input.uv;\
return output;\
@@ -578,7 +582,6 @@ bool ImGui_ImplDX11_CreateDeviceObjects()
}
// Create texture sampler
- // (Bilinear sampling is required by default. Set 'io.Fonts->Flags |= ImFontAtlasFlags_NoBakedLines' or 'style.AntiAliasedLinesUseTex = false' to allow point/nearest sampling)
{
D3D11_SAMPLER_DESC desc;
ZeroMemory(&desc, sizeof(desc));
@@ -586,10 +589,10 @@ bool ImGui_ImplDX11_CreateDeviceObjects()
desc.AddressU = D3D11_TEXTURE_ADDRESS_CLAMP;
desc.AddressV = D3D11_TEXTURE_ADDRESS_CLAMP;
desc.AddressW = D3D11_TEXTURE_ADDRESS_CLAMP;
- desc.MipLODBias = 0.f;
+ desc.MipLODBias = 0.0f;
desc.ComparisonFunc = D3D11_COMPARISON_ALWAYS;
- desc.MinLOD = 0.f;
- desc.MaxLOD = 0.f;
+ desc.MinLOD = 0.0f;
+ desc.MaxLOD = 0.0f;
bd->pd3dDevice->CreateSamplerState(&desc, &bd->pTexSamplerLinear);
desc.Filter = D3D11_FILTER_MIN_MAG_MIP_POINT;
bd->pd3dDevice->CreateSamplerState(&desc, &bd->pTexSamplerNearest);
@@ -638,6 +641,9 @@ bool ImGui_ImplDX11_Init(ID3D11Device* device, ID3D11DeviceContext* device_co
ImGuiPlatformIO& platform_io = ImGui::GetPlatformIO();
platform_io.Renderer_TextureMaxWidth = platform_io.Renderer_TextureMaxHeight = D3D11_REQ_TEXTURE2D_U_OR_V_DIMENSION;
+ platform_io.DrawCallback_ResetRenderState = ImGui_ImplDX11_DrawCallback_ResetRenderState;
+ platform_io.DrawCallback_SetSamplerLinear = ImGui_ImplDX11_DrawCallback_SetSamplerLinear;
+ platform_io.DrawCallback_SetSamplerNearest = ImGui_ImplDX11_DrawCallback_SetSamplerNearest;
// Get factory from device
IDXGIDevice* pDXGIDevice = nullptr;
diff --git a/include/imgui/backends/imgui_impl_dx11.h b/include/imgui/backends/imgui_impl_dx11.h
index bf27e42..c75652e 100644
--- a/include/imgui/backends/imgui_impl_dx11.h
+++ b/include/imgui/backends/imgui_impl_dx11.h
@@ -45,9 +45,9 @@ struct ImGui_ImplDX11_RenderState
{
ID3D11Device* Device;
ID3D11DeviceContext* DeviceContext;
- ID3D11SamplerState* SamplerLinear;
- ID3D11SamplerState* SamplerNearest;
ID3D11Buffer* VertexConstantBuffer;
+ //ID3D11SamplerState* SamplerLinear; // Use ImDrawList::AddCallback(ImGui::GetPlatform().DrawCallback_SetSamplerLinear)
+ //ID3D11SamplerState* SamplerNearest; // Use ImDrawList::AddCallback(ImGui::GetPlatform().DrawCallback_SetSamplerNearest)
};
#endif // #ifndef IMGUI_DISABLE
diff --git a/include/imgui/backends/imgui_impl_dx12.cpp b/include/imgui/backends/imgui_impl_dx12.cpp
index 976c937..1d3b062 100644
--- a/include/imgui/backends/imgui_impl_dx12.cpp
+++ b/include/imgui/backends/imgui_impl_dx12.cpp
@@ -23,6 +23,7 @@
// CHANGELOG
// (minor and older changes stripped away, please see git history for details)
// 2026-XX-XX: Platform: Added support for multiple windows via the ImGuiPlatformIO interface.
+// 2026-04-23: Added support for standard draw callbacks (in platform_io): DrawCallback_ResetRenderState, DrawCallback_SetSamplerLinear, DrawCallback_SetSamplerNearest. (#9378)
// 2025-10-23: [Docking] DirectX12: Fixed an issue in synchronization logic improving rendering throughput for secondary viewports. (#8961, #9025)
// 2025-10-11: DirectX12: Reuse texture upload buffer and grow it only when necessary. (#9002)
// 2025-09-29: DirectX12: Rework synchronization logic. (#8961)
@@ -95,6 +96,8 @@ struct ImGui_ImplDX12_Texture
struct ImGui_ImplDX12_Data
{
ImGui_ImplDX12_InitInfo InitInfo;
+ ImGui_ImplDX12_RenderState* RenderState;
+
IDXGIFactory5* pdxgiFactory;
ID3D12Device* pd3dDevice;
ID3D12RootSignature* pRootSignatureLinear;
@@ -217,19 +220,15 @@ struct VERTEX_CONSTANT_BUFFER_DX12
static void ImGui_ImplDX12_InitMultiViewportSupport();
static void ImGui_ImplDX12_ShutdownMultiViewportSupport();
-// FIXME-WIP: Allow user to forward declare those two, for until we come up with a backend agnostic API to do this. (#9173)
-void ImGui_ImplDX12_SetupSamplerLinear(ID3D12GraphicsCommandList* command_list);
-void ImGui_ImplDX12_SetupSamplerNearest(ID3D12GraphicsCommandList* command_list);
-
// Functions
-void ImGui_ImplDX12_SetupSamplerLinear(ID3D12GraphicsCommandList* command_list)
+static void ImGui_ImplDX12_SetupSamplerLinear(ID3D12GraphicsCommandList* command_list)
{
ImGui_ImplDX12_Data* bd = ImGui_ImplDX12_GetBackendData();
command_list->SetPipelineState(bd->pPipelineStateLinear);
command_list->SetGraphicsRootSignature(bd->pRootSignatureLinear);
}
-void ImGui_ImplDX12_SetupSamplerNearest(ID3D12GraphicsCommandList* command_list)
+static void ImGui_ImplDX12_SetupSamplerNearest(ID3D12GraphicsCommandList* command_list)
{
ImGui_ImplDX12_Data* bd = ImGui_ImplDX12_GetBackendData();
command_list->SetPipelineState(bd->pPipelineStateNearest);
@@ -275,7 +274,7 @@ static void ImGui_ImplDX12_SetupRenderState(ImDrawData* draw_data, ID3D12Graphic
command_list->IASetVertexBuffers(0, 1, &vbv);
D3D12_INDEX_BUFFER_VIEW ibv = {};
ibv.BufferLocation = fr->IndexBuffer->GetGPUVirtualAddress();
- ibv.SizeInBytes = fr->IndexBufferSize * sizeof(ImDrawIdx);
+ ibv.SizeInBytes = (UINT)fr->IndexBufferSize * sizeof(ImDrawIdx);
ibv.Format = sizeof(ImDrawIdx) == 2 ? DXGI_FORMAT_R16_UINT : DXGI_FORMAT_R32_UINT;
command_list->IASetIndexBuffer(&ibv);
command_list->IASetPrimitiveTopology(D3D_PRIMITIVE_TOPOLOGY_TRIANGLELIST);
@@ -283,7 +282,7 @@ static void ImGui_ImplDX12_SetupRenderState(ImDrawData* draw_data, ID3D12Graphic
command_list->SetGraphicsRoot32BitConstants(0, 16, &vertex_constant_buffer, 0);
// Setup blend factor
- const float blend_factor[4] = { 0.f, 0.f, 0.f, 0.f };
+ const float blend_factor[4] = { 0.0f, 0.0f, 0.0f, 0.0f };
command_list->OMSetBlendFactor(blend_factor);
}
@@ -295,6 +294,11 @@ static inline void SafeRelease(T*& res)
res = nullptr;
}
+// Draw callbacks
+static void ImGui_ImplDX12_DrawCallback_ResetRenderState(const ImDrawList*, const ImDrawCmd*) {} // Intentionally empty. Used as an identifier for rendering loop to call its code. Simpler to implement this way.
+static void ImGui_ImplDX12_DrawCallback_SetSamplerLinear(const ImDrawList*, const ImDrawCmd*) { ImGui_ImplDX12_Data* bd = ImGui_ImplDX12_GetBackendData(); ImGui_ImplDX12_SetupSamplerLinear(bd->RenderState->CommandList); }
+static void ImGui_ImplDX12_DrawCallback_SetSamplerNearest(const ImDrawList*, const ImDrawCmd*) { ImGui_ImplDX12_Data* bd = ImGui_ImplDX12_GetBackendData(); ImGui_ImplDX12_SetupSamplerNearest(bd->RenderState->CommandList); }
+
// Render function
void ImGui_ImplDX12_RenderDrawData(ImDrawData* draw_data, ID3D12GraphicsCommandList* command_list)
{
@@ -393,7 +397,7 @@ void ImGui_ImplDX12_RenderDrawData(ImDrawData* draw_data, ID3D12GraphicsCommandL
ImGui_ImplDX12_RenderState render_state;
render_state.Device = bd->pd3dDevice;
render_state.CommandList = command_list;
- platform_io.Renderer_RenderState = &render_state;
+ platform_io.Renderer_RenderState = bd->RenderState = &render_state;
// Render command lists
// (Because we merged all buffers into a single one, we maintain our own offset into them)
@@ -410,7 +414,7 @@ void ImGui_ImplDX12_RenderDrawData(ImDrawData* draw_data, ID3D12GraphicsCommandL
{
// User callback, registered via ImDrawList::AddCallback()
// (ImDrawCallback_ResetRenderState is a special callback value used by the user to request the renderer to reset render state.)
- if (pcmd->UserCallback == ImDrawCallback_ResetRenderState)
+ if (pcmd->UserCallback == ImGui_ImplDX12_DrawCallback_ResetRenderState)
ImGui_ImplDX12_SetupRenderState(draw_data, command_list, fr);
else
pcmd->UserCallback(draw_list, pcmd);
@@ -437,7 +441,7 @@ void ImGui_ImplDX12_RenderDrawData(ImDrawData* draw_data, ID3D12GraphicsCommandL
global_idx_offset += draw_list->IdxBuffer.Size;
global_vtx_offset += draw_list->VtxBuffer.Size;
}
- platform_io.Renderer_RenderState = nullptr;
+ platform_io.Renderer_RenderState = bd->RenderState = nullptr;
}
static void ImGui_ImplDX12_DestroyTexture(ImTextureData* tex)
@@ -686,11 +690,11 @@ bool ImGui_ImplDX12_CreateDeviceObjects()
staticSampler[0].AddressU = D3D12_TEXTURE_ADDRESS_MODE_CLAMP;
staticSampler[0].AddressV = D3D12_TEXTURE_ADDRESS_MODE_CLAMP;
staticSampler[0].AddressW = D3D12_TEXTURE_ADDRESS_MODE_CLAMP;
- staticSampler[0].MipLODBias = 0.f;
+ staticSampler[0].MipLODBias = 0.0f;
staticSampler[0].MaxAnisotropy = 0;
staticSampler[0].ComparisonFunc = D3D12_COMPARISON_FUNC_ALWAYS;
staticSampler[0].BorderColor = D3D12_STATIC_BORDER_COLOR_TRANSPARENT_BLACK;
- staticSampler[0].MinLOD = 0.f;
+ staticSampler[0].MinLOD = 0.0f;
staticSampler[0].MaxLOD = D3D12_FLOAT32_MAX;
staticSampler[0].ShaderRegister = 0;
staticSampler[0].RegisterSpace = 0;
@@ -740,7 +744,7 @@ bool ImGui_ImplDX12_CreateDeviceObjects()
bd->pd3dDevice->CreateRootSignature(0, blob->GetBufferPointer(), blob->GetBufferSize(), IID_PPV_ARGS(&bd->pRootSignatureLinear));
blob->Release();
- // Root Signature for ImDrawCallback_SetSamplerNearest
+ // Nearest sampler
staticSampler[0].Filter = D3D12_FILTER_MIN_MAG_MIP_POINT;
if (D3D12SerializeRootSignatureFn(&desc, D3D_ROOT_SIGNATURE_VERSION_1, &blob, nullptr) != S_OK)
return false;
@@ -793,7 +797,7 @@ bool ImGui_ImplDX12_CreateDeviceObjects()
PS_INPUT main(VS_INPUT input)\
{\
PS_INPUT output;\
- output.pos = mul( ProjectionMatrix, float4(input.pos.xy, 0.f, 1.f));\
+ output.pos = mul( ProjectionMatrix, float4(input.pos.xy, 0.0f, 1.0f));\
output.col = input.col;\
output.uv = input.uv;\
return output;\
@@ -889,7 +893,6 @@ bool ImGui_ImplDX12_CreateDeviceObjects()
return false;
}
- // Pipeline State for ImDrawCallback_SetSamplerNearest
psoDesc.pRootSignature = bd->pRootSignatureNearest;
result_pipeline_state = bd->pd3dDevice->CreateGraphicsPipelineState(&psoDesc, IID_PPV_ARGS(&bd->pPipelineStateNearest));
@@ -1012,6 +1015,11 @@ bool ImGui_ImplDX12_Init(ImGui_ImplDX12_InitInfo* init_info)
ImGuiViewport* main_viewport = ImGui::GetMainViewport();
main_viewport->RendererUserData = IM_NEW(ImGui_ImplDX12_ViewportData)(bd->numFramesInFlight);
+ ImGuiPlatformIO& platform_io = ImGui::GetPlatformIO();
+ platform_io.DrawCallback_ResetRenderState = ImGui_ImplDX12_DrawCallback_ResetRenderState;
+ platform_io.DrawCallback_SetSamplerLinear = ImGui_ImplDX12_DrawCallback_SetSamplerLinear;
+ platform_io.DrawCallback_SetSamplerNearest = ImGui_ImplDX12_DrawCallback_SetSamplerNearest;
+
#ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS
if (init_info->SrvDescriptorAllocFn == nullptr)
ImGui_ImplDX12_InitLegacySingleDescriptorMode(init_info);
@@ -1044,6 +1052,7 @@ bool ImGui_ImplDX12_Init(ID3D12Device* device, int num_frames_in_flight, DXGI_FO
bool ret = ImGui_ImplDX12_Init(&init_info);
ImGui_ImplDX12_Data* bd = ImGui_ImplDX12_GetBackendData();
bd->commandQueueOwned = true;
+
ImGuiIO& io = ImGui::GetIO();
io.BackendFlags &= ~ImGuiBackendFlags_RendererHasTextures; // Using legacy ImGui_ImplDX12_Init() call with 1 SRV descriptor we cannot support multiple textures.
diff --git a/include/imgui/backends/imgui_impl_dx9.cpp b/include/imgui/backends/imgui_impl_dx9.cpp
index 2362ed4..3eef0e3 100644
--- a/include/imgui/backends/imgui_impl_dx9.cpp
+++ b/include/imgui/backends/imgui_impl_dx9.cpp
@@ -19,6 +19,7 @@
// CHANGELOG
// (minor and older changes stripped away, please see git history for details)
// 2026-XX-XX: Platform: Added support for multiple windows via the ImGuiPlatformIO interface.
+// 2026-04-23: Added support for standard draw callbacks (in platform_io): DrawCallback_ResetRenderState, DrawCallback_SetSamplerLinear, DrawCallback_SetSamplerNearest. (#9378)
// 2026-03-19: Fixed issue in ImGui_ImplDX9_UpdateTexture() if ImTextureID_Invalid is defined to be != 0, which became the default since 2026-03-12. (#9295, #9310)
// 2025-09-18: Call platform_io.ClearRendererHandlers() on shutdown.
// 2025-06-11: DirectX9: Added support for ImGuiBackendFlags_RendererHasTextures, for dynamic font atlas.
@@ -170,6 +171,11 @@ static void ImGui_ImplDX9_SetupRenderState(ImDrawData* draw_data)
}
}
+// Draw callbacks
+static void ImGui_ImplDX9_DrawCallback_ResetRenderState(const ImDrawList*, const ImDrawCmd*) {} // Intentionally empty. Used as an identifier for rendering loop to call its code. Simpler to implement this way.
+static void ImGui_ImplDX9_DrawCallback_SetSamplerLinear(const ImDrawList*, const ImDrawCmd*) { ImGui_ImplDX9_Data* bd = ImGui_ImplDX9_GetBackendData(); bd->pd3dDevice->SetSamplerState(0, D3DSAMP_MINFILTER, D3DTEXF_LINEAR); bd->pd3dDevice->SetSamplerState(0, D3DSAMP_MAGFILTER, D3DTEXF_LINEAR); }
+static void ImGui_ImplDX9_DrawCallback_SetSamplerNearest(const ImDrawList*, const ImDrawCmd*) { ImGui_ImplDX9_Data* bd = ImGui_ImplDX9_GetBackendData(); bd->pd3dDevice->SetSamplerState(0, D3DSAMP_MINFILTER, D3DTEXF_POINT); bd->pd3dDevice->SetSamplerState(0, D3DSAMP_MAGFILTER, D3DTEXF_POINT); }
+
// Render function.
void ImGui_ImplDX9_RenderDrawData(ImDrawData* draw_data)
{
@@ -192,14 +198,14 @@ void ImGui_ImplDX9_RenderDrawData(ImDrawData* draw_data)
{
if (bd->pVB) { bd->pVB->Release(); bd->pVB = nullptr; }
bd->VertexBufferSize = draw_data->TotalVtxCount + 5000;
- if (device->CreateVertexBuffer(bd->VertexBufferSize * sizeof(CUSTOMVERTEX), D3DUSAGE_DYNAMIC | D3DUSAGE_WRITEONLY, D3DFVF_CUSTOMVERTEX, D3DPOOL_DEFAULT, &bd->pVB, nullptr) < 0)
+ if (device->CreateVertexBuffer((UINT)bd->VertexBufferSize * sizeof(CUSTOMVERTEX), D3DUSAGE_DYNAMIC | D3DUSAGE_WRITEONLY, D3DFVF_CUSTOMVERTEX, D3DPOOL_DEFAULT, &bd->pVB, nullptr) < 0)
return;
}
if (!bd->pIB || bd->IndexBufferSize < draw_data->TotalIdxCount)
{
if (bd->pIB) { bd->pIB->Release(); bd->pIB = nullptr; }
bd->IndexBufferSize = draw_data->TotalIdxCount + 10000;
- if (device->CreateIndexBuffer(bd->IndexBufferSize * sizeof(ImDrawIdx), D3DUSAGE_DYNAMIC | D3DUSAGE_WRITEONLY, sizeof(ImDrawIdx) == 2 ? D3DFMT_INDEX16 : D3DFMT_INDEX32, D3DPOOL_DEFAULT, &bd->pIB, nullptr) < 0)
+ if (device->CreateIndexBuffer((UINT)bd->IndexBufferSize * sizeof(ImDrawIdx), D3DUSAGE_DYNAMIC | D3DUSAGE_WRITEONLY, sizeof(ImDrawIdx) == 2 ? D3DFMT_INDEX16 : D3DFMT_INDEX32, D3DPOOL_DEFAULT, &bd->pIB, nullptr) < 0)
return;
}
@@ -277,8 +283,7 @@ void ImGui_ImplDX9_RenderDrawData(ImDrawData* draw_data)
if (pcmd->UserCallback != nullptr)
{
// User callback, registered via ImDrawList::AddCallback()
- // (ImDrawCallback_ResetRenderState is a special callback value used by the user to request the renderer to reset render state.)
- if (pcmd->UserCallback == ImDrawCallback_ResetRenderState)
+ if (pcmd->UserCallback == ImGui_ImplDX9_DrawCallback_ResetRenderState)
ImGui_ImplDX9_SetupRenderState(draw_data);
else
pcmd->UserCallback(draw_list, pcmd);
@@ -338,50 +343,6 @@ static bool ImGui_ImplDX9_CheckFormatSupport(LPDIRECT3DDEVICE9 pDevice, D3DFORMA
return support;
}
-bool ImGui_ImplDX9_Init(IDirect3DDevice9* device)
-{
- ImGuiIO& io = ImGui::GetIO();
- IMGUI_CHECKVERSION();
- IM_ASSERT(io.BackendRendererUserData == nullptr && "Already initialized a renderer backend!");
-
- // Setup backend capabilities flags
- ImGui_ImplDX9_Data* bd = IM_NEW(ImGui_ImplDX9_Data)();
- io.BackendRendererUserData = (void*)bd;
- io.BackendRendererName = "imgui_impl_dx9";
- io.BackendFlags |= ImGuiBackendFlags_RendererHasVtxOffset; // We can honor the ImDrawCmd::VtxOffset field, allowing for large meshes.
- io.BackendFlags |= ImGuiBackendFlags_RendererHasTextures; // We can honor ImGuiPlatformIO::Textures[] requests during render.
- io.BackendFlags |= ImGuiBackendFlags_RendererHasViewports; // We can create multi-viewports on the Renderer side (optional)
-
- ImGuiPlatformIO& platform_io = ImGui::GetPlatformIO();
- platform_io.Renderer_TextureMaxWidth = platform_io.Renderer_TextureMaxHeight = 4096;
-
- bd->pd3dDevice = device;
- bd->pd3dDevice->AddRef();
- bd->HasRgbaSupport = ImGui_ImplDX9_CheckFormatSupport(bd->pd3dDevice, D3DFMT_A8B8G8R8);
-
- ImGui_ImplDX9_InitMultiViewportSupport();
-
- return true;
-}
-
-void ImGui_ImplDX9_Shutdown()
-{
- ImGui_ImplDX9_Data* bd = ImGui_ImplDX9_GetBackendData();
- IM_ASSERT(bd != nullptr && "No renderer backend to shutdown, or already shutdown?");
- ImGuiIO& io = ImGui::GetIO();
- ImGuiPlatformIO& platform_io = ImGui::GetPlatformIO();
-
- ImGui_ImplDX9_ShutdownMultiViewportSupport();
- ImGui_ImplDX9_InvalidateDeviceObjects();
- if (bd->pd3dDevice) { bd->pd3dDevice->Release(); }
-
- io.BackendRendererName = nullptr;
- io.BackendRendererUserData = nullptr;
- io.BackendFlags &= ~(ImGuiBackendFlags_RendererHasVtxOffset | ImGuiBackendFlags_RendererHasTextures | ImGuiBackendFlags_RendererHasViewports);
- platform_io.ClearRendererHandlers();
- IM_DELETE(bd);
-}
-
// Convert RGBA32 to BGRA32 (because RGBA32 is not well supported by DX9 devices)
static void ImGui_ImplDX9_CopyTextureRegion(bool tex_use_colors, const ImU32* src, int src_pitch, ImU32* dst, int dst_pitch, int w, int h)
{
@@ -496,6 +457,53 @@ void ImGui_ImplDX9_NewFrame()
IM_UNUSED(bd);
}
+bool ImGui_ImplDX9_Init(IDirect3DDevice9* device)
+{
+ ImGuiIO& io = ImGui::GetIO();
+ IMGUI_CHECKVERSION();
+ IM_ASSERT(io.BackendRendererUserData == nullptr && "Already initialized a renderer backend!");
+
+ // Setup backend capabilities flags
+ ImGui_ImplDX9_Data* bd = IM_NEW(ImGui_ImplDX9_Data)();
+ io.BackendRendererUserData = (void*)bd;
+ io.BackendRendererName = "imgui_impl_dx9";
+ io.BackendFlags |= ImGuiBackendFlags_RendererHasVtxOffset; // We can honor the ImDrawCmd::VtxOffset field, allowing for large meshes.
+ io.BackendFlags |= ImGuiBackendFlags_RendererHasTextures; // We can honor ImGuiPlatformIO::Textures[] requests during render.
+ io.BackendFlags |= ImGuiBackendFlags_RendererHasViewports; // We can create multi-viewports on the Renderer side (optional)
+
+ ImGuiPlatformIO& platform_io = ImGui::GetPlatformIO();
+ platform_io.Renderer_TextureMaxWidth = platform_io.Renderer_TextureMaxHeight = 4096;
+ platform_io.DrawCallback_ResetRenderState = ImGui_ImplDX9_DrawCallback_ResetRenderState;
+ platform_io.DrawCallback_SetSamplerLinear = ImGui_ImplDX9_DrawCallback_SetSamplerLinear;
+ platform_io.DrawCallback_SetSamplerNearest = ImGui_ImplDX9_DrawCallback_SetSamplerNearest;
+
+ bd->pd3dDevice = device;
+ bd->pd3dDevice->AddRef();
+ bd->HasRgbaSupport = ImGui_ImplDX9_CheckFormatSupport(bd->pd3dDevice, D3DFMT_A8B8G8R8);
+
+ ImGui_ImplDX9_InitMultiViewportSupport();
+
+ return true;
+}
+
+void ImGui_ImplDX9_Shutdown()
+{
+ ImGui_ImplDX9_Data* bd = ImGui_ImplDX9_GetBackendData();
+ IM_ASSERT(bd != nullptr && "No renderer backend to shutdown, or already shutdown?");
+ ImGuiIO& io = ImGui::GetIO();
+ ImGuiPlatformIO& platform_io = ImGui::GetPlatformIO();
+
+ ImGui_ImplDX9_ShutdownMultiViewportSupport();
+ ImGui_ImplDX9_InvalidateDeviceObjects();
+ if (bd->pd3dDevice) { bd->pd3dDevice->Release(); }
+
+ io.BackendRendererName = nullptr;
+ io.BackendRendererUserData = nullptr;
+ io.BackendFlags &= ~(ImGuiBackendFlags_RendererHasVtxOffset | ImGuiBackendFlags_RendererHasTextures | ImGuiBackendFlags_RendererHasViewports);
+ platform_io.ClearRendererHandlers();
+ IM_DELETE(bd);
+}
+
//--------------------------------------------------------------------------------------------------------
// MULTI-VIEWPORT / PLATFORM INTERFACE SUPPORT
// This is an _advanced_ and _optional_ feature, allowing the backend to create and handle multiple viewports simultaneously.
diff --git a/include/imgui/backends/imgui_impl_glfw.cpp b/include/imgui/backends/imgui_impl_glfw.cpp
index 6376c0d..b5347cd 100644
--- a/include/imgui/backends/imgui_impl_glfw.cpp
+++ b/include/imgui/backends/imgui_impl_glfw.cpp
@@ -32,6 +32,7 @@
// CHANGELOG
// (minor and older changes stripped away, please see git history for details)
// 2026-XX-XX: Platform: Added support for multiple windows via the ImGuiPlatformIO interface.
+// 2026-04-21: Added a Win32-specific implementation of ImGui_ImplGlfw_GetContentScaleXXXX functions for legacy GLFW 3.2.
// 2026-03-25: Mouse cursor is properly restored if changed by user app/code while using glfwSetInputMode(..., GLFW_CURSOR_DISABLED) or ImGuiConfigFlags_NoMouseCursorChange. Amend change from 2025-12-10.
// 2026-02-10: Try to set IMGUI_IMPL_GLFW_DISABLE_X11 / IMGUI_IMPL_GLFW_DISABLE_WAYLAND automatically if corresponding headers are not accessible. (#9225)
// 2026-01-25: [Docking] Improve workarounds for cases where GLFW is unable to provide any reliable monitor info. Preserve existing monitor list when none of the new one is valid. (#9195, #7902, #5683)
@@ -255,7 +256,7 @@ struct ImGui_ImplGlfw_Data
bool IsWayland;
bool InstalledCallbacks;
bool CallbacksChainForAllWindows;
- char BackendPlatformName[32];
+ char BackendPlatformName[40];
#ifdef EMSCRIPTEN_USE_EMBEDDED_GLFW3
const char* CanvasSelector;
#endif
@@ -722,7 +723,13 @@ static bool ImGui_ImplGlfw_Init(GLFWwindow* window, bool install_callbacks, Glfw
// Setup backend capabilities flags
ImGui_ImplGlfw_Data* bd = IM_NEW(ImGui_ImplGlfw_Data)();
- snprintf(bd->BackendPlatformName, sizeof(bd->BackendPlatformName), "imgui_impl_glfw (%d)", GLFW_VERSION_COMBINED);
+ bd->Context = ImGui::GetCurrentContext();
+ bd->Window = window;
+ bd->Time = 0.0;
+ bd->IsWayland = ImGui_ImplGlfw_IsWayland();
+ ImGui_ImplGlfw_ContextMap_Add(window, bd->Context);
+
+ snprintf(bd->BackendPlatformName, sizeof(bd->BackendPlatformName), "imgui_impl_glfw (%d)%s", GLFW_VERSION_COMBINED, bd->IsWayland ? " (Wayland)" : "");
io.BackendPlatformUserData = (void*)bd;
io.BackendPlatformName = bd->BackendPlatformName;
#if GLFW_HAS_CREATECURSOR
@@ -744,12 +751,6 @@ static bool ImGui_ImplGlfw_Init(GLFWwindow* window, bool install_callbacks, Glfw
io.BackendFlags |= ImGuiBackendFlags_HasMouseHoveredViewport; // We can call io.AddMouseViewportEvent() with correct data (optional)
#endif
- bd->Context = ImGui::GetCurrentContext();
- bd->Window = window;
- bd->Time = 0.0;
- bd->IsWayland = ImGui_ImplGlfw_IsWayland();
- ImGui_ImplGlfw_ContextMap_Add(window, bd->Context);
-
ImGuiPlatformIO& platform_io = ImGui::GetPlatformIO();
#if GLFW_VERSION_COMBINED < 3300
platform_io.Platform_SetClipboardTextFn = [](ImGuiContext*, const char* text) { glfwSetClipboardString(ImGui_ImplGlfw_GetBackendData()->Window, text); };
@@ -1126,6 +1127,16 @@ static void ImGui_ImplGlfw_UpdateMonitors()
}
}
+// For GFLW 3.2 + Windows: include a simplified non-monitor aware version of ImGui_ImplWin32_GetDpiScaleForMonitor().
+// This is merely a band-aid to make using GLFW 3.2 a little bit nicer, but prefer to use GLFW 3.3+ or the full correct functions from the Win32 backend.
+#if !GLFW_HAS_PER_MONITOR_DPI && defined(_WIN32) && !defined(NOGDI)
+static float ImGui_ImplWin32_GetLegacyDpiScale() { const HDC dc = ::GetDC(nullptr); UINT xdpi = ::GetDeviceCaps(dc, LOGPIXELSX); ::ReleaseDC(nullptr, dc); return (float)xdpi / 96.0f; }
+static void glfwGetWindowContentScale(GLFWwindow*, float* x_scale, float* y_scale) { *x_scale = *y_scale = ImGui_ImplWin32_GetLegacyDpiScale(); }
+static void glfwGetMonitorContentScale(GLFWmonitor*, float* x_scale, float* y_scale) { *x_scale = *y_scale = ImGui_ImplWin32_GetLegacyDpiScale(); }
+#undef GLFW_HAS_PER_MONITOR_DPI
+#define GLFW_HAS_PER_MONITOR_DPI 1
+#endif
+
// - On Windows the process needs to be marked DPI-aware!! SDL2 doesn't do it by default. You can call ::SetProcessDPIAware() or call ImGui_ImplWin32_EnableDpiAwareness() from Win32 backend.
// - Apple platforms use FramebufferScale so we always return 1.0f.
// - Some accessibility applications are declaring virtual monitors with a DPI of 0.0f, see #7902. We preserve this value for caller to handle.
@@ -1195,7 +1206,7 @@ void ImGui_ImplGlfw_NewFrame()
// (Accept glfwGetTime() not returning a monotonically increasing value. Seems to happens on disconnecting peripherals and probably on VMs and Emscripten, see #6491, #6189, #6114, #3644)
double current_time = glfwGetTime();
if (current_time <= bd->Time)
- current_time = bd->Time + 0.00001f;
+ current_time = bd->Time + 0.00001;
io.DeltaTime = bd->Time > 0.0 ? (float)(current_time - bd->Time) : (float)(1.0f / 60.0f);
bd->Time = current_time;
diff --git a/include/imgui/backends/imgui_impl_metal.mm b/include/imgui/backends/imgui_impl_metal.mm
index bc67626..62afb25 100644
--- a/include/imgui/backends/imgui_impl_metal.mm
+++ b/include/imgui/backends/imgui_impl_metal.mm
@@ -18,6 +18,10 @@
// CHANGELOG
// (minor and older changes stripped away, please see git history for details)
// 2026-XX-XX: Metal: Added support for multiple windows via the ImGuiPlatformIO interface.
+// 2026-04-28: Added support for standard draw callbacks (in platform_io): DrawCallback_SetSamplerLinear and DrawCallback_SetSamplerNearest. (#9378, #9381)
+// 2026-04-23: Added support for standard draw callbacks (in platform_io): DrawCallback_ResetRenderState (others are not yet supported). (#9378)
+// 2026-04-14: Metal: use a dedicated bufferCacheLock to avoid crashing when bufferCache is replaced by a new object while being used for @synchronize(). (#9367)
+// 2026-04-03: Metal: avoid redundant vertex buffer bind in SetupRenderState. (#9343)
// 2026-03-19: Fixed issue in ImGui_ImplMetal_RenderDrawData() if ImTextureID_Invalid is defined to be != 0, which became the default since 2026-03-12. (#9295, #9310)
// 2025-09-18: Call platform_io.ClearRendererHandlers() on shutdown.
// 2025-06-11: Added support for ImGuiBackendFlags_RendererHasTextures, for dynamic font atlas. Removed ImGui_ImplMetal_CreateFontsTexture() and ImGui_ImplMetal_DestroyFontsTexture().
@@ -82,9 +86,12 @@ - (instancetype)initWithTexture:(id)metalTexture;
@interface MetalContext : NSObject
@property (nonatomic, strong) id device;
@property (nonatomic, strong) id depthStencilState;
+@property (nonatomic, strong) id samplerStateLinear;
+@property (nonatomic, strong) id samplerStateNearest;
@property (nonatomic, strong) FramebufferDescriptor* framebufferDescriptor; // framebuffer descriptor for current frame; transient
@property (nonatomic, strong) NSMutableDictionary* renderPipelineStateCache; // pipeline cache; keyed on framebuffer descriptors
@property (nonatomic, strong) NSMutableArray* bufferCache;
+@property (nonatomic, strong) NSObject* bufferCacheLock;
@property (nonatomic, assign) double lastBufferCachePurge;
- (MetalBuffer*)dequeueReusableBufferOfLength:(NSUInteger)length device:(id)device;
- (id)renderPipelineStateForFramebufferDescriptor:(FramebufferDescriptor*)descriptor device:(id)device;
@@ -93,6 +100,7 @@ - (MetalBuffer*)dequeueReusableBufferOfLength:(NSUInteger)length device:(id RenderCommandEncoder;
ImGui_ImplMetal_Data() { memset((void*)this, 0, sizeof(*this)); }
};
@@ -123,7 +131,6 @@ void ImGui_ImplMetal_RenderDrawData(ImDrawData* draw_data,
ImGui_ImplMetal_RenderDrawData(draw_data,
(__bridge id)(commandBuffer),
(__bridge id)(commandEncoder));
-
}
bool ImGui_ImplMetal_CreateDeviceObjects(MTL::Device* device)
@@ -135,45 +142,6 @@ bool ImGui_ImplMetal_CreateDeviceObjects(MTL::Device* device)
#pragma mark - Dear ImGui Metal Backend API
-bool ImGui_ImplMetal_Init(id device)
-{
- ImGuiIO& io = ImGui::GetIO();
- IMGUI_CHECKVERSION();
- IM_ASSERT(io.BackendRendererUserData == nullptr && "Already initialized a renderer backend!");
-
- ImGui_ImplMetal_Data* bd = IM_NEW(ImGui_ImplMetal_Data)();
- io.BackendRendererUserData = (void*)bd;
- io.BackendRendererName = "imgui_impl_metal";
- io.BackendFlags |= ImGuiBackendFlags_RendererHasVtxOffset; // We can honor the ImDrawCmd::VtxOffset field, allowing for large meshes.
- io.BackendFlags |= ImGuiBackendFlags_RendererHasTextures; // We can honor ImGuiPlatformIO::Textures[] requests during render.
- io.BackendFlags |= ImGuiBackendFlags_RendererHasViewports; // We can create multi-viewports on the Renderer side (optional)
-
- bd->SharedMetalContext = [[MetalContext alloc] init];
- bd->SharedMetalContext.device = device;
-
- ImGui_ImplMetal_InitMultiViewportSupport();
-
- return true;
-}
-
-void ImGui_ImplMetal_Shutdown()
-{
- ImGui_ImplMetal_Data* bd = ImGui_ImplMetal_GetBackendData();
- IM_UNUSED(bd);
- IM_ASSERT(bd != nullptr && "No renderer backend to shutdown, or already shutdown?");
- ImGuiIO& io = ImGui::GetIO();
- ImGuiPlatformIO& platform_io = ImGui::GetPlatformIO();
-
- ImGui_ImplMetal_ShutdownMultiViewportSupport();
- ImGui_ImplMetal_DestroyDeviceObjects();
- ImGui_ImplMetal_DestroyBackendData();
-
- io.BackendRendererName = nullptr;
- io.BackendRendererUserData = nullptr;
- io.BackendFlags &= ~(ImGuiBackendFlags_RendererHasVtxOffset | ImGuiBackendFlags_RendererHasTextures | ImGuiBackendFlags_RendererHasViewports);
- platform_io.ClearRendererHandlers();
-}
-
void ImGui_ImplMetal_NewFrame(MTLRenderPassDescriptor* renderPassDescriptor)
{
ImGui_ImplMetal_Data* bd = ImGui_ImplMetal_GetBackendData();
@@ -226,11 +194,16 @@ static void ImGui_ImplMetal_SetupRenderState(ImDrawData* draw_data, idSharedMetalContext.samplerStateLinear atIndex:0];
- [commandEncoder setVertexBuffer:vertexBuffer.buffer offset:0 atIndex:0];
- [commandEncoder setVertexBufferOffset:vertexBufferOffset atIndex:0];
+ [commandEncoder setVertexBuffer:vertexBuffer.buffer offset:vertexBufferOffset atIndex:0];
}
+// Draw callbacks
+static void ImGui_ImplMetal_DrawCallback_ResetRenderState(const ImDrawList*, const ImDrawCmd*) {} // Intentionally empty. Used as an identifier for rendering loop to call its code. Simpler to implement this way.
+static void ImGui_ImplMetal_DrawCallback_SetSamplerLinear(const ImDrawList*, const ImDrawCmd*) { ImGui_ImplMetal_Data* bd = ImGui_ImplMetal_GetBackendData(); [bd->RenderCommandEncoder setFragmentSamplerState:bd->SharedMetalContext.samplerStateLinear atIndex:0]; }
+static void ImGui_ImplMetal_DrawCallback_SetSamplerNearest(const ImDrawList*, const ImDrawCmd*) { ImGui_ImplMetal_Data* bd = ImGui_ImplMetal_GetBackendData(); [bd->RenderCommandEncoder setFragmentSamplerState:bd->SharedMetalContext.samplerStateNearest atIndex:0]; }
+
// Metal Render function.
void ImGui_ImplMetal_RenderDrawData(ImDrawData* draw_data, id commandBuffer, id commandEncoder)
{
@@ -267,6 +240,7 @@ void ImGui_ImplMetal_RenderDrawData(ImDrawData* draw_data, id
MetalBuffer* vertexBuffer = [ctx dequeueReusableBufferOfLength:vertexBufferLength device:commandBuffer.device];
MetalBuffer* indexBuffer = [ctx dequeueReusableBufferOfLength:indexBufferLength device:commandBuffer.device];
+ bd->RenderCommandEncoder = commandEncoder;
ImGui_ImplMetal_SetupRenderState(draw_data, commandBuffer, commandEncoder, renderPipelineState, vertexBuffer, 0);
// Will project scissor/clipping rectangles into framebuffer space
@@ -287,8 +261,7 @@ void ImGui_ImplMetal_RenderDrawData(ImDrawData* draw_data, id
if (pcmd->UserCallback)
{
// User callback, registered via ImDrawList::AddCallback()
- // (ImDrawCallback_ResetRenderState is a special callback value used by the user to request the renderer to reset render state.)
- if (pcmd->UserCallback == ImDrawCallback_ResetRenderState)
+ if (pcmd->UserCallback == ImGui_ImplMetal_DrawCallback_ResetRenderState)
ImGui_ImplMetal_SetupRenderState(draw_data, commandBuffer, commandEncoder, renderPipelineState, vertexBuffer, vertexBufferOffset);
else
pcmd->UserCallback(draw_list, pcmd);
@@ -302,8 +275,8 @@ void ImGui_ImplMetal_RenderDrawData(ImDrawData* draw_data, id
// Clamp to viewport as setScissorRect() won't accept values that are off bounds
if (clip_min.x < 0.0f) { clip_min.x = 0.0f; }
if (clip_min.y < 0.0f) { clip_min.y = 0.0f; }
- if (clip_max.x > fb_width) { clip_max.x = (float)fb_width; }
- if (clip_max.y > fb_height) { clip_max.y = (float)fb_height; }
+ if (clip_max.x > (float)fb_width) { clip_max.x = (float)fb_width; }
+ if (clip_max.y > (float)fb_height) { clip_max.y = (float)fb_height; }
if (clip_max.x <= clip_min.x || clip_max.y <= clip_min.y)
continue;
if (pcmd->ElemCount == 0) // drawIndexedPrimitives() validation doesn't accept this
@@ -340,14 +313,13 @@ void ImGui_ImplMetal_RenderDrawData(ImDrawData* draw_data, id
MetalContext* sharedMetalContext = bd->SharedMetalContext;
[commandBuffer addCompletedHandler:^(id)
{
- dispatch_async(dispatch_get_main_queue(), ^{
- @synchronized(sharedMetalContext.bufferCache)
- {
- [sharedMetalContext.bufferCache addObject:vertexBuffer];
- [sharedMetalContext.bufferCache addObject:indexBuffer];
- }
- });
+ @synchronized(sharedMetalContext.bufferCacheLock)
+ {
+ [sharedMetalContext.bufferCache addObject:vertexBuffer];
+ [sharedMetalContext.bufferCache addObject:indexBuffer];
+ }
}];
+ bd->RenderCommandEncoder = nil;
}
static void ImGui_ImplMetal_DestroyTexture(ImTextureData* tex)
@@ -424,8 +396,19 @@ bool ImGui_ImplMetal_CreateDeviceObjects(id device)
depthStencilDescriptor.depthWriteEnabled = NO;
depthStencilDescriptor.depthCompareFunction = MTLCompareFunctionAlways;
bd->SharedMetalContext.depthStencilState = [device newDepthStencilStateWithDescriptor:depthStencilDescriptor];
+ MTLSamplerDescriptor* samplerDescriptor = [[MTLSamplerDescriptor alloc] init];
+ samplerDescriptor.minFilter = MTLSamplerMinMagFilterLinear;
+ samplerDescriptor.magFilter = MTLSamplerMinMagFilterLinear;
+ samplerDescriptor.mipFilter = MTLSamplerMipFilterLinear;
+ bd->SharedMetalContext.samplerStateLinear = [device newSamplerStateWithDescriptor:samplerDescriptor];
+ samplerDescriptor.minFilter = MTLSamplerMinMagFilterNearest;
+ samplerDescriptor.magFilter = MTLSamplerMinMagFilterNearest;
+ samplerDescriptor.mipFilter = MTLSamplerMipFilterNearest;
+ bd->SharedMetalContext.samplerStateNearest = [device newSamplerStateWithDescriptor:samplerDescriptor];
+
ImGui_ImplMetal_CreateDeviceObjectsForPlatformWindows();
#ifdef IMGUI_IMPL_METAL_CPP
+ [samplerDescriptor release];
[depthStencilDescriptor release];
#endif
@@ -443,6 +426,52 @@ void ImGui_ImplMetal_DestroyDeviceObjects()
ImGui_ImplMetal_InvalidateDeviceObjectsForPlatformWindows();
[bd->SharedMetalContext.renderPipelineStateCache removeAllObjects];
+ bd->SharedMetalContext.samplerStateLinear = nil;
+ bd->SharedMetalContext.samplerStateNearest = nil;
+}
+
+bool ImGui_ImplMetal_Init(id device)
+{
+ ImGuiIO& io = ImGui::GetIO();
+ IMGUI_CHECKVERSION();
+ IM_ASSERT(io.BackendRendererUserData == nullptr && "Already initialized a renderer backend!");
+
+ ImGui_ImplMetal_Data* bd = IM_NEW(ImGui_ImplMetal_Data)();
+ io.BackendRendererUserData = (void*)bd;
+ io.BackendRendererName = "imgui_impl_metal";
+ io.BackendFlags |= ImGuiBackendFlags_RendererHasVtxOffset; // We can honor the ImDrawCmd::VtxOffset field, allowing for large meshes.
+ io.BackendFlags |= ImGuiBackendFlags_RendererHasTextures; // We can honor ImGuiPlatformIO::Textures[] requests during render.
+ io.BackendFlags |= ImGuiBackendFlags_RendererHasViewports; // We can create multi-viewports on the Renderer side (optional)
+
+ ImGuiPlatformIO& platform_io = ImGui::GetPlatformIO();
+ platform_io.DrawCallback_ResetRenderState = ImGui_ImplMetal_DrawCallback_ResetRenderState;
+ platform_io.DrawCallback_SetSamplerLinear = ImGui_ImplMetal_DrawCallback_SetSamplerLinear;
+ platform_io.DrawCallback_SetSamplerNearest = ImGui_ImplMetal_DrawCallback_SetSamplerNearest;
+
+ bd->SharedMetalContext = [[MetalContext alloc] init];
+ bd->SharedMetalContext.device = device;
+
+ ImGui_ImplMetal_InitMultiViewportSupport();
+
+ return true;
+}
+
+void ImGui_ImplMetal_Shutdown()
+{
+ ImGui_ImplMetal_Data* bd = ImGui_ImplMetal_GetBackendData();
+ IM_UNUSED(bd);
+ IM_ASSERT(bd != nullptr && "No renderer backend to shutdown, or already shutdown?");
+ ImGuiIO& io = ImGui::GetIO();
+ ImGuiPlatformIO& platform_io = ImGui::GetPlatformIO();
+
+ ImGui_ImplMetal_ShutdownMultiViewportSupport();
+ ImGui_ImplMetal_DestroyDeviceObjects();
+ ImGui_ImplMetal_DestroyBackendData();
+
+ io.BackendRendererName = nullptr;
+ io.BackendRendererUserData = nullptr;
+ io.BackendFlags &= ~(ImGuiBackendFlags_RendererHasVtxOffset | ImGuiBackendFlags_RendererHasTextures | ImGuiBackendFlags_RendererHasViewports);
+ platform_io.ClearRendererHandlers();
}
#pragma mark - Multi-viewport support
@@ -672,6 +701,7 @@ - (instancetype)init
{
self.renderPipelineStateCache = [NSMutableDictionary dictionary];
self.bufferCache = [NSMutableArray array];
+ self.bufferCacheLock = [[NSObject alloc] init];
_lastBufferCachePurge = GetMachAbsoluteTimeInSeconds();
}
return self;
@@ -679,9 +709,9 @@ - (instancetype)init
- (MetalBuffer*)dequeueReusableBufferOfLength:(NSUInteger)length device:(id)device
{
- uint64_t now = GetMachAbsoluteTimeInSeconds();
+ double now = GetMachAbsoluteTimeInSeconds();
- @synchronized(self.bufferCache)
+ @synchronized(self.bufferCacheLock)
{
// Purge old buffers that haven't been useful for a while
if (now - self.lastBufferCachePurge > 1.0)
@@ -748,9 +778,9 @@ - (MetalBuffer*)dequeueReusableBufferOfLength:(NSUInteger)length device:(id texture [[texture(0)]]) {\n"
- " constexpr sampler linearSampler(coord::normalized, min_filter::linear, mag_filter::linear, mip_filter::linear);\n"
- " half4 texColor = texture.sample(linearSampler, in.texCoords);\n"
+ " texture2d texture [[texture(0)]],\n"
+ " sampler textureSampler [[sampler(0)]]) {\n"
+ " half4 texColor = texture.sample(textureSampler, in.texCoords);\n"
" return half4(in.color) * texColor;\n"
"}\n";
diff --git a/include/imgui/backends/imgui_impl_metal4.h b/include/imgui/backends/imgui_impl_metal4.h
new file mode 100644
index 0000000..61f797f
--- /dev/null
+++ b/include/imgui/backends/imgui_impl_metal4.h
@@ -0,0 +1,90 @@
+// dear imgui: Renderer Backend for Metal 4
+// This needs to be used along with a Platform Backend (e.g. OSX)
+// Metal 4 requires Apple Silicon and macOS 26+.
+
+// Implemented features:
+// [X] Renderer: User texture binding. Use 'MTLTexture.gpuResourceID' as texture identifier. Read the FAQ about ImTextureID/ImTextureRef!
+// [X] Renderer: Large meshes support (64k+ vertices) even with 16-bit indices (ImGuiBackendFlags_RendererHasVtxOffset).
+// [X] Renderer: Texture updates support for dynamic font atlas (ImGuiBackendFlags_RendererHasTextures).
+// [X] Renderer: Multi-viewport support (multiple windows).
+// Missing features or Issues:
+// [ ] Texture view pool support? Reevaluate which type to use for ImtextureID.
+
+// You can use unmodified imgui_impl_* files in your project. See examples/ folder for examples of using this.
+// Prefer including the entire imgui/ repository into your project (either as a copy or as a submodule), and only build the backends you need.
+// Learn about Dear ImGui:
+// - FAQ https://dearimgui.com/faq
+// - Getting Started https://dearimgui.com/getting-started
+// - Documentation https://dearimgui.com/docs (same as your local docs/ folder).
+// - Introduction, links and more at the top of imgui.cpp
+
+#pragma once
+#include "imgui.h" // IMGUI_IMPL_API
+#ifndef IMGUI_DISABLE
+
+//-----------------------------------------------------------------------------
+// ObjC API
+//-----------------------------------------------------------------------------
+
+#ifdef __OBJC__
+
+@class MTL4RenderPassDescriptor;
+@protocol MTLDevice, MTL4CommandBuffer, MTL4RenderCommandEncoder, MTL4CommandQueue;
+
+// framesInFlight must match the number of frames your application keeps in flight (e.g. the size of your own
+// command buffer/allocator ring). The backend uses it to size its own per-frame-in-flight resources (constant
+// buffer, vertex/index buffer cache) so the CPU never overwrites a slot the GPU may still be reading.
+// Follow "Getting Started" link and check examples/ folder to learn about using backends!
+IMGUI_IMPL_API bool ImGui_ImplMetal4_Init(id device, id commandQueue, int framesInFlight);
+IMGUI_IMPL_API void ImGui_ImplMetal4_Shutdown();
+// frameInFlightIndex must match the slot you use to index your own per-frame-in-flight resources
+// (e.g. the same index used to pick your command buffer/allocator), and must be < framesInFlight passed to Init().
+IMGUI_IMPL_API void ImGui_ImplMetal4_NewFrame(MTL4RenderPassDescriptor* renderPassDescriptor, int frameInFlightIndex);
+IMGUI_IMPL_API void ImGui_ImplMetal4_RenderDrawData(ImDrawData* drawData,
+ id commandBuffer,
+ id commandEncoder);
+
+// Called by Init/NewFrame/Shutdown
+IMGUI_IMPL_API bool ImGui_ImplMetal4_CreateDeviceObjects(id device);
+IMGUI_IMPL_API void ImGui_ImplMetal4_DestroyDeviceObjects();
+
+// (Advanced) Use e.g. if you need to precisely control the timing of texture updates (e.g. for staged rendering), by setting ImDrawData::Textures = nullptr to handle this manually.
+IMGUI_IMPL_API void ImGui_ImplMetal4_UpdateTexture(ImTextureData* tex);
+
+#endif
+
+//-----------------------------------------------------------------------------
+// C++ API
+//-----------------------------------------------------------------------------
+
+// Enable Metal C++ binding support with '#define IMGUI_IMPL_METAL_CPP' in your imconfig.h file
+// More info about using Metal from C++: https://developer.apple.com/metal/cpp/
+
+#ifdef IMGUI_IMPL_METAL_CPP
+#ifndef __OBJC__
+
+// Forward declare relevant classes from the MTL and MTL4 namespace
+namespace MTL { class Device; }
+namespace MTL4 { class CommandQueue; class CommandBuffer; class RenderPassDescriptor; class RenderCommandEncoder; }
+
+// Follow "Getting Started" link and check examples/ folder to learn about using backends!
+IMGUI_IMPL_API bool ImGui_ImplMetal4_Init(MTL::Device* device, MTL4::CommandQueue* commandQueue, int framesInFlight);
+IMGUI_IMPL_API void ImGui_ImplMetal4_Shutdown();
+IMGUI_IMPL_API void ImGui_ImplMetal4_NewFrame(MTL4::RenderPassDescriptor* renderPassDescriptor, int frameInFlightIndex);
+IMGUI_IMPL_API void ImGui_ImplMetal4_RenderDrawData(ImDrawData* draw_data,
+ MTL4::CommandBuffer* commandBuffer,
+ MTL4::RenderCommandEncoder* commandEncoder);
+
+// Called by Init/NewFrame/Shutdown
+IMGUI_IMPL_API bool ImGui_ImplMetal4_CreateDeviceObjects(MTL::Device* device);
+IMGUI_IMPL_API void ImGui_ImplMetal4_DestroyDeviceObjects();
+
+// (Advanced) Use e.g. if you need to precisely control the timing of texture updates (e.g. for staged rendering), by setting ImDrawData::Textures = nullptr to handle this manually.
+IMGUI_IMPL_API void ImGui_ImplMetal4_UpdateTexture(ImTextureData* tex);
+
+#endif
+#endif
+
+//-----------------------------------------------------------------------------
+
+#endif // #ifndef IMGUI_DISABLE
diff --git a/include/imgui/backends/imgui_impl_metal4.mm b/include/imgui/backends/imgui_impl_metal4.mm
new file mode 100644
index 0000000..092be12
--- /dev/null
+++ b/include/imgui/backends/imgui_impl_metal4.mm
@@ -0,0 +1,937 @@
+// dear imgui: Renderer Backend for Metal 4
+// This needs to be used along with a Platform Backend (e.g. OSX)
+// Metal 4 requires Apple Silicon and macOS 26+.
+
+// Implemented features:
+// [X] Renderer: User texture binding. Use 'MTLTexture' as texture identifier. Read the FAQ about ImTextureID/ImTextureRef!
+// [X] Renderer: Large meshes support (64k+ vertices) even with 16-bit indices (ImGuiBackendFlags_RendererHasVtxOffset).
+// [X] Renderer: Texture updates support for dynamic font atlas (ImGuiBackendFlags_RendererHasTextures).
+// [X] Renderer: Multi-viewport support (multiple windows).
+
+// Missing features or Issues:
+// [ ] Texture view pool support? Reevaluate which type to use for ImtextureID.
+
+// You can use unmodified imgui_impl_* files in your project. See examples/ folder for examples of using this.
+// Prefer including the entire imgui/ repository into your project (either as a copy or as a submodule), and only build the backends you need.
+// Learn about Dear ImGui:
+// - FAQ https://dearimgui.com/faq
+// - Getting Started https://dearimgui.com/getting-started
+// - Documentation https://dearimgui.com/docs (same as your local docs/ folder).
+// - Introduction, links and more at the top of imgui.cpp
+
+// CHANGELOG
+// (minor and older changes stripped away, please see git history for details)
+// 2026-07-07: Metal 4: Added metal-cpp support. (#9461)
+// 2026-07-02: Metal 4: Added new Metal 4 backend implementation. (#9458)
+
+#include "imgui.h"
+#ifndef IMGUI_DISABLE
+#include "imgui_impl_metal4.h"
+#import
+#import
+
+#ifdef IMGUI_IMPL_METAL_CPP
+#include
+#endif
+
+// Forward Declarations
+static void ImGui_ImplMetal_InitMultiViewportSupport();
+static void ImGui_ImplMetal_ShutdownMultiViewportSupport();
+static void ImGui_ImplMetal_CreateDeviceObjectsForPlatformWindows();
+static void ImGui_ImplMetal_InvalidateDeviceObjectsForPlatformWindows();
+
+#pragma mark - Support classes and structs
+
+#define METAL_IMGUI_VIEWPORTS_PER_CHUNK 64
+
+struct ImGui_Metal4_ConstantData
+{
+ // 1 projection matrix is encoded as 4x4 float.
+ // Store up to 64 of them in same constant buffer, so multiple viewports can use same constant buffer.
+ float ModelViewProjectionMatrix[METAL_IMGUI_VIEWPORTS_PER_CHUNK][4][4];
+};
+
+@interface MetalBuffer : NSObject
+@property (nonatomic, strong) id buffer;
+@property (nonatomic, assign) double lastReuseTime;
+- (instancetype)initWithBuffer:(id)buffer;
+@end
+
+// An object that encapsulates the data necessary to uniquely identify a
+// render pipeline state. These are used as cache keys.
+@interface FramebufferDescriptor : NSObject
+@property (nonatomic, assign) unsigned long sampleCount;
+@property (nonatomic, assign) MTLPixelFormat colorPixelFormat;
+@property (nonatomic, assign) MTLPixelFormat depthPixelFormat;
+@property (nonatomic, assign) MTLPixelFormat stencilPixelFormat;
+- (instancetype)initWithRenderPassDescriptor:(MTL4RenderPassDescriptor*)renderPassDescriptor;
+@end
+
+@interface MetalTexture : NSObject
+@property (nonatomic, strong) id metalTexture;
+- (instancetype)initWithTexture:(id)metalTexture;
+@end
+
+// A singleton that stores long-lived objects that are needed by the Metal
+// renderer backend. Stores the render pipeline state cache and the default
+// font texture, and manages the reusable buffer cache.
+@interface MetalContext : NSObject
+@property (nonatomic, strong) id device;
+@property (nonatomic, strong) id commandQueue;
+@property (nonatomic, strong) id depthStencilState;
+@property (nonatomic, strong) id argumentTable;
+@property (nonatomic, strong) id samplerStateLinear;
+@property (nonatomic, strong) id samplerStateNearest;
+@property (nonatomic, strong) id residencySet;
+@property (nonatomic, strong) FramebufferDescriptor* framebufferDescriptor;
+@property (nonatomic, strong) NSMutableDictionary* renderPipelineStateCache;
+@property (nonatomic, assign) NSUInteger framesInFlight;
+@property (nonatomic, assign) NSUInteger currentFrameSlot;
+@property (nonatomic, strong) NSMutableArray*>* bufferCaches;
+@property (nonatomic, strong) NSObject* bufferCacheLock;
+@property (nonatomic, assign) double lastBufferCachePurge;
+@property (nonatomic, strong) NSArray>* events; // for tracking when a commands are complete to reset allocator
+@property (nonatomic) uint64_t eventValue;
+@property (nonatomic, strong) NSArray>* commandAllocators;
+@property (nonatomic, strong) NSMutableArray>*>* constantBuffers;
+@property (nonatomic) uint64_t constantBufferChunkCount;
+@property (nonatomic) uint64_t currentConstantBufferIndex;
+- (MetalBuffer*)dequeueReusableBufferOfLength:(NSUInteger)length device:(id)device;
+- (id)renderPipelineStateForFramebufferDescriptor:(FramebufferDescriptor*)descriptor device:(id)device;
+@end
+
+struct ImGui_ImplMetal4_Data
+{
+ MetalContext* SharedMetalContext;
+ id RenderCommandEncoder;
+
+ ImGui_ImplMetal4_Data() { memset((void*)this, 0, sizeof(*this)); }
+};
+
+static ImGui_ImplMetal4_Data* ImGui_ImplMetal4_GetBackendData() { return ImGui::GetCurrentContext() ? (ImGui_ImplMetal4_Data*)ImGui::GetIO().BackendRendererUserData : nullptr; }
+static void ImGui_ImplMetal4_DestroyBackendData(){ IM_DELETE(ImGui_ImplMetal4_GetBackendData()); }
+
+static inline CFTimeInterval GetMachAbsoluteTimeInSeconds() { return (CFTimeInterval)(double)(clock_gettime_nsec_np(CLOCK_UPTIME_RAW) / 1e9); }
+
+#ifdef IMGUI_IMPL_METAL_CPP
+
+#pragma mark - Dear ImGui Metal C++ Backend API
+
+bool ImGui_ImplMetal4_Init(MTL::Device* device, MTL4::CommandQueue* commandQueue, int framesInFlight)
+{
+ return ImGui_ImplMetal4_Init((__bridge id)(device),(__bridge id)(commandQueue), framesInFlight);
+}
+
+void ImGui_ImplMetal4_NewFrame(MTL4::RenderPassDescriptor* renderPassDescriptor, int frameInFlightIndex)
+{
+ ImGui_ImplMetal4_NewFrame((__bridge MTL4RenderPassDescriptor*)(renderPassDescriptor), frameInFlightIndex);
+}
+
+void ImGui_ImplMetal4_RenderDrawData(ImDrawData* draw_data,
+ MTL4::CommandBuffer* commandBuffer,
+ MTL4::RenderCommandEncoder* commandEncoder)
+{
+ ImGui_ImplMetal4_RenderDrawData(draw_data,
+ (__bridge id)(commandBuffer),
+ (__bridge id)(commandEncoder));
+}
+
+bool ImGui_ImplMetal_CreateDeviceObjects(MTL::Device* device)
+{
+ return ImGui_ImplMetal4_CreateDeviceObjects((__bridge id)(device));
+}
+
+#endif // #ifdef IMGUI_IMPL_METAL_CPP
+
+#pragma mark - Dear ImGui Metal Backend API
+
+void ImGui_ImplMetal4_NewFrame(MTL4RenderPassDescriptor* renderPassDescriptor, int frameInFlightIndex)
+{
+ ImGui_ImplMetal4_Data* bd = ImGui_ImplMetal4_GetBackendData();
+ IM_ASSERT(bd != nil && "Context or backend not initialized! Did you call ImGui_ImplMetal4_Init()?");
+ IM_ASSERT(frameInFlightIndex < bd->SharedMetalContext.framesInFlight && "frameInFlightIndex out of range! See framesInFlight passed to ImGui_ImplMetal4_Init().");
+#ifdef IMGUI_IMPL_METAL_CPP
+ bd->SharedMetalContext.framebufferDescriptor = [[[FramebufferDescriptor alloc] initWithRenderPassDescriptor:renderPassDescriptor]autorelease];
+#else
+ bd->SharedMetalContext.framebufferDescriptor = [[FramebufferDescriptor alloc] initWithRenderPassDescriptor:renderPassDescriptor];
+#endif
+ bd->SharedMetalContext.currentFrameSlot = (NSUInteger)frameInFlightIndex;
+ if (bd->SharedMetalContext.depthStencilState == nil)
+ ImGui_ImplMetal4_CreateDeviceObjects(bd->SharedMetalContext.device);
+
+ bd->SharedMetalContext.currentConstantBufferIndex = 0;
+ [bd->SharedMetalContext.events[frameInFlightIndex] waitUntilSignaledValue:bd->SharedMetalContext.eventValue timeoutMS:UINT64_MAX];
+ [bd->SharedMetalContext.commandAllocators[frameInFlightIndex] reset];
+}
+
+static void ImGui_ImplMetal4_SetupRenderState(ImDrawData* draw_data, id commandBuffer,
+ id commandEncoder, id renderPipelineState,
+ MetalBuffer* vertexBuffer, size_t vertexBufferOffset)
+{
+ IM_UNUSED(commandBuffer);
+ ImGui_ImplMetal4_Data* bd = ImGui_ImplMetal4_GetBackendData();
+ [commandEncoder setCullMode:MTLCullModeNone];
+ [commandEncoder setDepthStencilState:bd->SharedMetalContext.depthStencilState];
+
+ // Setup viewport, orthographic projection matrix
+ // Our visible imgui space lies from draw_data->DisplayPos (top left) to
+ // draw_data->DisplayPos+data_data->DisplaySize (bottom right). DisplayMin is typically (0,0) for single viewport apps.
+ MTLViewport viewport =
+ {
+ .originX = 0.0,
+ .originY = 0.0,
+ .width = (double)(draw_data->DisplaySize.x * draw_data->FramebufferScale.x),
+ .height = (double)(draw_data->DisplaySize.y * draw_data->FramebufferScale.y),
+ .znear = 0.0,
+ .zfar = 1.0
+ };
+ [commandEncoder setViewport:viewport];
+
+ float L = draw_data->DisplayPos.x;
+ float R = draw_data->DisplayPos.x + draw_data->DisplaySize.x;
+ float T = draw_data->DisplayPos.y;
+ float B = draw_data->DisplayPos.y + draw_data->DisplaySize.y;
+ float N = (float)viewport.znear;
+ float F = (float)viewport.zfar;
+ const float ortho_projection[4][4] =
+ {
+ { 2.0f/(R-L), 0.0f, 0.0f, 0.0f },
+ { 0.0f, 2.0f/(T-B), 0.0f, 0.0f },
+ { 0.0f, 0.0f, 1/(F-N), 0.0f },
+ { (R+L)/(L-R), (T+B)/(B-T), N/(F-N), 1.0f },
+ };
+
+ int currentChunk = (int)((float)bd->SharedMetalContext.currentConstantBufferIndex / (float)METAL_IMGUI_VIEWPORTS_PER_CHUNK);
+ int currentIndex = bd->SharedMetalContext.currentConstantBufferIndex % METAL_IMGUI_VIEWPORTS_PER_CHUNK;
+
+ int currentFrameIndex = (int)bd->SharedMetalContext.currentFrameSlot;
+ id constantBuffer = bd->SharedMetalContext.constantBuffers[currentFrameIndex][currentChunk];
+ ImGui_Metal4_ConstantData* constantBufferContents = (ImGui_Metal4_ConstantData*)constantBuffer.contents;
+
+ memcpy(&constantBufferContents->ModelViewProjectionMatrix[currentIndex], ortho_projection, sizeof(ortho_projection));
+
+ id argumentTable = bd->SharedMetalContext.argumentTable;
+ [argumentTable setAddress:constantBuffer.gpuAddress+(uint64_t)currentIndex * sizeof(constantBufferContents->ModelViewProjectionMatrix[0]) atIndex:1];
+ [argumentTable setAddress:(vertexBuffer.buffer.gpuAddress + vertexBufferOffset) attributeStride:sizeof(ImDrawVert) atIndex:0];
+ [argumentTable setSamplerState:bd->SharedMetalContext.samplerStateLinear.gpuResourceID atIndex:0];
+ [commandEncoder setArgumentTable:argumentTable atStages:MTLRenderStageVertex | MTLRenderStageFragment];
+ [commandEncoder setRenderPipelineState:renderPipelineState];
+}
+
+static void ImGui_ImplMetal4_DrawCallback_ResetRenderState(const ImDrawList*, const ImDrawCmd*) {} // Intentionally empty. Used as an identifier for rendering loop to call its code. Simpler to implement this way.
+static void ImGui_ImplMetal4_DrawCallback_SetSamplerLinear(const ImDrawList*, const ImDrawCmd*) { ImGui_ImplMetal4_Data* bd = ImGui_ImplMetal4_GetBackendData(); [bd->SharedMetalContext.argumentTable setSamplerState:bd->SharedMetalContext.samplerStateLinear.gpuResourceID atIndex:0]; }
+static void ImGui_ImplMetal4_DrawCallback_SetSamplerNearest(const ImDrawList*, const ImDrawCmd*) { ImGui_ImplMetal4_Data* bd = ImGui_ImplMetal4_GetBackendData(); [bd->SharedMetalContext.argumentTable setSamplerState:bd->SharedMetalContext.samplerStateNearest.gpuResourceID atIndex:0]; }
+
+void ImGui_ImplMetal4_RenderDrawData(ImDrawData* draw_data, id commandBuffer, id commandEncoder)
+{
+ ImGui_ImplMetal4_Data* bd = ImGui_ImplMetal4_GetBackendData();
+ MetalContext* ctx = bd->SharedMetalContext;
+
+ // Avoid rendering when minimized, scale coordinates for retina displays (screen coordinates != framebuffer coordinates)
+ int fb_width = (int)(draw_data->DisplaySize.x * draw_data->FramebufferScale.x);
+ int fb_height = (int)(draw_data->DisplaySize.y * draw_data->FramebufferScale.y);
+ if (fb_width <= 0 || fb_height <= 0 || draw_data->CmdLists.Size == 0)
+ return;
+
+ // Catch up with texture updates. Most of the times, the list will have 1 element with an OK status, aka nothing to do.
+ // (This almost always points to ImGui::GetPlatformIO().Textures[] but is part of ImDrawData to allow overriding or disabling texture updates).
+ if (draw_data->Textures != nullptr)
+ for (ImTextureData* tex : *draw_data->Textures)
+ if (tex->Status != ImTextureStatus_OK)
+ ImGui_ImplMetal4_UpdateTexture(tex);
+
+ // Try to retrieve a render pipeline state that is compatible with the framebuffer config for this frame
+ // The hit rate for this cache should be very near 100%.
+ id renderPipelineState = ctx.renderPipelineStateCache[ctx.framebufferDescriptor];
+ if (renderPipelineState == nil)
+ {
+ // No luck; make a new render pipeline state
+ renderPipelineState = [ctx renderPipelineStateForFramebufferDescriptor:ctx.framebufferDescriptor device:commandBuffer.device];
+
+ // Cache render pipeline state for later reuse
+ ctx.renderPipelineStateCache[ctx.framebufferDescriptor] = renderPipelineState;
+ }
+
+ size_t vertexBufferLength = (size_t)draw_data->TotalVtxCount * sizeof(ImDrawVert);
+ size_t indexBufferLength = (size_t)draw_data->TotalIdxCount * sizeof(ImDrawIdx);
+ MetalBuffer* vertexBuffer = [ctx dequeueReusableBufferOfLength:vertexBufferLength device:commandBuffer.device];
+ MetalBuffer* indexBuffer = [ctx dequeueReusableBufferOfLength:indexBufferLength device:commandBuffer.device];
+
+ bd->RenderCommandEncoder = commandEncoder;
+
+ // check if more chunks are required
+ const int chunksRequired = 1 + (int)((float)bd->SharedMetalContext.currentConstantBufferIndex / (float)METAL_IMGUI_VIEWPORTS_PER_CHUNK);
+ if (chunksRequired > bd->SharedMetalContext.constantBufferChunkCount)
+ {
+ for (NSUInteger i = 0; i < bd->SharedMetalContext.framesInFlight; i++)
+ {
+ id buffer = [bd->SharedMetalContext.device newBufferWithLength:sizeof(ImGui_Metal4_ConstantData) options:MTLResourceStorageModeShared];
+ [bd->SharedMetalContext.constantBuffers[i] addObject:buffer];
+ [bd->SharedMetalContext.residencySet addAllocation:buffer];
+ }
+ bd->SharedMetalContext.constantBufferChunkCount++;
+ }
+
+ ImGui_ImplMetal4_SetupRenderState(draw_data, commandBuffer, commandEncoder, renderPipelineState, vertexBuffer, 0);
+ bd->SharedMetalContext.currentConstantBufferIndex++;
+
+ // Will project scissor/clipping rectangles into framebuffer space
+ ImVec2 clip_off = draw_data->DisplayPos; // (0,0) unless using multi-viewports
+ ImVec2 clip_scale = draw_data->FramebufferScale; // (1,1) unless using retina display which are often (2,2)
+
+ // Render command lists
+ size_t vertexBufferOffset = 0;
+ size_t indexBufferOffset = 0;
+ for (const ImDrawList* draw_list : draw_data->CmdLists)
+ {
+ memcpy((char*)vertexBuffer.buffer.contents + vertexBufferOffset, draw_list->VtxBuffer.Data, (size_t)draw_list->VtxBuffer.Size * sizeof(ImDrawVert));
+ memcpy((char*)indexBuffer.buffer.contents + indexBufferOffset, draw_list->IdxBuffer.Data, (size_t)draw_list->IdxBuffer.Size * sizeof(ImDrawIdx));
+
+ for (int cmd_i = 0; cmd_i < draw_list->CmdBuffer.Size; cmd_i++)
+ {
+ const ImDrawCmd* pcmd = &draw_list->CmdBuffer[cmd_i];
+ if (pcmd->UserCallback)
+ {
+ // User callback, registered via ImDrawList::AddCallback()
+ if (pcmd->UserCallback == ImGui_ImplMetal4_DrawCallback_ResetRenderState)
+ ImGui_ImplMetal4_SetupRenderState(draw_data, commandBuffer, commandEncoder, renderPipelineState, vertexBuffer, vertexBufferOffset);
+ else
+ pcmd->UserCallback(draw_list, pcmd);
+ }
+ else
+ {
+ // Project scissor/clipping rectangles into framebuffer space
+ ImVec2 clip_min((pcmd->ClipRect.x - clip_off.x) * clip_scale.x, (pcmd->ClipRect.y - clip_off.y) * clip_scale.y);
+ ImVec2 clip_max((pcmd->ClipRect.z - clip_off.x) * clip_scale.x, (pcmd->ClipRect.w - clip_off.y) * clip_scale.y);
+
+ // Clamp to viewport as setScissorRect() won't accept values that are off bounds
+ if (clip_min.x < 0.0f) { clip_min.x = 0.0f; }
+ if (clip_min.y < 0.0f) { clip_min.y = 0.0f; }
+ if (clip_max.x > (float)fb_width) { clip_max.x = (float)fb_width; }
+ if (clip_max.y > (float)fb_height) { clip_max.y = (float)fb_height; }
+ if (clip_max.x <= clip_min.x || clip_max.y <= clip_min.y)
+ continue;
+ if (pcmd->ElemCount == 0) // drawIndexedPrimitives() validation doesn't accept this
+ continue;
+
+ // Apply scissor/clipping rectangle
+ MTLScissorRect scissorRect =
+ {
+ .x = NSUInteger(clip_min.x),
+ .y = NSUInteger(clip_min.y),
+ .width = NSUInteger(clip_max.x - clip_min.x),
+ .height = NSUInteger(clip_max.y - clip_min.y)
+ };
+ [commandEncoder setScissorRect:scissorRect];
+
+ // Bind texture, Draw
+ ImTextureID tex_id = pcmd->GetTexID();
+ if (tex_id != ImTextureID_Invalid)
+ {
+ id texture = (__bridge id)(void*)(intptr_t)tex_id;
+ [bd->SharedMetalContext.residencySet addAllocation:texture];
+ [bd->SharedMetalContext.argumentTable setTexture:texture.gpuResourceID atIndex:0];
+ }
+
+ [bd->SharedMetalContext.argumentTable setAddress:(vertexBuffer.buffer.gpuAddress + vertexBufferOffset + (pcmd->VtxOffset * sizeof(ImDrawVert))) attributeStride:sizeof(ImDrawVert) atIndex:0];
+
+ size_t indexBufferCmdOffset = indexBufferOffset + (pcmd->IdxOffset * sizeof(ImDrawIdx));
+ [commandEncoder drawIndexedPrimitives:MTLPrimitiveTypeTriangle
+ indexCount:pcmd->ElemCount
+ indexType:sizeof(ImDrawIdx) == 2 ? MTLIndexTypeUInt16 : MTLIndexTypeUInt32
+ indexBuffer:indexBuffer.buffer.gpuAddress + indexBufferCmdOffset
+ indexBufferLength:indexBuffer.buffer.length - indexBufferCmdOffset];
+ }
+ }
+
+ vertexBufferOffset += (size_t)draw_list->VtxBuffer.Size * sizeof(ImDrawVert);
+ indexBufferOffset += (size_t)draw_list->IdxBuffer.Size * sizeof(ImDrawIdx);
+ }
+
+ MetalContext* sharedMetalContext = bd->SharedMetalContext;
+ @synchronized(sharedMetalContext.bufferCacheLock)
+ {
+ NSMutableArray* slotCache = sharedMetalContext.bufferCaches[sharedMetalContext.currentFrameSlot];
+ [slotCache addObject:vertexBuffer];
+ [slotCache addObject:indexBuffer];
+ }
+
+ // Commit residency set
+ [bd->SharedMetalContext.residencySet commit];
+ bd->RenderCommandEncoder = nil;
+}
+
+static void ImGui_ImplMetal4_DestroyTexture(ImTextureData* tex)
+{
+ if (MetalTexture* backend_tex = (__bridge_transfer MetalTexture*)(tex->BackendUserData))
+ {
+ IM_ASSERT(backend_tex.metalTexture == (__bridge id)(void*)(intptr_t)tex->TexID);
+ backend_tex.metalTexture = nil;
+
+ // Clear identifiers and mark as destroyed (in order to allow e.g. calling InvalidateDeviceObjects while running)
+ tex->SetTexID(ImTextureID_Invalid);
+ tex->BackendUserData = nullptr;
+ }
+ tex->SetStatus(ImTextureStatus_Destroyed);
+}
+
+void ImGui_ImplMetal4_UpdateTexture(ImTextureData* tex)
+{
+ ImGui_ImplMetal4_Data* bd = ImGui_ImplMetal4_GetBackendData();
+ if (tex->Status == ImTextureStatus_WantCreate)
+ {
+ // Create and upload new texture to graphics system
+ //IMGUI_DEBUG_LOG("UpdateTexture #%03d: WantCreate %dx%d\n", tex->UniqueID, tex->Width, tex->Height);
+ IM_ASSERT(tex->TexID == ImTextureID_Invalid && tex->BackendUserData == nullptr);
+ IM_ASSERT(tex->Format == ImTextureFormat_RGBA32);
+
+ // We are retrieving and uploading the font atlas as a 4-channels RGBA texture here.
+ // In theory we could call GetTexDataAsAlpha8() and upload a 1-channel texture to save on memory access bandwidth.
+ // However, using a shader designed for 1-channel texture would make it less obvious to use the ImTextureID facility to render users own textures.
+ // You can make that change in your implementation.
+ MTLTextureDescriptor* textureDescriptor = [MTLTextureDescriptor texture2DDescriptorWithPixelFormat:MTLPixelFormatRGBA8Unorm
+ width:(NSUInteger)tex->Width
+ height:(NSUInteger)tex->Height
+ mipmapped:NO];
+ textureDescriptor.usage = MTLTextureUsageShaderRead;
+ textureDescriptor.storageMode = MTLStorageModeShared;
+
+ id texture = [bd->SharedMetalContext.device newTextureWithDescriptor:textureDescriptor];
+ [bd->SharedMetalContext.residencySet addAllocation:texture];
+ [texture replaceRegion:MTLRegionMake2D(0, 0, (NSUInteger)tex->Width, (NSUInteger)tex->Height) mipmapLevel:0 withBytes:tex->Pixels bytesPerRow:(NSUInteger)tex->Width * 4];
+ MetalTexture* backend_tex = [[MetalTexture alloc] initWithTexture:texture];
+
+ // Store identifiers
+ tex->SetTexID((ImTextureID)(intptr_t)texture);
+ tex->SetStatus(ImTextureStatus_OK);
+ tex->BackendUserData = (__bridge_retained void*)(backend_tex);
+ }
+ else if (tex->Status == ImTextureStatus_WantUpdates)
+ {
+ // Update selected blocks. We only ever write to textures regions which have never been used before!
+ // This backend choose to use tex->Updates[] but you can use tex->UpdateRect to upload a single region.
+ MetalTexture* backend_tex = (__bridge MetalTexture*)(tex->BackendUserData);
+ for (ImTextureRect& r : tex->Updates)
+ {
+ [backend_tex.metalTexture replaceRegion:MTLRegionMake2D((NSUInteger)r.x, (NSUInteger)r.y, (NSUInteger)r.w, (NSUInteger)r.h)
+ mipmapLevel:0
+ withBytes:tex->GetPixelsAt(r.x, r.y)
+ bytesPerRow:(NSUInteger)tex->Width * 4];
+ }
+ tex->SetStatus(ImTextureStatus_OK);
+ }
+ else if (tex->Status == ImTextureStatus_WantDestroy && tex->UnusedFrames > 0)
+ {
+ ImGui_ImplMetal4_DestroyTexture(tex);
+ }
+}
+
+bool ImGui_ImplMetal4_CreateDeviceObjects(id device)
+{
+ ImGui_ImplMetal4_Data* bd = ImGui_ImplMetal4_GetBackendData();
+
+ MTLResidencySetDescriptor* residencySetDescriptor = [[MTLResidencySetDescriptor alloc] init];
+ residencySetDescriptor.initialCapacity = 1000;
+
+ NSError* error = nil;
+ bd->SharedMetalContext.residencySet = [device newResidencySetWithDescriptor:residencySetDescriptor error:&error];
+ IM_ASSERT(bd->SharedMetalContext.residencySet != nil && error == nil);
+
+ [bd->SharedMetalContext.commandQueue addResidencySet:bd->SharedMetalContext.residencySet];
+
+ MTLDepthStencilDescriptor* depthStencilDescriptor = [[MTLDepthStencilDescriptor alloc] init];
+ depthStencilDescriptor.depthWriteEnabled = NO;
+ depthStencilDescriptor.depthCompareFunction = MTLCompareFunctionAlways;
+ bd->SharedMetalContext.depthStencilState = [device newDepthStencilStateWithDescriptor:depthStencilDescriptor];
+ MTLSamplerDescriptor* samplerDescriptor = [[MTLSamplerDescriptor alloc] init];
+ samplerDescriptor.supportArgumentBuffers = YES;
+ samplerDescriptor.minFilter = MTLSamplerMinMagFilterLinear;
+ samplerDescriptor.magFilter = MTLSamplerMinMagFilterLinear;
+ samplerDescriptor.mipFilter = MTLSamplerMipFilterLinear;
+ bd->SharedMetalContext.samplerStateLinear = [device newSamplerStateWithDescriptor:samplerDescriptor];
+ samplerDescriptor.minFilter = MTLSamplerMinMagFilterNearest;
+ samplerDescriptor.magFilter = MTLSamplerMinMagFilterNearest;
+ samplerDescriptor.mipFilter = MTLSamplerMipFilterNearest;
+ bd->SharedMetalContext.samplerStateNearest = [device newSamplerStateWithDescriptor:samplerDescriptor];
+
+ NSMutableArray>* commandAllocators = [NSMutableArray array];
+ NSMutableArray>* events = [NSMutableArray array];
+ bd->SharedMetalContext.constantBuffers = [NSMutableArray array];
+ for (NSUInteger i = 0; i < bd->SharedMetalContext.framesInFlight; i++)
+ {
+ events[i] = [device newSharedEvent];
+ commandAllocators[i] = [device newCommandAllocator];
+ bd->SharedMetalContext.constantBuffers[i] = [NSMutableArray array];
+ id buffer = [device newBufferWithLength:sizeof(ImGui_Metal4_ConstantData) options:MTLResourceStorageModeShared];
+ [bd->SharedMetalContext.constantBuffers[i] addObject:buffer];
+ [bd->SharedMetalContext.residencySet addAllocation:buffer];
+ }
+ bd->SharedMetalContext.constantBufferChunkCount = 1;
+ bd->SharedMetalContext.events = events;
+
+ MTL4ArgumentTableDescriptor* argumentTableDescriptor = [[MTL4ArgumentTableDescriptor alloc] init];
+ argumentTableDescriptor.maxBufferBindCount = 2; // vertex buffer + constant buffer
+ argumentTableDescriptor.maxTextureBindCount = 1; // font atlas or user texture
+ argumentTableDescriptor.maxSamplerStateBindCount = 2;
+ argumentTableDescriptor.supportAttributeStrides = YES; // required: vertex buffer is bound via setAddress:stride:atIndex: for stage_in fetch
+
+ bd->SharedMetalContext.commandAllocators = commandAllocators;
+
+ bd->SharedMetalContext.argumentTable = [device newArgumentTableWithDescriptor:argumentTableDescriptor error:&error];
+ IM_ASSERT(bd->SharedMetalContext.argumentTable != nil && error == nil);
+
+ ImGui_ImplMetal_CreateDeviceObjectsForPlatformWindows();
+ return true;
+}
+
+void ImGui_ImplMetal4_DestroyDeviceObjects()
+{
+ ImGui_ImplMetal4_Data* bd = ImGui_ImplMetal4_GetBackendData();
+
+ // Destroy all textures
+ for (ImTextureData* tex : ImGui::GetPlatformIO().Textures)
+ if (tex->RefCount == 1)
+ ImGui_ImplMetal4_DestroyTexture(tex);
+
+ [bd->SharedMetalContext.renderPipelineStateCache removeAllObjects];
+ bd->SharedMetalContext.samplerStateLinear = nil;
+ bd->SharedMetalContext.samplerStateNearest = nil;
+ ImGui_ImplMetal_InvalidateDeviceObjectsForPlatformWindows();
+ [bd->SharedMetalContext.renderPipelineStateCache removeAllObjects];
+}
+
+bool ImGui_ImplMetal4_Init(id device, id commandQueue, int framesInFlight)
+{
+ ImGuiIO& io = ImGui::GetIO();
+ IMGUI_CHECKVERSION();
+ IM_ASSERT(io.BackendRendererUserData == nullptr && "Already initialized a renderer backend!");
+ IM_ASSERT(framesInFlight > 0 && "framesInFlight must be at least 1!");
+
+ ImGui_ImplMetal4_Data* bd = IM_NEW(ImGui_ImplMetal4_Data)();
+ io.BackendRendererUserData = (void*)bd;
+ io.BackendRendererName = "imgui_impl_metal4";
+ io.BackendFlags |= ImGuiBackendFlags_RendererHasVtxOffset; // We can honor the ImDrawCmd::VtxOffset field, allowing for large meshes.
+ io.BackendFlags |= ImGuiBackendFlags_RendererHasTextures; // We can honor ImGuiPlatformIO::Textures[] requests during render.
+ io.BackendFlags |= ImGuiBackendFlags_RendererHasViewports; // We can create multi-viewports on the Renderer side (optional)
+
+ ImGuiPlatformIO& platform_io = ImGui::GetPlatformIO();
+ platform_io.DrawCallback_ResetRenderState = ImGui_ImplMetal4_DrawCallback_ResetRenderState;
+ platform_io.DrawCallback_SetSamplerLinear = ImGui_ImplMetal4_DrawCallback_SetSamplerLinear;
+ platform_io.DrawCallback_SetSamplerNearest = ImGui_ImplMetal4_DrawCallback_SetSamplerNearest;
+
+ bd->SharedMetalContext = [[MetalContext alloc] init];
+ bd->SharedMetalContext.device = device;
+ bd->SharedMetalContext.commandQueue = commandQueue;
+ bd->SharedMetalContext.framesInFlight = (NSUInteger)framesInFlight;
+ NSMutableArray*>* bufferCaches = [NSMutableArray array];
+ for (NSUInteger i = 0; i < framesInFlight; i++)
+ [bufferCaches addObject:[NSMutableArray array]];
+ bd->SharedMetalContext.bufferCaches = bufferCaches;
+
+ ImGui_ImplMetal_InitMultiViewportSupport();
+ return true;
+}
+
+void ImGui_ImplMetal4_Shutdown()
+{
+ ImGui_ImplMetal4_Data* bd = ImGui_ImplMetal4_GetBackendData();
+ IM_UNUSED(bd);
+ IM_ASSERT(bd != nullptr && "No renderer backend to shutdown, or already shutdown?");
+ ImGuiIO& io = ImGui::GetIO();
+ ImGuiPlatformIO& platform_io = ImGui::GetPlatformIO();
+
+ ImGui_ImplMetal_ShutdownMultiViewportSupport();
+ ImGui_ImplMetal4_DestroyDeviceObjects();
+ ImGui_ImplMetal4_DestroyBackendData();
+
+ io.BackendRendererName = nullptr;
+ io.BackendRendererUserData = nullptr;
+ io.BackendFlags &= ~(ImGuiBackendFlags_RendererHasVtxOffset | ImGuiBackendFlags_RendererHasTextures);
+ platform_io.ClearRendererHandlers();
+}
+
+@implementation MetalBuffer
+- (instancetype)initWithBuffer:(id)buffer
+{
+ if ((self = [super init]))
+ {
+ _buffer = buffer;
+ _lastReuseTime = GetMachAbsoluteTimeInSeconds();
+ }
+ return self;
+}
+@end
+
+#pragma mark - FramebufferDescriptor implementation
+
+@implementation FramebufferDescriptor
+- (instancetype)initWithRenderPassDescriptor:(MTL4RenderPassDescriptor*)renderPassDescriptor
+{
+ if ((self = [super init]))
+ {
+ _sampleCount = renderPassDescriptor.colorAttachments[0].texture.sampleCount;
+ _colorPixelFormat = renderPassDescriptor.colorAttachments[0].texture.pixelFormat;
+ _depthPixelFormat = renderPassDescriptor.depthAttachment.texture.pixelFormat;
+ _stencilPixelFormat = renderPassDescriptor.stencilAttachment.texture.pixelFormat;
+ }
+ return self;
+}
+
+- (nonnull id)copyWithZone:(nullable NSZone*)zone
+{
+ FramebufferDescriptor* copy = [[FramebufferDescriptor allocWithZone:zone] init];
+ copy.sampleCount = self.sampleCount;
+ copy.colorPixelFormat = self.colorPixelFormat;
+ copy.depthPixelFormat = self.depthPixelFormat;
+ copy.stencilPixelFormat = self.stencilPixelFormat;
+ return copy;
+}
+
+- (NSUInteger)hash
+{
+ NSUInteger sc = _sampleCount & 0x3;
+ NSUInteger cf = _colorPixelFormat & 0x3FF;
+ NSUInteger df = _depthPixelFormat & 0x3FF;
+ NSUInteger sf = _stencilPixelFormat & 0x3FF;
+ NSUInteger hash = (sf << 22) | (df << 12) | (cf << 2) | sc;
+ return hash;
+}
+
+- (BOOL)isEqual:(id)object
+{
+ FramebufferDescriptor* other = object;
+ if (![other isKindOfClass:[FramebufferDescriptor class]])
+ return NO;
+ return other.sampleCount == self.sampleCount &&
+ other.colorPixelFormat == self.colorPixelFormat &&
+ other.depthPixelFormat == self.depthPixelFormat &&
+ other.stencilPixelFormat == self.stencilPixelFormat;
+}
+
+@end
+
+#pragma mark - MetalTexture implementation
+
+@implementation MetalTexture
+- (instancetype)initWithTexture:(id)metalTexture
+{
+ if ((self = [super init]))
+ self.metalTexture = metalTexture;
+ return self;
+}
+
+@end
+
+#pragma mark - MetalContext implementation
+
+@implementation MetalContext
+- (instancetype)init
+{
+ if ((self = [super init]))
+ {
+ self.renderPipelineStateCache = [NSMutableDictionary dictionary];
+ self.bufferCacheLock = [[NSObject alloc] init];
+ _lastBufferCachePurge = GetMachAbsoluteTimeInSeconds();
+ }
+ return self;
+}
+
+- (void)dealloc
+{
+}
+
+- (MetalBuffer*)dequeueReusableBufferOfLength:(NSUInteger)length device:(id)device
+{
+ double now = GetMachAbsoluteTimeInSeconds();
+ NSMutableArray* slotCache = self.bufferCaches[self.currentFrameSlot];
+
+ @synchronized(self.bufferCacheLock)
+ {
+ // Purge old buffers that haven't been useful for a while
+ if (now - self.lastBufferCachePurge > 1.0)
+ {
+ for (NSMutableArray* cache in self.bufferCaches)
+ {
+ NSMutableArray* survivors = [NSMutableArray array];
+ for (MetalBuffer* candidate in cache)
+ if (candidate.lastReuseTime > self.lastBufferCachePurge)
+ [survivors addObject:candidate];
+ [cache setArray:survivors];
+ }
+ self.lastBufferCachePurge = now;
+ }
+
+ // See if we have a buffer we can reuse, from this frame-in-flight slot's own cache
+ MetalBuffer* bestCandidate = nil;
+ for (MetalBuffer* candidate in slotCache)
+ if (candidate.buffer.length >= length && (bestCandidate == nil || bestCandidate.lastReuseTime > candidate.lastReuseTime))
+ bestCandidate = candidate;
+
+ if (bestCandidate != nil)
+ {
+ [slotCache removeObject:bestCandidate];
+ bestCandidate.lastReuseTime = now;
+ return bestCandidate;
+ }
+ }
+
+ // No luck; make a new buffer
+ id backing = [device newBufferWithLength:length options:MTLResourceStorageModeShared];
+ [self.residencySet addAllocation:backing];
+ return [[MetalBuffer alloc] initWithBuffer:backing];
+}
+
+const char* shaderCode = R"(
+#include
+using namespace metal;
+
+struct Uniforms {
+ float4x4 projectionMatrix;
+};
+
+struct VertexIn {
+ float2 position [[attribute(0)]];
+ float2 texCoords [[attribute(1)]];
+ uchar4 color [[attribute(2)]];
+};
+
+struct VertexOut {
+ float4 position [[position]];
+ float2 texCoords;
+ float4 color;
+};
+
+vertex VertexOut vertex_main(VertexIn in [[stage_in]],
+ constant Uniforms &uniforms [[buffer(1)]])
+{
+ VertexOut out;
+ out.position = uniforms.projectionMatrix * float4(in.position, 0, 1);
+ out.texCoords = in.texCoords;
+ out.color = float4(in.color) / float4(255.0);
+ return out;
+}
+
+fragment half4 fragment_main(VertexOut in [[stage_in]],
+ texture2d texture [[texture(0)]],
+ sampler textureSampler [[sampler(0)]])
+{
+ half4 texColor = texture.sample(textureSampler, in.texCoords);
+ return half4(in.color) * texColor;
+}
+)";
+
+- (id)renderPipelineStateForFramebufferDescriptor:(FramebufferDescriptor*)descriptor device:(id)device
+{
+ NSError* error = nil;
+
+ id library = [device newLibraryWithSource:[NSString stringWithUTF8String:shaderCode] options:nil error:&error];
+ if (library == nil)
+ {
+ NSLog(@"Error: failed to create Metal library: %@", error);
+ return nil;
+ }
+
+ id vertexFunction = [library newFunctionWithName:@"vertex_main"];
+ id fragmentFunction = [library newFunctionWithName:@"fragment_main"];
+
+ if (vertexFunction == nil || fragmentFunction == nil)
+ {
+ NSLog(@"Error: failed to find Metal shader functions in library: %@", error);
+ return nil;
+ }
+
+ MTLVertexDescriptor* vertexDescriptor = [MTLVertexDescriptor vertexDescriptor];
+ vertexDescriptor.attributes[0].offset = offsetof(ImDrawVert, pos);
+ vertexDescriptor.attributes[0].format = MTLVertexFormatFloat2; // position
+ vertexDescriptor.attributes[0].bufferIndex = 0;
+ vertexDescriptor.attributes[1].offset = offsetof(ImDrawVert, uv);
+ vertexDescriptor.attributes[1].format = MTLVertexFormatFloat2; // texCoords
+ vertexDescriptor.attributes[1].bufferIndex = 0;
+ vertexDescriptor.attributes[2].offset = offsetof(ImDrawVert, col);
+ vertexDescriptor.attributes[2].format = MTLVertexFormatUChar4; // color
+ vertexDescriptor.attributes[2].bufferIndex = 0;
+ vertexDescriptor.layouts[0].stepRate = 1;
+ vertexDescriptor.layouts[0].stepFunction = MTLVertexStepFunctionPerVertex;
+ vertexDescriptor.layouts[0].stride = sizeof(ImDrawVert);
+
+ MTLRenderPipelineDescriptor* pipelineDescriptor = [[MTLRenderPipelineDescriptor alloc] init];
+ pipelineDescriptor.vertexFunction = vertexFunction;
+ pipelineDescriptor.fragmentFunction = fragmentFunction;
+ pipelineDescriptor.vertexDescriptor = vertexDescriptor;
+ pipelineDescriptor.rasterSampleCount = self.framebufferDescriptor.sampleCount;
+ pipelineDescriptor.colorAttachments[0].pixelFormat = self.framebufferDescriptor.colorPixelFormat;
+ pipelineDescriptor.colorAttachments[0].blendingEnabled = YES;
+ pipelineDescriptor.colorAttachments[0].rgbBlendOperation = MTLBlendOperationAdd;
+ pipelineDescriptor.colorAttachments[0].sourceRGBBlendFactor = MTLBlendFactorSourceAlpha;
+ pipelineDescriptor.colorAttachments[0].destinationRGBBlendFactor = MTLBlendFactorOneMinusSourceAlpha;
+ pipelineDescriptor.colorAttachments[0].alphaBlendOperation = MTLBlendOperationAdd;
+ pipelineDescriptor.colorAttachments[0].sourceAlphaBlendFactor = MTLBlendFactorOne;
+ pipelineDescriptor.colorAttachments[0].destinationAlphaBlendFactor = MTLBlendFactorOneMinusSourceAlpha;
+ pipelineDescriptor.depthAttachmentPixelFormat = self.framebufferDescriptor.depthPixelFormat;
+ pipelineDescriptor.stencilAttachmentPixelFormat = self.framebufferDescriptor.stencilPixelFormat;
+
+ id renderPipelineState = [device newRenderPipelineStateWithDescriptor:pipelineDescriptor error:&error];
+ if (error != nil)
+ NSLog(@"Error: failed to create Metal pipeline state: %@", error);
+
+ return renderPipelineState;
+}
+
+@end
+
+
+#pragma mark - Multi-viewport support
+
+#import
+
+#if TARGET_OS_OSX
+#import
+#endif
+
+//--------------------------------------------------------------------------------------------------------
+// MULTI-VIEWPORT / PLATFORM INTERFACE SUPPORT
+// This is an _advanced_ and _optional_ feature, allowing the back-end to create and handle multiple viewports simultaneously.
+// If you are new to dear imgui or creating a new binding for dear imgui, it is recommended that you completely ignore this section first..
+//--------------------------------------------------------------------------------------------------------
+
+struct ImGuiViewportDataMetal
+{
+ CAMetalLayer* MetalLayer;
+ id CommandQueue;
+ MTL4RenderPassDescriptor* RenderPassDescriptor;
+ void* Handle = nullptr;
+ bool FirstFrame = true;
+};
+
+static void ImGui_ImplMetal_CreateWindow(ImGuiViewport* viewport)
+{
+ ImGui_ImplMetal4_Data* bd = ImGui_ImplMetal4_GetBackendData();
+ ImGuiViewportDataMetal* data = IM_NEW(ImGuiViewportDataMetal)();
+ viewport->RendererUserData = data;
+
+ // PlatformHandleRaw should always be a NSWindow*, whereas PlatformHandle might be a higher-level handle (e.g. GLFWWindow*, SDL_Window*).
+ // Some back-ends will leave PlatformHandleRaw == 0, in which case we assume PlatformHandle will contain the NSWindow*.
+ void* handle = viewport->PlatformHandleRaw ? viewport->PlatformHandleRaw : viewport->PlatformHandle;
+ IM_ASSERT(handle != nullptr);
+
+ id device = bd->SharedMetalContext.device;
+ CAMetalLayer* layer = [CAMetalLayer layer];
+ layer.device = device;
+ layer.framebufferOnly = YES;
+ layer.pixelFormat = bd->SharedMetalContext.framebufferDescriptor.colorPixelFormat;
+#if TARGET_OS_OSX
+ NSWindow* window = (__bridge NSWindow*)handle;
+ NSView* view = window.contentView;
+ view.layer = layer;
+ view.wantsLayer = YES;
+#endif
+ data->MetalLayer = layer;
+ data->CommandQueue = [device newCommandQueue];
+ data->RenderPassDescriptor = [[MTL4RenderPassDescriptor alloc] init];
+ data->Handle = handle;
+}
+
+static void ImGui_ImplMetal_DestroyWindow(ImGuiViewport* viewport)
+{
+ // The main viewport (owned by the application) will always have RendererUserData == 0 since we didn't create the data for it.
+ if (ImGuiViewportDataMetal* data = (ImGuiViewportDataMetal*)viewport->RendererUserData)
+ IM_DELETE(data);
+ viewport->RendererUserData = nullptr;
+}
+
+inline static CGSize MakeScaledSize(CGSize size, CGFloat scale)
+{
+ return CGSizeMake(size.width * scale, size.height * scale);
+}
+
+static void ImGui_ImplMetal_SetWindowSize(ImGuiViewport* viewport, ImVec2 size)
+{
+ ImGuiViewportDataMetal* data = (ImGuiViewportDataMetal*)viewport->RendererUserData;
+ data->MetalLayer.drawableSize = MakeScaledSize(CGSizeMake(size.x, size.y), viewport->DpiScale);
+}
+
+static void ImGui_ImplMetal_RenderWindow(ImGuiViewport* viewport, void*)
+{
+ ImGuiViewportDataMetal* data = (ImGuiViewportDataMetal*)viewport->RendererUserData;
+
+#if TARGET_OS_OSX
+ void* handle = viewport->PlatformHandleRaw ? viewport->PlatformHandleRaw : viewport->PlatformHandle;
+ NSWindow* window = (__bridge NSWindow*)handle;
+
+ // Always render the first frame, regardless of occlusionState, to avoid an initial flicker
+ if ((window.occlusionState & NSWindowOcclusionStateVisible) == 0 && !data->FirstFrame)
+ {
+ // Do not render windows which are completely occluded. Calling -[CAMetalLayer nextDrawable] will hang for
+ // approximately 1 second if the Metal layer is completely occluded.
+ return;
+ }
+ data->FirstFrame = false;
+
+ float fb_scale = (float)window.backingScaleFactor;
+ if (data->MetalLayer.contentsScale != fb_scale)
+ {
+ data->MetalLayer.contentsScale = fb_scale;
+ data->MetalLayer.drawableSize = MakeScaledSize(window.frame.size, fb_scale);
+ }
+#endif
+
+ id drawable = [data->MetalLayer nextDrawable];
+ if (drawable == nil)
+ return;
+
+ MTL4RenderPassDescriptor* renderPassDescriptor = data->RenderPassDescriptor;
+ renderPassDescriptor.colorAttachments[0].texture = drawable.texture;
+ renderPassDescriptor.colorAttachments[0].clearColor = MTLClearColorMake(0, 0, 0, 0);
+ if ((viewport->Flags & ImGuiViewportFlags_NoRendererClear) == 0)
+ renderPassDescriptor.colorAttachments[0].loadAction = MTLLoadActionClear;
+
+ ImGui_ImplMetal4_Data* bd = ImGui_ImplMetal4_GetBackendData();
+ id commandBuffer = [bd->SharedMetalContext.device newCommandBuffer];
+ [commandBuffer beginCommandBufferWithAllocator:bd->SharedMetalContext.commandAllocators[bd->SharedMetalContext.currentFrameSlot]];
+
+ id renderEncoder = [commandBuffer renderCommandEncoderWithDescriptor:renderPassDescriptor];
+ ImGui_ImplMetal4_RenderDrawData(viewport->DrawData, commandBuffer, renderEncoder);
+ [renderEncoder endEncoding];
+ [commandBuffer endCommandBuffer];
+
+ [bd->SharedMetalContext.commandQueue waitForDrawable:drawable];
+ [bd->SharedMetalContext.commandQueue commit:&commandBuffer count:1];
+ [bd->SharedMetalContext.commandQueue signalDrawable:drawable];
+ [drawable present];
+ [bd->SharedMetalContext.commandQueue signalEvent:bd->SharedMetalContext.events[bd->SharedMetalContext.currentFrameSlot] value:++(bd->SharedMetalContext.eventValue)];
+}
+
+static void ImGui_ImplMetal_InitMultiViewportSupport()
+{
+ ImGuiPlatformIO& platform_io = ImGui::GetPlatformIO();
+ platform_io.Renderer_CreateWindow = ImGui_ImplMetal_CreateWindow;
+ platform_io.Renderer_DestroyWindow = ImGui_ImplMetal_DestroyWindow;
+ platform_io.Renderer_SetWindowSize = ImGui_ImplMetal_SetWindowSize;
+ platform_io.Renderer_RenderWindow = ImGui_ImplMetal_RenderWindow;
+}
+
+static void ImGui_ImplMetal_ShutdownMultiViewportSupport()
+{
+ ImGui::DestroyPlatformWindows();
+}
+
+static void ImGui_ImplMetal_CreateDeviceObjectsForPlatformWindows()
+{
+ ImGuiPlatformIO& platform_io = ImGui::GetPlatformIO();
+ for (int i = 1; i < platform_io.Viewports.Size; i++)
+ if (!platform_io.Viewports[i]->RendererUserData)
+ ImGui_ImplMetal_CreateWindow(platform_io.Viewports[i]);
+}
+
+static void ImGui_ImplMetal_InvalidateDeviceObjectsForPlatformWindows()
+{
+ ImGuiPlatformIO& platform_io = ImGui::GetPlatformIO();
+ for (int i = 1; i < platform_io.Viewports.Size; i++)
+ if (platform_io.Viewports[i]->RendererUserData)
+ ImGui_ImplMetal_DestroyWindow(platform_io.Viewports[i]);
+}
+
+//-----------------------------------------------------------------------------
+
+
+#endif // #ifndef IMGUI_DISABLE
diff --git a/include/imgui/backends/imgui_impl_opengl2.cpp b/include/imgui/backends/imgui_impl_opengl2.cpp
index d18a4fd..0f4500e 100644
--- a/include/imgui/backends/imgui_impl_opengl2.cpp
+++ b/include/imgui/backends/imgui_impl_opengl2.cpp
@@ -7,6 +7,7 @@
// [X] Renderer: Multi-viewport support (multiple windows). Enable with 'io.ConfigFlags |= ImGuiConfigFlags_ViewportsEnable'.
// Missing features or Issues:
// [ ] Renderer: Large meshes support (64k+ vertices) even with 16-bit indices (ImGuiBackendFlags_RendererHasVtxOffset).
+// [ ] Renderer: Use of DrawCallback_SetSamplerLinear, DrawCallback_SetSamplerNearest is emulated by poking to glTexParameter(), as legacy OpenGL doesn't have glBindSampler().
// You can use unmodified imgui_impl_* files in your project. See examples/ folder for examples of using this.
// Prefer including the entire imgui/ repository into your project (either as a copy or as a submodule), and only build the backends you need.
@@ -27,6 +28,8 @@
// CHANGELOG
// (minor and older changes stripped away, please see git history for details)
// 2026-XX-XX: Platform: Added support for multiple windows via the ImGuiPlatformIO interface.
+// 2026-07-15: OpenGL: Backup and restore GL_UNPACK_ROW_LENGTH and GL_UNPACK_ALIGNMENT in UpdateTexture() to avoid corrupting caller GL state. (#8802, #9473)
+// 2026-04-23: OpenGL: Added support for standard draw callbacks (in platform_io): DrawCallback_ResetRenderState, DrawCallback_SetSamplerLinear, DrawCallback_SetSamplerNearest. (#9378)
// 2026-03-12: OpenGL: Fixed invalid assert in ImGui_ImplOpenGL3_UpdateTexture() if ImTextureID_Invalid is defined to be != 0, which became the default since 2026-03-12. (#9295)
// 2025-09-18: Call platform_io.ClearRendererHandlers() on shutdown.
// 2025-07-15: OpenGL: Set GL_UNPACK_ALIGNMENT to 1 before updating textures. (#8802)
@@ -88,6 +91,9 @@
// OpenGL data
struct ImGui_ImplOpenGL2_Data
{
+ bool UseTexParameterToSetSampler;
+ GLuint NextSampler;
+
ImGui_ImplOpenGL2_Data() { memset((void*)this, 0, sizeof(*this)); }
};
@@ -103,41 +109,6 @@ static void ImGui_ImplOpenGL2_InitMultiViewportSupport();
static void ImGui_ImplOpenGL2_ShutdownMultiViewportSupport();
// Functions
-bool ImGui_ImplOpenGL2_Init()
-{
- ImGuiIO& io = ImGui::GetIO();
- IMGUI_CHECKVERSION();
- IM_ASSERT(io.BackendRendererUserData == nullptr && "Already initialized a renderer backend!");
-
- // Setup backend capabilities flags
- ImGui_ImplOpenGL2_Data* bd = IM_NEW(ImGui_ImplOpenGL2_Data)();
- io.BackendRendererUserData = (void*)bd;
- io.BackendRendererName = "imgui_impl_opengl2";
- io.BackendFlags |= ImGuiBackendFlags_RendererHasTextures; // We can honor ImGuiPlatformIO::Textures[] requests during render.
- io.BackendFlags |= ImGuiBackendFlags_RendererHasViewports; // We can create multi-viewports on the Renderer side (optional)
-
- ImGui_ImplOpenGL2_InitMultiViewportSupport();
-
- return true;
-}
-
-void ImGui_ImplOpenGL2_Shutdown()
-{
- ImGui_ImplOpenGL2_Data* bd = ImGui_ImplOpenGL2_GetBackendData();
- IM_ASSERT(bd != nullptr && "No renderer backend to shutdown, or already shutdown?");
- ImGuiIO& io = ImGui::GetIO();
- ImGuiPlatformIO& platform_io = ImGui::GetPlatformIO();
-
- ImGui_ImplOpenGL2_ShutdownMultiViewportSupport();
- ImGui_ImplOpenGL2_DestroyDeviceObjects();
-
- io.BackendRendererName = nullptr;
- io.BackendRendererUserData = nullptr;
- io.BackendFlags &= ~(ImGuiBackendFlags_RendererHasTextures | ImGuiBackendFlags_RendererHasViewports);
- platform_io.ClearRendererHandlers();
- IM_DELETE(bd);
-}
-
void ImGui_ImplOpenGL2_NewFrame()
{
ImGui_ImplOpenGL2_Data* bd = ImGui_ImplOpenGL2_GetBackendData();
@@ -148,6 +119,7 @@ void ImGui_ImplOpenGL2_NewFrame()
static void ImGui_ImplOpenGL2_SetupRenderState(ImDrawData* draw_data, int fb_width, int fb_height)
{
// Setup render state: alpha-blending enabled, no face culling, no depth testing, scissor enabled, vertex/texcoord/color pointers, polygon fill.
+ ImGui_ImplOpenGL2_Data* bd = ImGui_ImplOpenGL2_GetBackendData();
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
//glBlendFuncSeparate(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA, GL_ONE, GL_ONE_MINUS_SRC_ALPHA); // In order to composite our output buffer we need to preserve alpha
@@ -165,6 +137,7 @@ static void ImGui_ImplOpenGL2_SetupRenderState(ImDrawData* draw_data, int fb_wid
glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
glShadeModel(GL_SMOOTH);
glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
+ bd->NextSampler = GL_LINEAR;
// If you are using this code with non-legacy OpenGL header/contexts (which you should not, prefer using imgui_impl_opengl3.cpp!!),
// you may need to backup/reset/restore other state, e.g. for current shader using the commented lines below.
@@ -189,12 +162,18 @@ static void ImGui_ImplOpenGL2_SetupRenderState(ImDrawData* draw_data, int fb_wid
glLoadIdentity();
}
+// Draw callbacks
+static void ImGui_ImplOpenGL2_DrawCallback_ResetRenderState(const ImDrawList*, const ImDrawCmd*) {} // Intentionally empty. Used as an identifier for rendering loop to call its code. Simpler to implement this way.
+static void ImGui_ImplOpenGL2_DrawCallback_SetSamplerLinear(const ImDrawList*, const ImDrawCmd*) { ImGui_ImplOpenGL2_Data* bd = ImGui_ImplOpenGL2_GetBackendData(); bd->UseTexParameterToSetSampler = true; bd->NextSampler = GL_LINEAR; }
+static void ImGui_ImplOpenGL2_DrawCallback_SetSamplerNearest(const ImDrawList*, const ImDrawCmd*) { ImGui_ImplOpenGL2_Data* bd = ImGui_ImplOpenGL2_GetBackendData(); bd->UseTexParameterToSetSampler = true; bd->NextSampler = GL_NEAREST; }
+
// OpenGL2 Render function.
// Note that this implementation is little overcomplicated because we are saving/setting up/restoring every OpenGL state explicitly.
// This is in order to be able to run within an OpenGL engine that doesn't do so.
void ImGui_ImplOpenGL2_RenderDrawData(ImDrawData* draw_data)
{
// Avoid rendering when minimized, scale coordinates for retina displays (screen coordinates != framebuffer coordinates)
+ ImGui_ImplOpenGL2_Data* bd = ImGui_ImplOpenGL2_GetBackendData();
int fb_width = (int)(draw_data->DisplaySize.x * draw_data->FramebufferScale.x);
int fb_height = (int)(draw_data->DisplaySize.y * draw_data->FramebufferScale.y);
if (fb_width == 0 || fb_height == 0)
@@ -238,8 +217,7 @@ void ImGui_ImplOpenGL2_RenderDrawData(ImDrawData* draw_data)
if (pcmd->UserCallback)
{
// User callback, registered via ImDrawList::AddCallback()
- // (ImDrawCallback_ResetRenderState is a special callback value used by the user to request the renderer to reset render state.)
- if (pcmd->UserCallback == ImDrawCallback_ResetRenderState)
+ if (pcmd->UserCallback == ImGui_ImplOpenGL2_DrawCallback_ResetRenderState)
ImGui_ImplOpenGL2_SetupRenderState(draw_data, fb_width, fb_height);
else
pcmd->UserCallback(draw_list, pcmd);
@@ -256,7 +234,17 @@ void ImGui_ImplOpenGL2_RenderDrawData(ImDrawData* draw_data)
glScissor((int)clip_min.x, (int)((float)fb_height - clip_max.y), (int)(clip_max.x - clip_min.x), (int)(clip_max.y - clip_min.y));
// Bind texture, Draw
- glBindTexture(GL_TEXTURE_2D, (GLuint)(intptr_t)pcmd->GetTexID());
+ GLuint pcmd_texture = (GLuint)(intptr_t)pcmd->GetTexID();
+ glBindTexture(GL_TEXTURE_2D, pcmd_texture);
+
+ // Emulate sampler change (even though it is technically part of texture data)
+ // As a sort of hack/workaround, we only start writing using glTextParameter() if sampler is ever changed explicitly.
+ if (bd->UseTexParameterToSetSampler)
+ {
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, bd->NextSampler);
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, bd->NextSampler);
+ }
+
glDrawElements(GL_TRIANGLES, (GLsizei)pcmd->ElemCount, sizeof(ImDrawIdx) == 2 ? GL_UNSIGNED_SHORT : GL_UNSIGNED_INT, idx_buffer + pcmd->IdxOffset);
}
}
@@ -281,6 +269,10 @@ void ImGui_ImplOpenGL2_RenderDrawData(ImDrawData* draw_data)
void ImGui_ImplOpenGL2_UpdateTexture(ImTextureData* tex)
{
+ // Backup GL_UNPACK state that we modify, restore on exit.
+ GLint last_unpack_row_length = 0; GL_CALL(glGetIntegerv(GL_UNPACK_ROW_LENGTH, &last_unpack_row_length));
+ GLint last_unpack_alignment = 0; GL_CALL(glGetIntegerv(GL_UNPACK_ALIGNMENT, &last_unpack_alignment));
+
if (tex->Status == ImTextureStatus_WantCreate)
{
// Create and upload new texture to graphics system
@@ -337,6 +329,10 @@ void ImGui_ImplOpenGL2_UpdateTexture(ImTextureData* tex)
tex->SetTexID(ImTextureID_Invalid);
tex->SetStatus(ImTextureStatus_Destroyed);
}
+
+ // Restore GL_UNPACK state
+ GL_CALL(glPixelStorei(GL_UNPACK_ROW_LENGTH, last_unpack_row_length));
+ GL_CALL(glPixelStorei(GL_UNPACK_ALIGNMENT, last_unpack_alignment));
}
bool ImGui_ImplOpenGL2_CreateDeviceObjects()
@@ -354,6 +350,45 @@ void ImGui_ImplOpenGL2_DestroyDeviceObjects()
}
}
+bool ImGui_ImplOpenGL2_Init()
+{
+ ImGuiIO& io = ImGui::GetIO();
+ IMGUI_CHECKVERSION();
+ IM_ASSERT(io.BackendRendererUserData == nullptr && "Already initialized a renderer backend!");
+
+ // Setup backend capabilities flags
+ ImGui_ImplOpenGL2_Data* bd = IM_NEW(ImGui_ImplOpenGL2_Data)();
+ io.BackendRendererUserData = (void*)bd;
+ io.BackendRendererName = "imgui_impl_opengl2";
+ io.BackendFlags |= ImGuiBackendFlags_RendererHasTextures; // We can honor ImGuiPlatformIO::Textures[] requests during render.
+ io.BackendFlags |= ImGuiBackendFlags_RendererHasViewports; // We can create multi-viewports on the Renderer side (optional)
+
+ ImGui_ImplOpenGL2_InitMultiViewportSupport();
+
+ ImGuiPlatformIO& platform_io = ImGui::GetPlatformIO();
+ platform_io.DrawCallback_ResetRenderState = ImGui_ImplOpenGL2_DrawCallback_ResetRenderState;
+ platform_io.DrawCallback_SetSamplerLinear = ImGui_ImplOpenGL2_DrawCallback_SetSamplerLinear;
+ platform_io.DrawCallback_SetSamplerNearest = ImGui_ImplOpenGL2_DrawCallback_SetSamplerNearest;
+
+ return true;
+}
+
+void ImGui_ImplOpenGL2_Shutdown()
+{
+ ImGui_ImplOpenGL2_Data* bd = ImGui_ImplOpenGL2_GetBackendData();
+ IM_ASSERT(bd != nullptr && "No renderer backend to shutdown, or already shutdown?");
+ ImGuiIO& io = ImGui::GetIO();
+ ImGuiPlatformIO& platform_io = ImGui::GetPlatformIO();
+
+ ImGui_ImplOpenGL2_ShutdownMultiViewportSupport();
+ ImGui_ImplOpenGL2_DestroyDeviceObjects();
+
+ io.BackendRendererName = nullptr;
+ io.BackendRendererUserData = nullptr;
+ io.BackendFlags &= ~(ImGuiBackendFlags_RendererHasTextures | ImGuiBackendFlags_RendererHasViewports);
+ platform_io.ClearRendererHandlers();
+ IM_DELETE(bd);
+}
//--------------------------------------------------------------------------------------------------------
// MULTI-VIEWPORT / PLATFORM INTERFACE SUPPORT
diff --git a/include/imgui/backends/imgui_impl_opengl2.h b/include/imgui/backends/imgui_impl_opengl2.h
index cd18594..f41138d 100644
--- a/include/imgui/backends/imgui_impl_opengl2.h
+++ b/include/imgui/backends/imgui_impl_opengl2.h
@@ -7,6 +7,7 @@
// [X] Renderer: Multi-viewport support (multiple windows). Enable with 'io.ConfigFlags |= ImGuiConfigFlags_ViewportsEnable'.
// Missing features or Issues:
// [ ] Renderer: Large meshes support (64k+ vertices) even with 16-bit indices (ImGuiBackendFlags_RendererHasVtxOffset).
+// [ ] Renderer: Use of DrawCallback_SetSamplerLinear, DrawCallback_SetSamplerNearest is emulated by poking to glTexParameter(), as legacy OpenGL doesn't have glBindSampler().
// You can use unmodified imgui_impl_* files in your project. See examples/ folder for examples of using this.
// Prefer including the entire imgui/ repository into your project (either as a copy or as a submodule), and only build the backends you need.
diff --git a/include/imgui/backends/imgui_impl_opengl3.cpp b/include/imgui/backends/imgui_impl_opengl3.cpp
index 5b7e926..50b001a 100644
--- a/include/imgui/backends/imgui_impl_opengl3.cpp
+++ b/include/imgui/backends/imgui_impl_opengl3.cpp
@@ -25,6 +25,11 @@
// CHANGELOG
// (minor and older changes stripped away, please see git history for details)
// 2026-XX-XX: Platform: Added support for multiple windows via the ImGuiPlatformIO interface.
+// 2026-07-15: OpenGL: Backup and restore GL_UNPACK_ROW_LENGTH and GL_UNPACK_ALIGNMENT in UpdateTexture() to avoid corrupting caller GL state. (#8802, #9473)
+// 2026-06-17: OpenGL: Expose selected render state in ImGui_ImplOpenGL3_RenderState, Allowing to dynamically select between use of glBindSampler() and glTexParameter(). You can access in 'void* platform_io.Renderer_RenderState' during rendering.
+// 2026-06-03: OpenGL: GLSL version detection assume GLSL 410 when GL context is 4.1. Fixes an issue running on macOS with Wine. (#9427, #6577)
+// 2026-04-23: OpenGL: Added support for standard draw callbacks (in platform_io): DrawCallback_ResetRenderState, DrawCallback_SetSamplerLinear, DrawCallback_SetSamplerNearest. (#9378)
+// (Breaking): this change prioritize using glBindSampler() when available, which would override glTexParameter() settings you may have set on custom textures.
// 2026-03-12: OpenGL: Fixed invalid assert in ImGui_ImplOpenGL3_UpdateTexture() if ImTextureID_Invalid is defined to be != 0, which became the default since 2026-03-12. (#9295)
// 2025-12-11: OpenGL: Fixed embedded loader multiple init/shutdown cycles broken on some platforms. (#8792, #9112)
// 2025-09-18: Call platform_io.ClearRendererHandlers() on shutdown.
@@ -254,6 +259,10 @@ struct ImGui_ImplOpenGL3_Data
bool HasBindSampler;
bool HasClipOrigin;
bool UseBufferSubData;
+#ifdef IMGUI_IMPL_OPENGL_MAY_HAVE_BIND_SAMPLER
+ GLuint TexSamplers[2]; // Used if HasBindSimpler. (0=linear, 1=nearest)
+#endif
+
ImVector TempBuffer;
ImGui_ImplOpenGL3_Data() { memset((void*)this, 0, sizeof(*this)); }
@@ -318,143 +327,6 @@ static void ImGui_ImplOpenGL3_ShutdownLoader()
}
// Functions
-bool ImGui_ImplOpenGL3_Init(const char* glsl_version)
-{
- ImGuiIO& io = ImGui::GetIO();
- IMGUI_CHECKVERSION();
- IM_ASSERT(io.BackendRendererUserData == nullptr && "Already initialized a renderer backend!");
-
- // Initialize loader
- if (!ImGui_ImplOpenGL3_InitLoader())
- return false;
-
- // Setup backend capabilities flags
- ImGui_ImplOpenGL3_Data* bd = IM_NEW(ImGui_ImplOpenGL3_Data)();
- io.BackendRendererUserData = (void*)bd;
- io.BackendRendererName = "imgui_impl_opengl3";
-
- // Query for GL version (e.g. 320 for GL 3.2)
- const char* gl_version_str = (const char*)glGetString(GL_VERSION);
-#if defined(IMGUI_IMPL_OPENGL_ES2)
- // GLES 2
- bd->GlVersion = 200;
- bd->GlProfileIsES2 = true;
- IM_UNUSED(gl_version_str);
-#else
- // Desktop or GLES 3
- GLint major = 0;
- GLint minor = 0;
- glGetIntegerv(GL_MAJOR_VERSION, &major);
- glGetIntegerv(GL_MINOR_VERSION, &minor);
- if (major == 0 && minor == 0)
- sscanf(gl_version_str, "%d.%d", &major, &minor); // Query GL_VERSION in desktop GL 2.x, the string will start with "."
- bd->GlVersion = (GLuint)(major * 100 + minor * 10);
- glGetIntegerv(GL_MAX_TEXTURE_SIZE, &bd->MaxTextureSize);
-
-#if defined(IMGUI_IMPL_OPENGL_ES3)
- bd->GlProfileIsES3 = true;
-#else
- if (strncmp(gl_version_str, "OpenGL ES 3", 11) == 0)
- bd->GlProfileIsES3 = true;
-#endif
-
-#if defined(GL_CONTEXT_PROFILE_MASK)
- if (!bd->GlProfileIsES3 && bd->GlVersion >= 320)
- glGetIntegerv(GL_CONTEXT_PROFILE_MASK, &bd->GlProfileMask);
- bd->GlProfileIsCompat = (bd->GlProfileMask & GL_CONTEXT_COMPATIBILITY_PROFILE_BIT) != 0;
-#endif
-
- bd->UseBufferSubData = false;
- /*
- // Query vendor to enable glBufferSubData kludge
-#ifdef _WIN32
- if (const char* vendor = (const char*)glGetString(GL_VENDOR))
- if (strncmp(vendor, "Intel", 5) == 0)
- bd->UseBufferSubData = true;
-#endif
- */
-#endif
-
-#ifdef IMGUI_IMPL_OPENGL_DEBUG
- printf("GlVersion = %d, \"%s\"\nGlProfileIsCompat = %d\nGlProfileMask = 0x%X\nGlProfileIsES2/IsEs3 = %d/%d\nGL_VENDOR = '%s'\nGL_RENDERER = '%s'\n", bd->GlVersion, gl_version_str, bd->GlProfileIsCompat, bd->GlProfileMask, bd->GlProfileIsES2, bd->GlProfileIsES3, (const char*)glGetString(GL_VENDOR), (const char*)glGetString(GL_RENDERER)); // [DEBUG]
-#endif
-
-#ifdef IMGUI_IMPL_OPENGL_MAY_HAVE_VTX_OFFSET
- if (bd->GlVersion >= 320)
- io.BackendFlags |= ImGuiBackendFlags_RendererHasVtxOffset; // We can honor the ImDrawCmd::VtxOffset field, allowing for large meshes.
-#endif
- io.BackendFlags |= ImGuiBackendFlags_RendererHasTextures; // We can honor ImGuiPlatformIO::Textures[] requests during render.
- io.BackendFlags |= ImGuiBackendFlags_RendererHasViewports; // We can create multi-viewports on the Renderer side (optional)
-
- ImGuiPlatformIO& platform_io = ImGui::GetPlatformIO();
- platform_io.Renderer_TextureMaxWidth = platform_io.Renderer_TextureMaxHeight = (int)bd->MaxTextureSize;
-
- // Store GLSL version string so we can refer to it later in case we recreate shaders.
- // Note: GLSL version is NOT the same as GL version. Leave this to nullptr if unsure.
- if (glsl_version == nullptr)
- {
-#if defined(IMGUI_IMPL_OPENGL_ES2)
- glsl_version = "#version 100";
-#elif defined(IMGUI_IMPL_OPENGL_ES3)
- glsl_version = "#version 300 es";
-#elif defined(__APPLE__)
- glsl_version = "#version 150";
-#else
- glsl_version = "#version 130";
-#endif
- }
- IM_ASSERT((int)strlen(glsl_version) + 2 < IM_COUNTOF(bd->GlslVersionString));
- strcpy(bd->GlslVersionString, glsl_version);
- strcat(bd->GlslVersionString, "\n");
-
- // Make an arbitrary GL call (we don't actually need the result)
- // IF YOU GET A CRASH HERE: it probably means the OpenGL function loader didn't do its job. Let us know!
- GLint current_texture;
- glGetIntegerv(GL_TEXTURE_BINDING_2D, ¤t_texture);
-
- // Detect extensions we support
-#ifdef IMGUI_IMPL_OPENGL_MAY_HAVE_POLYGON_MODE
- bd->HasPolygonMode = (!bd->GlProfileIsES2 && !bd->GlProfileIsES3);
-#endif
-#ifdef IMGUI_IMPL_OPENGL_MAY_HAVE_BIND_SAMPLER
- bd->HasBindSampler = (bd->GlVersion >= 330 || bd->GlProfileIsES3);
-#endif
- bd->HasClipOrigin = (bd->GlVersion >= 450);
-#ifdef IMGUI_IMPL_OPENGL_HAS_EXTENSIONS
- GLint num_extensions = 0;
- glGetIntegerv(GL_NUM_EXTENSIONS, &num_extensions);
- for (GLint i = 0; i < num_extensions; i++)
- {
- const char* extension = (const char*)glGetStringi(GL_EXTENSIONS, i);
- if (extension != nullptr && strcmp(extension, "GL_ARB_clip_control") == 0)
- bd->HasClipOrigin = true;
- }
-#endif
-
- ImGui_ImplOpenGL3_InitMultiViewportSupport();
-
- return true;
-}
-
-void ImGui_ImplOpenGL3_Shutdown()
-{
- ImGui_ImplOpenGL3_Data* bd = ImGui_ImplOpenGL3_GetBackendData();
- IM_ASSERT(bd != nullptr && "No renderer backend to shutdown, or already shutdown?");
- ImGuiIO& io = ImGui::GetIO();
- ImGuiPlatformIO& platform_io = ImGui::GetPlatformIO();
-
- ImGui_ImplOpenGL3_ShutdownMultiViewportSupport();
- ImGui_ImplOpenGL3_DestroyDeviceObjects();
-
- io.BackendRendererName = nullptr;
- io.BackendRendererUserData = nullptr;
- io.BackendFlags &= ~(ImGuiBackendFlags_RendererHasVtxOffset | ImGuiBackendFlags_RendererHasTextures | ImGuiBackendFlags_RendererHasViewports);
- platform_io.ClearRendererHandlers();
- IM_DELETE(bd);
-
- ImGui_ImplOpenGL3_ShutdownLoader();
-}
-
void ImGui_ImplOpenGL3_NewFrame()
{
ImGui_ImplOpenGL3_Data* bd = ImGui_ImplOpenGL3_GetBackendData();
@@ -466,7 +338,7 @@ void ImGui_ImplOpenGL3_NewFrame()
IM_ASSERT(0 && "ImGui_ImplOpenGL3_CreateDeviceObjects() failed!");
}
-static void ImGui_ImplOpenGL3_SetupRenderState(ImDrawData* draw_data, int fb_width, int fb_height, GLuint vertex_array_object)
+static void ImGui_ImplOpenGL3_SetupRenderState(ImDrawData* draw_data, ImGui_ImplOpenGL3_RenderState* render_state, int fb_width, int fb_height, GLuint vertex_array_object)
{
ImGui_ImplOpenGL3_Data* bd = ImGui_ImplOpenGL3_GetBackendData();
@@ -520,8 +392,11 @@ static void ImGui_ImplOpenGL3_SetupRenderState(ImDrawData* draw_data, int fb_wid
glUniformMatrix4fv(bd->AttribLocationProjMtx, 1, GL_FALSE, &ortho_projection[0][0]);
#ifdef IMGUI_IMPL_OPENGL_MAY_HAVE_BIND_SAMPLER
- if (bd->HasBindSampler)
- glBindSampler(0, 0); // We use combined texture/sampler state. Applications using GL 3.3 and GL ES 3.0 may set that otherwise.
+ if (render_state->UseBindSampler)
+ {
+ render_state->CurrentSampler = bd->TexSamplers[0];
+ glBindSampler(0, render_state->CurrentSampler); // We use combined texture/sampler state. Applications using GL 3.3 and GL ES 3.0 may set that otherwise.
+ }
#endif
(void)vertex_array_object;
@@ -540,6 +415,45 @@ static void ImGui_ImplOpenGL3_SetupRenderState(ImDrawData* draw_data, int fb_wid
GL_CALL(glVertexAttribPointer(bd->AttribLocationVtxColor, 4, GL_UNSIGNED_BYTE, GL_TRUE, sizeof(ImDrawVert), (GLvoid*)offsetof(ImDrawVert, col)));
}
+// Draw callbacks
+static void ImGui_ImplOpenGL3_DrawCallback_ResetRenderState(const ImDrawList*, const ImDrawCmd*) {} // Intentionally empty. Used as an identifier for rendering loop to call its code. Simpler to implement this way.
+static void ImGui_ImplOpenGL3_DrawCallback_SetSamplerLinear(const ImDrawList*, const ImDrawCmd*)
+{
+ ImGui_ImplOpenGL3_RenderState* render_state = ImGui_ImplOpenGL3_GetRenderState();
+#ifdef IMGUI_IMPL_OPENGL_MAY_HAVE_BIND_SAMPLER
+ ImGui_ImplOpenGL3_Data* bd = ImGui_ImplOpenGL3_GetBackendData();
+ if (bd->HasBindSampler)
+ {
+ render_state->CurrentSampler = bd->TexSamplers[0];
+ render_state->UseTexParameterFilter = false;
+ glBindSampler(0, render_state->CurrentSampler);
+ }
+ else
+#endif
+ {
+ render_state->UseTexParameterFilter = true;
+ render_state->CurrentTexParameterFilter = GL_LINEAR;
+ }
+}
+static void ImGui_ImplOpenGL3_DrawCallback_SetSamplerNearest(const ImDrawList*, const ImDrawCmd*)
+{
+ ImGui_ImplOpenGL3_RenderState* render_state = ImGui_ImplOpenGL3_GetRenderState();
+#ifdef IMGUI_IMPL_OPENGL_MAY_HAVE_BIND_SAMPLER
+ ImGui_ImplOpenGL3_Data* bd = ImGui_ImplOpenGL3_GetBackendData();
+ if (bd->HasBindSampler)
+ {
+ render_state->CurrentSampler = bd->TexSamplers[1];
+ render_state->UseTexParameterFilter = false;
+ glBindSampler(0, render_state->CurrentSampler);
+ }
+ else
+#endif
+ {
+ render_state->UseTexParameterFilter = true;
+ render_state->CurrentTexParameterFilter = GL_NEAREST;
+ }
+}
+
// OpenGL3 Render function.
// Note that this implementation is little overcomplicated because we are saving/setting up/restoring every OpenGL state explicitly.
// This is in order to be able to run within an OpenGL engine that doesn't do so.
@@ -608,7 +522,17 @@ void ImGui_ImplOpenGL3_RenderDrawData(ImDrawData* draw_data)
#ifdef IMGUI_IMPL_OPENGL_USE_VERTEX_ARRAY
GL_CALL(glGenVertexArrays(1, &vertex_array_object));
#endif
- ImGui_ImplOpenGL3_SetupRenderState(draw_data, fb_width, fb_height, vertex_array_object);
+
+ // Setup render state structure (for callbacks and custom texture bindings)
+ ImGuiPlatformIO& platform_io = ImGui::GetPlatformIO();
+ ImGui_ImplOpenGL3_RenderState render_state;
+ render_state.UseBindSampler = bd->HasBindSampler;
+ render_state.UseTexParameterFilter = false;
+ render_state.CurrentSampler = 0;
+ render_state.CurrentTexParameterFilter = 0;
+ platform_io.Renderer_RenderState = &render_state;
+
+ ImGui_ImplOpenGL3_SetupRenderState(draw_data, &render_state, fb_width, fb_height, vertex_array_object);
// Will project scissor/clipping rectangles into framebuffer space
ImVec2 clip_off = draw_data->DisplayPos; // (0,0) unless using multi-viewports
@@ -654,9 +578,8 @@ void ImGui_ImplOpenGL3_RenderDrawData(ImDrawData* draw_data)
if (pcmd->UserCallback != nullptr)
{
// User callback, registered via ImDrawList::AddCallback()
- // (ImDrawCallback_ResetRenderState is a special callback value used by the user to request the renderer to reset render state.)
- if (pcmd->UserCallback == ImDrawCallback_ResetRenderState)
- ImGui_ImplOpenGL3_SetupRenderState(draw_data, fb_width, fb_height, vertex_array_object);
+ if (pcmd->UserCallback == ImGui_ImplOpenGL3_DrawCallback_ResetRenderState)
+ ImGui_ImplOpenGL3_SetupRenderState(draw_data, &render_state, fb_width, fb_height, vertex_array_object);
else
pcmd->UserCallback(draw_list, pcmd);
}
@@ -673,6 +596,15 @@ void ImGui_ImplOpenGL3_RenderDrawData(ImDrawData* draw_data)
// Bind texture, Draw
GL_CALL(glBindTexture(GL_TEXTURE_2D, (GLuint)(intptr_t)pcmd->GetTexID()));
+
+ // Emulate sampler change (even though it is technically part of texture data)
+ // As a sort of hack/workaround, we only start writing using glTexParameter() if sampler is ever changed explicitly.
+ if (render_state.UseTexParameterFilter)
+ {
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, render_state.CurrentTexParameterFilter);
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, render_state.CurrentTexParameterFilter);
+ }
+
#ifdef IMGUI_IMPL_OPENGL_MAY_HAVE_VTX_OFFSET
if (bd->GlVersion >= 320)
GL_CALL(glDrawElementsBaseVertex(GL_TRIANGLES, (GLsizei)pcmd->ElemCount, sizeof(ImDrawIdx) == 2 ? GL_UNSIGNED_SHORT : GL_UNSIGNED_INT, (void*)(intptr_t)(pcmd->IdxOffset * sizeof(ImDrawIdx)), (GLint)pcmd->VtxOffset));
@@ -682,6 +614,7 @@ void ImGui_ImplOpenGL3_RenderDrawData(ImDrawData* draw_data)
}
}
}
+ platform_io.Renderer_RenderState = nullptr;
// Destroy the temporary VAO
#ifdef IMGUI_IMPL_OPENGL_USE_VERTEX_ARRAY
@@ -740,13 +673,15 @@ static void ImGui_ImplOpenGL3_DestroyTexture(ImTextureData* tex)
void ImGui_ImplOpenGL3_UpdateTexture(ImTextureData* tex)
{
- // FIXME: Consider backing up and restoring
- if (tex->Status == ImTextureStatus_WantCreate || tex->Status == ImTextureStatus_WantUpdates)
+ // Backup GL_UNPACK state that we modify, restore on exit.
+ GLint last_unpack_row_length = 0; (void)last_unpack_row_length;
+ GLint last_unpack_alignment = 0; (void)last_unpack_alignment;
+ const bool last_unpack_state_save_and_restore = (tex->Status == ImTextureStatus_WantCreate || tex->Status == ImTextureStatus_WantUpdates);
+ if (last_unpack_state_save_and_restore)
{
#ifdef GL_UNPACK_ROW_LENGTH // Not on WebGL/ES
- GL_CALL(glPixelStorei(GL_UNPACK_ROW_LENGTH, 0));
-#endif
-#ifdef GL_UNPACK_ALIGNMENT
+ GL_CALL(glGetIntegerv(GL_UNPACK_ROW_LENGTH, &last_unpack_row_length));
+ GL_CALL(glGetIntegerv(GL_UNPACK_ALIGNMENT, &last_unpack_alignment));
GL_CALL(glPixelStorei(GL_UNPACK_ALIGNMENT, 1));
#endif
}
@@ -770,6 +705,9 @@ void ImGui_ImplOpenGL3_UpdateTexture(ImTextureData* tex)
GL_CALL(glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR));
GL_CALL(glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE));
GL_CALL(glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE));
+#if GL_UNPACK_ROW_LENGTH // Not on WebGL/ES
+ GL_CALL(glPixelStorei(GL_UNPACK_ROW_LENGTH, 0));
+#endif
GL_CALL(glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, tex->Width, tex->Height, 0, GL_RGBA, GL_UNSIGNED_BYTE, pixels));
// Store identifiers
@@ -792,7 +730,6 @@ void ImGui_ImplOpenGL3_UpdateTexture(ImTextureData* tex)
GL_CALL(glPixelStorei(GL_UNPACK_ROW_LENGTH, tex->Width));
for (ImTextureRect& r : tex->Updates)
GL_CALL(glTexSubImage2D(GL_TEXTURE_2D, 0, r.x, r.y, r.w, r.h, GL_RGBA, GL_UNSIGNED_BYTE, tex->GetPixelsAt(r.x, r.y)));
- GL_CALL(glPixelStorei(GL_UNPACK_ROW_LENGTH, 0));
#else
// GL ES doesn't have GL_UNPACK_ROW_LENGTH, so we need to (A) copy to a contiguous buffer or (B) upload line by line.
ImGui_ImplOpenGL3_Data* bd = ImGui_ImplOpenGL3_GetBackendData();
@@ -812,6 +749,15 @@ void ImGui_ImplOpenGL3_UpdateTexture(ImTextureData* tex)
}
else if (tex->Status == ImTextureStatus_WantDestroy && tex->UnusedFrames > 0)
ImGui_ImplOpenGL3_DestroyTexture(tex);
+
+ // Restore GL_UNPACK state
+ if (last_unpack_state_save_and_restore)
+ {
+#ifdef GL_UNPACK_ROW_LENGTH
+ GL_CALL(glPixelStorei(GL_UNPACK_ROW_LENGTH, last_unpack_row_length));
+ GL_CALL(glPixelStorei(GL_UNPACK_ALIGNMENT, last_unpack_alignment));
+#endif
+ }
}
// If you get an error please report on github. You may try different GL context version or GLSL version. See GL<>GLSL version table at the top of this file.
@@ -1038,6 +984,20 @@ bool ImGui_ImplOpenGL3_CreateDeviceObjects()
glGenBuffers(1, &bd->VboHandle);
glGenBuffers(1, &bd->ElementsHandle);
+#ifdef IMGUI_IMPL_OPENGL_MAY_HAVE_BIND_SAMPLER
+ if (bd->HasBindSampler)
+ {
+ glGenSamplers(2, &bd->TexSamplers[0]);
+ for (int sampler_n = 0; sampler_n < 2; sampler_n++)
+ {
+ GL_CALL(glSamplerParameteri(bd->TexSamplers[sampler_n], GL_TEXTURE_MIN_FILTER, (sampler_n == 0) ? GL_LINEAR : GL_NEAREST));
+ GL_CALL(glSamplerParameteri(bd->TexSamplers[sampler_n], GL_TEXTURE_MAG_FILTER, (sampler_n == 0) ? GL_LINEAR : GL_NEAREST));
+ GL_CALL(glSamplerParameteri(bd->TexSamplers[sampler_n], GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE));
+ GL_CALL(glSamplerParameteri(bd->TexSamplers[sampler_n], GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE));
+ }
+ }
+#endif
+
// Restore modified GL state
glBindTexture(GL_TEXTURE_2D, last_texture);
glBindBuffer(GL_ARRAY_BUFFER, last_array_buffer);
@@ -1055,6 +1015,9 @@ void ImGui_ImplOpenGL3_DestroyDeviceObjects()
{
ImGui_ImplOpenGL3_InitLoader();
ImGui_ImplOpenGL3_Data* bd = ImGui_ImplOpenGL3_GetBackendData();
+#ifdef IMGUI_IMPL_OPENGL_MAY_HAVE_BIND_SAMPLER
+ if (bd->TexSamplers[0]) { glDeleteSamplers(2, &bd->TexSamplers[0]); bd->TexSamplers[0] = bd->TexSamplers[1] = 0; }
+#endif
if (bd->VboHandle) { glDeleteBuffers(1, &bd->VboHandle); bd->VboHandle = 0; }
if (bd->ElementsHandle) { glDeleteBuffers(1, &bd->ElementsHandle); bd->ElementsHandle = 0; }
if (bd->ShaderHandle) { glDeleteProgram(bd->ShaderHandle); bd->ShaderHandle = 0; }
@@ -1065,6 +1028,149 @@ void ImGui_ImplOpenGL3_DestroyDeviceObjects()
ImGui_ImplOpenGL3_DestroyTexture(tex);
}
+bool ImGui_ImplOpenGL3_Init(const char* glsl_version)
+{
+ ImGuiIO& io = ImGui::GetIO();
+ IMGUI_CHECKVERSION();
+ IM_ASSERT(io.BackendRendererUserData == nullptr && "Already initialized a renderer backend!");
+
+ // Initialize loader
+ if (!ImGui_ImplOpenGL3_InitLoader())
+ return false;
+
+ // Setup backend capabilities flags
+ ImGui_ImplOpenGL3_Data* bd = IM_NEW(ImGui_ImplOpenGL3_Data)();
+ io.BackendRendererUserData = (void*)bd;
+ io.BackendRendererName = "imgui_impl_opengl3";
+
+ // Query for GL version (e.g. 320 for GL 3.2)
+ const char* gl_version_str = (const char*)glGetString(GL_VERSION);
+#if defined(IMGUI_IMPL_OPENGL_ES2)
+ // GLES 2
+ bd->GlVersion = 200;
+ bd->GlProfileIsES2 = true;
+ IM_UNUSED(gl_version_str);
+#else
+ // Desktop or GLES 3
+ GLint major = 0;
+ GLint minor = 0;
+ glGetIntegerv(GL_MAJOR_VERSION, &major);
+ glGetIntegerv(GL_MINOR_VERSION, &minor);
+ if (major == 0 && minor == 0)
+ sscanf(gl_version_str, "%d.%d", &major, &minor); // Query GL_VERSION in desktop GL 2.x, the string will start with "."
+ bd->GlVersion = (GLuint)(major * 100 + minor * 10);
+ glGetIntegerv(GL_MAX_TEXTURE_SIZE, &bd->MaxTextureSize);
+
+#if defined(IMGUI_IMPL_OPENGL_ES3)
+ bd->GlProfileIsES3 = true;
+#else
+ if (strncmp(gl_version_str, "OpenGL ES 3", 11) == 0)
+ bd->GlProfileIsES3 = true;
+#endif
+
+#if defined(GL_CONTEXT_PROFILE_MASK)
+ if (!bd->GlProfileIsES3 && bd->GlVersion >= 320)
+ glGetIntegerv(GL_CONTEXT_PROFILE_MASK, &bd->GlProfileMask);
+ bd->GlProfileIsCompat = (bd->GlProfileMask & GL_CONTEXT_COMPATIBILITY_PROFILE_BIT) != 0;
+#endif
+
+ bd->UseBufferSubData = false;
+ /*
+ // Query vendor to enable glBufferSubData kludge
+#ifdef _WIN32
+ if (const char* vendor = (const char*)glGetString(GL_VENDOR))
+ if (strncmp(vendor, "Intel", 5) == 0)
+ bd->UseBufferSubData = true;
+#endif
+ */
+#endif
+
+#ifdef IMGUI_IMPL_OPENGL_DEBUG
+ printf("GlVersion = %d, \"%s\"\nGlProfileIsCompat = %d\nGlProfileMask = 0x%X\nGlProfileIsES2/IsEs3 = %d/%d\nGL_VENDOR = '%s'\nGL_RENDERER = '%s'\n", bd->GlVersion, gl_version_str, bd->GlProfileIsCompat, bd->GlProfileMask, bd->GlProfileIsES2, bd->GlProfileIsES3, (const char*)glGetString(GL_VENDOR), (const char*)glGetString(GL_RENDERER)); // [DEBUG]
+#endif
+
+#ifdef IMGUI_IMPL_OPENGL_MAY_HAVE_VTX_OFFSET
+ if (bd->GlVersion >= 320)
+ io.BackendFlags |= ImGuiBackendFlags_RendererHasVtxOffset; // We can honor the ImDrawCmd::VtxOffset field, allowing for large meshes.
+#endif
+ io.BackendFlags |= ImGuiBackendFlags_RendererHasTextures; // We can honor ImGuiPlatformIO::Textures[] requests during render.
+ io.BackendFlags |= ImGuiBackendFlags_RendererHasViewports; // We can create multi-viewports on the Renderer side (optional)
+
+ ImGuiPlatformIO& platform_io = ImGui::GetPlatformIO();
+ platform_io.Renderer_TextureMaxWidth = platform_io.Renderer_TextureMaxHeight = (int)bd->MaxTextureSize;
+ platform_io.DrawCallback_ResetRenderState = ImGui_ImplOpenGL3_DrawCallback_ResetRenderState;
+ platform_io.DrawCallback_SetSamplerLinear = ImGui_ImplOpenGL3_DrawCallback_SetSamplerLinear;
+ platform_io.DrawCallback_SetSamplerNearest = ImGui_ImplOpenGL3_DrawCallback_SetSamplerNearest;
+
+ // Store GLSL version string so we can refer to it later in case we recreate shaders.
+ // Note: GLSL version is NOT the same as GL version. Leave this to nullptr if unsure.
+ if (glsl_version == nullptr)
+ {
+#if defined(IMGUI_IMPL_OPENGL_ES2)
+ glsl_version = "#version 100";
+#elif defined(IMGUI_IMPL_OPENGL_ES3)
+ glsl_version = "#version 300 es";
+#elif defined(__APPLE__)
+ glsl_version = "#version 150";
+#else
+ if (bd->GlVersion >= 410)
+ glsl_version = "#version 410";
+ else
+ glsl_version = "#version 130";
+#endif
+ }
+ IM_ASSERT((int)strlen(glsl_version) + 2 < IM_COUNTOF(bd->GlslVersionString));
+ strcpy(bd->GlslVersionString, glsl_version);
+ strcat(bd->GlslVersionString, "\n");
+
+ // Make an arbitrary GL call (we don't actually need the result)
+ // IF YOU GET A CRASH HERE: it probably means the OpenGL function loader didn't do its job. Let us know!
+ GLint current_texture;
+ glGetIntegerv(GL_TEXTURE_BINDING_2D, ¤t_texture);
+
+ // Detect extensions we support
+#ifdef IMGUI_IMPL_OPENGL_MAY_HAVE_POLYGON_MODE
+ bd->HasPolygonMode = (!bd->GlProfileIsES2 && !bd->GlProfileIsES3);
+#endif
+#ifdef IMGUI_IMPL_OPENGL_MAY_HAVE_BIND_SAMPLER
+ bd->HasBindSampler = (bd->GlVersion >= 330 || bd->GlProfileIsES3);
+#endif
+ bd->HasClipOrigin = (bd->GlVersion >= 450);
+#ifdef IMGUI_IMPL_OPENGL_HAS_EXTENSIONS
+ GLint num_extensions = 0;
+ glGetIntegerv(GL_NUM_EXTENSIONS, &num_extensions);
+ for (GLint i = 0; i < num_extensions; i++)
+ {
+ const char* extension = (const char*)glGetStringi(GL_EXTENSIONS, i);
+ if (extension != nullptr && strcmp(extension, "GL_ARB_clip_control") == 0)
+ bd->HasClipOrigin = true;
+ }
+#endif
+
+ ImGui_ImplOpenGL3_InitMultiViewportSupport();
+
+ return true;
+}
+
+void ImGui_ImplOpenGL3_Shutdown()
+{
+ ImGui_ImplOpenGL3_Data* bd = ImGui_ImplOpenGL3_GetBackendData();
+ IM_ASSERT(bd != nullptr && "No renderer backend to shutdown, or already shutdown?");
+ ImGuiIO& io = ImGui::GetIO();
+ ImGuiPlatformIO& platform_io = ImGui::GetPlatformIO();
+
+ ImGui_ImplOpenGL3_ShutdownMultiViewportSupport();
+ ImGui_ImplOpenGL3_DestroyDeviceObjects();
+
+ io.BackendRendererName = nullptr;
+ io.BackendRendererUserData = nullptr;
+ io.BackendFlags &= ~(ImGuiBackendFlags_RendererHasVtxOffset | ImGuiBackendFlags_RendererHasTextures | ImGuiBackendFlags_RendererHasViewports);
+ platform_io.ClearRendererHandlers();
+ IM_DELETE(bd);
+
+ ImGui_ImplOpenGL3_ShutdownLoader();
+}
+
//--------------------------------------------------------------------------------------------------------
// MULTI-VIEWPORT / PLATFORM INTERFACE SUPPORT
// This is an _advanced_ and _optional_ feature, allowing the backend to create and handle multiple viewports simultaneously.
diff --git a/include/imgui/backends/imgui_impl_opengl3.h b/include/imgui/backends/imgui_impl_opengl3.h
index 7855c43..62cee8b 100644
--- a/include/imgui/backends/imgui_impl_opengl3.h
+++ b/include/imgui/backends/imgui_impl_opengl3.h
@@ -66,4 +66,17 @@ IMGUI_IMPL_API void ImGui_ImplOpenGL3_UpdateTexture(ImTextureData* tex);
#endif
+// [BETA] Selected render state data shared with callbacks.
+// This is temporarily stored in GetPlatformIO().Renderer_RenderState during the ImGui_ImplOpenGL3_RenderDrawData() call.
+// (Please open an issue if you feel you need access to more data)
+struct ImGui_ImplOpenGL3_RenderState
+{
+ bool UseBindSampler;
+ bool UseTexParameterFilter;
+ unsigned int CurrentSampler; // (GLuint) Used if UseBindSampler == true, otherwise always 0
+ unsigned int CurrentTexParameterFilter; // (GLuint) Used if UseTexParameterToSetSampler == true
+};
+
+static inline ImGui_ImplOpenGL3_RenderState* ImGui_ImplOpenGL3_GetRenderState() { return (ImGui_ImplOpenGL3_RenderState*)ImGui::GetPlatformIO().Renderer_RenderState; }
+
#endif // #ifndef IMGUI_DISABLE
diff --git a/include/imgui/backends/imgui_impl_sdl2.cpp b/include/imgui/backends/imgui_impl_sdl2.cpp
index d38bdae..9e91366 100644
--- a/include/imgui/backends/imgui_impl_sdl2.cpp
+++ b/include/imgui/backends/imgui_impl_sdl2.cpp
@@ -26,6 +26,8 @@
// CHANGELOG
// (minor and older changes stripped away, please see git history for details)
// 2026-XX-XX: Platform: Added support for multiple windows via the ImGuiPlatformIO interface.
+// 2026-07-15: Inputs: restore SDL_StartTextInput()/SDL_StopTextInput() in IME handler for on-screen keyboard support on Android/mobile. (#7636, #9474)
+// 2026-04-16: Made ImGui_ImplSDL2_GetContentScaleForWindow(), ImGui_ImplSDL2_GetContentScaleForDisplay() helpers return a minimum of 1.0f, as some Linux setup seems to report <1.0f value and this breaks scaling border size. (#9369)
// 2026-03-09: [Docking] Fixed an issue dated 2025/04/09 (1.92 WIP) where a refactor+merge caused ImGuiBackendFlags_HasMouseHoveredViewport to never be set, causing foreign windows to be ignored when deciding of hovered viewport. (#9284)
// 2026-02-13: Inputs: systems other than X11 are back to starting mouse capture on mouse down (reverts 2025-02-26 change). Only X11 requires waiting for a drag by default (not ideal, but a better default for X11 users). Added ImGui_ImplSDL2_SetMouseCaptureMode() for X11 debugger users. (#3650, #6410, #9235)
// 2026-01-15: Changed GetClipboardText() handler to return nullptr on error aka clipboard contents is not text. Consistent with other backends. (#9168)
@@ -164,8 +166,9 @@ struct ImGui_ImplSDL2_Data
SDL_Renderer* Renderer;
Uint64 Time;
char* ClipboardTextData;
- char BackendPlatformName[48];
- bool UseVulkan;
+ char BackendPlatformName[64];
+ bool IsWayland;
+ bool IsVulkan;
bool WantUpdateMonitors;
// Mouse handling
@@ -229,6 +232,18 @@ static void ImGui_ImplSDL2_PlatformSetImeData(ImGuiContext*, ImGuiViewport* view
r.w = 1;
r.h = (int)data->InputLineHeight;
SDL_SetTextInputRect(&r);
+
+#ifdef __ANDROID__
+ // SDL_StartTextInput() is needed on Android (and some other platforms) to show the on-screen keyboard. (#7636, #9474, #6306)
+ // It was removed in a7703fe6 due to concerns about its relation to desktop IME, but is required on mobile.
+ SDL_StartTextInput();
+#endif
+ }
+ else
+ {
+#ifdef __ANDROID__
+ SDL_StopTextInput();
+#endif
}
}
@@ -550,11 +565,12 @@ static bool ImGui_ImplSDL2_Init(SDL_Window* window, SDL_Renderer* renderer, void
SDL_version ver_runtime;
SDL_VERSION(&ver_compiled);
SDL_GetVersion(&ver_runtime);
+ const char* sdl_video_driver = SDL_GetCurrentVideoDriver();
// Setup backend capabilities flags
ImGui_ImplSDL2_Data* bd = IM_NEW(ImGui_ImplSDL2_Data)();
- snprintf(bd->BackendPlatformName, sizeof(bd->BackendPlatformName), "imgui_impl_sdl2 (%u.%u.%u, %u.%u.%u)",
- ver_compiled.major, ver_compiled.minor, ver_compiled.patch, ver_runtime.major, ver_runtime.minor, ver_runtime.patch);
+ snprintf(bd->BackendPlatformName, sizeof(bd->BackendPlatformName), "imgui_impl_sdl2 (%u.%u.%u, %u.%u.%u) (%s)",
+ ver_compiled.major, ver_compiled.minor, ver_compiled.patch, ver_runtime.major, ver_runtime.minor, ver_runtime.patch, sdl_video_driver);
io.BackendPlatformUserData = (void*)bd;
io.BackendPlatformName = bd->BackendPlatformName;
io.BackendFlags |= ImGuiBackendFlags_HasMouseCursors; // We can honor GetMouseCursor() values (optional)
@@ -564,16 +580,16 @@ static bool ImGui_ImplSDL2_Init(SDL_Window* window, SDL_Renderer* renderer, void
bd->Window = window;
bd->WindowID = SDL_GetWindowID(window);
bd->Renderer = renderer;
+ bd->IsWayland = strcmp(sdl_video_driver, "Wayland") == 0;
// Check and store if we are on a SDL backend that supports SDL_GetGlobalMouseState() and SDL_CaptureMouse()
// ("wayland" and "rpi" don't support it, but we chose to use a white-list instead of a black-list)
bd->MouseCanUseGlobalState = false;
bd->MouseCaptureMode = ImGui_ImplSDL2_MouseCaptureMode_Disabled;
#if SDL_HAS_CAPTURE_AND_GLOBAL_MOUSE
- const char* sdl_backend = SDL_GetCurrentVideoDriver();
const char* capture_and_global_state_whitelist[] = { "windows", "cocoa", "x11", "DIVE", "VMAN" };
for (const char* item : capture_and_global_state_whitelist)
- if (strncmp(sdl_backend, item, strlen(item)) == 0)
+ if (strncmp(sdl_video_driver, item, strlen(item)) == 0)
{
bd->MouseCanUseGlobalState = true;
bd->MouseCaptureMode = (strcmp(item, "x11") == 0) ? ImGui_ImplSDL2_MouseCaptureMode_EnabledAfterDrag : ImGui_ImplSDL2_MouseCaptureMode_Enabled;
@@ -679,7 +695,7 @@ bool ImGui_ImplSDL2_InitForVulkan(SDL_Window* window)
if (!ImGui_ImplSDL2_Init(window, nullptr, nullptr))
return false;
ImGui_ImplSDL2_Data* bd = ImGui_ImplSDL2_GetBackendData();
- bd->UseVulkan = true;
+ bd->IsVulkan = true;
return true;
}
@@ -851,6 +867,7 @@ float ImGui_ImplSDL2_GetContentScaleForWindow(SDL_Window* window)
return ImGui_ImplSDL2_GetContentScaleForDisplay(SDL_GetWindowDisplayIndex(window));
}
+// SDL_GetDisplayDPI() seems rather unreliable on Linux.
float ImGui_ImplSDL2_GetContentScaleForDisplay(int display_index)
{
const char* sdl_driver = SDL_GetCurrentVideoDriver();
@@ -860,7 +877,11 @@ float ImGui_ImplSDL2_GetContentScaleForDisplay(int display_index)
#if !defined(__APPLE__) && !defined(__EMSCRIPTEN__) && !defined(__ANDROID__)
float dpi = 0.0f;
if (SDL_GetDisplayDPI(display_index, &dpi, nullptr, nullptr) == 0)
+ {
+ if (dpi < 96.0f)
+ dpi = 96.0f;
return dpi / 96.0f;
+ }
#endif
#endif
IM_UNUSED(display_index);
@@ -1019,7 +1040,7 @@ static void ImGui_ImplSDL2_GetWindowSizeAndFramebufferScale(SDL_Window* window,
if (out_size != nullptr)
*out_size = ImVec2((float)w, (float)h);
if (out_framebuffer_scale != nullptr)
- *out_framebuffer_scale = (w > 0 && h > 0) ? ImVec2((float)display_w / w, (float)display_h / h) : ImVec2(1.0f, 1.0f);
+ *out_framebuffer_scale = (w > 0 && h > 0) ? ImVec2((float)display_w / (float)w, (float)display_h / (float)h) : ImVec2(1.0f, 1.0f);
}
void ImGui_ImplSDL2_NewFrame()
@@ -1044,7 +1065,7 @@ void ImGui_ImplSDL2_NewFrame()
Uint64 current_time = SDL_GetPerformanceCounter();
if (current_time <= bd->Time)
current_time = bd->Time + 1;
- io.DeltaTime = bd->Time > 0 ? (float)((double)(current_time - bd->Time) / frequency) : (float)(1.0f / 60.0f);
+ io.DeltaTime = bd->Time > 0 ? (float)((double)(current_time - bd->Time) / (double)frequency) : (float)(1.0f / 60.0f);
bd->Time = current_time;
if (bd->MouseLastLeaveFrame && bd->MouseLastLeaveFrame >= ImGui::GetFrameCount() && bd->MouseButtonsDown == 0)
@@ -1106,7 +1127,7 @@ static void ImGui_ImplSDL2_CreateWindow(ImGuiViewport* viewport)
}
Uint32 sdl_flags = 0;
- sdl_flags |= use_opengl ? SDL_WINDOW_OPENGL : (bd->UseVulkan ? SDL_WINDOW_VULKAN : 0);
+ sdl_flags |= use_opengl ? SDL_WINDOW_OPENGL : (bd->IsVulkan ? SDL_WINDOW_VULKAN : 0);
sdl_flags |= SDL_GetWindowFlags(bd->Window) & SDL_WINDOW_ALLOW_HIGHDPI;
sdl_flags |= SDL_WINDOW_HIDDEN;
sdl_flags |= (viewport->Flags & ImGuiViewportFlags_NoDecoration) ? SDL_WINDOW_BORDERLESS : 0;
diff --git a/include/imgui/backends/imgui_impl_sdl3.cpp b/include/imgui/backends/imgui_impl_sdl3.cpp
index 738def9..2b26db3 100644
--- a/include/imgui/backends/imgui_impl_sdl3.cpp
+++ b/include/imgui/backends/imgui_impl_sdl3.cpp
@@ -124,8 +124,9 @@ struct ImGui_ImplSDL3_Data
SDL_Renderer* Renderer;
Uint64 Time;
char* ClipboardTextData;
- char BackendPlatformName[48];
- bool UseVulkan;
+ char BackendPlatformName[64];
+ bool IsWayland;
+ bool IsVulkan;
bool WantUpdateMonitors;
// IME handling
@@ -560,11 +561,13 @@ static bool ImGui_ImplSDL3_Init(SDL_Window* window, SDL_Renderer* renderer, void
//SDL_SetHint(SDL_HINT_EVENT_LOGGING, "2");
const int ver_linked = SDL_GetVersion();
+ const char* sdl_video_driver = SDL_GetCurrentVideoDriver();
// Setup backend capabilities flags
ImGui_ImplSDL3_Data* bd = IM_NEW(ImGui_ImplSDL3_Data)();
- snprintf(bd->BackendPlatformName, sizeof(bd->BackendPlatformName), "imgui_impl_sdl3 (%d.%d.%d; %d.%d.%d)",
- SDL_MAJOR_VERSION, SDL_MINOR_VERSION, SDL_MICRO_VERSION, SDL_VERSIONNUM_MAJOR(ver_linked), SDL_VERSIONNUM_MINOR(ver_linked), SDL_VERSIONNUM_MICRO(ver_linked));
+ snprintf(bd->BackendPlatformName, sizeof(bd->BackendPlatformName), "imgui_impl_sdl3 (%d.%d.%d; %d.%d.%d) (%s)",
+ SDL_MAJOR_VERSION, SDL_MINOR_VERSION, SDL_MICRO_VERSION, SDL_VERSIONNUM_MAJOR(ver_linked), SDL_VERSIONNUM_MINOR(ver_linked), SDL_VERSIONNUM_MICRO(ver_linked),
+ sdl_video_driver);
io.BackendPlatformUserData = (void*)bd;
io.BackendPlatformName = bd->BackendPlatformName;
io.BackendFlags |= ImGuiBackendFlags_HasMouseCursors; // We can honor GetMouseCursor() values (optional)
@@ -575,16 +578,16 @@ static bool ImGui_ImplSDL3_Init(SDL_Window* window, SDL_Renderer* renderer, void
bd->Window = window;
bd->WindowID = SDL_GetWindowID(window);
bd->Renderer = renderer;
+ bd->IsWayland = strcmp(sdl_video_driver, "wayland") == 0;
// Check and store if we are on a SDL backend that supports SDL_GetGlobalMouseState() and SDL_CaptureMouse()
// ("wayland" and "rpi" don't support it, but we chose to use a white-list instead of a black-list)
bd->MouseCanUseGlobalState = false;
bd->MouseCaptureMode = ImGui_ImplSDL3_MouseCaptureMode_Disabled;
#if SDL_HAS_CAPTURE_AND_GLOBAL_MOUSE
- const char* sdl_backend = SDL_GetCurrentVideoDriver();
const char* capture_and_global_state_whitelist[] = { "windows", "cocoa", "x11", "DIVE", "VMAN" };
for (const char* item : capture_and_global_state_whitelist)
- if (strncmp(sdl_backend, item, strlen(item)) == 0)
+ if (strncmp(sdl_video_driver, item, strlen(item)) == 0)
{
bd->MouseCanUseGlobalState = true;
bd->MouseCaptureMode = (strcmp(item, "x11") == 0) ? ImGui_ImplSDL3_MouseCaptureMode_EnabledAfterDrag : ImGui_ImplSDL3_MouseCaptureMode_Enabled;
@@ -667,7 +670,7 @@ bool ImGui_ImplSDL3_InitForVulkan(SDL_Window* window)
if (!ImGui_ImplSDL3_Init(window, nullptr, nullptr))
return false;
ImGui_ImplSDL3_Data* bd = ImGui_ImplSDL3_GetBackendData();
- bd->UseVulkan = true;
+ bd->IsVulkan = true;
return true;
}
@@ -785,8 +788,8 @@ static void ImGui_ImplSDL3_UpdateMouseData()
if (!(io.ConfigFlags & ImGuiConfigFlags_ViewportsEnable))
{
SDL_GetWindowPosition(focused_window, &window_x, &window_y);
- mouse_x -= window_x;
- mouse_y -= window_y;
+ mouse_x -= (float)window_x;
+ mouse_y -= (float)window_y;
}
io.AddMousePosEvent(mouse_x, mouse_y);
}
@@ -1014,7 +1017,7 @@ void ImGui_ImplSDL3_NewFrame()
Uint64 current_time = SDL_GetPerformanceCounter();
if (current_time <= bd->Time)
current_time = bd->Time + 1;
- io.DeltaTime = bd->Time > 0 ? (float)((double)(current_time - bd->Time) / frequency) : (float)(1.0f / 60.0f);
+ io.DeltaTime = bd->Time > 0 ? (float)((double)(current_time - bd->Time) / (double)frequency) : (float)(1.0f / 60.0f);
bd->Time = current_time;
if (bd->MousePendingLeaveFrame && bd->MousePendingLeaveFrame >= ImGui::GetFrameCount() && bd->MouseButtonsDown == 0)
@@ -1091,7 +1094,7 @@ static void ImGui_ImplSDL3_CreateWindow(ImGuiViewport* viewport)
SDL_WindowFlags sdl_flags = 0;
sdl_flags |= SDL_WINDOW_HIDDEN;
- sdl_flags |= use_opengl ? SDL_WINDOW_OPENGL : (bd->UseVulkan ? SDL_WINDOW_VULKAN : 0);
+ sdl_flags |= use_opengl ? SDL_WINDOW_OPENGL : (bd->IsVulkan ? SDL_WINDOW_VULKAN : 0);
sdl_flags |= SDL_GetWindowFlags(bd->Window) & SDL_WINDOW_HIGH_PIXEL_DENSITY;
sdl_flags |= (viewport->Flags & ImGuiViewportFlags_NoDecoration) ? SDL_WINDOW_BORDERLESS : 0;
sdl_flags |= (viewport->Flags & ImGuiViewportFlags_NoDecoration) ? 0 : SDL_WINDOW_RESIZABLE;
diff --git a/include/imgui/backends/imgui_impl_sdlgpu3.cpp b/include/imgui/backends/imgui_impl_sdlgpu3.cpp
index e01ddb7..3883ca8 100644
--- a/include/imgui/backends/imgui_impl_sdlgpu3.cpp
+++ b/include/imgui/backends/imgui_impl_sdlgpu3.cpp
@@ -24,6 +24,7 @@
// CHANGELOG
// 2026-XX-XX: Platform: Added support for multiple windows via the ImGuiPlatformIO interface.
+// 2026-04-23: Added support for standard draw callbacks (in platform_io): DrawCallback_ResetRenderState, DrawCallback_SetSamplerLinear, DrawCallback_SetSamplerNearest. Obsoleting samplers from ImGui_ImplSDLGPU3_RenderState. (#9378)
// 2026-03-19: Fixed issue in ImGui_ImplSDLGPU3_DestroyTexture() if ImTextureID_Invalid is defined to be != 0, which became the default since 2026-03-12. (#9295, #9310)
// 2026-02-25: Removed unnecessary call to SDL_WaitForGPUIdle when releasing vertex/index buffers. (#9262)
// 2025-11-26: macOS version can use MSL shaders in order to support macOS 10.14+ (vs Metallib shaders requiring macOS 14+). Requires calling SDL_CreateGPUDevice() with SDL_GPU_SHADERFORMAT_MSL.
@@ -61,6 +62,10 @@ struct ImGui_ImplSDLGPU3_Data
{
ImGui_ImplSDLGPU3_InitInfo InitInfo;
+ // Render state
+ ImGui_ImplSDLGPU3_RenderState* RenderState = nullptr; // == ImGui::GetPlatformIO().Renderer_RenderState during rendering.
+ SDL_GPUSampler* CurrentSampler = nullptr;
+
// Graphics pipeline & shaders
SDL_GPUShader* VertexShader = nullptr;
SDL_GPUShader* FragmentShader = nullptr;
@@ -89,10 +94,10 @@ static ImGui_ImplSDLGPU3_Data* ImGui_ImplSDLGPU3_GetBackendData()
return ImGui::GetCurrentContext() ? (ImGui_ImplSDLGPU3_Data*)ImGui::GetIO().BackendRendererUserData : nullptr;
}
-static void ImGui_ImplSDLGPU3_SetupRenderState(ImDrawData* draw_data, ImGui_ImplSDLGPU3_RenderState* render_state, SDL_GPUGraphicsPipeline* pipeline, SDL_GPUCommandBuffer* command_buffer, SDL_GPURenderPass* render_pass, ImGui_ImplSDLGPU3_FrameData* fd, uint32_t fb_width, uint32_t fb_height)
+static void ImGui_ImplSDLGPU3_SetupRenderState(ImDrawData* draw_data, SDL_GPUGraphicsPipeline* pipeline, SDL_GPUCommandBuffer* command_buffer, SDL_GPURenderPass* render_pass, ImGui_ImplSDLGPU3_FrameData* fd, uint32_t fb_width, uint32_t fb_height)
{
ImGui_ImplSDLGPU3_Data* bd = ImGui_ImplSDLGPU3_GetBackendData();
- render_state->SamplerCurrent = bd->TexSamplerLinear;
+ bd->CurrentSampler = bd->TexSamplerLinear;
// Bind graphics pipeline
SDL_BindGPUGraphicsPipeline(render_pass, pipeline);
@@ -176,8 +181,8 @@ void ImGui_ImplSDLGPU3_PrepareDrawData(ImDrawData* draw_data, SDL_GPUCommandBuff
ImGui_ImplSDLGPU3_InitInfo* v = &bd->InitInfo;
ImGui_ImplSDLGPU3_FrameData* fd = &bd->MainWindowFrameData;
- uint32_t vertex_size = draw_data->TotalVtxCount * sizeof(ImDrawVert);
- uint32_t index_size = draw_data->TotalIdxCount * sizeof(ImDrawIdx);
+ uint32_t vertex_size = (uint32_t)draw_data->TotalVtxCount * sizeof(ImDrawVert);
+ uint32_t index_size = (uint32_t)draw_data->TotalIdxCount * sizeof(ImDrawIdx);
if (fd->VertexBuffer == nullptr || fd->VertexBufferSize < vertex_size)
CreateOrResizeBuffers(&fd->VertexBuffer, &fd->VertexTransferBuffer, &fd->VertexBufferSize, vertex_size, SDL_GPU_BUFFERUSAGE_VERTEX);
if (fd->IndexBuffer == nullptr || fd->IndexBufferSize < index_size)
@@ -218,6 +223,11 @@ void ImGui_ImplSDLGPU3_PrepareDrawData(ImDrawData* draw_data, SDL_GPUCommandBuff
SDL_EndGPUCopyPass(copy_pass);
}
+// Draw callbacks
+static void ImGui_ImplSDLGPU3_DrawCallback_ResetRenderState(const ImDrawList*, const ImDrawCmd*) {} // Intentionally empty. Used as an identifier for rendering loop to call its code. Simpler to implement this way.
+static void ImGui_ImplSDLGPU3_DrawCallback_SetSamplerLinear(const ImDrawList*, const ImDrawCmd*) { ImGui_ImplSDLGPU3_Data* bd = ImGui_ImplSDLGPU3_GetBackendData(); bd->CurrentSampler = bd->TexSamplerLinear; }
+static void ImGui_ImplSDLGPU3_DrawCallback_SetSamplerNearest(const ImDrawList*, const ImDrawCmd*) { ImGui_ImplSDLGPU3_Data* bd = ImGui_ImplSDLGPU3_GetBackendData(); bd->CurrentSampler = bd->TexSamplerNearest; }
+
void ImGui_ImplSDLGPU3_RenderDrawData(ImDrawData* draw_data, SDL_GPUCommandBuffer* command_buffer, SDL_GPURenderPass* render_pass, SDL_GPUGraphicsPipeline* pipeline)
{
// Avoid rendering when minimized, scale coordinates for retina displays (screen coordinates != framebuffer coordinates)
@@ -240,11 +250,9 @@ void ImGui_ImplSDLGPU3_RenderDrawData(ImDrawData* draw_data, SDL_GPUCommandBuffe
ImGuiPlatformIO& platform_io = ImGui::GetPlatformIO();
ImGui_ImplSDLGPU3_RenderState render_state;
render_state.Device = bd->InitInfo.Device;
- render_state.SamplerLinear = render_state.SamplerCurrent = bd->TexSamplerLinear;
- render_state.SamplerNearest = bd->TexSamplerNearest;
- platform_io.Renderer_RenderState = &render_state;
+ platform_io.Renderer_RenderState = bd->RenderState = &render_state;
- ImGui_ImplSDLGPU3_SetupRenderState(draw_data, &render_state, pipeline, command_buffer, render_pass, fd, fb_width, fb_height);
+ ImGui_ImplSDLGPU3_SetupRenderState(draw_data, pipeline, command_buffer, render_pass, fd, fb_width, fb_height);
// Render command lists
// (Because we merged all buffers into a single one, we maintain our own offset into them)
@@ -258,9 +266,8 @@ void ImGui_ImplSDLGPU3_RenderDrawData(ImDrawData* draw_data, SDL_GPUCommandBuffe
if (pcmd->UserCallback != nullptr)
{
// User callback, registered via ImDrawList::AddCallback()
- // (ImDrawCallback_ResetRenderState is a special callback value used by the user to request the renderer to reset render state.)
- if (pcmd->UserCallback == ImDrawCallback_ResetRenderState)
- ImGui_ImplSDLGPU3_SetupRenderState(draw_data, &render_state, pipeline, command_buffer, render_pass, fd, fb_width, fb_height);
+ if (pcmd->UserCallback == ImGui_ImplSDLGPU3_DrawCallback_ResetRenderState)
+ ImGui_ImplSDLGPU3_SetupRenderState(draw_data, pipeline, command_buffer, render_pass, fd, fb_width, fb_height);
else
pcmd->UserCallback(draw_list, pcmd);
}
@@ -273,8 +280,8 @@ void ImGui_ImplSDLGPU3_RenderDrawData(ImDrawData* draw_data, SDL_GPUCommandBuffe
// Clamp to viewport as SDL_SetGPUScissor() won't accept values that are off bounds
if (clip_min.x < 0.0f) { clip_min.x = 0.0f; }
if (clip_min.y < 0.0f) { clip_min.y = 0.0f; }
- if (clip_max.x > fb_width) { clip_max.x = (float)fb_width; }
- if (clip_max.y > fb_height) { clip_max.y = (float)fb_height; }
+ if (clip_max.x > (float)fb_width) { clip_max.x = (float)fb_width; }
+ if (clip_max.y > (float)fb_height) { clip_max.y = (float)fb_height; }
if (clip_max.x <= clip_min.x || clip_max.y <= clip_min.y)
continue;
@@ -289,7 +296,7 @@ void ImGui_ImplSDLGPU3_RenderDrawData(ImDrawData* draw_data, SDL_GPUCommandBuffe
// Bind DescriptorSet with font or user texture
SDL_GPUTextureSamplerBinding texture_sampler_binding;
texture_sampler_binding.texture = (SDL_GPUTexture*)(intptr_t)pcmd->GetTexID();
- texture_sampler_binding.sampler = render_state.SamplerCurrent;
+ texture_sampler_binding.sampler = bd->CurrentSampler;
SDL_BindGPUFragmentSamplers(render_pass, 0, &texture_sampler_binding, 1);
// Draw
@@ -308,6 +315,8 @@ void ImGui_ImplSDLGPU3_RenderDrawData(ImDrawData* draw_data, SDL_GPUCommandBuffe
// We perform a call to SDL_SetGPUScissor() to set back a full viewport which is likely to fix things for 99% users but technically this is not perfect. (See github #4644)
SDL_Rect scissor_rect { 0, 0, fb_width, fb_height };
SDL_SetGPUScissor(render_pass, &scissor_rect);
+
+ platform_io.Renderer_RenderState = bd->RenderState = nullptr;
}
static void ImGui_ImplSDLGPU3_DestroyTexture(ImTextureData* tex)
@@ -662,6 +671,11 @@ bool ImGui_ImplSDLGPU3_Init(ImGui_ImplSDLGPU3_InitInfo* info)
io.BackendFlags |= ImGuiBackendFlags_RendererHasTextures; // We can honor ImGuiPlatformIO::Textures[] requests during render.
io.BackendFlags |= ImGuiBackendFlags_RendererHasViewports; // We can create multi-viewports on the Renderer side (optional)
+ ImGuiPlatformIO& platform_io = ImGui::GetPlatformIO();
+ platform_io.DrawCallback_ResetRenderState = ImGui_ImplSDLGPU3_DrawCallback_ResetRenderState;
+ platform_io.DrawCallback_SetSamplerLinear = ImGui_ImplSDLGPU3_DrawCallback_SetSamplerLinear;
+ platform_io.DrawCallback_SetSamplerNearest = ImGui_ImplSDLGPU3_DrawCallback_SetSamplerNearest;
+
IM_ASSERT(info->Device != nullptr);
IM_ASSERT(info->ColorTargetFormat != SDL_GPU_TEXTUREFORMAT_INVALID);
diff --git a/include/imgui/backends/imgui_impl_sdlgpu3.h b/include/imgui/backends/imgui_impl_sdlgpu3.h
index fe66433..04ce552 100644
--- a/include/imgui/backends/imgui_impl_sdlgpu3.h
+++ b/include/imgui/backends/imgui_impl_sdlgpu3.h
@@ -58,9 +58,6 @@ IMGUI_IMPL_API void ImGui_ImplSDLGPU3_UpdateTexture(ImTextureData* tex);
struct ImGui_ImplSDLGPU3_RenderState
{
SDL_GPUDevice* Device;
- SDL_GPUSampler* SamplerLinear; // Bilinear filtering sampler
- SDL_GPUSampler* SamplerNearest; // Nearest/point filtering sampler
- SDL_GPUSampler* SamplerCurrent; // Current sampler (may be changed by callback)
};
#endif // #ifndef IMGUI_DISABLE
diff --git a/include/imgui/backends/imgui_impl_sdlrenderer2.cpp b/include/imgui/backends/imgui_impl_sdlrenderer2.cpp
index 218ee3f..a16ec31 100644
--- a/include/imgui/backends/imgui_impl_sdlrenderer2.cpp
+++ b/include/imgui/backends/imgui_impl_sdlrenderer2.cpp
@@ -14,10 +14,11 @@
// [X] Renderer: Large meshes support (64k+ vertices) even with 16-bit indices (ImGuiBackendFlags_RendererHasVtxOffset).
// [X] Renderer: Texture updates support for dynamic font atlas (ImGuiBackendFlags_RendererHasTextures).
// [X] Renderer: Expose selected render state for draw callbacks to use. Access in '(ImGui_ImplXXXX_RenderState*)GetPlatformIO().Renderer_RenderState'.
-// Missing features:
+// Missing features or Issues:
// [ ] Renderer: Multi-viewport support (multiple windows).
+// [ ] Renderer: Missing support for DrawCallback_SetSamplerLinear, DrawCallback_SetSamplerNearest callbacks: SDLRenderer2 does not support changing SDL_SCALE_MODE while rendering.
-// You can copy and use unmodified imgui_impl_* files in your project. See examples/ folder for examples of using this.
+// You can use unmodified imgui_impl_* files in your project. See examples/ folder for examples of using this.
// Prefer including the entire imgui/ repository into your project (either as a copy or as a submodule), and only build the backends you need.
// Learn about Dear ImGui:
// - FAQ https://dearimgui.com/faq
@@ -26,6 +27,8 @@
// - Introduction, links and more at the top of imgui.cpp
// CHANGELOG
+// (minor and older changes stripped away, please see git history for details)
+// 2026-04-23: Added support for standard draw callbacks (in platform_io): DrawCallback_ResetRenderState (others cannot be supported). (#9378)
// 2026-03-12: Fixed invalid assert in ImGui_ImplSDLRenderer2_UpdateTexture() if ImTextureID_Invalid is defined to be != 0, which became the default since 2026-03-12. (#9295)
// 2025-09-18: Call platform_io.ClearRendererHandlers() on shutdown.
// 2025-06-11: Added support for ImGuiBackendFlags_RendererHasTextures, for dynamic font atlas. Removed ImGui_ImplSDLRenderer2_CreateFontsTexture() and ImGui_ImplSDLRenderer2_DestroyFontsTexture().
@@ -74,41 +77,6 @@ static ImGui_ImplSDLRenderer2_Data* ImGui_ImplSDLRenderer2_GetBackendData()
}
// Functions
-bool ImGui_ImplSDLRenderer2_Init(SDL_Renderer* renderer)
-{
- ImGuiIO& io = ImGui::GetIO();
- IMGUI_CHECKVERSION();
- IM_ASSERT(io.BackendRendererUserData == nullptr && "Already initialized a renderer backend!");
- IM_ASSERT(renderer != nullptr && "SDL_Renderer not initialized!");
-
- // Setup backend capabilities flags
- ImGui_ImplSDLRenderer2_Data* bd = IM_NEW(ImGui_ImplSDLRenderer2_Data)();
- io.BackendRendererUserData = (void*)bd;
- io.BackendRendererName = "imgui_impl_sdlrenderer2";
- io.BackendFlags |= ImGuiBackendFlags_RendererHasVtxOffset; // We can honor the ImDrawCmd::VtxOffset field, allowing for large meshes.
- io.BackendFlags |= ImGuiBackendFlags_RendererHasTextures; // We can honor ImGuiPlatformIO::Textures[] requests during render.
-
- bd->Renderer = renderer;
-
- return true;
-}
-
-void ImGui_ImplSDLRenderer2_Shutdown()
-{
- ImGui_ImplSDLRenderer2_Data* bd = ImGui_ImplSDLRenderer2_GetBackendData();
- IM_ASSERT(bd != nullptr && "No renderer backend to shutdown, or already shutdown?");
- ImGuiIO& io = ImGui::GetIO();
- ImGuiPlatformIO& platform_io = ImGui::GetPlatformIO();
-
- ImGui_ImplSDLRenderer2_DestroyDeviceObjects();
-
- io.BackendRendererName = nullptr;
- io.BackendRendererUserData = nullptr;
- io.BackendFlags &= ~(ImGuiBackendFlags_RendererHasVtxOffset | ImGuiBackendFlags_RendererHasTextures);
- platform_io.ClearRendererHandlers();
- IM_DELETE(bd);
-}
-
static void ImGui_ImplSDLRenderer2_SetupRenderState(SDL_Renderer* renderer)
{
// Clear out any viewports and cliprect set by the user
@@ -124,6 +92,9 @@ void ImGui_ImplSDLRenderer2_NewFrame()
IM_UNUSED(bd);
}
+// Draw callbacks
+static void ImGui_ImplSDLRenderer2_DrawCallback_ResetRenderState(const ImDrawList*, const ImDrawCmd*) {} // Intentionally empty. Used as an identifier for rendering loop to call its code. Simpler to implement this way.
+
void ImGui_ImplSDLRenderer2_RenderDrawData(ImDrawData* draw_data, SDL_Renderer* renderer)
{
// If there's a scale factor set by the user, use that instead
@@ -186,8 +157,7 @@ void ImGui_ImplSDLRenderer2_RenderDrawData(ImDrawData* draw_data, SDL_Renderer*
if (pcmd->UserCallback)
{
// User callback, registered via ImDrawList::AddCallback()
- // (ImDrawCallback_ResetRenderState is a special callback value used by the user to request the renderer to reset render state.)
- if (pcmd->UserCallback == ImDrawCallback_ResetRenderState)
+ if (pcmd->UserCallback == ImGui_ImplSDLRenderer2_DrawCallback_ResetRenderState)
ImGui_ImplSDLRenderer2_SetupRenderState(renderer);
else
pcmd->UserCallback(draw_list, pcmd);
@@ -295,6 +265,44 @@ void ImGui_ImplSDLRenderer2_DestroyDeviceObjects()
}
}
+bool ImGui_ImplSDLRenderer2_Init(SDL_Renderer* renderer)
+{
+ ImGuiIO& io = ImGui::GetIO();
+ IMGUI_CHECKVERSION();
+ IM_ASSERT(io.BackendRendererUserData == nullptr && "Already initialized a renderer backend!");
+ IM_ASSERT(renderer != nullptr && "SDL_Renderer not initialized!");
+
+ // Setup backend capabilities flags
+ ImGui_ImplSDLRenderer2_Data* bd = IM_NEW(ImGui_ImplSDLRenderer2_Data)();
+ io.BackendRendererUserData = (void*)bd;
+ io.BackendRendererName = "imgui_impl_sdlrenderer2";
+ io.BackendFlags |= ImGuiBackendFlags_RendererHasVtxOffset; // We can honor the ImDrawCmd::VtxOffset field, allowing for large meshes.
+ io.BackendFlags |= ImGuiBackendFlags_RendererHasTextures; // We can honor ImGuiPlatformIO::Textures[] requests during render.
+
+ ImGuiPlatformIO& platform_io = ImGui::GetPlatformIO();
+ platform_io.DrawCallback_ResetRenderState = ImGui_ImplSDLRenderer2_DrawCallback_ResetRenderState;
+
+ bd->Renderer = renderer;
+
+ return true;
+}
+
+void ImGui_ImplSDLRenderer2_Shutdown()
+{
+ ImGui_ImplSDLRenderer2_Data* bd = ImGui_ImplSDLRenderer2_GetBackendData();
+ IM_ASSERT(bd != nullptr && "No renderer backend to shutdown, or already shutdown?");
+ ImGuiIO& io = ImGui::GetIO();
+ ImGuiPlatformIO& platform_io = ImGui::GetPlatformIO();
+
+ ImGui_ImplSDLRenderer2_DestroyDeviceObjects();
+
+ io.BackendRendererName = nullptr;
+ io.BackendRendererUserData = nullptr;
+ io.BackendFlags &= ~(ImGuiBackendFlags_RendererHasVtxOffset | ImGuiBackendFlags_RendererHasTextures);
+ platform_io.ClearRendererHandlers();
+ IM_DELETE(bd);
+}
+
//-----------------------------------------------------------------------------
#if defined(__clang__)
diff --git a/include/imgui/backends/imgui_impl_sdlrenderer2.h b/include/imgui/backends/imgui_impl_sdlrenderer2.h
index ca49786..9bb6853 100644
--- a/include/imgui/backends/imgui_impl_sdlrenderer2.h
+++ b/include/imgui/backends/imgui_impl_sdlrenderer2.h
@@ -14,8 +14,9 @@
// [X] Renderer: Large meshes support (64k+ vertices) even with 16-bit indices (ImGuiBackendFlags_RendererHasVtxOffset).
// [X] Renderer: Texture updates support for dynamic font atlas (ImGuiBackendFlags_RendererHasTextures).
// [X] Renderer: Expose selected render state for draw callbacks to use. Access in '(ImGui_ImplXXXX_RenderState*)GetPlatformIO().Renderer_RenderState'.
-// Missing features:
+// Missing features or Issues:
// [ ] Renderer: Multi-viewport support (multiple windows).
+// [ ] Renderer: Missing support for DrawCallback_SetSamplerLinear, DrawCallback_SetSamplerNearest callbacks: SDLRenderer2 does not support changing SDL_SCALE_MODE while rendering.
// You can use unmodified imgui_impl_* files in your project. See examples/ folder for examples of using this.
// Prefer including the entire imgui/ repository into your project (either as a copy or as a submodule), and only build the backends you need.
diff --git a/include/imgui/backends/imgui_impl_sdlrenderer3.cpp b/include/imgui/backends/imgui_impl_sdlrenderer3.cpp
index 45397e3..6e3055b 100644
--- a/include/imgui/backends/imgui_impl_sdlrenderer3.cpp
+++ b/include/imgui/backends/imgui_impl_sdlrenderer3.cpp
@@ -17,7 +17,7 @@
// Missing features:
// [ ] Renderer: Multi-viewport support (multiple windows).
-// You can copy and use unmodified imgui_impl_* files in your project. See examples/ folder for examples of using this.
+// You can use unmodified imgui_impl_* files in your project. See examples/ folder for examples of using this.
// Prefer including the entire imgui/ repository into your project (either as a copy or as a submodule), and only build the backends you need.
// Learn about Dear ImGui:
// - FAQ https://dearimgui.com/faq
@@ -26,6 +26,9 @@
// - Introduction, links and more at the top of imgui.cpp
// CHANGELOG
+// (minor and older changes stripped away, please see git history for details)
+// 2026-07-15: Fixed default sampler state to be linear (broken 2026-04-23). (#9470, #9378)
+// 2026-04-23: Added support for standard draw callbacks (in platform_io): DrawCallback_ResetRenderState, DrawCallback_SetSamplerLinear, DrawCallback_SetSamplerNearest. (#9378)
// 2026-03-12: Fixed invalid assert in ImGui_ImplSDLRenderer3_UpdateTexture() if ImTextureID_Invalid is defined to be != 0, which became the default since 2026-03-12. (#9295)
// 2025-09-18: Call platform_io.ClearRendererHandlers() on shutdown.
// 2025-06-11: Added support for ImGuiBackendFlags_RendererHasTextures, for dynamic font atlas. Removed ImGui_ImplSDLRenderer3_CreateFontsTexture() and ImGui_ImplSDLRenderer3_DestroyFontsTexture().
@@ -61,6 +64,9 @@ struct ImGui_ImplSDLRenderer3_Data
SDL_Renderer* Renderer; // Main viewport's renderer
ImVector ColorBuffer;
+ // Render State
+ SDL_ScaleMode CurrentScaleMode;
+
ImGui_ImplSDLRenderer3_Data() { memset((void*)this, 0, sizeof(*this)); }
};
@@ -72,47 +78,16 @@ static ImGui_ImplSDLRenderer3_Data* ImGui_ImplSDLRenderer3_GetBackendData()
}
// Functions
-bool ImGui_ImplSDLRenderer3_Init(SDL_Renderer* renderer)
-{
- ImGuiIO& io = ImGui::GetIO();
- IMGUI_CHECKVERSION();
- IM_ASSERT(io.BackendRendererUserData == nullptr && "Already initialized a renderer backend!");
- IM_ASSERT(renderer != nullptr && "SDL_Renderer not initialized!");
-
- // Setup backend capabilities flags
- ImGui_ImplSDLRenderer3_Data* bd = IM_NEW(ImGui_ImplSDLRenderer3_Data)();
- io.BackendRendererUserData = (void*)bd;
- io.BackendRendererName = "imgui_impl_sdlrenderer3";
- io.BackendFlags |= ImGuiBackendFlags_RendererHasVtxOffset; // We can honor the ImDrawCmd::VtxOffset field, allowing for large meshes.
- io.BackendFlags |= ImGuiBackendFlags_RendererHasTextures; // We can honor ImGuiPlatformIO::Textures[] requests during render.
-
- bd->Renderer = renderer;
-
- return true;
-}
-
-void ImGui_ImplSDLRenderer3_Shutdown()
+static void ImGui_ImplSDLRenderer3_SetupRenderState(SDL_Renderer* renderer)
{
ImGui_ImplSDLRenderer3_Data* bd = ImGui_ImplSDLRenderer3_GetBackendData();
- IM_ASSERT(bd != nullptr && "No renderer backend to shutdown, or already shutdown?");
- ImGuiIO& io = ImGui::GetIO();
- ImGuiPlatformIO& platform_io = ImGui::GetPlatformIO();
-
- ImGui_ImplSDLRenderer3_DestroyDeviceObjects();
- io.BackendRendererName = nullptr;
- io.BackendRendererUserData = nullptr;
- io.BackendFlags &= ~(ImGuiBackendFlags_RendererHasVtxOffset | ImGuiBackendFlags_RendererHasTextures);
- platform_io.ClearRendererHandlers();
- IM_DELETE(bd);
-}
-
-static void ImGui_ImplSDLRenderer3_SetupRenderState(SDL_Renderer* renderer)
-{
// Clear out any viewports and cliprect set by the user
// FIXME: Technically speaking there are lots of other things we could backup/setup/restore during our render process.
SDL_SetRenderViewport(renderer, nullptr);
SDL_SetRenderClipRect(renderer, nullptr);
+
+ bd->CurrentScaleMode = SDL_SCALEMODE_LINEAR;
}
void ImGui_ImplSDLRenderer3_NewFrame()
@@ -140,6 +115,11 @@ static int SDL_RenderGeometryRaw8BitColor(SDL_Renderer* renderer, ImVectorCurrentScaleMode = SDL_SCALEMODE_LINEAR; }
+static void ImGui_ImplSDLRenderer3_DrawCallback_SetSamplerNearest(const ImDrawList*, const ImDrawCmd*) { ImGui_ImplSDLRenderer3_Data* bd = ImGui_ImplSDLRenderer3_GetBackendData(); bd->CurrentScaleMode = SDL_SCALEMODE_NEAREST; }
+
void ImGui_ImplSDLRenderer3_RenderDrawData(ImDrawData* draw_data, SDL_Renderer* renderer)
{
ImGui_ImplSDLRenderer3_Data* bd = ImGui_ImplSDLRenderer3_GetBackendData();
@@ -193,6 +173,7 @@ void ImGui_ImplSDLRenderer3_RenderDrawData(ImDrawData* draw_data, SDL_Renderer*
// Will project scissor/clipping rectangles into framebuffer space
ImVec2 clip_off = draw_data->DisplayPos; // (0,0) unless using multi-viewports
ImVec2 clip_scale = render_scale;
+ SDL_ScaleMode last_scale_mode = bd->CurrentScaleMode;
// Render command lists
for (const ImDrawList* draw_list : draw_data->CmdLists)
@@ -206,8 +187,7 @@ void ImGui_ImplSDLRenderer3_RenderDrawData(ImDrawData* draw_data, SDL_Renderer*
if (pcmd->UserCallback)
{
// User callback, registered via ImDrawList::AddCallback()
- // (ImDrawCallback_ResetRenderState is a special callback value used by the user to request the renderer to reset render state.)
- if (pcmd->UserCallback == ImDrawCallback_ResetRenderState)
+ if (pcmd->UserCallback == ImGui_ImplSDLRenderer3_DrawCallback_ResetRenderState)
ImGui_ImplSDLRenderer3_SetupRenderState(renderer);
else
pcmd->UserCallback(draw_list, pcmd);
@@ -231,8 +211,12 @@ void ImGui_ImplSDLRenderer3_RenderDrawData(ImDrawData* draw_data, SDL_Renderer*
const float* uv = (const float*)(const void*)((const char*)(vtx_buffer + pcmd->VtxOffset) + offsetof(ImDrawVert, uv));
const SDL_Color* color = (const SDL_Color*)(const void*)((const char*)(vtx_buffer + pcmd->VtxOffset) + offsetof(ImDrawVert, col)); // SDL 2.0.19+
+ if (last_scale_mode != bd->CurrentScaleMode)
+ SDL_FlushRenderer(renderer);
+
// Bind texture, Draw
SDL_Texture* tex = (SDL_Texture*)pcmd->GetTexID();
+ SDL_SetTextureScaleMode(tex, bd->CurrentScaleMode);
SDL_RenderGeometryRaw8BitColor(renderer, bd->ColorBuffer, tex,
xy, (int)sizeof(ImDrawVert),
color, (int)sizeof(ImDrawVert),
@@ -311,6 +295,46 @@ void ImGui_ImplSDLRenderer3_DestroyDeviceObjects()
}
}
+bool ImGui_ImplSDLRenderer3_Init(SDL_Renderer* renderer)
+{
+ ImGuiIO& io = ImGui::GetIO();
+ IMGUI_CHECKVERSION();
+ IM_ASSERT(io.BackendRendererUserData == nullptr && "Already initialized a renderer backend!");
+ IM_ASSERT(renderer != nullptr && "SDL_Renderer not initialized!");
+
+ // Setup backend capabilities flags
+ ImGui_ImplSDLRenderer3_Data* bd = IM_NEW(ImGui_ImplSDLRenderer3_Data)();
+ io.BackendRendererUserData = (void*)bd;
+ io.BackendRendererName = "imgui_impl_sdlrenderer3";
+ io.BackendFlags |= ImGuiBackendFlags_RendererHasVtxOffset; // We can honor the ImDrawCmd::VtxOffset field, allowing for large meshes.
+ io.BackendFlags |= ImGuiBackendFlags_RendererHasTextures; // We can honor ImGuiPlatformIO::Textures[] requests during render.
+
+ ImGuiPlatformIO& platform_io = ImGui::GetPlatformIO();
+ platform_io.DrawCallback_ResetRenderState = ImGui_ImplSDLRenderer3_DrawCallback_ResetRenderState;
+ platform_io.DrawCallback_SetSamplerLinear = ImGui_ImplSDLRenderer3_DrawCallback_SetSamplerLinear;
+ platform_io.DrawCallback_SetSamplerNearest = ImGui_ImplSDLRenderer3_DrawCallback_SetSamplerNearest;
+
+ bd->Renderer = renderer;
+
+ return true;
+}
+
+void ImGui_ImplSDLRenderer3_Shutdown()
+{
+ ImGui_ImplSDLRenderer3_Data* bd = ImGui_ImplSDLRenderer3_GetBackendData();
+ IM_ASSERT(bd != nullptr && "No renderer backend to shutdown, or already shutdown?");
+ ImGuiIO& io = ImGui::GetIO();
+ ImGuiPlatformIO& platform_io = ImGui::GetPlatformIO();
+
+ ImGui_ImplSDLRenderer3_DestroyDeviceObjects();
+
+ io.BackendRendererName = nullptr;
+ io.BackendRendererUserData = nullptr;
+ io.BackendFlags &= ~(ImGuiBackendFlags_RendererHasVtxOffset | ImGuiBackendFlags_RendererHasTextures);
+ platform_io.ClearRendererHandlers();
+ IM_DELETE(bd);
+}
+
//-----------------------------------------------------------------------------
#if defined(__clang__)
diff --git a/include/imgui/backends/imgui_impl_sdlrenderer3.h b/include/imgui/backends/imgui_impl_sdlrenderer3.h
index 4815503..5b6ccf3 100644
--- a/include/imgui/backends/imgui_impl_sdlrenderer3.h
+++ b/include/imgui/backends/imgui_impl_sdlrenderer3.h
@@ -17,7 +17,7 @@
// Missing features:
// [ ] Renderer: Multi-viewport support (multiple windows).
-// You can copy and use unmodified imgui_impl_* files in your project. See examples/ folder for examples of using this.
+// You can use unmodified imgui_impl_* files in your project. See examples/ folder for examples of using this.
// Prefer including the entire imgui/ repository into your project (either as a copy or as a submodule), and only build the backends you need.
// Learn about Dear ImGui:
// - FAQ https://dearimgui.com/faq
diff --git a/include/imgui/backends/imgui_impl_vulkan.cpp b/include/imgui/backends/imgui_impl_vulkan.cpp
index 2de2f56..857e358 100644
--- a/include/imgui/backends/imgui_impl_vulkan.cpp
+++ b/include/imgui/backends/imgui_impl_vulkan.cpp
@@ -2,7 +2,7 @@
// This needs to be used along with a Platform Backend (e.g. GLFW, SDL, Win32, custom..)
// Implemented features:
-// [!] Renderer: User texture binding. Use 'VkDescriptorSet' as texture identifier. Call ImGui_ImplVulkan_AddTexture() to register one. Read the FAQ about ImTextureID/ImTextureRef + https://github.com/ocornut/imgui/pull/914 for discussions.
+// [!] Renderer: User texture binding. Use a VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE 'VkDescriptorSet' as texture identifier. Call ImGui_ImplVulkan_AddTexture() to register one. Read the FAQ about ImTextureID/ImTextureRef + https://github.com/ocornut/imgui/pull/914 for discussions.
// [X] Renderer: Large meshes support (64k+ vertices) even with 16-bit indices (ImGuiBackendFlags_RendererHasVtxOffset).
// [X] Renderer: Texture updates support for dynamic font atlas (ImGuiBackendFlags_RendererHasTextures).
// [X] Renderer: Expose selected render state for draw callbacks to use. Access in '(ImGui_ImplXXXX_RenderState*)GetPlatformIO().Renderer_RenderState'.
@@ -29,6 +29,17 @@
// CHANGELOG
// (minor and older changes stripped away, please see git history for details)
// 2026-XX-XX: Platform: Added support for multiple windows via the ImGuiPlatformIO interface.
+// 2026-07-15: [Docking] Vulkan: fixed use-after-free when using multi-viewport with dynamic rendering path: deep-copy SurfaceFormat.format into the persistent buffer instead of storing a pointer to the viewport's wd->SurfaceFormat which dangles after the viewport is destroyed. (#9390, #9468)
+// 2026-04-23: Added support for standard draw callbacks (in platform_io): DrawCallback_ResetRenderState, DrawCallback_SetSamplerLinear, DrawCallback_SetSamplerNearest. (#9378)
+// 2026-04-22: *BREAKING CHANGE* redesigned to use separate ImageView + Sampler instead of Combined Image Sampler. This change allows us to facilitate changing samplers, in line with other backends.
+// - When registering custom textures: changed ImGui_ImplVulkan_AddTexture() signature to remove Sampler.
+// - Before: ImGui_ImplVulkan_AddTexture(VkSampler, VkImageView, VkImageLayout)
+// - After: ImGui_ImplVulkan_AddTexture(VkImageView, VkImageLayout)
+// - Kept inline redirection function that ignores the sampler.
+// - When creating your own descriptor pool (instead of letting backend creates its own):
+// - Before: need at least IMGUI_IMPL_VULKAN_MINIMUM_IMAGE_SAMPLER_POOL_SIZE descriptors of type VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER.
+// - After: need at least IMGUI_IMPL_VULKAN_MINIMUM_SAMPLED_IMAGE_POOL_SIZE descriptors of type VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE.
+// + IMGUI_IMPL_VULKAN_MINIMUM_SAMPLER_POOL_SIZE descriptors of type VK_DESCRIPTOR_TYPE_SAMPLER.
// 2026-03-11: Vulkan: Added ImGui_ImplVulkan_PipelineInfo::ExtraDynamicStates[] to allow specifying extra dynamic states to add when creating the VkPipeline. (#9211)
// 2025-09-26: [Helpers] *BREAKING CHANGE*: Vulkan: Helper ImGui_ImplVulkanH_DestroyWindow() does not call vkDestroySurfaceKHR(): as surface is created by caller of ImGui_ImplVulkanH_CreateOrResizeWindow(), it is more consistent that we don't destroy it. (#9163)
// 2026-01-05: [Helpers] *BREAKING CHANGE*: Vulkan: Helper for creating render pass uses ImGui_ImplVulkanH_Window::AttachmentDesc to create render pass. Removed ClearEnabled. (#9152)
@@ -290,10 +301,12 @@ struct ImGui_ImplVulkan_ViewportData
struct ImGui_ImplVulkan_Data
{
ImGui_ImplVulkan_InitInfo VulkanInitInfo;
+ ImGui_ImplVulkan_RenderState* RenderState; // == ImGui::GetPlatformIO().Renderer_RenderState during rendering.
VkDeviceSize BufferMemoryAlignment;
VkDeviceSize NonCoherentAtomSize;
VkPipelineCreateFlags PipelineCreateFlags;
- VkDescriptorSetLayout DescriptorSetLayout;
+ VkDescriptorSetLayout DescriptorSetLayoutTexture;
+ VkDescriptorSetLayout DescriptorSetLayoutSampler;
VkPipelineLayout PipelineLayout;
VkPipeline Pipeline; // pipeline for main render pass (created by app)
VkPipeline PipelineForViewports; // pipeline for secondary viewports (created by backend)
@@ -303,7 +316,10 @@ struct ImGui_ImplVulkan_Data
ImVector PipelineRenderingCreateInfoColorAttachmentFormats; // Deep copy of format array
// Texture management
- VkSampler TexSamplerLinear;
+ VkSampler SamplerLinear;
+ VkSampler SamplerNearest;
+ VkDescriptorSet SamplerLinearDS;
+ VkDescriptorSet SamplerNearestDS;
VkCommandPool TexCommandPool;
VkCommandBuffer TexCommandBuffer;
@@ -347,7 +363,7 @@ void main()
*/
static uint32_t __glsl_shader_vert_spv[] =
{
- 0x07230203,0x00010000,0x00080001,0x0000002e,0x00000000,0x00020011,0x00000001,0x0006000b,
+ 0x07230203,0x00010000,0x0008000b,0x0000002e,0x00000000,0x00020011,0x00000001,0x0006000b,
0x00000001,0x4c534c47,0x6474732e,0x3035342e,0x00000000,0x0003000e,0x00000000,0x00000001,
0x000a000f,0x00000000,0x00000004,0x6e69616d,0x00000000,0x0000000b,0x0000000f,0x00000015,
0x0000001b,0x0000001c,0x00030003,0x00000002,0x000001c2,0x00040005,0x00000004,0x6e69616d,
@@ -360,10 +376,10 @@ static uint32_t __glsl_shader_vert_spv[] =
0x00050006,0x0000001e,0x00000000,0x61635375,0x0000656c,0x00060006,0x0000001e,0x00000001,
0x61725475,0x616c736e,0x00006574,0x00030005,0x00000020,0x00006370,0x00040047,0x0000000b,
0x0000001e,0x00000000,0x00040047,0x0000000f,0x0000001e,0x00000002,0x00040047,0x00000015,
- 0x0000001e,0x00000001,0x00050048,0x00000019,0x00000000,0x0000000b,0x00000000,0x00030047,
- 0x00000019,0x00000002,0x00040047,0x0000001c,0x0000001e,0x00000000,0x00050048,0x0000001e,
- 0x00000000,0x00000023,0x00000000,0x00050048,0x0000001e,0x00000001,0x00000023,0x00000008,
- 0x00030047,0x0000001e,0x00000002,0x00020013,0x00000002,0x00030021,0x00000003,0x00000002,
+ 0x0000001e,0x00000001,0x00030047,0x00000019,0x00000002,0x00050048,0x00000019,0x00000000,
+ 0x0000000b,0x00000000,0x00040047,0x0000001c,0x0000001e,0x00000000,0x00030047,0x0000001e,
+ 0x00000002,0x00050048,0x0000001e,0x00000000,0x00000023,0x00000000,0x00050048,0x0000001e,
+ 0x00000001,0x00000023,0x00000008,0x00020013,0x00000002,0x00030021,0x00000003,0x00000002,
0x00030016,0x00000006,0x00000020,0x00040017,0x00000007,0x00000006,0x00000004,0x00040017,
0x00000008,0x00000006,0x00000002,0x0004001e,0x00000009,0x00000007,0x00000008,0x00040020,
0x0000000a,0x00000003,0x00000009,0x0004003b,0x0000000a,0x0000000b,0x00000003,0x00040015,
@@ -395,39 +411,44 @@ static uint32_t __glsl_shader_vert_spv[] =
/*
#version 450 core
layout(location = 0) out vec4 fColor;
-layout(set=0, binding=0) uniform sampler2D sTexture;
+layout(set=0, binding=0) uniform texture2D _Texture;
+layout(set=1, binding=0) uniform sampler _Sampler;
layout(location = 0) in struct { vec4 Color; vec2 UV; } In;
void main()
{
- fColor = In.Color * texture(sTexture, In.UV.st);
+ fColor = In.Color * texture(sampler2D(_Texture, _Sampler), In.UV.st);
}
*/
static uint32_t __glsl_shader_frag_spv[] =
{
- 0x07230203,0x00010000,0x00080001,0x0000001e,0x00000000,0x00020011,0x00000001,0x0006000b,
+ 0x07230203,0x00010000,0x0008000b,0x00000023,0x00000000,0x00020011,0x00000001,0x0006000b,
0x00000001,0x4c534c47,0x6474732e,0x3035342e,0x00000000,0x0003000e,0x00000000,0x00000001,
0x0007000f,0x00000004,0x00000004,0x6e69616d,0x00000000,0x00000009,0x0000000d,0x00030010,
0x00000004,0x00000007,0x00030003,0x00000002,0x000001c2,0x00040005,0x00000004,0x6e69616d,
0x00000000,0x00040005,0x00000009,0x6c6f4366,0x0000726f,0x00030005,0x0000000b,0x00000000,
0x00050006,0x0000000b,0x00000000,0x6f6c6f43,0x00000072,0x00040006,0x0000000b,0x00000001,
- 0x00005655,0x00030005,0x0000000d,0x00006e49,0x00050005,0x00000016,0x78655473,0x65727574,
- 0x00000000,0x00040047,0x00000009,0x0000001e,0x00000000,0x00040047,0x0000000d,0x0000001e,
- 0x00000000,0x00040047,0x00000016,0x00000022,0x00000000,0x00040047,0x00000016,0x00000021,
- 0x00000000,0x00020013,0x00000002,0x00030021,0x00000003,0x00000002,0x00030016,0x00000006,
- 0x00000020,0x00040017,0x00000007,0x00000006,0x00000004,0x00040020,0x00000008,0x00000003,
- 0x00000007,0x0004003b,0x00000008,0x00000009,0x00000003,0x00040017,0x0000000a,0x00000006,
- 0x00000002,0x0004001e,0x0000000b,0x00000007,0x0000000a,0x00040020,0x0000000c,0x00000001,
- 0x0000000b,0x0004003b,0x0000000c,0x0000000d,0x00000001,0x00040015,0x0000000e,0x00000020,
- 0x00000001,0x0004002b,0x0000000e,0x0000000f,0x00000000,0x00040020,0x00000010,0x00000001,
- 0x00000007,0x00090019,0x00000013,0x00000006,0x00000001,0x00000000,0x00000000,0x00000000,
- 0x00000001,0x00000000,0x0003001b,0x00000014,0x00000013,0x00040020,0x00000015,0x00000000,
- 0x00000014,0x0004003b,0x00000015,0x00000016,0x00000000,0x0004002b,0x0000000e,0x00000018,
- 0x00000001,0x00040020,0x00000019,0x00000001,0x0000000a,0x00050036,0x00000002,0x00000004,
- 0x00000000,0x00000003,0x000200f8,0x00000005,0x00050041,0x00000010,0x00000011,0x0000000d,
- 0x0000000f,0x0004003d,0x00000007,0x00000012,0x00000011,0x0004003d,0x00000014,0x00000017,
- 0x00000016,0x00050041,0x00000019,0x0000001a,0x0000000d,0x00000018,0x0004003d,0x0000000a,
- 0x0000001b,0x0000001a,0x00050057,0x00000007,0x0000001c,0x00000017,0x0000001b,0x00050085,
- 0x00000007,0x0000001d,0x00000012,0x0000001c,0x0003003e,0x00000009,0x0000001d,0x000100fd,
+ 0x00005655,0x00030005,0x0000000d,0x00006e49,0x00050005,0x00000015,0x7865545f,0x65727574,
+ 0x00000000,0x00050005,0x00000019,0x6d61535f,0x72656c70,0x00000000,0x00040047,0x00000009,
+ 0x0000001e,0x00000000,0x00040047,0x0000000d,0x0000001e,0x00000000,0x00040047,0x00000015,
+ 0x00000021,0x00000000,0x00040047,0x00000015,0x00000022,0x00000000,0x00040047,0x00000019,
+ 0x00000021,0x00000000,0x00040047,0x00000019,0x00000022,0x00000001,0x00020013,0x00000002,
+ 0x00030021,0x00000003,0x00000002,0x00030016,0x00000006,0x00000020,0x00040017,0x00000007,
+ 0x00000006,0x00000004,0x00040020,0x00000008,0x00000003,0x00000007,0x0004003b,0x00000008,
+ 0x00000009,0x00000003,0x00040017,0x0000000a,0x00000006,0x00000002,0x0004001e,0x0000000b,
+ 0x00000007,0x0000000a,0x00040020,0x0000000c,0x00000001,0x0000000b,0x0004003b,0x0000000c,
+ 0x0000000d,0x00000001,0x00040015,0x0000000e,0x00000020,0x00000001,0x0004002b,0x0000000e,
+ 0x0000000f,0x00000000,0x00040020,0x00000010,0x00000001,0x00000007,0x00090019,0x00000013,
+ 0x00000006,0x00000001,0x00000000,0x00000000,0x00000000,0x00000001,0x00000000,0x00040020,
+ 0x00000014,0x00000000,0x00000013,0x0004003b,0x00000014,0x00000015,0x00000000,0x0002001a,
+ 0x00000017,0x00040020,0x00000018,0x00000000,0x00000017,0x0004003b,0x00000018,0x00000019,
+ 0x00000000,0x0003001b,0x0000001b,0x00000013,0x0004002b,0x0000000e,0x0000001d,0x00000001,
+ 0x00040020,0x0000001e,0x00000001,0x0000000a,0x00050036,0x00000002,0x00000004,0x00000000,
+ 0x00000003,0x000200f8,0x00000005,0x00050041,0x00000010,0x00000011,0x0000000d,0x0000000f,
+ 0x0004003d,0x00000007,0x00000012,0x00000011,0x0004003d,0x00000013,0x00000016,0x00000015,
+ 0x0004003d,0x00000017,0x0000001a,0x00000019,0x00050056,0x0000001b,0x0000001c,0x00000016,
+ 0x0000001a,0x00050041,0x0000001e,0x0000001f,0x0000000d,0x0000001d,0x0004003d,0x0000000a,
+ 0x00000020,0x0000001f,0x00050057,0x00000007,0x00000021,0x0000001c,0x00000020,0x00050085,
+ 0x00000007,0x00000022,0x00000012,0x00000021,0x0003003e,0x00000009,0x00000022,0x000100fd,
0x00010038
};
@@ -510,9 +531,7 @@ static void ImGui_ImplVulkan_SetupRenderState(ImDrawData* draw_data, VkPipeline
ImGui_ImplVulkan_Data* bd = ImGui_ImplVulkan_GetBackendData();
// Bind pipeline:
- {
- vkCmdBindPipeline(command_buffer, VK_PIPELINE_BIND_POINT_GRAPHICS, pipeline);
- }
+ vkCmdBindPipeline(command_buffer, VK_PIPELINE_BIND_POINT_GRAPHICS, pipeline);
// Bind Vertex And Index Buffer:
if (draw_data->TotalVtxCount > 0)
@@ -524,29 +543,42 @@ static void ImGui_ImplVulkan_SetupRenderState(ImDrawData* draw_data, VkPipeline
}
// Setup viewport:
- {
- VkViewport viewport;
- viewport.x = 0;
- viewport.y = 0;
- viewport.width = (float)fb_width;
- viewport.height = (float)fb_height;
- viewport.minDepth = 0.0f;
- viewport.maxDepth = 1.0f;
- vkCmdSetViewport(command_buffer, 0, 1, &viewport);
- }
+ VkViewport viewport;
+ viewport.x = 0;
+ viewport.y = 0;
+ viewport.width = (float)fb_width;
+ viewport.height = (float)fb_height;
+ viewport.minDepth = 0.0f;
+ viewport.maxDepth = 1.0f;
+ vkCmdSetViewport(command_buffer, 0, 1, &viewport);
// Setup scale and translation:
// Our visible imgui space lies from draw_data->DisplayPps (top left) to draw_data->DisplayPos+data_data->DisplaySize (bottom right). DisplayPos is (0,0) for single viewport apps.
- {
- float constants[4];
- constants[0] = 2.0f / draw_data->DisplaySize.x; // Scale
- constants[1] = 2.0f / draw_data->DisplaySize.y;
- constants[2] = -1.0f - draw_data->DisplayPos.x * constants[0]; // Translate
- constants[3] = -1.0f - draw_data->DisplayPos.y * constants[1];
- vkCmdPushConstants(command_buffer, bd->PipelineLayout, VK_SHADER_STAGE_VERTEX_BIT, 0, sizeof(float) * 4, constants);
- }
+ float constants[4];
+ constants[0] = 2.0f / draw_data->DisplaySize.x; // Scale
+ constants[1] = 2.0f / draw_data->DisplaySize.y;
+ constants[2] = -1.0f - draw_data->DisplayPos.x * constants[0]; // Translate
+ constants[3] = -1.0f - draw_data->DisplayPos.y * constants[1];
+ vkCmdPushConstants(command_buffer, bd->PipelineLayout, VK_SHADER_STAGE_VERTEX_BIT, 0, sizeof(float) * 4, constants);
+
+ // Setup sampler
+ vkCmdBindDescriptorSets(bd->RenderState->CommandBuffer, VK_PIPELINE_BIND_POINT_GRAPHICS, bd->PipelineLayout, 1, 1, &bd->SamplerLinearDS, 0, nullptr);
}
+// Draw callbacks
+static void ImGui_ImplVulkan_DrawCallback_ResetRenderState(const ImDrawList*, const ImDrawCmd*) {} // Intentionally empty. Used as an identifier for rendering loop to call its code. Simpler to implement this way.
+static void ImGui_ImplVulkan_DrawCallback_SetSamplerLinear(const ImDrawList*, const ImDrawCmd*) { ImGui_ImplVulkan_Data* bd = ImGui_ImplVulkan_GetBackendData(); vkCmdBindDescriptorSets(bd->RenderState->CommandBuffer, VK_PIPELINE_BIND_POINT_GRAPHICS, bd->RenderState->PipelineLayout, 1, 1, &bd->SamplerLinearDS, 0, nullptr); }
+static void ImGui_ImplVulkan_DrawCallback_SetSamplerNearest(const ImDrawList*, const ImDrawCmd*) { ImGui_ImplVulkan_Data* bd = ImGui_ImplVulkan_GetBackendData(); vkCmdBindDescriptorSets(bd->RenderState->CommandBuffer, VK_PIPELINE_BIND_POINT_GRAPHICS, bd->RenderState->PipelineLayout, 1, 1, &bd->SamplerNearestDS, 0, nullptr); }
+
+// If you want to use your own sampler, you can create your own callback, access ImGui_ImplVulkan_RenderState for command-buffer and pipeline layout, e.g.
+/*
+void ImGui_ImplVulkan_DrawCallback_SetSamplerCustom(const ImDrawList*, const ImDrawCmd* cmd)
+{
+ ImGui_ImplVulkan_RenderState* render_state = (ImGui_ImplVulkan_RenderState*)ImGui::GetPlatformIO().Renderer_RenderState;
+ vkCmdBindDescriptorSets(render_state->CommandBuffer, VK_PIPELINE_BIND_POINT_GRAPHICS, render_state->PipelineLayout, 1, 1, (VkDescriptorSet*)cmd->UserCallbackData, 0, nullptr);
+}
+*/
+
// Render function
void ImGui_ImplVulkan_RenderDrawData(ImDrawData* draw_data, VkCommandBuffer command_buffer, VkPipeline pipeline)
{
@@ -620,16 +652,16 @@ void ImGui_ImplVulkan_RenderDrawData(ImDrawData* draw_data, VkCommandBuffer comm
vkUnmapMemory(v->Device, rb->IndexBufferMemory);
}
- // Setup desired Vulkan state
- ImGui_ImplVulkan_SetupRenderState(draw_data, pipeline, command_buffer, rb, fb_width, fb_height);
-
// Setup render state structure (for callbacks and custom texture bindings)
ImGuiPlatformIO& platform_io = ImGui::GetPlatformIO();
ImGui_ImplVulkan_RenderState render_state;
render_state.CommandBuffer = command_buffer;
render_state.Pipeline = pipeline;
render_state.PipelineLayout = bd->PipelineLayout;
- platform_io.Renderer_RenderState = &render_state;
+ platform_io.Renderer_RenderState = bd->RenderState = &render_state;
+
+ // Setup desired Vulkan state
+ ImGui_ImplVulkan_SetupRenderState(draw_data, pipeline, command_buffer, rb, fb_width, fb_height);
// Will project scissor/clipping rectangles into framebuffer space
ImVec2 clip_off = draw_data->DisplayPos; // (0,0) unless using multi-viewports
@@ -637,7 +669,7 @@ void ImGui_ImplVulkan_RenderDrawData(ImDrawData* draw_data, VkCommandBuffer comm
// Render command lists
// (Because we merged all buffers into a single one, we maintain our own offset into them)
- VkDescriptorSet last_desc_set = VK_NULL_HANDLE;
+ VkDescriptorSet last_image_view = VK_NULL_HANDLE;
int global_vtx_offset = 0;
int global_idx_offset = 0;
for (const ImDrawList* draw_list : draw_data->CmdLists)
@@ -648,12 +680,13 @@ void ImGui_ImplVulkan_RenderDrawData(ImDrawData* draw_data, VkCommandBuffer comm
if (pcmd->UserCallback != nullptr)
{
// User callback, registered via ImDrawList::AddCallback()
- // (ImDrawCallback_ResetRenderState is a special callback value used by the user to request the renderer to reset render state.)
- if (pcmd->UserCallback == ImDrawCallback_ResetRenderState)
+ if (pcmd->UserCallback == ImGui_ImplVulkan_DrawCallback_ResetRenderState)
+ {
ImGui_ImplVulkan_SetupRenderState(draw_data, pipeline, command_buffer, rb, fb_width, fb_height);
+ last_image_view = VK_NULL_HANDLE;
+ }
else
pcmd->UserCallback(draw_list, pcmd);
- last_desc_set = VK_NULL_HANDLE;
}
else
{
@@ -664,8 +697,8 @@ void ImGui_ImplVulkan_RenderDrawData(ImDrawData* draw_data, VkCommandBuffer comm
// Clamp to viewport as vkCmdSetScissor() won't accept values that are off bounds
if (clip_min.x < 0.0f) { clip_min.x = 0.0f; }
if (clip_min.y < 0.0f) { clip_min.y = 0.0f; }
- if (clip_max.x > fb_width) { clip_max.x = (float)fb_width; }
- if (clip_max.y > fb_height) { clip_max.y = (float)fb_height; }
+ if (clip_max.x > (float)fb_width) { clip_max.x = (float)fb_width; }
+ if (clip_max.y > (float)fb_height) { clip_max.y = (float)fb_height; }
if (clip_max.x <= clip_min.x || clip_max.y <= clip_min.y)
continue;
@@ -677,11 +710,11 @@ void ImGui_ImplVulkan_RenderDrawData(ImDrawData* draw_data, VkCommandBuffer comm
scissor.extent.height = (uint32_t)(clip_max.y - clip_min.y);
vkCmdSetScissor(command_buffer, 0, 1, &scissor);
- // Bind DescriptorSet with font or user texture
- VkDescriptorSet desc_set = (VkDescriptorSet)pcmd->GetTexID();
- if (desc_set != last_desc_set)
- vkCmdBindDescriptorSets(command_buffer, VK_PIPELINE_BIND_POINT_GRAPHICS, bd->PipelineLayout, 0, 1, &desc_set, 0, nullptr);
- last_desc_set = desc_set;
+ // Bind DescriptorSets for image view (font or user texture) and samplers
+ VkDescriptorSet image_view = (VkDescriptorSet)pcmd->GetTexID();
+ if (image_view != last_image_view)
+ vkCmdBindDescriptorSets(command_buffer, VK_PIPELINE_BIND_POINT_GRAPHICS, bd->PipelineLayout, 0, 1, &image_view, 0, nullptr);
+ last_image_view = image_view;
// Draw
vkCmdDrawIndexed(command_buffer, pcmd->ElemCount, 1, pcmd->IdxOffset + global_idx_offset, pcmd->VtxOffset + global_vtx_offset, 0);
@@ -690,7 +723,7 @@ void ImGui_ImplVulkan_RenderDrawData(ImDrawData* draw_data, VkCommandBuffer comm
global_idx_offset += draw_list->IdxBuffer.Size;
global_vtx_offset += draw_list->VtxBuffer.Size;
}
- platform_io.Renderer_RenderState = nullptr;
+ platform_io.Renderer_RenderState = bd->RenderState = nullptr;
// Note: at this point both vkCmdSetViewport() and vkCmdSetScissor() have been called.
// Our last values will leak into user/application rendering IF:
@@ -784,7 +817,7 @@ void ImGui_ImplVulkan_UpdateTexture(ImTextureData* tex)
}
// Create the Descriptor Set
- backend_tex->DescriptorSet = ImGui_ImplVulkan_AddTexture(bd->TexSamplerLinear, backend_tex->ImageView, VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL);
+ backend_tex->DescriptorSet = ImGui_ImplVulkan_AddTexture(backend_tex->ImageView, VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL);
// Store identifiers
tex->SetTexID((ImTextureID)backend_tex->DescriptorSet);
@@ -1079,15 +1112,83 @@ static VkPipeline ImGui_ImplVulkan_CreatePipeline(VkDevice device, const VkAlloc
return pipeline;
}
+static void ImGui_ImplVulkan_CreateDescriptorSetLayout(VkDescriptorSetLayout* p_layout, VkDescriptorType descriptor_type)
+{
+ ImGui_ImplVulkan_Data* bd = ImGui_ImplVulkan_GetBackendData();
+ ImGui_ImplVulkan_InitInfo* v = &bd->VulkanInitInfo;
+
+ VkDescriptorSetLayoutBinding binding[1] = {};
+ binding[0].descriptorType = descriptor_type;
+ binding[0].descriptorCount = 1;
+ binding[0].stageFlags = VK_SHADER_STAGE_FRAGMENT_BIT;
+ VkDescriptorSetLayoutCreateInfo info = {};
+ info.sType = VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_CREATE_INFO;
+ info.bindingCount = 1;
+ info.pBindings = binding;
+ VkResult err = vkCreateDescriptorSetLayout(v->Device, &info, v->Allocator, p_layout);
+ check_vk_result(err);
+}
+
+static VkDescriptorSet ImGui_ImplVulkan_CreateSamplerDS(VkSampler sampler)
+{
+ ImGui_ImplVulkan_Data* bd = ImGui_ImplVulkan_GetBackendData();
+ ImGui_ImplVulkan_InitInfo* v = &bd->VulkanInitInfo;
+
+ VkDescriptorSet descriptor_set;
+ VkDescriptorSetAllocateInfo alloc_info = {};
+ alloc_info.sType = VK_STRUCTURE_TYPE_DESCRIPTOR_SET_ALLOCATE_INFO;
+ alloc_info.descriptorPool = bd->DescriptorPool ? bd->DescriptorPool : v->DescriptorPool;
+ alloc_info.descriptorSetCount = 1;
+ alloc_info.pSetLayouts = &bd->DescriptorSetLayoutSampler;
+ VkResult err = vkAllocateDescriptorSets(v->Device, &alloc_info, &descriptor_set);
+ check_vk_result(err);
+
+ VkDescriptorImageInfo desc_image = {};
+ desc_image.sampler = sampler;
+ VkWriteDescriptorSet sampler_write_desc = {};
+ sampler_write_desc.sType = VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET;
+ sampler_write_desc.dstSet = descriptor_set;
+ sampler_write_desc.descriptorCount = 1;
+ sampler_write_desc.dstBinding = 0;
+ sampler_write_desc.descriptorType = VK_DESCRIPTOR_TYPE_SAMPLER;
+ sampler_write_desc.pImageInfo = &desc_image;
+ vkUpdateDescriptorSets(v->Device, 1, &sampler_write_desc, 0, nullptr);
+ return descriptor_set;
+}
+
bool ImGui_ImplVulkan_CreateDeviceObjects()
{
ImGui_ImplVulkan_Data* bd = ImGui_ImplVulkan_GetBackendData();
ImGui_ImplVulkan_InitInfo* v = &bd->VulkanInitInfo;
VkResult err;
- if (!bd->TexSamplerLinear)
+ if (!bd->DescriptorSetLayoutTexture)
+ ImGui_ImplVulkan_CreateDescriptorSetLayout(&bd->DescriptorSetLayoutTexture, VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE);
+ if (!bd->DescriptorSetLayoutSampler)
+ ImGui_ImplVulkan_CreateDescriptorSetLayout(&bd->DescriptorSetLayoutSampler, VK_DESCRIPTOR_TYPE_SAMPLER);
+
+ if (v->DescriptorPoolSize != 0)
+ {
+ IM_ASSERT(v->DescriptorPoolSize >= IMGUI_IMPL_VULKAN_MINIMUM_SAMPLED_IMAGE_POOL_SIZE);
+ VkDescriptorPoolSize pool_sizes[] =
+ {
+ { VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE, v->DescriptorPoolSize },
+ { VK_DESCRIPTOR_TYPE_SAMPLER, IMGUI_IMPL_VULKAN_MINIMUM_SAMPLER_POOL_SIZE },
+ };
+ VkDescriptorPoolCreateInfo pool_info = {};
+ pool_info.sType = VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_CREATE_INFO;
+ pool_info.flags = VK_DESCRIPTOR_POOL_CREATE_FREE_DESCRIPTOR_SET_BIT;
+ pool_info.maxSets = v->DescriptorPoolSize + IMGUI_IMPL_VULKAN_MINIMUM_SAMPLER_POOL_SIZE;
+ pool_info.poolSizeCount = (uint32_t)IM_COUNTOF(pool_sizes);
+ pool_info.pPoolSizes = pool_sizes;
+ err = vkCreateDescriptorPool(v->Device, &pool_info, v->Allocator, &bd->DescriptorPool);
+ check_vk_result(err);
+ }
+
+ // Create samplers
+ // Bilinear sampling is required by default. Set 'io.Fonts->Flags |= ImFontAtlasFlags_NoBakedLines' or 'style.AntiAliasedLinesUseTex = false' to allow point/nearest sampling.
+ if (!bd->SamplerLinear || !bd->SamplerNearest)
{
- // Bilinear sampling is required by default. Set 'io.Fonts->Flags |= ImFontAtlasFlags_NoBakedLines' or 'style.AntiAliasedLinesUseTex = false' to allow point/nearest sampling.
VkSamplerCreateInfo info = {};
info.sType = VK_STRUCTURE_TYPE_SAMPLER_CREATE_INFO;
info.magFilter = VK_FILTER_LINEAR;
@@ -1099,37 +1200,16 @@ bool ImGui_ImplVulkan_CreateDeviceObjects()
info.minLod = -1000;
info.maxLod = 1000;
info.maxAnisotropy = 1.0f;
- err = vkCreateSampler(v->Device, &info, v->Allocator, &bd->TexSamplerLinear);
+ err = vkCreateSampler(v->Device, &info, v->Allocator, &bd->SamplerLinear);
check_vk_result(err);
- }
+ bd->SamplerLinearDS = ImGui_ImplVulkan_CreateSamplerDS(bd->SamplerLinear);
- if (!bd->DescriptorSetLayout)
- {
- VkDescriptorSetLayoutBinding binding[1] = {};
- binding[0].descriptorType = VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER;
- binding[0].descriptorCount = 1;
- binding[0].stageFlags = VK_SHADER_STAGE_FRAGMENT_BIT;
- VkDescriptorSetLayoutCreateInfo info = {};
- info.sType = VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_CREATE_INFO;
- info.bindingCount = 1;
- info.pBindings = binding;
- err = vkCreateDescriptorSetLayout(v->Device, &info, v->Allocator, &bd->DescriptorSetLayout);
- check_vk_result(err);
- }
-
- if (v->DescriptorPoolSize != 0)
- {
- IM_ASSERT(v->DescriptorPoolSize >= IMGUI_IMPL_VULKAN_MINIMUM_IMAGE_SAMPLER_POOL_SIZE);
- VkDescriptorPoolSize pool_size = { VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, v->DescriptorPoolSize };
- VkDescriptorPoolCreateInfo pool_info = {};
- pool_info.sType = VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_CREATE_INFO;
- pool_info.flags = VK_DESCRIPTOR_POOL_CREATE_FREE_DESCRIPTOR_SET_BIT;
- pool_info.maxSets = v->DescriptorPoolSize;
- pool_info.poolSizeCount = 1;
- pool_info.pPoolSizes = &pool_size;
-
- err = vkCreateDescriptorPool(v->Device, &pool_info, v->Allocator, &bd->DescriptorPool);
+ info.magFilter = VK_FILTER_NEAREST;
+ info.minFilter = VK_FILTER_NEAREST;
+ info.mipmapMode = VK_SAMPLER_MIPMAP_MODE_NEAREST;
+ err = vkCreateSampler(v->Device, &info, v->Allocator, &bd->SamplerNearest);
check_vk_result(err);
+ bd->SamplerNearestDS = ImGui_ImplVulkan_CreateSamplerDS(bd->SamplerNearest);
}
if (!bd->PipelineLayout)
@@ -1139,10 +1219,10 @@ bool ImGui_ImplVulkan_CreateDeviceObjects()
push_constants[0].stageFlags = VK_SHADER_STAGE_VERTEX_BIT;
push_constants[0].offset = sizeof(float) * 0;
push_constants[0].size = sizeof(float) * 4;
- VkDescriptorSetLayout set_layout[1] = { bd->DescriptorSetLayout };
+ VkDescriptorSetLayout set_layout[2] = { bd->DescriptorSetLayoutTexture, bd->DescriptorSetLayoutSampler };
VkPipelineLayoutCreateInfo layout_info = {};
layout_info.sType = VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO;
- layout_info.setLayoutCount = 1;
+ layout_info.setLayoutCount = 2;
layout_info.pSetLayouts = set_layout;
layout_info.pushConstantRangeCount = 1;
layout_info.pPushConstantRanges = push_constants;
@@ -1222,10 +1302,12 @@ void ImGui_ImplVulkan_DestroyDeviceObjects()
if (bd->TexCommandBuffer) { vkFreeCommandBuffers(v->Device, bd->TexCommandPool, 1, &bd->TexCommandBuffer); bd->TexCommandBuffer = VK_NULL_HANDLE; }
if (bd->TexCommandPool) { vkDestroyCommandPool(v->Device, bd->TexCommandPool, v->Allocator); bd->TexCommandPool = VK_NULL_HANDLE; }
- if (bd->TexSamplerLinear) { vkDestroySampler(v->Device, bd->TexSamplerLinear, v->Allocator); bd->TexSamplerLinear = VK_NULL_HANDLE; }
+ if (bd->SamplerLinear) { vkDestroySampler(v->Device, bd->SamplerLinear, v->Allocator); bd->SamplerLinear = VK_NULL_HANDLE; }
+ if (bd->SamplerNearest) { vkDestroySampler(v->Device, bd->SamplerNearest, v->Allocator); bd->SamplerNearest = VK_NULL_HANDLE; }
if (bd->ShaderModuleVert) { vkDestroyShaderModule(v->Device, bd->ShaderModuleVert, v->Allocator); bd->ShaderModuleVert = VK_NULL_HANDLE; }
if (bd->ShaderModuleFrag) { vkDestroyShaderModule(v->Device, bd->ShaderModuleFrag, v->Allocator); bd->ShaderModuleFrag = VK_NULL_HANDLE; }
- if (bd->DescriptorSetLayout) { vkDestroyDescriptorSetLayout(v->Device, bd->DescriptorSetLayout, v->Allocator); bd->DescriptorSetLayout = VK_NULL_HANDLE; }
+ if (bd->DescriptorSetLayoutTexture) { vkDestroyDescriptorSetLayout(v->Device, bd->DescriptorSetLayoutTexture, v->Allocator); bd->DescriptorSetLayoutTexture = VK_NULL_HANDLE; }
+ if (bd->DescriptorSetLayoutSampler) { vkDestroyDescriptorSetLayout(v->Device, bd->DescriptorSetLayoutSampler, v->Allocator); bd->DescriptorSetLayoutSampler = VK_NULL_HANDLE; }
if (bd->PipelineLayout) { vkDestroyPipelineLayout(v->Device, bd->PipelineLayout, v->Allocator); bd->PipelineLayout = VK_NULL_HANDLE; }
if (bd->Pipeline) { vkDestroyPipeline(v->Device, bd->Pipeline, v->Allocator); bd->Pipeline = VK_NULL_HANDLE; }
if (bd->PipelineForViewports) { vkDestroyPipeline(v->Device, bd->PipelineForViewports, v->Allocator); bd->PipelineForViewports = VK_NULL_HANDLE; }
@@ -1323,6 +1405,11 @@ bool ImGui_ImplVulkan_Init(ImGui_ImplVulkan_InitInfo* info)
io.BackendFlags |= ImGuiBackendFlags_RendererHasTextures; // We can honor ImGuiPlatformIO::Textures[] requests during render.
io.BackendFlags |= ImGuiBackendFlags_RendererHasViewports; // We can create multi-viewports on the Renderer side (optional)
+ ImGuiPlatformIO& platform_io = ImGui::GetPlatformIO();
+ platform_io.DrawCallback_ResetRenderState = ImGui_ImplVulkan_DrawCallback_ResetRenderState;
+ platform_io.DrawCallback_SetSamplerLinear = ImGui_ImplVulkan_DrawCallback_SetSamplerLinear;
+ platform_io.DrawCallback_SetSamplerNearest = ImGui_ImplVulkan_DrawCallback_SetSamplerNearest;
+
// Sanity checks
IM_ASSERT(info->Instance != VK_NULL_HANDLE);
IM_ASSERT(info->PhysicalDevice != VK_NULL_HANDLE);
@@ -1406,7 +1493,7 @@ void ImGui_ImplVulkan_SetMinImageCount(uint32_t min_image_count)
// Register a texture by creating a descriptor
// FIXME: This is experimental in the sense that we are unsure how to best design/tackle this problem, please post to https://github.com/ocornut/imgui/pull/914 if you have suggestions.
-VkDescriptorSet ImGui_ImplVulkan_AddTexture(VkSampler sampler, VkImageView image_view, VkImageLayout image_layout)
+VkDescriptorSet ImGui_ImplVulkan_AddTexture(VkImageView image_view, VkImageLayout image_layout)
{
ImGui_ImplVulkan_Data* bd = ImGui_ImplVulkan_GetBackendData();
ImGui_ImplVulkan_InitInfo* v = &bd->VulkanInitInfo;
@@ -1419,7 +1506,7 @@ VkDescriptorSet ImGui_ImplVulkan_AddTexture(VkSampler sampler, VkImageView image
alloc_info.sType = VK_STRUCTURE_TYPE_DESCRIPTOR_SET_ALLOCATE_INFO;
alloc_info.descriptorPool = pool;
alloc_info.descriptorSetCount = 1;
- alloc_info.pSetLayouts = &bd->DescriptorSetLayout;
+ alloc_info.pSetLayouts = &bd->DescriptorSetLayoutTexture;
VkResult err = vkAllocateDescriptorSets(v->Device, &alloc_info, &descriptor_set);
check_vk_result(err);
}
@@ -1428,20 +1515,27 @@ VkDescriptorSet ImGui_ImplVulkan_AddTexture(VkSampler sampler, VkImageView image
if (descriptor_set != VK_NULL_HANDLE)
{
VkDescriptorImageInfo desc_image[1] = {};
- desc_image[0].sampler = sampler;
desc_image[0].imageView = image_view;
desc_image[0].imageLayout = image_layout;
VkWriteDescriptorSet write_desc[1] = {};
write_desc[0].sType = VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET;
write_desc[0].dstSet = descriptor_set;
write_desc[0].descriptorCount = 1;
- write_desc[0].descriptorType = VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER;
+ write_desc[0].descriptorType = VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE;
write_desc[0].pImageInfo = desc_image;
vkUpdateDescriptorSets(v->Device, 1, write_desc, 0, nullptr);
}
return descriptor_set;
}
+#ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS
+VkDescriptorSet ImGui_ImplVulkan_AddTexture(VkSampler sampler, VkImageView image_view, VkImageLayout image_layout)
+{
+ IM_UNUSED(sampler);
+ return ImGui_ImplVulkan_AddTexture(image_view, image_layout);
+}
+#endif
+
void ImGui_ImplVulkan_RemoveTexture(VkDescriptorSet descriptor_set)
{
ImGui_ImplVulkan_Data* bd = ImGui_ImplVulkan_GetBackendData();
@@ -2034,7 +2128,9 @@ static void ImGui_ImplVulkan_CreateWindow(ImGuiViewport* viewport)
{
pipeline_info->PipelineRenderingCreateInfo.sType = VK_STRUCTURE_TYPE_PIPELINE_RENDERING_CREATE_INFO;
pipeline_info->PipelineRenderingCreateInfo.colorAttachmentCount = 1;
- pipeline_info->PipelineRenderingCreateInfo.pColorAttachmentFormats = &wd->SurfaceFormat.format;
+ bd->PipelineRenderingCreateInfoColorAttachmentFormats.resize(1);
+ bd->PipelineRenderingCreateInfoColorAttachmentFormats[0] = wd->SurfaceFormat.format;
+ pipeline_info->PipelineRenderingCreateInfo.pColorAttachmentFormats = bd->PipelineRenderingCreateInfoColorAttachmentFormats.Data;
}
else
{
diff --git a/include/imgui/backends/imgui_impl_vulkan.h b/include/imgui/backends/imgui_impl_vulkan.h
index 5036431..3ca126c 100644
--- a/include/imgui/backends/imgui_impl_vulkan.h
+++ b/include/imgui/backends/imgui_impl_vulkan.h
@@ -2,7 +2,7 @@
// This needs to be used along with a Platform Backend (e.g. GLFW, SDL, Win32, custom..)
// Implemented features:
-// [!] Renderer: User texture binding. Use 'VkDescriptorSet' as texture identifier. Call ImGui_ImplVulkan_AddTexture() to register one. Read the FAQ about ImTextureID/ImTextureRef + https://github.com/ocornut/imgui/pull/914 for discussions.
+// [!] Renderer: User texture binding. Use a VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE 'VkDescriptorSet' as texture identifier. Call ImGui_ImplVulkan_AddTexture() to register one. Read the FAQ about ImTextureID/ImTextureRef + https://github.com/ocornut/imgui/pull/914 for discussions.
// [X] Renderer: Large meshes support (64k+ vertices) even with 16-bit indices (ImGuiBackendFlags_RendererHasVtxOffset).
// [X] Renderer: Texture updates support for dynamic font atlas (ImGuiBackendFlags_RendererHasTextures).
// [X] Renderer: Expose selected render state for draw callbacks to use. Access in '(ImGui_ImplXXXX_RenderState*)GetPlatformIO().Renderer_RenderState'.
@@ -79,7 +79,8 @@
#endif
// Backend uses a small number of descriptors per font atlas + as many as additional calls done to ImGui_ImplVulkan_AddTexture().
-#define IMGUI_IMPL_VULKAN_MINIMUM_IMAGE_SAMPLER_POOL_SIZE (8) // Minimum per atlas
+#define IMGUI_IMPL_VULKAN_MINIMUM_SAMPLED_IMAGE_POOL_SIZE (8) // Minimum per atlas
+#define IMGUI_IMPL_VULKAN_MINIMUM_SAMPLER_POOL_SIZE (2) // Minimum for linear + nearest
// Specify settings to create pipeline and swapchain
struct ImGui_ImplVulkan_PipelineInfo
@@ -116,7 +117,7 @@ struct ImGui_ImplVulkan_InitInfo
uint32_t QueueFamily;
VkQueue Queue;
VkDescriptorPool DescriptorPool; // See requirements in note above; ignored if using DescriptorPoolSize > 0
- uint32_t DescriptorPoolSize; // Optional: set to create internal descriptor pool automatically instead of using DescriptorPool.
+ uint32_t DescriptorPoolSize; // Optional: set to create internal ImageView descriptor pool automatically instead of using DescriptorPool.
uint32_t MinImageCount; // >= 2
uint32_t ImageCount; // >= MinImageCount
VkPipelineCache PipelineCache; // Optional
@@ -160,18 +161,21 @@ IMGUI_IMPL_API void ImGui_ImplVulkan_CreateMainPipeline(const ImGui_
// (Advanced) Use e.g. if you need to precisely control the timing of texture updates (e.g. for staged rendering), by setting ImDrawData::Textures = nullptr to handle this manually.
IMGUI_IMPL_API void ImGui_ImplVulkan_UpdateTexture(ImTextureData* tex);
-// Register a texture (VkDescriptorSet == ImTextureID)
-// FIXME: This is experimental in the sense that we are unsure how to best design/tackle this problem
-// Please post to https://github.com/ocornut/imgui/pull/914 if you have suggestions.
-IMGUI_IMPL_API VkDescriptorSet ImGui_ImplVulkan_AddTexture(VkSampler sampler, VkImageView image_view, VkImageLayout image_layout);
+// Register a texture (VkDescriptorSet for a VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE == ImTextureID)
+IMGUI_IMPL_API VkDescriptorSet ImGui_ImplVulkan_AddTexture(VkImageView image_view, VkImageLayout image_layout);
IMGUI_IMPL_API void ImGui_ImplVulkan_RemoveTexture(VkDescriptorSet descriptor_set);
+#ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS
+IMGUI_IMPL_API VkDescriptorSet ImGui_ImplVulkan_AddTexture(VkSampler sampler, VkImageView image_view, VkImageLayout image_layout); // Ignore VkSampler
+#endif
+
// Optional: load Vulkan functions with a custom function loader
// This is only useful with IMGUI_IMPL_VULKAN_NO_PROTOTYPES / VK_NO_PROTOTYPES
IMGUI_IMPL_API bool ImGui_ImplVulkan_LoadFunctions(uint32_t api_version, PFN_vkVoidFunction(*loader_func)(const char* function_name, void* user_data), void* user_data = nullptr);
// [BETA] Selected render state data shared with callbacks.
// This is temporarily stored in GetPlatformIO().Renderer_RenderState during the ImGui_ImplVulkan_RenderDrawData() call.
+// ImGui_ImplVulkan_RenderState* render_state = (ImGui_ImplVulkan_RenderState*)ImGui::GetPlatformIO().Renderer_RenderState;
// (Please open an issue if you feel you need access to more data)
struct ImGui_ImplVulkan_RenderState
{
@@ -262,7 +266,7 @@ struct ImGui_ImplVulkanH_Window
memset((void*)this, 0, sizeof(*this));
// Parameters to create SwapChain
- PresentMode = (VkPresentModeKHR)~0; // Ensure we get an error if user doesn't set this.
+ PresentMode = VK_PRESENT_MODE_MAX_ENUM_KHR; // Ensure we get an error if user doesn't set this.
// Parameters to create RenderPass
AttachmentDesc.format = VK_FORMAT_UNDEFINED; // Will automatically use wd->SurfaceFormat.format.
diff --git a/include/imgui/backends/imgui_impl_wgpu.cpp b/include/imgui/backends/imgui_impl_wgpu.cpp
index 5a98b7e..a572e08 100644
--- a/include/imgui/backends/imgui_impl_wgpu.cpp
+++ b/include/imgui/backends/imgui_impl_wgpu.cpp
@@ -22,6 +22,7 @@
// CHANGELOG
// (minor and older changes stripped away, please see git history for details)
+// 2026-04-23: Added support for standard draw callbacks (in platform_io): DrawCallback_ResetRenderState, DrawCallback_SetSamplerLinear, DrawCallback_SetSamplerNearest. (#9378)
// 2026-03-25: Added support for WGVK native backend via IMGUI_IMPL_WEBGPU_BACKEND_WGVK define, with SPIRV shaders if WGSL is not available. (#9316, #9246, #9257)
// 2026-03-09: Removed support for Emscripten < 4.0.10. (#9281)
// 2025-10-16: Update to compile with Dawn and Emscripten's 4.0.10+ '--use-port=emdawnwebgpu' ports. (#8381, #8898)
@@ -85,11 +86,13 @@ struct ImGui_ImplWGPU_Texture
struct RenderResources
{
- WGPUSampler Sampler = nullptr; // Sampler for textures
- WGPUBuffer Uniforms = nullptr; // Shader uniforms
- WGPUBindGroup CommonBindGroup = nullptr; // Resources bind-group to bind the common resources to pipeline
- ImGuiStorage ImageBindGroups; // Resources bind-group to bind the font/image resources to pipeline (this is a key->value map)
- WGPUBindGroupLayout ImageBindGroupLayout = nullptr; // Cache layout used for the image bind group. Avoids allocating unnecessary JS objects when working with WebASM
+ WGPUSampler SamplerLinear = nullptr; // Bilinear sampler
+ WGPUSampler SamplerNearest = nullptr; // Nearest/point sampler
+ WGPUBuffer Uniforms = nullptr; // Shader uniforms
+ WGPUBindGroup CommonBindGroupLinear = nullptr; // Common bind-group bound to group 0 (uniforms + SamplerLinear)
+ WGPUBindGroup CommonBindGroupNearest = nullptr; // Common bind-group bound to group 0 (uniforms + SamplerNearest)
+ ImGuiStorage ImageBindGroups; // Resources bind-group to bind the font/image resources to pipeline (this is a key->value map)
+ WGPUBindGroupLayout ImageBindGroupLayout = nullptr; // Cache layout used for the image bind group. Avoids allocating unnecessary JS objects when working with WebASM
};
struct FrameResources
@@ -116,6 +119,7 @@ struct ImGui_ImplWGPU_Data
WGPUTextureFormat renderTargetFormat = WGPUTextureFormat_Undefined;
WGPUTextureFormat depthStencilFormat = WGPUTextureFormat_Undefined;
WGPURenderPipeline pipelineState = nullptr;
+ ImGui_ImplWGPU_RenderState* RenderState = nullptr; // == ImGui::GetPlatformIO().Renderer_RenderState during rendering.
RenderResources renderResources;
FrameResources* pFrameResources = nullptr;
@@ -298,9 +302,11 @@ static void SafeRelease(WGPUShaderModule& res)
}
static void SafeRelease(RenderResources& res)
{
- SafeRelease(res.Sampler);
+ SafeRelease(res.SamplerLinear);
+ SafeRelease(res.SamplerNearest);
SafeRelease(res.Uniforms);
- SafeRelease(res.CommonBindGroup);
+ SafeRelease(res.CommonBindGroupLinear);
+ SafeRelease(res.CommonBindGroupNearest);
SafeRelease(res.ImageBindGroupLayout);
};
@@ -315,6 +321,7 @@ static void SafeRelease(FrameResources& res)
static WGPUProgrammableStageDescriptor ImGui_ImplWGPU_CreateShaderModuleWGSL(const char* wgsl_source)
{
ImGui_ImplWGPU_Data* bd = ImGui_ImplWGPU_GetBackendData();
+ IM_UNUSED(bd);
WGPUShaderSourceWGSL wgsl_desc = {};
wgsl_desc.chain.sType = WGPUSType_ShaderSourceWGSL;
@@ -323,10 +330,31 @@ static WGPUProgrammableStageDescriptor ImGui_ImplWGPU_CreateShaderModuleWGSL(con
WGPUShaderModuleDescriptor desc = {};
desc.nextInChain = (WGPUChainedStruct*)&wgsl_desc;
- WGPUProgrammableStageDescriptor stage_desc = {};
- stage_desc.module = wgpuDeviceCreateShaderModule(bd->wgpuDevice, &desc);
+ // Detect shader compilation errors by using an error scope.
+ // Flag to be passed into the validation callback `userdata1` pointer.
+ int validation_error = 0;
+ wgpuDevicePushErrorScope(bd->wgpuDevice, WGPUErrorFilter_Validation);
+ WGPUShaderModule module = wgpuDeviceCreateShaderModule(bd->wgpuDevice, &desc);
+ WGPUPopErrorScopeCallbackInfo pop_cb = {};
+ pop_cb.mode = WGPUCallbackMode_AllowSpontaneous;
+ pop_cb.callback = [](WGPUPopErrorScopeStatus, WGPUErrorType type, WGPUStringView, void* userdata1, void*)
+ {
+ if (type == WGPUErrorType_Validation)
+ *static_cast(userdata1) = 1;
+ };
+ pop_cb.userdata1 = &validation_error;
+ wgpuDevicePopErrorScope(bd->wgpuDevice, pop_cb);
- stage_desc.entryPoint = { "main", WGPU_STRLEN };
+ WGPUProgrammableStageDescriptor stage_desc = {};
+ if (module && !validation_error)
+ {
+ stage_desc.module = module;
+ stage_desc.entryPoint = { "main", WGPU_STRLEN };
+ }
+ else if (module)
+ {
+ wgpuShaderModuleRelease(module);
+ }
return stage_desc;
}
@@ -420,15 +448,19 @@ static void ImGui_ImplWGPU_SetupRenderState(ImDrawData* draw_data, WGPURenderPas
wgpuRenderPassEncoderSetVertexBuffer(ctx, 0, fr->VertexBuffer, 0, fr->VertexBufferSize * sizeof(ImDrawVert));
wgpuRenderPassEncoderSetIndexBuffer(ctx, fr->IndexBuffer, sizeof(ImDrawIdx) == 2 ? WGPUIndexFormat_Uint16 : WGPUIndexFormat_Uint32, 0, fr->IndexBufferSize * sizeof(ImDrawIdx));
wgpuRenderPassEncoderSetPipeline(ctx, bd->pipelineState);
- wgpuRenderPassEncoderSetBindGroup(ctx, 0, bd->renderResources.CommonBindGroup, 0, nullptr);
+ wgpuRenderPassEncoderSetBindGroup(ctx, 0, bd->renderResources.CommonBindGroupLinear, 0, nullptr);
// Setup blend factor
- WGPUColor blend_color = { 0.f, 0.f, 0.f, 0.f };
+ WGPUColor blend_color = { 0.0f, 0.0f, 0.0f, 0.0f };
wgpuRenderPassEncoderSetBlendConstant(ctx, &blend_color);
}
+// Draw callbacks
+static void ImGui_ImplWGPU_DrawCallback_ResetRenderState(const ImDrawList*, const ImDrawCmd*) {} // Intentionally empty. Used as an identifier for rendering loop to call its code. Simpler to implement this way.
+static void ImGui_ImplWGPU_DrawCallback_SetSamplerLinear(const ImDrawList*, const ImDrawCmd*) { ImGui_ImplWGPU_Data* bd = ImGui_ImplWGPU_GetBackendData(); wgpuRenderPassEncoderSetBindGroup(bd->RenderState->RenderPassEncoder, 0, bd->renderResources.CommonBindGroupLinear, 0, nullptr); }
+static void ImGui_ImplWGPU_DrawCallback_SetSamplerNearest(const ImDrawList*, const ImDrawCmd*) { ImGui_ImplWGPU_Data* bd = ImGui_ImplWGPU_GetBackendData(); wgpuRenderPassEncoderSetBindGroup(bd->RenderState->RenderPassEncoder, 0, bd->renderResources.CommonBindGroupNearest, 0, nullptr); }
+
// Render function
-// (this used to be set in io.RenderDrawListsFn and called by ImGui::Render(), but you can now call this directly from your main loop)
void ImGui_ImplWGPU_RenderDrawData(ImDrawData* draw_data, WGPURenderPassEncoder pass_encoder)
{
// Avoid rendering when minimized
@@ -523,7 +555,7 @@ void ImGui_ImplWGPU_RenderDrawData(ImDrawData* draw_data, WGPURenderPassEncoder
ImGui_ImplWGPU_RenderState render_state;
render_state.Device = bd->wgpuDevice;
render_state.RenderPassEncoder = pass_encoder;
- platform_io.Renderer_RenderState = &render_state;
+ platform_io.Renderer_RenderState = bd->RenderState = &render_state;
// Render command lists
// (Because we merged all buffers into a single one, we maintain our own offset into them)
@@ -539,8 +571,7 @@ void ImGui_ImplWGPU_RenderDrawData(ImDrawData* draw_data, WGPURenderPassEncoder
if (pcmd->UserCallback != nullptr)
{
// User callback, registered via ImDrawList::AddCallback()
- // (ImDrawCallback_ResetRenderState is a special callback value used by the user to request the renderer to reset render state.)
- if (pcmd->UserCallback == ImDrawCallback_ResetRenderState)
+ if (pcmd->UserCallback == ImGui_ImplWGPU_DrawCallback_ResetRenderState)
ImGui_ImplWGPU_SetupRenderState(draw_data, pass_encoder, fr);
else
pcmd->UserCallback(draw_list, pcmd);
@@ -551,12 +582,11 @@ void ImGui_ImplWGPU_RenderDrawData(ImDrawData* draw_data, WGPURenderPassEncoder
ImTextureID tex_id = pcmd->GetTexID();
ImGuiID tex_id_hash = ImHashData(&tex_id, sizeof(tex_id), 0);
WGPUBindGroup bind_group = (WGPUBindGroup)bd->renderResources.ImageBindGroups.GetVoidPtr(tex_id_hash);
- if (!bind_group)
- {
- bind_group = ImGui_ImplWGPU_CreateImageBindGroup(bd->renderResources.ImageBindGroupLayout, (WGPUTextureView)tex_id);
- bd->renderResources.ImageBindGroups.SetVoidPtr(tex_id_hash, bind_group);
- }
- wgpuRenderPassEncoderSetBindGroup(pass_encoder, 1, (WGPUBindGroup)bind_group, 0, nullptr);
+ if (!bind_group && tex_id != 0)
+ if ((bind_group = ImGui_ImplWGPU_CreateImageBindGroup(bd->renderResources.ImageBindGroupLayout, (WGPUTextureView)tex_id)) != 0)
+ bd->renderResources.ImageBindGroups.SetVoidPtr(tex_id_hash, bind_group);
+ if (bind_group)
+ wgpuRenderPassEncoderSetBindGroup(pass_encoder, 1, (WGPUBindGroup)bind_group, 0, nullptr);
// Project scissor/clipping rectangles into framebuffer space
ImVec2 clip_min((pcmd->ClipRect.x - clip_off.x) * clip_scale.x, (pcmd->ClipRect.y - clip_off.y) * clip_scale.y);
@@ -565,8 +595,8 @@ void ImGui_ImplWGPU_RenderDrawData(ImDrawData* draw_data, WGPURenderPassEncoder
// Clamp to viewport as wgpuRenderPassEncoderSetScissorRect() won't accept values that are off bounds
if (clip_min.x < 0.0f) { clip_min.x = 0.0f; }
if (clip_min.y < 0.0f) { clip_min.y = 0.0f; }
- if (clip_max.x > fb_width) { clip_max.x = (float)fb_width; }
- if (clip_max.y > fb_height) { clip_max.y = (float)fb_height; }
+ if (clip_max.x > (float)fb_width) { clip_max.x = (float)fb_width; }
+ if (clip_max.y > (float)fb_height) { clip_max.y = (float)fb_height; }
if (clip_max.x <= clip_min.x || clip_max.y <= clip_min.y)
continue;
@@ -588,7 +618,7 @@ void ImGui_ImplWGPU_RenderDrawData(ImDrawData* draw_data, WGPURenderPassEncoder
}
image_bind_groups.Data.resize(0);
- platform_io.Renderer_RenderState = nullptr;
+ platform_io.Renderer_RenderState = bd->RenderState = nullptr;
}
static void ImGui_ImplWGPU_DestroyTexture(ImTextureData* tex)
@@ -816,29 +846,35 @@ bool ImGui_ImplWGPU_CreateDeviceObjects()
ImGui_ImplWGPU_CreateUniformBuffer();
- // Create sampler
+ // Create samplers (Linear/Nearest)
// (Bilinear sampling is required by default. Set 'io.Fonts->Flags |= ImFontAtlasFlags_NoBakedLines' or 'style.AntiAliasedLinesUseTex = false' to allow point/nearest sampling)
WGPUSamplerDescriptor sampler_desc = {};
- sampler_desc.minFilter = WGPUFilterMode_Linear;
- sampler_desc.magFilter = WGPUFilterMode_Linear;
- sampler_desc.mipmapFilter = WGPUMipmapFilterMode_Linear;
sampler_desc.addressModeU = WGPUAddressMode_ClampToEdge;
sampler_desc.addressModeV = WGPUAddressMode_ClampToEdge;
sampler_desc.addressModeW = WGPUAddressMode_ClampToEdge;
sampler_desc.maxAnisotropy = 1;
- bd->renderResources.Sampler = wgpuDeviceCreateSampler(bd->wgpuDevice, &sampler_desc);
+ sampler_desc.minFilter = WGPUFilterMode_Linear;
+ sampler_desc.magFilter = WGPUFilterMode_Linear;
+ sampler_desc.mipmapFilter = WGPUMipmapFilterMode_Linear;
+ bd->renderResources.SamplerLinear = wgpuDeviceCreateSampler(bd->wgpuDevice, &sampler_desc);
+ sampler_desc.minFilter = WGPUFilterMode_Nearest;
+ sampler_desc.magFilter = WGPUFilterMode_Nearest;
+ sampler_desc.mipmapFilter = WGPUMipmapFilterMode_Nearest;
+ bd->renderResources.SamplerNearest = wgpuDeviceCreateSampler(bd->wgpuDevice, &sampler_desc);
- // Create resource bind group
+ // Create resource bind groups (one per sampler, otherwise identical)
WGPUBindGroupEntry common_bg_entries[] =
{
{ nullptr, 0, bd->renderResources.Uniforms, 0, MEMALIGN(sizeof(Uniforms), 16), 0, 0 },
- { nullptr, 1, 0, 0, 0, bd->renderResources.Sampler, 0 },
+ { nullptr, 1, 0, 0, 0, bd->renderResources.SamplerLinear, 0 },
};
WGPUBindGroupDescriptor common_bg_descriptor = {};
common_bg_descriptor.layout = bg_layouts[0];
common_bg_descriptor.entryCount = sizeof(common_bg_entries) / sizeof(WGPUBindGroupEntry);
common_bg_descriptor.entries = common_bg_entries;
- bd->renderResources.CommonBindGroup = wgpuDeviceCreateBindGroup(bd->wgpuDevice, &common_bg_descriptor);
+ bd->renderResources.CommonBindGroupLinear = wgpuDeviceCreateBindGroup(bd->wgpuDevice, &common_bg_descriptor);
+ common_bg_entries[1].sampler = bd->renderResources.SamplerNearest;
+ bd->renderResources.CommonBindGroupNearest = wgpuDeviceCreateBindGroup(bd->wgpuDevice, &common_bg_descriptor);
bd->renderResources.ImageBindGroupLayout = bg_layouts[1];
SafeRelease(vertex_shader_desc.module);
@@ -890,6 +926,11 @@ bool ImGui_ImplWGPU_Init(ImGui_ImplWGPU_InitInfo* init_info)
io.BackendFlags |= ImGuiBackendFlags_RendererHasVtxOffset; // We can honor the ImDrawCmd::VtxOffset field, allowing for large meshes.
io.BackendFlags |= ImGuiBackendFlags_RendererHasTextures; // We can honor ImGuiPlatformIO::Textures[] requests during render.
+ ImGuiPlatformIO& platform_io = ImGui::GetPlatformIO();
+ platform_io.DrawCallback_ResetRenderState = ImGui_ImplWGPU_DrawCallback_ResetRenderState;
+ platform_io.DrawCallback_SetSamplerLinear = ImGui_ImplWGPU_DrawCallback_SetSamplerLinear;
+ platform_io.DrawCallback_SetSamplerNearest = ImGui_ImplWGPU_DrawCallback_SetSamplerNearest;
+
bd->initInfo = *init_info;
bd->wgpuDevice = init_info->Device;
bd->defaultQueue = wgpuDeviceGetQueue(bd->wgpuDevice);
@@ -898,11 +939,7 @@ bool ImGui_ImplWGPU_Init(ImGui_ImplWGPU_InitInfo* init_info)
bd->numFramesInFlight = init_info->NumFramesInFlight;
bd->frameIndex = UINT_MAX;
- bd->renderResources.Sampler = nullptr;
- bd->renderResources.Uniforms = nullptr;
- bd->renderResources.CommonBindGroup = nullptr;
bd->renderResources.ImageBindGroups.Data.reserve(100);
- bd->renderResources.ImageBindGroupLayout = nullptr;
// Create buffers with a default size (they will later be grown as needed)
bd->pFrameResources = new FrameResources[bd->numFramesInFlight];
diff --git a/include/imgui/backends/imgui_impl_win32.cpp b/include/imgui/backends/imgui_impl_win32.cpp
index 44842f9..8dee46a 100644
--- a/include/imgui/backends/imgui_impl_win32.cpp
+++ b/include/imgui/backends/imgui_impl_win32.cpp
@@ -23,6 +23,7 @@
// CHANGELOG
// (minor and older changes stripped away, please see git history for details)
// 2026-XX-XX: Platform: Added support for multiple windows via the ImGuiPlatformIO interface.
+// 2026-05-19: DPI: ImGui_ImplWin32_EnableDpiAwareness() helper uses SetProcessDpiAwarenessContext() instead of SetThreadDpiAwarenessContext(), fixes DPI scaling issues with e.g. OpenGL. (#9403)
// 2026-03-31: [Viewports] Fixed setting/getting size when viewports have OS decorations (e.g. io.ConfigViewportsNoDecoration = false) and process is running in Per-Monitor V2 DPI mode. (#8897)
// 2026-01-28: Inputs: Minor optimization not submitting gamepad input if packet number has not changed (reworked from 2025-09-23 attempt). (#9202, #8556)
// 2026-01-26: [Viewports] Fixed an issue from 1.90.5 where newly appearing windows that are not parented to the main viewport don't have task bar icon appear before the windows was explicited refocused. (#7354, #8669)
@@ -520,7 +521,7 @@ void ImGui_ImplWin32_NewFrame()
// Setup time step
INT64 current_time = 0;
::QueryPerformanceCounter((LARGE_INTEGER*)¤t_time);
- io.DeltaTime = (float)(current_time - bd->Time) / bd->TicksPerSecond;
+ io.DeltaTime = (float)((double)(current_time - bd->Time) / (double)bd->TicksPerSecond);
bd->Time = current_time;
// Update OS mouse position
@@ -1016,6 +1017,7 @@ DECLARE_HANDLE(DPI_AWARENESS_CONTEXT);
typedef HRESULT(WINAPI* PFN_SetProcessDpiAwareness)(PROCESS_DPI_AWARENESS); // Shcore.lib + dll, Windows 8.1+
typedef HRESULT(WINAPI* PFN_GetDpiForMonitor)(HMONITOR, MONITOR_DPI_TYPE, UINT*, UINT*); // Shcore.lib + dll, Windows 8.1+
typedef DPI_AWARENESS_CONTEXT(WINAPI* PFN_SetThreadDpiAwarenessContext)(DPI_AWARENESS_CONTEXT); // User32.lib + dll, Windows 10 v1607+ (Creators Update)
+typedef BOOL (WINAPI* PFN_SetProcessDpiAwarenessContext)(DPI_AWARENESS_CONTEXT); // User32.lib + dll, Windows 10 v1703+ (Creators Update)
typedef DPI_AWARENESS_CONTEXT(WINAPI* PFN_GetThreadDpiAwarenessContext)(); // "
typedef BOOL(WINAPI* PFN_AreDpiAwarenessContextsEqual)(DPI_AWARENESS_CONTEXT, DPI_AWARENESS_CONTEXT); // "
@@ -1029,7 +1031,12 @@ void ImGui_ImplWin32_EnableDpiAwareness()
if (_IsWindows10OrGreater())
{
static HINSTANCE user32_dll = ::LoadLibraryA("user32.dll"); // Reference counted per-process
- if (PFN_SetThreadDpiAwarenessContext SetThreadDpiAwarenessContextFn = (PFN_SetThreadDpiAwarenessContext)::GetProcAddress(user32_dll, "SetThreadDpiAwarenessContext"))
+ if (PFN_SetProcessDpiAwarenessContext SetProcessDpiAwarenessContextFn = (PFN_SetProcessDpiAwarenessContext)::GetProcAddress(user32_dll, "SetProcessDpiAwarenessContext")) // Windows 10 v1703+
+ {
+ SetProcessDpiAwarenessContextFn(DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2);
+ return;
+ }
+ if (PFN_SetThreadDpiAwarenessContext SetThreadDpiAwarenessContextFn = (PFN_SetThreadDpiAwarenessContext)::GetProcAddress(user32_dll, "SetThreadDpiAwarenessContext")) // Windows 10 v1607+
{
SetThreadDpiAwarenessContextFn(DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2);
return;
@@ -1078,7 +1085,7 @@ float ImGui_ImplWin32_GetDpiScaleForMonitor(void* monitor)
{
GetDpiForMonitorFn((HMONITOR)monitor, MDT_EFFECTIVE_DPI, &xdpi, &ydpi);
IM_ASSERT(xdpi == ydpi); // Please contact me if you hit this assert!
- return xdpi / 96.0f;
+ return (float)xdpi / 96.0f;
}
}
#ifndef NOGDI
@@ -1088,7 +1095,7 @@ float ImGui_ImplWin32_GetDpiScaleForMonitor(void* monitor)
IM_ASSERT(xdpi == ydpi); // Please contact me if you hit this assert!
::ReleaseDC(nullptr, dc);
#endif
- return xdpi / 96.0f;
+ return (float)xdpi / 96.0f;
}
float ImGui_ImplWin32_GetDpiScaleForHwnd(void* hwnd)
diff --git a/include/imgui/backends/vulkan/glsl_shader.frag b/include/imgui/backends/vulkan/glsl_shader.frag
index ce7e6f7..00fa28c 100644
--- a/include/imgui/backends/vulkan/glsl_shader.frag
+++ b/include/imgui/backends/vulkan/glsl_shader.frag
@@ -1,7 +1,8 @@
#version 450 core
layout(location = 0) out vec4 fColor;
-layout(set=0, binding=0) uniform sampler2D sTexture;
+layout(set=0, binding=0) uniform texture2D _Texture;
+layout(set=1, binding=0) uniform sampler _Sampler;
layout(location = 0) in struct {
vec4 Color;
@@ -10,5 +11,5 @@ layout(location = 0) in struct {
void main()
{
- fColor = In.Color * texture(sTexture, In.UV.st);
+ fColor = In.Color * texture(sampler2D(_Texture, _Sampler), In.UV.st);
}
diff --git a/include/imgui/docs/BACKENDS.md b/include/imgui/docs/BACKENDS.md
index 091de1b..de01b99 100644
--- a/include/imgui/docs/BACKENDS.md
+++ b/include/imgui/docs/BACKENDS.md
@@ -89,6 +89,7 @@ List of Renderer Backends:
imgui_impl_dx11.cpp ; DirectX11
imgui_impl_dx12.cpp ; DirectX12
imgui_impl_metal.mm ; Metal (ObjC or C++)
+ imgui_impl_metal4.mm ; Metal 4 (ObjC or C++)
imgui_impl_opengl2.cpp ; OpenGL 2 (legacy fixed pipeline. Don't use with modern OpenGL code!)
imgui_impl_opengl3.cpp ; OpenGL 3/4, OpenGL ES 2/3, WebGL
imgui_impl_sdlgpu3.cpp ; SDL_GPU (portable 3D graphics API of SDL3)
@@ -116,7 +117,7 @@ If you are not sure which backend to use, the recommended platform/frameworks fo
| GLFW | https://github.com/glfw/glfw | imgui_impl_glfw.cpp | |
| Sokol | https://github.com/floooh/sokol | [util/sokol_imgui.h](https://github.com/floooh/sokol/blob/master/util/sokol_imgui.h) | Lower-level than GLFW/SDL |
-If your application runs on Windows or if you are using multi-viewport, the win32 backend handles some details a little better than other backends.
+If your application runs on Windows or if you are using multi-viewports, the imgui_impl_win32 backend handles some details better than other backends.
## Using third-party Backends
@@ -256,8 +257,8 @@ void MyImGuiBackend_RenderDrawData(ImDrawData* draw_data)
const ImDrawCmd* pcmd = &cmd_list->CmdBuffer[cmd_i];
if (pcmd->UserCallback)
{
- if (pcmd->UserCallback == ImDrawCallback_ResetRenderState)
- MyEngineSetupenderState();
+ if (pcmd->UserCallback == platform_io.DrawCallback_ResetRenderState)
+ MyEngineSetupSenderState();
else
pcmd->UserCallback(cmd_list, pcmd);
}
diff --git a/include/imgui/docs/CHANGELOG.txt b/include/imgui/docs/CHANGELOG.txt
index 196c260..85fbcfb 100644
--- a/include/imgui/docs/CHANGELOG.txt
+++ b/include/imgui/docs/CHANGELOG.txt
@@ -35,6 +35,458 @@ HOW TO UPDATE?
and API updates have been a little more frequent lately. They are documented below and in imgui.cpp and should not affect all users.
- Please report any issue!
+-----------------------------------------------------------------------
+ VERSION 1.92.9b (Released 2026-07-31)
+-----------------------------------------------------------------------
+
+Decorated log and release notes: https://github.com/ocornut/imgui/releases/tag/v1.92.9b
+
+Changes:
+
+- DragXXX, SliderXXX: fixed a regression in 1.92.9 where clicking a previously
+ Ctrl+Clicked field would flick it to text edit mode for a frame. (#9476, #701)
+- Tables:
+ - Fixed Y2 position of lower horizontal border (ImGuiTableFlags_BordersOuterH)
+ being off by one pixel when vertical ones are not also enabled. [@thedmd]
+ - Fixed X position of angled borders being off by half a pixel. [@thedmd]
+- ImDrawData: fixed a regression in 1.92.9 where legacy `ImDrawData::CmdListsCount` was always 0.
+ Prefer using `ImDrawData::CmdList.Size` anyway.
+
+
+-----------------------------------------------------------------------
+ VERSION 1.92.9 (Released 2026-07-25)
+-----------------------------------------------------------------------
+
+Decorated log and release notes: https://github.com/ocornut/imgui/releases/tag/v1.92.9
+
+Breaking Changes:
+
+- DragXXX, SliderXXX, InputScalar: with `ImGuiItemFlags_LiveEditOnInputScalar` now
+ defaulting to being disabled: inputting a value with the keyboard doesn't write
+ intermediate values to the backing variable. (#9476)
+ Before: DragFloat() with user typing "123" --> write back 1, then 12, then 123.
+ After: DragFloat() with user typing "123" --> write back 123 when validated/unfocused.
+ You can enable the flag back for a given scope if needed by specific widget/behavior.
+ Read below for details.
+- TreeNode: commented out legacy name `ImGuiTreeNodeFlags_SpanTextWidth` which
+ was obsoleted in 1.90.7 (May 2024). Use `ImGuiTreeNodeFlags_SpanLabelWidth`.
+- ColorEdit: obsoleted SetColorEditOptions() function added in 1.51 (June 2017) in favor
+ of directly poking to io.ConfigColorEditFlags. More consistent and easier to discover.
+- Drag and Drop: commented out legacy name `ImGuiDragDropFlags_SourceAutoExpirePayload`
+ which obsoleted in 1.90.9 (July 2024). Use `ImGuiDragDropFlags_PayloadAutoExpire`.
+- ImDrawData: marked `CmdListsCount` as obsolete (technically was obsoleted in 1.89.8).
+ Before: `draw_data->CmdListsCount`, After: `draw_data->CmdLists.Size`.
+
+Other Changes:
+
+- LiveEdit on/off: added `ImGuiItemFlags_LiveEditOnInputText` and `ImGuiItemFlags_LiveEditOnInputScalar`
+ flags to configure the timing of applying edits of backing variables when typing
+ values using a keyboard.
+ (#9476, #701, #3936, #3946, #5904, #6284, #8149, #8065, #8665, #9117, #9299, #700, #1351,
+ #1875, #2060, #2215, #2380, #2550, #3083, #3338, #3556, #4373, #4714, #4885, #5184,
+ #5777, #6707, #6766, #8004, #8303, #8915, #9308)
+ - ImGuiItemFlags_LiveEditOnInputText is enabled by default (same as before):
+ - The expectation is that for strings/text, enabling LiveEdit is a better default.
+ - ImGuiItemFlags_LiveEditOnInputScalar is disabled by default (new behavior):
+ - The expectation is that for numeric/scalars values, disabling LiveEdit is a better default.
+ - Until now:
+ - Edits where always applied immediately to backing variable, which is equivalent
+ to the `ImGuiItemFlags_LiveEditXXX` flags being enabled.
+ - Typing '123' in an integer field would output successively 1, 12 then 123.
+ - Most uses of `IsItemDeactivatedAfterEdit()` or `ImGuiInputTextFlags_EnterReturnsTrue`
+ were actually workarounds for this issue. Advanced applications would typically
+ use `IsItemDeactivatedAfterEdit()` to distinguish transactions.
+ Workarounds often required a backing store for scalar values, and there were
+ also a few niggles related to `IsItemDeactivatedAfterEdit()` when using +/-
+ buttons of an `InputInt()` widgets.
+ - Many of those situations can now be naturally simplified when disabling
+ `ImGuiItemFlags_LiveEditOnInputScalar` is disabled.
+ - The new flags allows disabling this behavior selectively for strings fields
+ such as `InputText()` vs scalar fields: `SliderInt()`, `InputFloat()`, etc.
+ - When LiveEdit is disabled, edits are applied when pressing enter, tabbing out,
+ clearing a field or deactivating due to a focus loss.
+ - The flag may be altered programmatically, e.g. for the entire frame scope:
+ NewFrame();
+ PushItemFlag(ImGuiItemFlags_LiveEditOnInputScalar, true); // Enable for scalars for the whole frame
+ ....
+ PopItemFlag();
+ EndFrame();
+ Or for a specific widget:
+ PushItemFlag(ImGuiItemFlags_LiveEditOnInput, true); // Enable for one widget
+ SliderInt(...);
+ PopItemFlag();
+ - We intentionally are not adding `io.ConfigLiveEditXXX` fields to dictate the
+ default value of each `ImGuiItemFlags_LiveEditXXX`, because this is not expected
+ to be a user preference but a programmer/widget preferences.
+ And we strive to make the toolkit consistent.
+- Windows:
+ - Clicking on a window's empty-space to move/focus a window checks
+ for lack of mouse button ownership. This gives an additional opportunity
+ for user code to bypass it without using a clickable item. (#9382)
+ - Clicking on a window's empty-space to move/focus a window checks
+ for lack of queued focus request. (#9382)
+ - Fixed double-click collapse toggle not owning the mouse button. If a
+ `SetNextWindowPos()` with pivot was queued in the same frame, the second
+ click could trigger another item in the same window. (#9439) [@Cleroth]
+- Popups:
+ - Added bool return value to `OpenPopup()`, `OpenPopupOnItemClick()` functions
+ to notify when the popup was just opened. (#9429)
+- InputText:
+ - Added `style.InputTextCursorSize` to configure cursor/caret thickness. (#7031, #9409)
+ It is automatically scaled by `style.ScaleAllSizes()`.
+ - Reworked `io.ConfigInputTextEnterKeepActive` mode so that pressing
+ Ctrl+Enter or Shift+Enter still allows to deactivate. (#9239)
+- Tables:
+ - Redesigned/rewrote code to reconcile columns and settings on topology changes. (#9108)
+ - When a column label is passed to TableSetupColumn(), the underlying identifier
+ is used to match live columns data and .ini settings data when changing.
+ This makes it possible to add/remove columns from a table without losing
+ neither live data neither .ini settings data.
+ - PS: Note that this is distinct from toggling column visibility or reordering
+ columns, which was always possible. The new matching makes it easier to create
+ tables that are entirely customized by user or code, without losing state.
+ - Columns without identifiers or with duplicate identifiers are matched
+ sequentially, matching old behavior.
+ - Column ID are stored in .ini file.
+ - Code is being tested both for live topology changes and for loading .ini
+ data with mismatched topology.
+ - Context Menu: added a "Reset" sub-menu with a "Reset Visibility" option.
+ (which is greyed out when using default settings)
+ - Headers: fixed label being clipped early to reserve space for a sort marker
+ even when no sort marker is displayed. Auto-fitting a column still accounts
+ for the possible marker, so that sorting after an auto-fit doesn't clip the label.
+- Multi-Select:
+ - Reworked `ImGuiMultiSelectFlags_NoAutoSelect` as it carried side-effects that
+ were hardcoded/designed to use multi-selection on checkboxes. (#9391)
+ Specifically removed those undocumented behaviors from `_NoAutoSelect`:
+ - Clicking a selected/checked item always unselect/uncheck.
+ - Shift+Click inverts targets value and copy to range.
+ - Shift+Keyboard copy selection source value to range.
+ Those behaviors are still happening on checkboxes used within multi-selection.
+- Fonts:
+ - Added `IMGUI_DISABLE_DEFAULT_FONT_BITMAP`/`IMGUI_DISABLE_DEFAULT_FONT_VECTOR` to
+ disable embedding either fonts separately. (#9407)
+ - Tweak `CalcTextSize()` awkward width rounding/ceiling code to reduce floating-point
+ precision issues altering the result by 1 even at relatively small width. (#791)
+ - Better document the fact that `ImFontAtlas::Clear()`/`ClearFonts()` functions are
+ unlikely to be useful nowadays. Better recover to an edge case of mistakenly
+ calling `ClearFonts()` during rendering.
+ - Fixed an issue where passing a manually created ImFontAtlas to CreateContext() would
+ incorrectly destroy it in `DestroyContext()` when ref-count gets back to zero. (#9426)
+ - Destroying an ImGui context using a `ImFontAtlas` checks that the later has no references.
+- Nav:
+ - Fixed context menu activation with gamepad erroneously testing for _NavEnableKeyboard
+ instead of _NavEnableGamepad. (#9454, #8803, #9270) [@Clownacy]
+- TreeNode:
+ - Fixed nav cursor rendering with rounding even though tree nodes don't have it. (#7589)
+- Inputs:
+ - Added `GetItemClickedCountWithSingleClickDelay()` helper for easy disambiguation
+ between single-click and double-click for actions that needs single-click to do
+ something other than selection. (#8337)
+ - Returns 1 on single-click but delayed by io.MouseSingleClickDelay.
+ - Returns 2 on double-click, and 2+ on subsequent repeated clicks.
+ - Added `io.MouseSingleClickDelay` to configure default delayed single click delay when
+ using `GetItemClickedCountWithSingleClickDelay()` or `IsMouseReleasedWithDelay()`. (#8337)
+ Note that `io.MouseSingleClickDelay` is always `> io.MouseDoubleClickTime`.
+- ColorEdit:
+ - Added `io.ConfigColorEditFlags` to read/modify current color edit/picker settings.
+ - ColorPicker: added `ImGuiColorEditFlags_PickerNoRotate` to disable rotation of the
+ S/V triangle when in `ImGuiColorEditFlags_PickerHueWheel` mode. (#9337) [@SeanTheBuilder1]
+ Likely best passed to `style.ColorEditFlags` to setup globally and once.
+ - ColorButton: small rendering tweak/optimization for the alpha checkerboard.
+- Style:
+ - Added style.MenuItemRounding, ImGuiStyleVar_MenuItemRounding. (#7589, #9375, #9453)
+ - Added style.SelectableRounding, ImGuiStyleVar_SelectableRounding. (#7589, #9375, #9453)
+ The use of this is discouraged because it can easily create problems rendering e.g.
+ contiguous selection.
+ - Scale the NavCursor border thickness when using large values with `ScallAllSizes()`.
+- Settings:
+ - Windows/Tables settings entries can now record the last used date in YYYYMMDD format,
+ allowing tools to run to e.g. delete entries that haven't been used in X months. (#9460)
+ - Added `bool io.ConfigIniSettingsSaveLastUsedDate` to disable saving that info. (#9460)
+ - Added `int io.ConfigIniSettingsAutoDiscardMonths` to enable a mode where unused settings
+ are automatically discard after xx months. (#9460)
+ - Added a trimming tool under Metrics->Settings, along with a yet-unexposed function.
+ - The current system date is fed through `ImGuiPlatformIO::Platform_SessionDate`,
+ which is automatically set by a call to time() done during context creation. (#9460)
+ - Added `IMGUI_DISABLE_TIME_FUNCTIONS` to disable setting platform_io.Platform_SessionDate.
+ A custom backend may still set it manually. (#9460)
+- DrawList:
+ - Minor optimization to `AddLine()`, `AddLineH()`, `AddLineV()` functions. (#4091)
+ - Added `ImDrawListFlags_TextNoPixelSnap` to disable snapping of AddText()
+ coordinates for a given scope. (#3437, #9417, #2291)
+- Demo:
+ - Extract 'Widgets->Tree Nodes->Selectable Nodes' out of the 'Advanced'
+ demo for clarity (manual reimplementation of basic selection).
+- Debug Tools:
+ - Added `IM_DEBUG_BREAK()` handler for GCC+AArch64/ARM64. [@tom-seddon]
+- Backends:
+ - Android:
+ - Clear mouse position on touch release (`AMOTION_EVENT_ACTION_UP`) to prevent
+ items from staying in hovered state. (#6627, #9474) [@Turtle-PB]
+ - Metal4:
+ - Added new Metal 4 backend (forked from Metal 3 backend). (#9458, #9451) [@AmelieHeinrich]
+ - Added Metal-cpp support enabled with `IMGUI_IMPL_METAL_CPP` define. (#9461) [@MERL10N]
+ - OpenGL2:
+ - Backup and restore `GL_UNPACK_ROW_LENGTH` and `GL_UNPACK_ALIGNMENT` when updating texture
+ to avoid altering caller GL state. (#8802, #9473) [@Turtle-PB]
+ - OpenGL3:
+ - GLSL version detection assume GLSL 410 when GL context is 4.1.
+ Fixes an issue running on macOS with Wine. [#9427, #6577) [@perminovVS]
+ - Expose selected render state in `ImGui_ImplOpenGL3_RenderState`, allowing to
+ dynamically select between use of `glBindSampler()` and `glTexParameter()`. (#9378)
+ - Backup and restore `GL_UNPACK_ROW_LENGTH` and `GL_UNPACK_ALIGNMENT` when updating texture
+ to avoid altering caller GL state. (#8802, #9473) [@Turtle-PB]
+ - SDL2:
+ - Restore SDL_StartTextInput()/SDL_StopTextInput() in IME handler for on-screen keyboard
+ support on Android. (#7636, #9474) [@Turtle-PB]
+ - SDLRenderer3:
+ - Fixed sampler change which didn't work on all graphics backends. (#7616, #9470, #9378)
+ - Fixed default sampler not being Linear. Regression in 1.92.8. (#7616, #9470, #9378) [@ShiroKSH]
+ - Win32:
+ - Uses `SetProcessDpiAwarenessContext()` instead of `SetThreadDpiAwarenessContext()`
+ when available, fixing OpenGL DPI scaling issues as e.g. NVIDIA drivers tends
+ to spawn multiple-thread to manage OpenGL. (#9403)
+- Examples:
+ - Android: update to AGP 9.2.0 to support Gradle 9.6.0.
+ - Apple+Metal4: added new example. (#9465, #9451) [@hoffstadt]
+ - OpenGL3+GLFW/SDL2/SDL3: allow Wine compatibility by passing empty GLSL version
+ string to ImGui_ImplOpenGL3_Init() to let backend decide of a GLSL version based
+ on actual GL version obtained. (#9427, #6577) [@perminovVS]
+ - OpenGL3+Win32: rework context creation to allow Wine compatibility. (#9427, #6577) [@perminovVS]
+ - SDL2/SDL3: use `SDL_GetWindowSizeInPixels()` to create frame-buffers. Fixes issues
+ with non-fractional framebuffer size on Wayland. (#8761, #9124) [@billtran1632001]
+ - SDL3+Metal4: added new example. (#9458, #9451) [@AmelieHeinrich]
+
+Docking+Viewports Branch:
+
+- Viewports:
+ - Fixed an issue where the implicit "Debug" window while hidden would erroneously
+ interfere with merging secondary viewports into the main viewport.
+- Docking:
+ - Fixed behavior change/regression in 1.92.8 where a window using the
+ ImGuiWindowFlags_AlwaysAutoResize flag would have ItemWidth default
+ change when docked. (#9355, #9443) [@reybits]
+- Backends:
+ - Metal4: added multi-viewport support. (#9465, #9451) [@hoffstadt]
+ - Vulkan: fixed use after-free when using multi-viewports with dynamic rendering.
+ (#9390, #9468) [@vikhik, @Turtle-PB]
+
+
+-----------------------------------------------------------------------
+ VERSION 1.92.8 (Released 2026-05-12)
+-----------------------------------------------------------------------
+
+Decorated log and release notes: https://github.com/ocornut/imgui/releases/tag/v1.92.8
+
+Breaking Changes:
+
+- DrawList: swapped the last two arguments of `AddRect()`, `AddPolyline()`, `PathStroke()`.
+ - Before: `void ImDrawList::AddRect(ImVec2 p_min, ImVec2 p_max, ImU32 col, float rounding = 0.0f, ImDrawFlags flags = 0, float thickness = 1.0f);`
+ - After: `void ImDrawList::AddRect(ImVec2 p_min, ImVec2 p_max, ImU32 col, float rounding = 0.0f, float thickness = 1.0f, ImDrawFlags flags = 0);`
+ - Before: `void ImDrawList::AddPolyline(const ImVec2* points, int num_points, ImU32 col, ImDrawFlags flags, float thickness);`
+ - After: `void ImDrawList::AddPolyline(const ImVec2* points, int num_points, ImU32 col, float thickness, ImDrawFlags flags = 0);`
+ - Before: `void ImDrawList::PathStroke(ImU32 col, ImDrawFlags flags = 0, float thickness = 1.0f);`
+ - After: `void ImDrawList::PathStroke(ImU32 col, float thickness = 1.0f, ImDrawFlags flags = 0);`
+ Added inline redirection functions when IMGUI_DISABLE_OBSOLETE_FUNCTIONS is off.
+ Marked the old functions are =delete when IMGUI_DISABLE_OBSOLETE_FUNCTIONS is on, to allow for better type-checking.
+ Effectively the typical call site is changing from:
+ - Before: `window->DrawList->AddRect(p_min, p_max, color, rounding, ImDrawFlags_None, border_size);`
+ - After: `window->DrawList->AddRect(p_min, p_max, color, rounding, border_size);`
+ Notes:
+ - Users of C++ and other languages with type-checking will be notified at compile-time of any mistakes.
+ - Users of high-level bindings or languages with no type-checking will be notified at runtime via an assert for invalid flags value.
+ If you are a binding maintainer consider doing something to facilitate transition or error detection.
+ - This is perhaps the worst breaking change in our history :( but it makes ImDrawList function signatures consistent.
+ As we are aiming to add flags and features to variety of ImDrawList functions, that consistency becomes more important.
+ The new order is also more convenient as `flags` are less frequently used than `thickness` in real code.
+ - As a general policy in Dear ImGui, all our flags default to 0 so ImDrawFlags_None was likely written 0 in some call sites.
+ - Consider adding `#define IMGUI_DISABLE_OBSOLETE_FUNCTIONS` in your imconfig.h, even temporarily, to clean up legacy code.
+ - Reminder: you do NOT need to specify `ImDrawFlags_RoundCornersAll` for rounding, it is already the default!
+- DrawList: obsoleted `ImDrawCallback_ResetRenderState` in favor of using `ImGui::GetPlatformIO().DrawCallback_ResetRenderState`,
+ which is part of our new standard draw callbacks. (#9378)
+ Redirecting the earlier value into the later one when set, so both old and new code should work.
+- DrawList: changed value of `ImDrawFlags_Closed`. It was previously advertised as "always == 1" when introduced
+ in 1.82 (2021/02), in order to facilitate backward compatibility with the legacy `bool closed` flag. This
+ guarantee has been removed. The bit is reserved, and `AddPolyline()`, `PathStroke()` will assert when it is used.
+- Backends:
+ - Vulkan: redesigned to use separate ImageView + Sampler instead of Combined Image Sampler. (#914)
+ This change allows us to facilitate changing samplers, in line with other backends. [@yaz0r, @ocornut]
+ - When creating your own descriptor pool (instead of letting backend creates its own):
+ - Before: need at least `IMGUI_IMPL_VULKAN_MINIMUM_IMAGE_SAMPLER_POOL_SIZE` descriptors of type `VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER`.
+ - After: need at least `IMGUI_IMPL_VULKAN_MINIMUM_SAMPLED_IMAGE_POOL_SIZE` descriptors of type `VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE`.
+ + `IMGUI_IMPL_VULKAN_MINIMUM_SAMPLER_POOL_SIZE` descriptors of type `VK_DESCRIPTOR_TYPE_SAMPLER`.
+ - When registering custom textures: changed ImGui_ImplVulkan_AddTexture() signature to remove Sampler.
+ - Before: `ImGui_ImplVulkan_AddTexture(VkSampler, VkImageView, VkImageLayout)`
+ - After: `ImGui_ImplVulkan_AddTexture(VkImageView, VkImageLayout)`
+ - Kept inline redirection function that ignores the sampler (will obsolete).
+ - DirectX10, DirectX11, SDLGPU3, Vulkan: removed samplers from `ImGui_ImplXXXX_RenderState`.
+ Prefer to use backend-agnostic DrawCallback_SetSamplerLinear which works everywhere! (#9378)
+ If there is a legit need/request for them or any render state we can always add them back.
+ - OpenGL3: the new sampler support system prioritize using glBindSampler() when available,
+ which would override glTexParameter() settings you may have set on custom textures. (#9378)
+
+Other Changes:
+
+- DrawList:
+ - Added room in `ImGuiPlatformIO` for standard backend-agnostic draw callbacks. Those callbacks
+ are setup/provided by the backend and available in most of our standard backends.
+ They allow backend-agnostic code from e.g. switching to a Nearest/Point sampler without
+ messing with custom Renderer-specific callbacks.
+ platform_io.DrawCallback_ResetRenderState; // Request to reset the graphics/render state.
+ platform_io.DrawCallback_SetSamplerLinear; // Request to set current texture sampling to Linear
+ platform_io.DrawCallback_SetSamplerNearest; // Request to set current texture sampling to Nearest/Point
+ Note that some backends might not support all callbacks.
+ (#9378, #9371, #3590, #8926, #2973, #7485, #7468, #6969, #5118, #7616, #9173, #8322, #7230,
+ #5999, #6452, #5156, #7342, #7592, #7511)
+ - Made `AddCallback()` user data default to Null for convenience.
+ - Added `AddLineH()`, `AddLineV()` helpers to draw horizontal and vertical lines. [@memononen]
+ The new functions are more optimal and will be part of a larger effort in 1.93 to fix
+ inconsistencies and improve the DrawList API. In the current API, `AddLine()` adds a "magic" +0.5f
+ offset and then center the line, whereas AddLineH()/AddLineV() use the right side of the line to expand.
+ For thickness=1.0f lines this is equivalent:
+ `AddLine({10,3}, {20,3}, ...)` --> `AddLineH(x1=10, x2=20, y=3, ...)`.
+ `AddLine({3,10}, {3,20}, ...)` --> `AddLineV(x=3, y1=10, y2=20, ...)`.
+ For larger integer thickness, AddLine() will center but may be blurry, AddLineH()/AddLineV()
+ will expand "inside" (to the right side) and will always be sharp.
+ A subsequent release will expand on those concepts and add new options.
+- InputText:
+ - InputTextMultiline: fixed an issue processing deactivation logic when an active
+ multi-line edit is clipped due to being out of view.
+ - Fixed a crash when toggling ReadOnly while active. (#9354)
+ - `CharFilter` callback event sets CursorPos/SelectionStart/SelectionEnd. (#816)
+- Tables:
+ - Fixed issues reporting ideal size to parent window/container: (#9352, #7651)
+ - When both scrollbars are visible but only one of ScrollX/ScrollY was explicitly requested.
+ - When vertical scrollbar was not at the top, the computation was often incorrect.
+- Windows:
+ - Fixed a single-axis auto-resizing feedback loop issue with nested containers
+ and varying scrollbar visibility. (#9352)
+ - Detect and report error when calling End() instead of EndPopup() on a popup. (#9351)
+ - Child windows with only `ImGuiChildFlags_AutoResizeY` flag keep using the proportional
+ default `ItemWidth`. (#9355)
+ - Using mouse wheel to scroll takes and keeps ownership of the corresponding keys
+ (e.g. `ImGuiKey_MouseWheelY`) while a wheeling window is locked. (#2604, #3795)
+- InputInt, InputFloat, InputScalar:
+ - Reinstated `ImGuiInputTextFlags_EnterReturnsTrue` support which was removed in 1.91.4.
+ (#8665, #9299, #8065, #3946, #6284, #9117)
+ - Fixed the fact that it didn't return true when validating same value.
+ - Fixed losing value when tabbing out or losing focus.
+ - Made it that pressing +/- step buttons also return true, which is in line
+ with 1.91.4 behavior.
+ - In a majority of cases you should use `IsItemDeactivatedAfterEdit()` instead,
+ but it still has a few edge cases flaws (to be addressed soon).
+ - Allow passing a format string that does not display the scalar value.
+ Parsing input with default format for the type. (#9385) [@FireFox2000000]
+- Multi-Select:
+ - Fixed an issue using Multi-Select within a Table causing column width measurement to
+ be invalid when trailing column contents is not submitted in the last row. (#9341, #8250)
+ - Fixed an issue using Multi-Select within a Table with the right-most column visible,
+ which could lead to an extra vertical offset in the Header row. (#8250)
+- Multi-Select + Box-Select:
+ - Fixed an issue using `ImGuiMultiSelectFlags_BoxSelect1d` mode while scrolling.
+ Notably, using mouse wheel while holding a box-selection could lead items close to windows
+ edges from not being correctly unselected. (#7994, #8250, #7821, #7850, #7970)
+ - Improved dirty/unclip rectangle logic for `ImGuiMultiSelectFlags_BoxSelect2d`.
+ - Fixed an issue using `ImGuiMultiSelectFlags_BoxSelect2d` mode, where
+ items out of view wouldn't be properly selected while scrolling while mouse cursor
+ is hovering outside of selection scope. (#7994, #1861, #6518)
+ - Fixed an issue where items out of horizontal view would sometimes lead
+ to incorrect merging of sequential selection requests while also scrolling fast
+ enough to overlap multiple rows during a frame. (#7994, #1861, #6518)
+ - Fixed an issue using `ImGuiMultiSelectFlags_BoxSelect2d` mode in a Table
+ while relying on the `TableNextColumn()` return value to perform coarse clipping. (#7994)
+ - Disabled merging consecutive selection requests as we have no reliable
+ way of detecting if user has submitted all consecutive items without clipping gaps,
+ and `ImGuiSelectionUserData` is technically opaque storage. (#7994, #1861)
+ (we will probably bring this back as a minor optimization if we have a way to for
+ user to tell us `ImGuiSelectionUserData` are indices)
+ - Fixes for using across nested child windows. (#8364)
+ - Box-Select + Clipper: fixed an issue selecting items while scrolling while a clipper
+ active. (#7994, #8250, #7821, #7850, #7970)
+ - Box-Select + Tables: fixed an issue using box-selection in a tables with
+ items straying out of columns boundaries. (#7994, #2221)
+ - Box-Select + Tables: fixed an issue when calling `BeginMultiSelect()` in a table
+ before layout has been locked (first row or headers row submitted). (#8250)
+- Menus:
+ - BeginMenu()/MenuItem(): fixed accidental triggering of child menu items when
+ opening a menu inside a small host window forcing the child menu window to be
+ repositioned under the mouse cursor. (#8233, #9394)
+ Done by reworking `BeginMenu()`/`MenuItem()`: they previously avoiding taking
+ ActiveID + key/click ownership (in order to allow releasing button on another item).
+ Now they take them and release them once the mouse is moved outside item boundaries.
+- Inputs:
+ - SetItemKeyOwner(): return true if ownership has been requested, which typically
+ needs to to checked for gating further tests. This is important as the function
+ may fail. (#456, #2637, #2620, #2891, #3370, #3724, #4828, #5108, #5242, #5641)
+ - SetItemKeyOwner(): does not set ownership is key is already taken. Effectively
+ this makes using `SetItemKeyOwner(ImGuiKey_MouseWheelY)` over an item work as
+ expected while not having item react if a scroll wheel is actively in progress.
+ May be subject to further redesign, e.g. conditional flags. Feedback welcome!
+- Style:
+ - Checkbox: added `ImGuiCol_CheckboxSelectedBg` to change or accentuate the
+ background color of checked/mixed checkboxes. (#9392)
+ - Added `ImGuiStyleVar_DragDropTargetRounding`. (#9056)
+ - Fixed vertical scrollbar top coordinates when using thick borders on windows
+ with no title bar and no menu bar. (#9366)
+- Fonts:
+ - imgui_freetype: add FreeType headers & compiled version in 'About Dear ImGui' details.
+ - Assert when using MergeMode with an explicit size over a target font with an implicit
+ size, as scale factor are likely erroneous. (#9361)
+- Clipper:
+ - Improved error reporting when misusing the clipper inside a table (prioritize
+ reporting the common clipper error over a table sanity check assert). (#9350)
+ - Tweaked assert triggering when first item height measurement fails, and made it
+ a better recoverable error. (#9350)
+- Misc:
+ - Minor optimization: reduce redundant label scanning in common widgets.
+ - Added missing Test Engine hooks for `PlotLines()`, `PlotHistogram()`, `VSliderXXX()`
+ and `TableHeader()` functions.
+- Demo:
+ - Added simple demo for a scrollable/zoomable image viewer with a grid.
+ Available in `Examples->Image Viewer` and `Widgets->Images`.
+- Backends:
+ - Added support for new standardized draw callbacks in most backends: (#9378)
+ - Allegro5: Reset n/a n/a
+ - DX9: Reset SetSamplerLinear SetSamplerNearest
+ - DX10: Reset SetSamplerLinear SetSamplerNearest
+ - DX11: Reset SetSamplerLinear SetSamplerNearest
+ - DX12: Reset SetSamplerLinear SetSamplerNearest
+ - Metal: Reset SetSamplerLinear SetSamplerNearest
+ - OpenGL2: Reset SetSamplerLinear SetSamplerNearest
+ - OpenGL3+: Reset SetSamplerLinear SetSamplerNearest
+ - SDLGPU3: Reset SetSamplerLinear SetSamplerNearest
+ - SDLRenderer2: Reset n/a n/a
+ - SDLRenderer3: Reset SetSamplerLinear SetSamplerNearest
+ - Vulkan: Reset SetSamplerLinear SetSamplerNearest
+ - WebGPU: Reset SetSamplerLinear SetSamplerNearest
+ (Vulkan backend by @yaz0r, Metal by @ssh4net, others by @ocornut)
+ - GLFW: added a Win32-specific implementation of `ImGui_ImplGlfw_GetContentScaleXXXX`
+ functions for legacy GLFW 3.2. (#9003)
+ - Metal: avoid redundant vertex buffer bind in `SetupRenderState()`, which leads
+ to validation issue. (#9343) [@Hunam6]
+ - Metal: use a dedicated `bufferCacheLock` to avoid crashing when `bufferCache` is
+ replaced by a new object while being used for `@synchronize()`. (#9367) [@andygrundman]
+ - SDL2: made `ImGui_ImplSDL2_GetContentScaleForWindow()`/`ImGui_ImplSDL2_GetContentScaleForDisplay()`
+ helpers return a minimum of 1.0f, as some Linux setup seems to report <1.0f value
+ and this breaks scaling border size. (#9369)
+ - WebGPU: rework choice/detection of using WGSL/SPIR-V shader on WGVK. (#9316, #9246, #9257, #9387)
+- Examples:
+ - Update VS toolset in all .vcxproj from VS2015 (v140) to VS2017 (v141). The later is the
+ first that supports vcpkg. Onward we will likely stop testing building the library with VS2015.
+ - GLFW+Vulkan, SDL2+Vulkan, SDL3+Vulkan, Win32+Vulkan: reworked to create a descriptor pool with:
+ - `IMGUI_IMPL_VULKAN_MINIMUM_SAMPLED_IMAGE_POOL_SIZE` descriptors of type `VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE`.
+ - `IMGUI_IMPL_VULKAN_MINIMUM_SAMPLER_POOL_SIZE` descriptors of type `VK_DESCRIPTOR_TYPE_SAMPLER`.
+
+Docking+Viewports Branch:
+
+- Docking:
+ - Toggling tab bar visibility marks saved settings as dirty. (#9380)
+- Viewports:
+ - Added opaque `void* PlatformIconData` storage in viewport and `ImGuiWindowClass`
+ to allow passing icon information to a custom backend or hook. (#2715)
+
+
-----------------------------------------------------------------------
VERSION 1.92.7 (Released 2026-04-02)
-----------------------------------------------------------------------
@@ -204,16 +656,17 @@ Docking+Viewports Branch:
- Viewports:
- Fixed an issue where the implicit "Debug" window would erroneously be targetted for
mouse inputs while hidden if (1) the implicit "Debug" window was used in a previous
- session and moved to a secondary viewport and (2) the Platform Backend does not
- support the ImGuiBackendFlags_HasMouseHoveredViewport feature. (#9254)
+ session and moved to a secondary viewport and (2) the Platform Backend does not
+ support the `ImGuiBackendFlags_HasMouseHoveredViewport` feature. (#9254)
- Backends: SDL2, SDL3: fixed an issue dated 2025/04/09 (1.92 WIP) where a refactor
- and a merge caused ImGuiBackendFlags_HasMouseHoveredViewport to never be set, causing
+ and a merge caused `ImGuiBackendFlags_HasMouseHoveredViewport` to never be set, causing
foreign windows to be ignored when deciding of hovered viewport. (#9284) [@ravencgg]
- - Backends: SDL3: use SDL_HAS_EVENT_DISPLAY_USABLE_BOUNDS_CHANGED (SDL 3.4.0+) when
+ - Backends: SDL3: use `SDL_HAS_EVENT_DISPLAY_USABLE_BOUNDS_CHANGED` (SDL 3.4.0+) when
available to avoid refreshing monitor work area every frame on Windows. (#8415)
- Backends: Win32: fixed setting/getting correct size when viewports have OS decorations
enabled (e.g. io.ConfigViewportsNoDecoration = false) and process is running in
- Per-Monitor V2 DPI mode. (#8897) [@lailoken]
+ Per-Monitor V2 DPI mode. May be related to incorrect mouse offset when using
+ decorated OS windows. (#8897) [@lailoken]
-----------------------------------------------------------------------
@@ -479,7 +932,7 @@ Docking+Viewports Branch:
- Backends:
- GLFW: dynamically load X11 functions to avoid `-lx11` linking requirement introduced
in 1.92.3. (#9116, #9109) [@ramenguy99]
- - GLFW: improve workarounds for cases where GLFW is unable to provide reliable monitor
+ - GLFW: improve workarounds for cases where GLFW is unable to provide reliable monitor
info. Preserve existing monitor list when none of the new one is valid. (#9195, #7902, #5683)
- SDL2, SDL3: adjust IME offset to match other backends and master branch. (#6071, #1953)
- Win32: viewports created by backend forcefully direct messages to
@@ -637,7 +1090,7 @@ Docking+Viewports Branch:
- Docking, Style: fixed per-window ImGuiCol_UnsavedMarker changes not being latched
by docked windows. (#8983, #9064)
-- Docking: fixed crash loading certain form of invalid .ini settings (e.g. nodes
+- Docking: fixed crash loading certain form of invalid .ini settings (e.g. nodes
referring to a missing parent, duplicate nodes id). (#9070)
- Docking: added io.ConfigDockingNoDockingOver helper config flag to prevent
merging windows into a same tab-bar.
@@ -761,7 +1214,7 @@ Other Changes:
not available. (#5924, #5562)
- SDL3+DirectX11: Added SDL3+DirectX11 example. (#8956, #8957) [@tomaz82]
- Win32+DirectX12: Rework synchronization logic. (#8961) [@RT2Code]
- - Made examples's main.cpp consistent with returning 1 on error.
+ - Made examples' main.cpp consistent with returning 1 on error.
Docking+Viewports Branch:
@@ -780,6 +1233,9 @@ Docking+Viewports Branch:
- Fixed a bug where ImGuiWindowFlags_NoBringToFrontOnFocus would effectively
be ignored when windows first appear and viewports are enabled. (#7008) [@jshofmann]
- Changed default value of io.ConfigViewportsNoDefaultParent to true. (#8948)
+ As a reminder, for backend honoring ParentViewportID:
+ - Parented windows will always appear in front of the main viewport.
+ - Non-parented windows can appear behing the main viewport.
- Fixed an issue inferring Z-order when attempting to merge a viewport
back in the the main/hosting viewport. (#8948)
Note that for GLFW/SDL2/OSX backends, which do not support honoring ParentViewportID.
@@ -3505,8 +3961,10 @@ Breaking changes:
input queue. This is automatically cleared by io.ClearInputKeys(). (#4921)
- ImDrawData: CmdLists[] array is now owned, changed from 'ImDrawList**' to
'ImVector'. Majority of users shouldn't be affected, but you
- cannot compare to NULL nor reassign manually anymore.
- Instead use AddDrawList(). Allocation count are identical. (#6406, #4879, #1878)
+ cannot compare to NULL nor reassign manually anymore. (#6406, #4879, #1878)
+ - Allocation count are identical.
+ - Use `draw_data->CmdLists.Size` instead of `draw_list->CmdListsCount`!
+ - Use `AddDrawList()` to add to a `ImDrawData`.
Other changes:
diff --git a/include/imgui/docs/EXAMPLES.md b/include/imgui/docs/EXAMPLES.md
index 676d745..6315a3a 100644
--- a/include/imgui/docs/EXAMPLES.md
+++ b/include/imgui/docs/EXAMPLES.md
@@ -60,10 +60,12 @@ Android + OpenGL3 (ES) example.
[example_apple_metal/](https://github.com/ocornut/imgui/tree/master/examples/example_apple_metal/)
OSX & iOS + Metal example.
-= main.m + imgui_impl_osx.mm + imgui_impl_metal.mm
+= main.mm + imgui_impl_osx.mm + imgui_impl_metal.mm
It is based on the "cross-platform" game template provided with Xcode as of Xcode 9.
-(NB: imgui_impl_osx.mm is currently not as feature complete as other platforms backends.
-You may prefer to use the GLFW Or SDL backends, which will also support Windows and Linux.)
+
+[example_apple_metal4/](https://github.com/ocornut/imgui/blob/master/examples/example_apple_metal4/)
+OSX & iOS + Metal4 example, Mac only.
+= main.mm + imgui_impl_osx.mm + imgui_impl_metal4.mm
[example_apple_opengl2/](https://github.com/ocornut/imgui/blob/master/examples/example_apple_opengl2/)
OSX + OpenGL2 example.
@@ -164,6 +166,10 @@ SDL3 + DirectX11 examples, Windows only.
SDL3 + Metal example, Mac only.
= main.cpp + imgui_impl_sdl3.cpp + imgui_impl_metal.mm
+[example_sdl3_metal4/](https://github.com/ocornut/imgui/blob/master/examples/example_sdl3_metal/)
+SDL3 + Metal4 example, Mac only.
+= main.cpp + imgui_impl_sdl3.cpp + imgui_impl_metal4.mm
+
[example_sdl3_opengl3/](https://github.com/ocornut/imgui/blob/master/examples/example_sdl3_opengl3/)
SDL3 (Win32, Mac, Linux, etc.) + OpenGL3+/ES2/ES3 example.
= main.cpp + imgui_impl_sdl3.cpp + imgui_impl_opengl3.cpp
diff --git a/include/imgui/docs/FAQ.md b/include/imgui/docs/FAQ.md
index f81fb8b..d676167 100644
--- a/include/imgui/docs/FAQ.md
+++ b/include/imgui/docs/FAQ.md
@@ -9,42 +9,58 @@ or view this file with any Markdown viewer.
## Index
-| **Q&A: Basics** |
-:---------------------------------------------------------- |
-| [Where is the documentation?](#q-where-is-the-documentation) |
-| [What is this library called?](#q-what-is-this-library-called) |
-| [What is the difference between Dear ImGui and traditional UI toolkits?](#q-what-is-the-difference-between-dear-imgui-and-traditional-ui-toolkits) |
-| [Which version should I get?](#q-which-version-should-i-get) |
-| **Q&A: Integration** |
-| **[How to get started?](#q-how-to-get-started)** |
-| **[How can I tell whether to dispatch mouse/keyboard to Dear ImGui or my application?](#q-how-can-i-tell-whether-to-dispatch-mousekeyboard-to-dear-imgui-or-my-application)** |
-| [How can I enable keyboard or gamepad controls?](#q-how-can-i-enable-keyboard-or-gamepad-controls) |
-| [How can I use this on a machine without mouse, keyboard or screen? (input share, remote display)](#q-how-can-i-use-this-on-a-machine-without-mouse-keyboard-or-screen-input-share-remote-display) |
-| [How can I create my own backend?](#q-how-can-i-create-my-own-backend)
-| [I integrated Dear ImGui in my engine and little squares are showing instead of text...](#q-i-integrated-dear-imgui-in-my-engine-and-little-squares-are-showing-instead-of-text) |
-| [I integrated Dear ImGui in my engine and some elements are clipping or disappearing when I move windows around...](#q-i-integrated-dear-imgui-in-my-engine-and-some-elements-are-clipping-or-disappearing-when-i-move-windows-around) |
-| [I integrated Dear ImGui in my engine and some elements are displaying outside their expected windows boundaries...](#q-i-integrated-dear-imgui-in-my-engine-and-some-elements-are-displaying-outside-their-expected-windows-boundaries) |
-| **Q&A: Usage** |
-| **[About the ID Stack system...](#q-about-the-id-stack-system)**
**[How can I have multiple widgets with the same label?](#q-how-can-i-have-multiple-widgets-with-the-same-label) (using `##` or `PushID()`)**
**[How can I have widgets with an empty label?](#q-how-can-i-have-widgets-with-an-empty-label) (using `##`)**
**[How can I animate the label of an existing widget?](#q-how-can-i-change-the-label-of-an-existing-widget) (using `###`)**
**[General description of the label and ID Stack system.](#general-description-of-the-label-and-id-stack-system)** |
-| [How can I display an image?](#q-how-can-i-display-an-image)
[What are ImTextureID/ImTextureRef?](#q-what-are-imtextureidimtextureref)|
-| [How can I use maths operators with ImVec2?](#q-how-can-i-use-maths-operators-with-imvec2) |
-| [How can I use my own maths types instead of ImVec2/ImVec4?](#q-how-can-i-use-my-own-maths-types-instead-of-imvec2imvec4) |
-| [How can I interact with standard C++ types (such as std::string and std::vector)?](#q-how-can-i-interact-with-standard-c-types-such-as-stdstring-and-stdvector) |
-| [How can I display custom shapes? (using low-level ImDrawList API)](#q-how-can-i-display-custom-shapes-using-low-level-imdrawlist-api) |
-| **Q&A: Fonts, Text** |
-| [How should I handle DPI in my application?](#q-how-should-i-handle-dpi-in-my-application) |
-| [How can I load a different font than the default?](#q-how-can-i-load-a-different-font-than-the-default) |
-| [How can I easily use icons in my application?](#q-how-can-i-easily-use-icons-in-my-application) |
-| [How can I load multiple fonts?](#q-how-can-i-load-multiple-fonts) |
-| [How can I display and input non-Latin characters such as Chinese, Japanese, Korean, Cyrillic?](#q-how-can-i-display-and-input-non-latin-characters-such-as-chinese-japanese-korean-cyrillic) |
-| **Q&A: Concerns** |
-| [Who uses Dear ImGui?](#q-who-uses-dear-imgui) |
-| [Can you create elaborate/serious tools with Dear ImGui?](#q-can-you-create-elaborateserious-tools-with-dear-imgui) |
-| [Can you reskin the look of Dear ImGui?](#q-can-you-reskin-the-look-of-dear-imgui) |
-| [Why using C++ (as opposed to C)?](#q-why-using-c-as-opposed-to-c) |
-| **Q&A: Community** |
-| [How can I help?](#q-how-can-i-help) |
+### Basics
+- [Where is the documentation?](#q-where-is-the-documentation)
+- [What is this library called?](#q-what-is-this-library-called)
+- [What is the difference between Dear ImGui and traditional UI toolkits?](#q-what-is-the-difference-between-dear-imgui-and-traditional-ui-toolkits)
+- [Which version should I get?](#q-which-version-should-i-get)
+
+### Integration
+
+- **[How to get started?](#q-how-to-get-started)**
+- **[How can I tell whether to dispatch mouse/keyboard to Dear ImGui or my application?](#q-how-can-i-tell-whether-to-dispatch-mousekeyboard-to-dear-imgui-or-my-application)**
+- [How can I enable keyboard or gamepad controls?](#q-how-can-i-enable-keyboard-or-gamepad-controls)
+- [How can I use this on a machine without mouse, keyboard or screen? (input share, remote display)](#q-how-can-i-use-this-on-a-machine-without-mouse-keyboard-or-screen-input-share-remote-display)
+- [How can I create my own backend?](#q-how-can-i-create-my-own-backend)
+- [I integrated Dear ImGui in my engine and little squares are showing instead of text...](#q-i-integrated-dear-imgui-in-my-engine-and-little-squares-are-showing-instead-of-text)
+- [I integrated Dear ImGui in my engine and some elements are clipping or disappearing when I move windows around...](#q-i-integrated-dear-imgui-in-my-engine-and-some-elements-are-clipping-or-disappearing-when-i-move-windows-around)
+- [I integrated Dear ImGui in my engine and some elements are displaying outside their expected windows boundaries...](#q-i-integrated-dear-imgui-in-my-engine-and-some-elements-are-displaying-outside-their-expected-windows-boundaries)
+
+### Usage
+
+- **[About the ID Stack system...](#q-about-the-id-stack-system)**
+ - **[How can I have multiple widgets with the same label?](#q-how-can-i-have-multiple-widgets-with-the-same-label) (using `##` or `PushID()`)**
+ - **[How can I have widgets with an empty label?](#q-how-can-i-have-widgets-with-an-empty-label) (using `##`)**
+ - **[How can I make a label dynamic?](#q-how-can-i-make-a-label-dynamic) (using `###`)**
+ - **[General description of the label and ID Stack system.](#general-description-of-the-label-and-id-stack-system)**
+- [How can I display an image?](#q-how-can-i-display-an-image), [What are ImTextureID/ImTextureRef?](#q-what-are-imtextureidimtextureref)
+- [How can I use maths operators with ImVec2?](#q-how-can-i-use-maths-operators-with-imvec2)
+- [How can I use my own maths types instead of ImVec2/ImVec4?](#q-how-can-i-use-my-own-maths-types-instead-of-imvec2imvec4)
+- [How can I interact with standard C++ types (such as std::string and std::vector)?](#q-how-can-i-interact-with-standard-c-types-such-as-stdstring-and-stdvector)
+- [How can I display custom shapes? (using low-level ImDrawList API)](#q-how-can-i-display-custom-shapes-using-low-level-imdrawlist-api)
+- [About Multi-Threading](#about-multi-threading)
+
+### Fonts, Text
+
+- [How should I handle DPI in my application?](#q-how-should-i-handle-dpi-in-my-application)
+- [How can I load a different font than the default?](#q-how-can-i-load-a-different-font-than-the-default)
+- [How can I easily use icons in my application?](#q-how-can-i-easily-use-icons-in-my-application)
+- [How can I load multiple fonts?](#q-how-can-i-load-multiple-fonts)
+- [How can I display and input non-Latin characters such as Chinese, Japanese, Korean, Cyrillic?](#q-how-can-i-display-and-input-non-latin-characters-such-as-chinese-japanese-korean-cyrillic)
+
+### Concerns
+
+- [Who uses Dear ImGui?](#q-who-uses-dear-imgui)
+- [Can you create elaborate/serious tools with Dear ImGui?](#q-can-you-create-elaborateserious-tools-with-dear-imgui)
+- [Can you reskin the look of Dear ImGui?](#q-can-you-reskin-the-look-of-dear-imgui)
+- [Why using C++ (as opposed to C)?](#q-why-using-c-as-opposed-to-c)
+
+### Community
+
+- [How can I help?](#q-how-can-i-help)
+
+--------
# Q&A: Basics
@@ -85,16 +101,17 @@ Here's a very simplified comparison between the approach taken by Dear ImGui vs
|--------------------------|--------------------------|
| UI fully issued on every update. | UI issued once then later modified. |
| UI layout is fully dynamic and can change at any time.
UI is generally emitted programmatically, which empowers reflecting a dynamic set of data. | UI layout is mostly static.
UI may be emitted programmatically or from data created by offline tools. UI need extra code to evolve, which is often tedious and error-prone if it needs to be reflecting dynamic data and systems. |
-| Application can submit UI based on arbitrary logic and then forget about it. | Application needs more bookkeeping of UI elements. |
+| UI system is optimized for the worst case and designed to be optimal even under frequent changes. | UI system is optimized for the case where nothing changes. Performances tends to degrade when anything changes. |
+| Application can submit UI based on arbitrary logic without bookkeeping all aspects of that logic. | Application needs more bookkeeping of UI elements. |
| UI library stores minimal amounts of data. At one point in time, it typically doesn't know or remember which other widgets are displayed and which widgets are coming next. As a result, certain layout features (alignment, resizing) are not as easy to implement or require ad-hoc code. | UI library stores entire widgets tree and state. UI library can use this retained data to easily layout things. |
| UI code may be added anywhere.
You can even create UI to edit a local variable! | UI code needs to be added in dedicated spots. |
| UI layout/logic/action/data bindings are all nearby in the code. | UI layout/logic/action/data bindings in distinct functions, files or formats. |
| Data is naturally always synchronized. | Use callback/signal/slot for synchronizing data (error-prone). |
-| API is simple and easy to learn. In particular, doing basic things is very easy. | API is more complex and specialized. |
-| API is low-level (raw language types). | API are higher-level (more abstractions, advanced language features). |
-| Less fancy look and feel. | Standard look and feel. |
+| API is simple and easy to learn. In particular, doing basic things is very easy.
Attractive to more programmers. | API is more complex and specialized.
Tends to require specialized programmers. |
+| API is low-level. Few abstractions, uses raw language types and your existing data. | API are higher-level. More abstractions, advanced language features. |
+| Less fancy look and feel. But keeps improving :) | Standard look and feel. |
| Compile yourself. Easy to debug, hack, modify, study. | Mostly use precompiled libraries. Compiling, modifying or studying is daunting if not impossible. |
-| Run on every platform. | Run on limited desktop platforms. |
+| Run on every platform (incl. web, consoles, mobiles, legacy systems). | Run on major desktop platforms. |
Idiomatic Dear ImGui code:
```cpp
@@ -666,6 +683,7 @@ This way you will be able to use your own types everywhere, e.g. passing `MyVect
---
### Q: How can I interact with standard C++ types (such as std::string and std::vector)?
+
- Being highly portable (backends/bindings for several languages, frameworks, programming styles, obscure or older platforms/compilers), and aiming for compatibility & performance suitable for every modern real-time game engine, Dear ImGui does not use any of std C++ types. We use raw types (e.g. char* instead of std::string) because they adapt to more use cases.
- To use ImGui::InputText() with a std::string or any resizable string class, see [misc/cpp/imgui_stdlib.h](https://github.com/ocornut/imgui/blob/master/misc/cpp/imgui_stdlib.h).
- To use combo boxes and list boxes with `std::vector` or any other data structure: the `BeginCombo()/EndCombo()` API
@@ -685,6 +703,10 @@ One possible implementation of a helper to facilitate printf-style building of s
This is a small helper where you can instance strings with configurable local buffers length. Many game engines will
provide similar or better string helpers.
+Using string views:
+
+- String view types such as `std::string_view` may be used with the [feature/string_view](https://github.com/ocornut/imgui/tree/features/string_view) branch. This branch is actively maintained and supported. Please provide feedback if you use it. We are waiting for a good moment to merge it.
+
##### [Return to Index](#index)
---
@@ -725,6 +747,20 @@ ImGui::End();
---
+### About Multi-Threading
+
+A same Dear ImGui context may be not used from multiple threads in parallel.
+
+If you want to use a same context within parallel tasks for occasional debug purpose, consider using a lock.
+
+If you want to submit contents from a main/update thread but render Dear ImGui output in a dedicated render thread, you'll need to stage `ImDrawData` and texture requests. See the `ImDrawDataSnapshot` and `ImTextureQueue` helpers in [imgui_threaded_rendering](https://github.com/ocornut/imgui_club#imgui_threaded_rendering). Also see topics with [label: multi-threading](https://github.com/ocornut/imgui/issues?q=label%3Amulti-threading).
+
+If you use multiple Dear ImGui contexts and want to use them from multiple threads, you need to `#define GImGui` to become a TLS variable (see details near the definition of `GImGui`. If you need to display multiple contexts simultaneously, consider using [imgui_multicontext_compositor](https://github.com/ocornut/imgui_club#imgui_multicontext_compositor). Also see topics with [label: multi-contexts](https://github.com/ocornut/imgui/issues?q=label%3Amulti-contexts).
+
+There is a script/patch to make the API take an explicit context pointer: [#5856](https://github.com/ocornut/imgui/pull/5856). It is presently unmaintained and likely to easy to update. It has been decided that the change is not currently worth applying to main-line but maybe will be in a future version.
+
+---
+
# Q&A: Fonts, Text
### Q: How should I handle DPI in my application?
diff --git a/include/imgui/docs/FONTS.md b/include/imgui/docs/FONTS.md
index 1e51cde..ac93bca 100644
--- a/include/imgui/docs/FONTS.md
+++ b/include/imgui/docs/FONTS.md
@@ -77,6 +77,17 @@ Some solutions:
You can use the `ImFontGlyphRangesBuilder` for this purpose and rebuilding your atlas between frames when new characters are needed. This will be the biggest win!
- Set `io.Fonts.Flags |= ImFontAtlasFlags_NoPowerOfTwoHeight;` to disable rounding the texture height to the next power of two.
+### (5) Reduce texture resizes/copy on startup
+
+🆕 Since 1.92, the ImFontAtlas is initially created using a 512x128 texture, then grows as glyphs and fonts are used. Atlas growth leads to alloc+copy, and both the old and new sized textures are present in memory for a short time (typically one frame). If you use known fonts and want to reduce initial growth, you may set `TexMinWidth` and `TexMinHeight` during initializaton.
+
+```cpp
+ImFontAtlas* atlas = io.Fonts;
+atlas->TexMinWidth = 1024;
+atlas->TexMinHeight = 1024;
+atlas->AddFont(...);
+```
+
##### [Return to Index](#index)
---------------------------------------
diff --git a/include/imgui/docs/README.md b/include/imgui/docs/README.md
index 283dd47..91bc92c 100644
--- a/include/imgui/docs/README.md
+++ b/include/imgui/docs/README.md
@@ -43,7 +43,7 @@ Dear ImGui is particularly suited to integration in game engines (for tooling),
**Backends for a variety of graphics API and rendering platforms** are provided in the [backends/](https://github.com/ocornut/imgui/tree/master/backends) folder, along with example applications in the [examples/](https://github.com/ocornut/imgui/tree/master/examples) folder. You may also create your own backend. Anywhere where you can render textured triangles, you can render Dear ImGui.
-C++20 users wishing to use a module may the use [stripe2933/imgui-module](https://github.com/stripe2933/imgui-module) third-party extension.
+C++20 users wishing to use a module may use the [stripe2933/imgui-module](https://github.com/stripe2933/imgui-module) third-party extension.
See the [Getting Started & Integration](#getting-started--integration) section of this document for more details.
@@ -141,7 +141,7 @@ Integrating Dear ImGui within your custom engine is a matter of mainly 1) wiring
- Generally, **make sure to spend time reading the [FAQ](https://www.dearimgui.com/faq), comments, and the examples applications!**
Officially maintained backends (in repository):
-- Renderers: DirectX9, DirectX10, DirectX11, DirectX12, Metal, OpenGL/ES/ES2, SDL_GPU, SDL_Renderer2/3, Vulkan, WebGPU.
+- Renderers: DirectX9, DirectX10, DirectX11, DirectX12, Metal 3/4, OpenGL/ES/ES2, SDL_GPU, SDL_Renderer2/3, Vulkan, WebGPU.
- Platforms: GLFW, SDL2/SDL3, Win32, Glut, OSX, Android.
- Frameworks: Allegro5, Emscripten.
diff --git a/include/imgui/docs/SECURITY.md b/include/imgui/docs/SECURITY.md
new file mode 100644
index 0000000..f2549ef
--- /dev/null
+++ b/include/imgui/docs/SECURITY.md
@@ -0,0 +1,17 @@
+# Security Policy
+
+Dear ImGui is primarily designed for developer tools and technical applications running trusted code and trusted data.
+
+Given that the library was not designed as a hardened security boundary against hostile or intentionally malformed inputs:
+consider not using it in a context where a crash (through e.g. intentionally malformed inputs) could lead to privilege elevation.
+E.g. running in a privileged process and interacting with non-privileged clients feeding code or data to Dear ImGui.
+
+Dear ImGui development efforts are focused on improving developer experience, usability, correctness, and robustness in real-world applications.
+We will do our best to reduce e.g. crashes caused by common programmer mistakes.
+
+However, the project does not specifically focus on adversarial fuzzing scenarios, allocation-failure hardening, or highly artificial edge cases that are unlikely to occur in normal usage.
+
+## Reporting a Vulnerability
+
+Considering the above policy, most things may be reported in GitHub Issues.
+If you have a reason to disclose privately, please reach out to the contact address listed in README.
diff --git a/include/imgui/docs/TODO.txt b/include/imgui/docs/TODO.txt
index 91d5bb5..1a7acd2 100644
--- a/include/imgui/docs/TODO.txt
+++ b/include/imgui/docs/TODO.txt
@@ -2,12 +2,14 @@ dear imgui
ISSUES & TODO LIST
Issue numbers (#) refer to GitHub issues listed at https://github.com/ocornut/imgui/issues/XXXX
+
THIS LIST IS NOT WELL MAINTAINED. MOST OF THE WORK HAPPENS ON GITHUB NOWADAYS.
+
The list below consist mostly of ideas noted down before they are requested/discussed by users (at which point they usually exist on the github issue tracker).
It's mostly a bunch of personal notes, probably incomplete. Feel free to query if you have any questions.
- - doc: add a proper documentation system (maybe relying on automation? #435)
- doc: checklist app to verify backends/integration of imgui (test inputs, rendering, callback, etc.).
+ - doc: add a proper documentation system (maybe relying on automation? #435)
- doc/tips: tips of the day: website? applet in imgui_club?
- window: preserve/restore relative focus ordering (persistent or not), and e.g. of multiple reappearing windows (#2304) -> also see docking reference to same #.
@@ -29,9 +31,9 @@ It's mostly a bunch of personal notes, probably incomplete. Feel free to query i
- window/clipping: some form of clipping when DisplaySize (or corresponding viewport) is zero.
- window/tabbing: add a way to signify that a window or docked window requires attention (e.g. blinking title bar, trying to click behind a modal).
- window/id_stack: add e.g. window->GetIDFromPath() with support for leading / and ../ (#1390, #331) -> model from test engine.
- ! scrolling: exposing horizontal scrolling with Shift+Wheel even when scrollbar is disabled expose lots of issues (#2424, #1463)
+
+ ! scrolling: exposing horizontal scrolling with Shift+Wheel even when scrollbar is disabled expose various issues (#2424, #1463)
- scrolling: while holding down a scrollbar, try to keep the same contents visible (at least while not moving mouse)
- - scrolling: allow immediately effective change of scroll after Begin() if we haven't appended items yet.
- scrolling: forward mouse wheel scrolling to parent window when at the edge of scrolling limits? (useful for listbox,tables?)
- scrolling/style: shadows on scrollable areas to denote that there is more contents (see e.g. DaVinci Resolve ui)
@@ -51,38 +53,32 @@ It's mostly a bunch of personal notes, probably incomplete. Feel free to query i
- widgets: display mode: widget-label, label-widget (aligned on column or using fixed size), label-newline-tab-widget etc. (#395)
- widgets: clean up widgets internal toward exposing everything and stabilizing imgui_internals.h.
- widgets: add always-allow-overlap mode. This should perhaps be the default? one problem is that highlight after mouse-wheel scrolling gets deferred, makes scrolling more flickery.
- - widgets: start exposing PushItemFlag() and ImGuiItemFlags
- widgets: alignment options in style (e.g. center Selectable, Right-Align within Button, etc.) #1260
- widgets: activate by identifier (trigger button, focus given id)
- widgets: custom glyph/shapes replacements for stock shapes. (also #6090 #2431 #2235 #6517)
- widgets: coloredit: keep reporting as active when picker is on?
- - widgets: group/scalarn functions: expose more per-component information. e.g. store NextItemData.ComponentIdx set by scalarn function, groups can expose them back somehow.
+ - widgets: group/ScalarN functions: expose more per-component information. e.g. store NextItemData.ComponentIdx set by scalarn function, groups can expose them back somehow.
- selectable: using (size.x == 0.0f) and (SelectableTextAlign.x > 0.0f) followed by SameLine() is currently not supported.
- selectable: generic BeginSelectable()/EndSelectable() mechanism. (work out alongside range-select branch)
- selectable: a way to visualize partial/mixed selection (e.g. parent tree node has children with mixed selection)
+ - input text: flag to disable live update of the user buffer (also applies to float/int text input) (#701)
- input text: preserve scrolling when unfocused?
- input text: reorganize event handling, allow CharFilter to modify buffers, allow multiple events? (#541)
- - input text: expose CursorPos in char filter event (#816)
- - input text: try usage idiom of using InputText with data only exposed through get/set accessors, without extraneous copy/alloc. (#3009)
- - input text: access public fields via a non-callback API e.g. InputTextGetState("xxx") that may return nullptr if not active (available in internals)
- - input text: flag to disable live update of the user buffer (also applies to float/int text input) (#701)
- input text: hover tooltip could show unclamped text
- input text: support for INSERT key to toggle overwrite mode. currently disabled because stb_textedit behavior is unsatisfactory on multi-line. (#2863)
- input text: option to Tab after an Enter validation.
- input text: add ImGuiInputTextFlags_EnterToApply? (off #218)
- input text: easier ways to update buffer (from source char*) while owned. preserve some sort of cursor position for multi-line text.
- input text: add discard flag (e.g. ImGuiInputTextFlags_DiscardActiveBuffer) or make it easier to clear active focus for text replacement during edition (#725)
- - input text: display bug when clicking a drag/slider after an input text in a different window has all-selected text (order dependent). actually a very old bug but no one appears to have noticed it.
- input text: allow centering/positioning text so that ctrl+clicking Drag or Slider keeps the textual value at the same pixel position.
- input text: decorrelate display layout from inputs with custom template - e.g. what's the easiest way to implement a nice IP/Mac address input editor?
- - input text: global callback system so user can plug in an expression evaluator easily. (#1691)
+ - input text: callback system (global) so user can plug in an expression evaluator easily. (#1691)
- input text: force scroll to end or scroll to a given line/contents (so user can implement a log or a search feature)
- input text: a way to preview completion (e.g. disabled text completing from the cursor)
- input text: a side bar that could e.g. preview where errors are. probably left to the user to draw but we'd need to give them the info there.
- input text: a way for the user to provide syntax coloring.
- input text: Shift+TAB with ImGuiInputTextFlags_AllowTabInput could eat preceding blanks, up to tab_count.
- - input text multi-line: don't directly call AddText() which does an unnecessary vertex reserve for character count prior to clipping. and/or more line-based clipping to AddText(). and/or reorganize TextUnformatted/RenderText for more efficiency for large text (e.g TextUnformatted could clip and log separately, etc).
- input text multi-line: support for copy/cut without selection (copy/cut current line?)
- input text multi-line: line numbers? status bar? (follow up on #200)
- input text multi-line: behave better when user changes input buffer while editing is active (even though it is illegal behavior). namely, the change of buffer can create a scrollbar glitch (#725)
@@ -111,11 +107,7 @@ It's mostly a bunch of personal notes, probably incomplete. Feel free to query i
!- color: the color conversion helpers/types are a mess and needs sorting out.
- color: (api breaking) ImGui::ColorConvertXXX functions should be loose ImColorConvertXX to match imgui_internals.h
- - plot: full featured plot/graph api w/ scrolling, zooming etc. --> promote using ImPlot
- - (plot: deleted all other todo lines on 2023-06-28)
-
- clipper: ability to disable the clipping through a simple flag/bool.
- - clipper: ability to run without knowing full count in advance.
- clipper: horizontal clipping support. (#2580)
- separator: expose flags (#759)
@@ -169,22 +161,19 @@ It's mostly a bunch of personal notes, probably incomplete. Feel free to query i
- knob: rotating knob widget (#942)
- drag float: support for reversed drags (min > max) (removed is_locked, also see fdc526e)
- drag float: up/down axis
- - drag float: power != 0.0f with current value being outside the range keeps the value stuck.
- drag float: added leeway on edge (e.g. a few invisible steps past the clamp limits)
- combo: a way/helper to customize the combo preview (#1658) -> experimental BeginComboPreview()
- combo/listbox: keyboard control. need InputText-like non-active focus + key handling. considering keyboard for custom listbox (pr #203)
- - listbox: multiple selection (WIP range-select branch)
- listbox: unselect option (#1208)
- - listbox: make it easier/more natural to implement range-select (need some sort of info/ref about the last clicked/focused item that user can translate to an index?) (WIP range-select branch)
- listbox: user may want to initial scroll to focus on the one selected value?
- listbox: disable capturing mouse wheel if the listbox has no scrolling. (#1681)
- listbox: scrolling should track modified selection.
- listbox: future api should allow to enable horizontal scrolling (#2510)
!- popups/menus: clarify usage of popups id, how MenuItem/Selectable closing parent popups affects the ID, etc. this is quite fishy needs improvement! (#331, #402)
- - modals: make modal title bar blink when trying to click outside the modal
- - modals: technically speaking, we could make Begin() with ImGuiWindowFlags_Modal work without involving popup. May help untangle a few things, as modals are more like regular windows than popups.
+ - modals: make modal title bar blink when trying to click outside the modal.
+ - modals: technically speaking, we could make Begin() with ImGuiWindowFlags_Modal work without involving popup. May help untangle a few things, as modals are more like regular windows than popups. (#402)
- popups: if the popup functions took explicit ImGuiID it would allow the user to manage the scope of those ID. (#331)
- popups: clicking outside (to close popup) and holding shouldn't drag window below.
- popups: add variant using global identifier similar to Begin/End (#402)
@@ -226,7 +215,7 @@ It's mostly a bunch of personal notes, probably incomplete. Feel free to query i
- style: FramePadding could be different for up vs down (#584)
- style: WindowPadding needs to be EVEN as the 0.5 multiplier used on this value probably have a subtle effect on clip rectangle
- style: have a more global HSV setter (e.g. alter hue on all elements). consider replacing active/hovered by offset in HSV space? (#438, #707, #1223)
- - style: gradients fill (#1223) ~ 2 bg colors for each fill? tricky with rounded shapes and using textures for corners.
+ - style: gradients fill (#4722, #1223) ~ 2 bg colors for each fill? tricky with rounded shapes and using textures for corners.
- style editor: color child window height expressed in multiple of line height.
- log: improve logging of ArrowButton, ListBox, TabItem
@@ -242,7 +231,6 @@ It's mostly a bunch of personal notes, probably incomplete. Feel free to query i
- filters: fuzzy matches (may use code at blog.forrestthewoods.com/4cffeed33fdb)
- drag and drop: focus drag target window on hold (even without open)
- - drag and drop: releasing a drop shows the "..." tooltip for one frame - since e13e598 (#1725)
- drag and drop: drag source on a group object (would need e.g. an invisible button covering group in EndGroup) https://twitter.com/paniq/status/1121446364909535233
- drag and drop: have some way to know when a drag begin from BeginDragDropSource() pov. (see 2018/01/11 post in #143)
- drag and drop: allow preview tooltip to be submitted from a different place than the drag source. (#1725)
@@ -275,7 +263,6 @@ It's mostly a bunch of personal notes, probably incomplete. Feel free to query i
- font: make it easier to submit own bitmap font (same texture, another texture?). (#2127, #2575)
- font: MemoryTTF taking ownership confusing/not obvious, maybe default should be opposite?
- font: storing MinAdvanceX per font would allow us to skip calculating line width (under a threshold of character count) in loops looking for block width
- - font/demo: demonstrate use of ImFontGlyphRangesBuilder.
- font/draw: vertical and/or rotated text renderer (#705) - vertical is easier clipping wise
- font/draw: need to be able to specify wrap start position.
- font/draw: better reserve policy for large horizontal block of text (shouldn't reserve for all clipped lines). also see #3349.
@@ -301,12 +288,11 @@ It's mostly a bunch of personal notes, probably incomplete. Feel free to query i
- nav: NavFlattened: ESC on a flattened child should select something.
- nav: NavFlattened: broken: in typical usage scenario, the items of a fully clipped child are currently not considered to enter into a NavFlattened child.
- nav: NavFlattened: cannot access menu-bar of a flattened child window with Alt/menu key (not a very common use case..).
- - nav: simulate right-click or context activation? (SHIFT+F10, keyboard Menu key?)
- nav/popup: esc/enter default behavior for popups, e.g. be able to mark an "ok" or "cancel" button that would get triggered by those keys, default validation button, etc.
- nav/treenode: left within a tree node block as a fallback (ImGuiTreeNodeFlags_NavLeftJumpsBackHere by default?)
- nav/menus: pressing left-right on a vertically clipped menu bar tends to jump to the collapse/close buttons.
- nav/menus: allow pressing Menu to leave a sub-menu.
- - nav/menus: a way to access the main menu bar with Alt? (currently needs CTRL+TAB) or last focused window menu bar?
+ ! nav/menus: a way to access the main menu bar with Alt? (currently needs CTRL+TAB) or last focused window menu bar?
- nav/menus: when using the main menu bar, even though we restore focus after, the underlying window loses its title bar highlight during menu manipulation. could we prevent it?
- nav/menus: main menu bar currently cannot restore a nullptr focus. Could save NavWindow at the time of being focused, similarly to what popup do?
- nav/menus: Alt,Up could open the first menu (e.g. "File") currently it tends to nav into the window/collapse menu. Do do that we would need custom transition?
@@ -340,7 +326,6 @@ It's mostly a bunch of personal notes, probably incomplete. Feel free to query i
- misc: no way to run a root-most GetID() with ImGui:: api since there's always a Debug window in the stack. (mentioned in #2960)
- misc: make the ImGuiCond values linear (non-power-of-two). internal storage for ImGuiWindow can use integers to combine into flags (Why?)
- misc: PushItemFlag(): add a flag to disable keyboard capture when used with mouse? (#1682)
- - misc: use more size_t in public api?
- misc: support for string view/range instead of char* would e.g. facilitate usage with Rust (#683, #3038, WIP string_view branch)
- demo: demonstrate using PushStyleVar() in more details.
@@ -358,8 +343,7 @@ It's mostly a bunch of personal notes, probably incomplete. Feel free to query i
- backends: opengl: could use a single vertex buffer and glBufferSubData for uploads?
- backends: opengl: explicitly disable GL_STENCIL_TEST in bindings.
- backends: vulkan: viewport: support for synchronized swapping of multiple swap chains.
- - backends: bgfx: https://gist.github.com/RichardGale/6e2b74bc42b3005e08397236e4be0fd0
- - backends: emscripten: with refactored examples, we could provide a direct imgui_impl_emscripten platform layer (see eg. https://github.com/floooh/sokol-samples/blob/master/html5/imgui-emsc.cc#L42)
+ - backends: emscripten: dedicated backend? (#8178, #9120, eg. https://github.com/floooh/sokol-samples/blob/master/html5/imgui-emsc.cc#L42)
- bindings: ways to use clang ast dump to generate bindings or helpers for bindings? (e.g. clang++ -Xclang -ast-dump=json imgui.h) (--> use https://github.com/dearimgui/dear_bindings)
diff --git a/include/imgui/examples/example_allegro5/example_allegro5.vcxproj b/include/imgui/examples/example_allegro5/example_allegro5.vcxproj
index 02f6a47..aa8a752 100644
--- a/include/imgui/examples/example_allegro5/example_allegro5.vcxproj
+++ b/include/imgui/examples/example_allegro5/example_allegro5.vcxproj
@@ -28,27 +28,27 @@
Application
true
MultiByte
- v140
+ v141
Application
true
MultiByte
- v140
+ v141
Application
false
true
MultiByte
- v140
+ v141
Application
false
true
MultiByte
- v140
+ v141
diff --git a/include/imgui/examples/example_android_opengl3/android/app/build.gradle b/include/imgui/examples/example_android_opengl3/android/app/build.gradle
index e142f19..65555fb 100644
--- a/include/imgui/examples/example_android_opengl3/android/app/build.gradle
+++ b/include/imgui/examples/example_android_opengl3/android/app/build.gradle
@@ -1,6 +1,5 @@
plugins {
alias(libs.plugins.android.application)
- alias(libs.plugins.kotlin.android)
}
android {
@@ -25,9 +24,6 @@ android {
sourceCompatibility JavaVersion.VERSION_11
targetCompatibility JavaVersion.VERSION_11
}
- kotlinOptions {
- jvmTarget = '11'
- }
externalNativeBuild {
cmake {
path file('../../CMakeLists.txt')
diff --git a/include/imgui/examples/example_apple_metal4/README.md b/include/imgui/examples/example_apple_metal4/README.md
new file mode 100644
index 0000000..240ae03
--- /dev/null
+++ b/include/imgui/examples/example_apple_metal4/README.md
@@ -0,0 +1,10 @@
+# iOS / OSX Metal4 example
+
+## Introduction
+
+This example shows how to integrate Dear ImGui with Metal4. It is based on the "cross-platform" game template provided with Xcode as of Xcode 9.
+
+Consider basing your work off the example_glfw_metal/ or example_sdl2_metal/ examples. They are better supported and will be portable unlike this one.
+
+
+
diff --git a/include/imgui/examples/example_apple_metal4/example_apple_metal4.xcodeproj/project.pbxproj b/include/imgui/examples/example_apple_metal4/example_apple_metal4.xcodeproj/project.pbxproj
new file mode 100644
index 0000000..ed60054
--- /dev/null
+++ b/include/imgui/examples/example_apple_metal4/example_apple_metal4.xcodeproj/project.pbxproj
@@ -0,0 +1,535 @@
+// !$*UTF8*$!
+{
+ archiveVersion = 1;
+ classes = {
+ };
+ objectVersion = 54;
+ objects = {
+
+/* Begin PBXBuildFile section */
+ 050450AB2768052600AB6805 /* imgui_tables.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5079822D257677DB0038A28D /* imgui_tables.cpp */; };
+ 050450AD276863B000AB6805 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 050450AC276863B000AB6805 /* QuartzCore.framework */; };
+ 05318E0F274C397200A8DE2E /* GameController.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 05318E0E274C397200A8DE2E /* GameController.framework */; };
+ 05A275442773BEA20084EF39 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 05A275432773BEA20084EF39 /* QuartzCore.framework */; };
+ 07A82ED82139413D0078D120 /* imgui_widgets.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 07A82ED72139413C0078D120 /* imgui_widgets.cpp */; };
+ 07A82ED92139418F0078D120 /* imgui_widgets.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 07A82ED72139413C0078D120 /* imgui_widgets.cpp */; };
+ 5079822E257677DB0038A28D /* imgui_tables.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5079822D257677DB0038A28D /* imgui_tables.cpp */; };
+ 8309BD8F253CCAAA0045E2A1 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8309BD8E253CCAAA0045E2A1 /* UIKit.framework */; };
+ 8309BDA5253CCC070045E2A1 /* main.mm in Sources */ = {isa = PBXBuildFile; fileRef = 8309BDA0253CCBC10045E2A1 /* main.mm */; };
+ 8309BDA8253CCC080045E2A1 /* main.mm in Sources */ = {isa = PBXBuildFile; fileRef = 8309BDA0253CCBC10045E2A1 /* main.mm */; };
+ 8309BDBB253CCCAD0045E2A1 /* imgui_impl_metal4.mm in Sources */ = {isa = PBXBuildFile; fileRef = 8309BDB5253CCC9D0045E2A1 /* imgui_impl_metal4.mm */; };
+ 8309BDBE253CCCB60045E2A1 /* imgui_impl_metal4.mm in Sources */ = {isa = PBXBuildFile; fileRef = 8309BDB5253CCC9D0045E2A1 /* imgui_impl_metal4.mm */; };
+ 8309BDBF253CCCB60045E2A1 /* imgui_impl_osx.mm in Sources */ = {isa = PBXBuildFile; fileRef = 8309BDB6253CCC9D0045E2A1 /* imgui_impl_osx.mm */; };
+ 8309BDC6253CCCFE0045E2A1 /* AppKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8309BDC5253CCCFE0045E2A1 /* AppKit.framework */; };
+ 8309BDFC253CDAB30045E2A1 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 8309BDF7253CDAAE0045E2A1 /* LaunchScreen.storyboard */; };
+ 8309BE04253CDAB60045E2A1 /* MainMenu.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 8309BDFA253CDAAE0045E2A1 /* MainMenu.storyboard */; };
+ 83BBE9E520EB46B900295997 /* Metal.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 83BBE9E420EB46B900295997 /* Metal.framework */; };
+ 83BBE9E720EB46BD00295997 /* MetalKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 83BBE9E620EB46BD00295997 /* MetalKit.framework */; };
+ 83BBE9EC20EB471700295997 /* MetalKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 83BBE9EA20EB471700295997 /* MetalKit.framework */; };
+ 83BBE9ED20EB471700295997 /* Metal.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 83BBE9EB20EB471700295997 /* Metal.framework */; };
+ 83BBEA0520EB54E700295997 /* imgui_draw.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 83BBEA0120EB54E700295997 /* imgui_draw.cpp */; };
+ 83BBEA0620EB54E700295997 /* imgui_draw.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 83BBEA0120EB54E700295997 /* imgui_draw.cpp */; };
+ 83BBEA0720EB54E700295997 /* imgui_demo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 83BBEA0220EB54E700295997 /* imgui_demo.cpp */; };
+ 83BBEA0820EB54E700295997 /* imgui_demo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 83BBEA0220EB54E700295997 /* imgui_demo.cpp */; };
+ 83BBEA0920EB54E700295997 /* imgui.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 83BBEA0320EB54E700295997 /* imgui.cpp */; };
+ 83BBEA0A20EB54E700295997 /* imgui.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 83BBEA0320EB54E700295997 /* imgui.cpp */; };
+/* End PBXBuildFile section */
+
+/* Begin PBXFileReference section */
+ 050450AC276863B000AB6805 /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; };
+ 05318E0E274C397200A8DE2E /* GameController.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = GameController.framework; path = System/Library/Frameworks/GameController.framework; sourceTree = SDKROOT; };
+ 05A2754027728F5B0084EF39 /* imgui_impl_metal4.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = imgui_impl_metal4.h; path = ../../backends/imgui_impl_metal4.h; sourceTree = ""; };
+ 05A2754127728F5B0084EF39 /* imgui_impl_osx.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = imgui_impl_osx.h; path = ../../backends/imgui_impl_osx.h; sourceTree = ""; };
+ 05A275432773BEA20084EF39 /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS15.2.sdk/System/Library/Frameworks/QuartzCore.framework; sourceTree = DEVELOPER_DIR; };
+ 07A82ED62139413C0078D120 /* imgui_internal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = imgui_internal.h; path = ../../imgui_internal.h; sourceTree = ""; };
+ 07A82ED72139413C0078D120 /* imgui_widgets.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = imgui_widgets.cpp; path = ../../imgui_widgets.cpp; sourceTree = ""; };
+ 5079822D257677DB0038A28D /* imgui_tables.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = imgui_tables.cpp; path = ../../imgui_tables.cpp; sourceTree = ""; };
+ 8307E7C420E9F9C900473790 /* example_apple_metal.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = example_apple_metal.app; sourceTree = BUILT_PRODUCTS_DIR; };
+ 8307E7DA20E9F9C900473790 /* example_apple_metal.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = example_apple_metal.app; sourceTree = BUILT_PRODUCTS_DIR; };
+ 8309BD8E253CCAAA0045E2A1 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS14.0.sdk/System/Library/Frameworks/UIKit.framework; sourceTree = DEVELOPER_DIR; };
+ 8309BDA0253CCBC10045E2A1 /* main.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = main.mm; sourceTree = ""; };
+ 8309BDB5253CCC9D0045E2A1 /* imgui_impl_metal4.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; name = imgui_impl_metal4.mm; path = ../../backends/imgui_impl_metal4.mm; sourceTree = ""; };
+ 8309BDB6253CCC9D0045E2A1 /* imgui_impl_osx.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; name = imgui_impl_osx.mm; path = ../../backends/imgui_impl_osx.mm; sourceTree = ""; };
+ 8309BDC5253CCCFE0045E2A1 /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = System/Library/Frameworks/AppKit.framework; sourceTree = SDKROOT; };
+ 8309BDF7253CDAAE0045E2A1 /* LaunchScreen.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; path = LaunchScreen.storyboard; sourceTree = ""; };
+ 8309BDF8253CDAAE0045E2A1 /* Info-iOS.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Info-iOS.plist"; sourceTree = ""; };
+ 8309BDFA253CDAAE0045E2A1 /* MainMenu.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; path = MainMenu.storyboard; sourceTree = ""; };
+ 8309BDFB253CDAAE0045E2A1 /* Info-macOS.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Info-macOS.plist"; sourceTree = ""; };
+ 83BBE9E420EB46B900295997 /* Metal.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Metal.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS11.4.sdk/System/Library/Frameworks/Metal.framework; sourceTree = DEVELOPER_DIR; };
+ 83BBE9E620EB46BD00295997 /* MetalKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MetalKit.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS11.4.sdk/System/Library/Frameworks/MetalKit.framework; sourceTree = DEVELOPER_DIR; };
+ 83BBE9E820EB46C100295997 /* ModelIO.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = ModelIO.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS11.4.sdk/System/Library/Frameworks/ModelIO.framework; sourceTree = DEVELOPER_DIR; };
+ 83BBE9EA20EB471700295997 /* MetalKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MetalKit.framework; path = System/Library/Frameworks/MetalKit.framework; sourceTree = SDKROOT; };
+ 83BBE9EB20EB471700295997 /* Metal.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Metal.framework; path = System/Library/Frameworks/Metal.framework; sourceTree = SDKROOT; };
+ 83BBE9EE20EB471C00295997 /* ModelIO.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = ModelIO.framework; path = System/Library/Frameworks/ModelIO.framework; sourceTree = SDKROOT; };
+ 83BBEA0020EB54E700295997 /* imgui.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = imgui.h; path = ../../imgui.h; sourceTree = ""; };
+ 83BBEA0120EB54E700295997 /* imgui_draw.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = imgui_draw.cpp; path = ../../imgui_draw.cpp; sourceTree = ""; };
+ 83BBEA0220EB54E700295997 /* imgui_demo.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = imgui_demo.cpp; path = ../../imgui_demo.cpp; sourceTree = ""; };
+ 83BBEA0320EB54E700295997 /* imgui.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = imgui.cpp; path = ../../imgui.cpp; sourceTree = ""; };
+ 83BBEA0420EB54E700295997 /* imconfig.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = imconfig.h; path = ../../imconfig.h; sourceTree = ""; };
+/* End PBXFileReference section */
+
+/* Begin PBXFrameworksBuildPhase section */
+ 8307E7C120E9F9C900473790 /* Frameworks */ = {
+ isa = PBXFrameworksBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 05A275442773BEA20084EF39 /* QuartzCore.framework in Frameworks */,
+ 8309BD8F253CCAAA0045E2A1 /* UIKit.framework in Frameworks */,
+ 83BBE9E720EB46BD00295997 /* MetalKit.framework in Frameworks */,
+ 83BBE9E520EB46B900295997 /* Metal.framework in Frameworks */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 8307E7D720E9F9C900473790 /* Frameworks */ = {
+ isa = PBXFrameworksBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 050450AD276863B000AB6805 /* QuartzCore.framework in Frameworks */,
+ 8309BDC6253CCCFE0045E2A1 /* AppKit.framework in Frameworks */,
+ 83BBE9EC20EB471700295997 /* MetalKit.framework in Frameworks */,
+ 05318E0F274C397200A8DE2E /* GameController.framework in Frameworks */,
+ 83BBE9ED20EB471700295997 /* Metal.framework in Frameworks */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXFrameworksBuildPhase section */
+
+/* Begin PBXGroup section */
+ 8307E7B520E9F9C700473790 = {
+ isa = PBXGroup;
+ children = (
+ 83BBE9F020EB544400295997 /* imgui */,
+ 8309BD9E253CCBA70045E2A1 /* example */,
+ 8307E7C520E9F9C900473790 /* Products */,
+ 83BBE9E320EB46B800295997 /* Frameworks */,
+ );
+ sourceTree = "";
+ };
+ 8307E7C520E9F9C900473790 /* Products */ = {
+ isa = PBXGroup;
+ children = (
+ 8307E7C420E9F9C900473790 /* example_apple_metal.app */,
+ 8307E7DA20E9F9C900473790 /* example_apple_metal.app */,
+ );
+ name = Products;
+ sourceTree = "";
+ };
+ 8309BD9E253CCBA70045E2A1 /* example */ = {
+ isa = PBXGroup;
+ children = (
+ 8309BDF6253CDAAE0045E2A1 /* iOS */,
+ 8309BDF9253CDAAE0045E2A1 /* macOS */,
+ 8309BDA0253CCBC10045E2A1 /* main.mm */,
+ );
+ name = example;
+ sourceTree = "";
+ };
+ 8309BDF6253CDAAE0045E2A1 /* iOS */ = {
+ isa = PBXGroup;
+ children = (
+ 8309BDF7253CDAAE0045E2A1 /* LaunchScreen.storyboard */,
+ 8309BDF8253CDAAE0045E2A1 /* Info-iOS.plist */,
+ );
+ path = iOS;
+ sourceTree = "";
+ };
+ 8309BDF9253CDAAE0045E2A1 /* macOS */ = {
+ isa = PBXGroup;
+ children = (
+ 8309BDFA253CDAAE0045E2A1 /* MainMenu.storyboard */,
+ 8309BDFB253CDAAE0045E2A1 /* Info-macOS.plist */,
+ );
+ path = macOS;
+ sourceTree = "";
+ };
+ 83BBE9E320EB46B800295997 /* Frameworks */ = {
+ isa = PBXGroup;
+ children = (
+ 050450AC276863B000AB6805 /* QuartzCore.framework */,
+ 05A275432773BEA20084EF39 /* QuartzCore.framework */,
+ 05318E0E274C397200A8DE2E /* GameController.framework */,
+ 8309BDC5253CCCFE0045E2A1 /* AppKit.framework */,
+ 8309BD8E253CCAAA0045E2A1 /* UIKit.framework */,
+ 83BBE9EE20EB471C00295997 /* ModelIO.framework */,
+ 83BBE9EB20EB471700295997 /* Metal.framework */,
+ 83BBE9EA20EB471700295997 /* MetalKit.framework */,
+ 83BBE9E820EB46C100295997 /* ModelIO.framework */,
+ 83BBE9E620EB46BD00295997 /* MetalKit.framework */,
+ 83BBE9E420EB46B900295997 /* Metal.framework */,
+ );
+ name = Frameworks;
+ sourceTree = "";
+ };
+ 83BBE9F020EB544400295997 /* imgui */ = {
+ isa = PBXGroup;
+ children = (
+ 5079822D257677DB0038A28D /* imgui_tables.cpp */,
+ 05A2754027728F5B0084EF39 /* imgui_impl_metal4.h */,
+ 8309BDB5253CCC9D0045E2A1 /* imgui_impl_metal4.mm */,
+ 05A2754127728F5B0084EF39 /* imgui_impl_osx.h */,
+ 8309BDB6253CCC9D0045E2A1 /* imgui_impl_osx.mm */,
+ 83BBEA0420EB54E700295997 /* imconfig.h */,
+ 83BBEA0320EB54E700295997 /* imgui.cpp */,
+ 83BBEA0020EB54E700295997 /* imgui.h */,
+ 83BBEA0220EB54E700295997 /* imgui_demo.cpp */,
+ 83BBEA0120EB54E700295997 /* imgui_draw.cpp */,
+ 07A82ED62139413C0078D120 /* imgui_internal.h */,
+ 07A82ED72139413C0078D120 /* imgui_widgets.cpp */,
+ );
+ name = imgui;
+ sourceTree = "";
+ };
+/* End PBXGroup section */
+
+/* Begin PBXNativeTarget section */
+ 8307E7C320E9F9C900473790 /* example_apple_metal_ios */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = 8307E7F020E9F9C900473790 /* Build configuration list for PBXNativeTarget "example_apple_metal_ios" */;
+ buildPhases = (
+ 8307E7C020E9F9C900473790 /* Sources */,
+ 8307E7C120E9F9C900473790 /* Frameworks */,
+ 8307E7C220E9F9C900473790 /* Resources */,
+ );
+ buildRules = (
+ );
+ dependencies = (
+ );
+ name = example_apple_metal_ios;
+ productName = "imguiex iOS";
+ productReference = 8307E7C420E9F9C900473790 /* example_apple_metal.app */;
+ productType = "com.apple.product-type.application";
+ };
+ 8307E7D920E9F9C900473790 /* example_apple_metal_macos */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = 8307E7F320E9F9C900473790 /* Build configuration list for PBXNativeTarget "example_apple_metal_macos" */;
+ buildPhases = (
+ 8307E7D620E9F9C900473790 /* Sources */,
+ 8307E7D720E9F9C900473790 /* Frameworks */,
+ 8307E7D820E9F9C900473790 /* Resources */,
+ );
+ buildRules = (
+ );
+ dependencies = (
+ );
+ name = example_apple_metal_macos;
+ productName = "imguiex macOS";
+ productReference = 8307E7DA20E9F9C900473790 /* example_apple_metal.app */;
+ productType = "com.apple.product-type.application";
+ };
+/* End PBXNativeTarget section */
+
+/* Begin PBXProject section */
+ 8307E7B620E9F9C700473790 /* Project object */ = {
+ isa = PBXProject;
+ attributes = {
+ BuildIndependentTargetsInParallel = YES;
+ LastUpgradeCheck = 1530;
+ ORGANIZATIONNAME = "Warren Moore";
+ TargetAttributes = {
+ 8307E7C320E9F9C900473790 = {
+ CreatedOnToolsVersion = 9.4.1;
+ ProvisioningStyle = Automatic;
+ };
+ 8307E7D920E9F9C900473790 = {
+ CreatedOnToolsVersion = 9.4.1;
+ ProvisioningStyle = Automatic;
+ };
+ };
+ };
+ buildConfigurationList = 8307E7B920E9F9C700473790 /* Build configuration list for PBXProject "example_apple_metal" */;
+ compatibilityVersion = "Xcode 8.0";
+ developmentRegion = en;
+ hasScannedForEncodings = 0;
+ knownRegions = (
+ en,
+ Base,
+ );
+ mainGroup = 8307E7B520E9F9C700473790;
+ productRefGroup = 8307E7C520E9F9C900473790 /* Products */;
+ projectDirPath = "";
+ projectRoot = "";
+ targets = (
+ 8307E7C320E9F9C900473790 /* example_apple_metal_ios */,
+ 8307E7D920E9F9C900473790 /* example_apple_metal_macos */,
+ );
+ };
+/* End PBXProject section */
+
+/* Begin PBXResourcesBuildPhase section */
+ 8307E7C220E9F9C900473790 /* Resources */ = {
+ isa = PBXResourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 8309BDFC253CDAB30045E2A1 /* LaunchScreen.storyboard in Resources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 8307E7D820E9F9C900473790 /* Resources */ = {
+ isa = PBXResourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 8309BE04253CDAB60045E2A1 /* MainMenu.storyboard in Resources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXResourcesBuildPhase section */
+
+/* Begin PBXSourcesBuildPhase section */
+ 8307E7C020E9F9C900473790 /* Sources */ = {
+ isa = PBXSourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 8309BDBB253CCCAD0045E2A1 /* imgui_impl_metal4.mm in Sources */,
+ 83BBEA0920EB54E700295997 /* imgui.cpp in Sources */,
+ 83BBEA0720EB54E700295997 /* imgui_demo.cpp in Sources */,
+ 83BBEA0520EB54E700295997 /* imgui_draw.cpp in Sources */,
+ 5079822E257677DB0038A28D /* imgui_tables.cpp in Sources */,
+ 07A82ED82139413D0078D120 /* imgui_widgets.cpp in Sources */,
+ 8309BDA5253CCC070045E2A1 /* main.mm in Sources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 8307E7D620E9F9C900473790 /* Sources */ = {
+ isa = PBXSourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 8309BDBE253CCCB60045E2A1 /* imgui_impl_metal4.mm in Sources */,
+ 8309BDBF253CCCB60045E2A1 /* imgui_impl_osx.mm in Sources */,
+ 83BBEA0A20EB54E700295997 /* imgui.cpp in Sources */,
+ 83BBEA0820EB54E700295997 /* imgui_demo.cpp in Sources */,
+ 83BBEA0620EB54E700295997 /* imgui_draw.cpp in Sources */,
+ 050450AB2768052600AB6805 /* imgui_tables.cpp in Sources */,
+ 07A82ED92139418F0078D120 /* imgui_widgets.cpp in Sources */,
+ 8309BDA8253CCC080045E2A1 /* main.mm in Sources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXSourcesBuildPhase section */
+
+/* Begin XCBuildConfiguration section */
+ 8307E7EE20E9F9C900473790 /* Debug */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ALWAYS_SEARCH_USER_PATHS = NO;
+ CLANG_ANALYZER_NONNULL = YES;
+ CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
+ CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
+ CLANG_CXX_LIBRARY = "libc++";
+ CLANG_ENABLE_MODULES = YES;
+ CLANG_ENABLE_OBJC_ARC = YES;
+ CLANG_ENABLE_OBJC_WEAK = YES;
+ CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
+ CLANG_WARN_BOOL_CONVERSION = YES;
+ CLANG_WARN_COMMA = YES;
+ CLANG_WARN_CONSTANT_CONVERSION = YES;
+ CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
+ CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
+ CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
+ CLANG_WARN_EMPTY_BODY = YES;
+ CLANG_WARN_ENUM_CONVERSION = YES;
+ CLANG_WARN_INFINITE_RECURSION = YES;
+ CLANG_WARN_INT_CONVERSION = YES;
+ CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
+ CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
+ CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
+ CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
+ CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
+ CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
+ CLANG_WARN_STRICT_PROTOTYPES = YES;
+ CLANG_WARN_SUSPICIOUS_MOVE = YES;
+ CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
+ CLANG_WARN_UNREACHABLE_CODE = YES;
+ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
+ COPY_PHASE_STRIP = NO;
+ DEAD_CODE_STRIPPING = YES;
+ DEBUG_INFORMATION_FORMAT = dwarf;
+ ENABLE_STRICT_OBJC_MSGSEND = YES;
+ ENABLE_TESTABILITY = YES;
+ ENABLE_USER_SCRIPT_SANDBOXING = YES;
+ GCC_C_LANGUAGE_STANDARD = gnu11;
+ GCC_DYNAMIC_NO_PIC = NO;
+ GCC_NO_COMMON_BLOCKS = YES;
+ GCC_OPTIMIZATION_LEVEL = 0;
+ GCC_PREPROCESSOR_DEFINITIONS = (
+ "DEBUG=1",
+ "$(inherited)",
+ );
+ GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
+ GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
+ GCC_WARN_UNDECLARED_SELECTOR = YES;
+ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
+ GCC_WARN_UNUSED_FUNCTION = YES;
+ GCC_WARN_UNUSED_VARIABLE = YES;
+ MTL_ENABLE_DEBUG_INFO = YES;
+ ONLY_ACTIVE_ARCH = YES;
+ };
+ name = Debug;
+ };
+ 8307E7EF20E9F9C900473790 /* Release */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ALWAYS_SEARCH_USER_PATHS = NO;
+ CLANG_ANALYZER_NONNULL = YES;
+ CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
+ CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
+ CLANG_CXX_LIBRARY = "libc++";
+ CLANG_ENABLE_MODULES = YES;
+ CLANG_ENABLE_OBJC_ARC = YES;
+ CLANG_ENABLE_OBJC_WEAK = YES;
+ CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
+ CLANG_WARN_BOOL_CONVERSION = YES;
+ CLANG_WARN_COMMA = YES;
+ CLANG_WARN_CONSTANT_CONVERSION = YES;
+ CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
+ CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
+ CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
+ CLANG_WARN_EMPTY_BODY = YES;
+ CLANG_WARN_ENUM_CONVERSION = YES;
+ CLANG_WARN_INFINITE_RECURSION = YES;
+ CLANG_WARN_INT_CONVERSION = YES;
+ CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
+ CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
+ CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
+ CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
+ CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
+ CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
+ CLANG_WARN_STRICT_PROTOTYPES = YES;
+ CLANG_WARN_SUSPICIOUS_MOVE = YES;
+ CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
+ CLANG_WARN_UNREACHABLE_CODE = YES;
+ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
+ COPY_PHASE_STRIP = NO;
+ DEAD_CODE_STRIPPING = YES;
+ DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
+ ENABLE_NS_ASSERTIONS = NO;
+ ENABLE_STRICT_OBJC_MSGSEND = YES;
+ ENABLE_USER_SCRIPT_SANDBOXING = YES;
+ GCC_C_LANGUAGE_STANDARD = gnu11;
+ GCC_NO_COMMON_BLOCKS = YES;
+ GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
+ GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
+ GCC_WARN_UNDECLARED_SELECTOR = YES;
+ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
+ GCC_WARN_UNUSED_FUNCTION = YES;
+ GCC_WARN_UNUSED_VARIABLE = YES;
+ MTL_ENABLE_DEBUG_INFO = NO;
+ };
+ name = Release;
+ };
+ 8307E7F120E9F9C900473790 /* Debug */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ CODE_SIGN_IDENTITY = "iPhone Developer";
+ CODE_SIGN_STYLE = Automatic;
+ DEVELOPMENT_TEAM = "";
+ INFOPLIST_FILE = "$(SRCROOT)/iOS/Info-iOS.plist";
+ IPHONEOS_DEPLOYMENT_TARGET = 12.0;
+ LD_RUNPATH_SEARCH_PATHS = (
+ "$(inherited)",
+ "@executable_path/Frameworks",
+ );
+ PRODUCT_BUNDLE_IDENTIFIER = "org.imgui.example.apple-metal-ios";
+ PRODUCT_NAME = example_apple_metal;
+ SDKROOT = iphoneos;
+ TARGETED_DEVICE_FAMILY = "1,2";
+ USER_HEADER_SEARCH_PATHS = "$(SRCROOT)/../../**";
+ };
+ name = Debug;
+ };
+ 8307E7F220E9F9C900473790 /* Release */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ CODE_SIGN_IDENTITY = "iPhone Developer";
+ CODE_SIGN_STYLE = Automatic;
+ DEVELOPMENT_TEAM = "";
+ INFOPLIST_FILE = "$(SRCROOT)/iOS/Info-iOS.plist";
+ IPHONEOS_DEPLOYMENT_TARGET = 12.0;
+ LD_RUNPATH_SEARCH_PATHS = (
+ "$(inherited)",
+ "@executable_path/Frameworks",
+ );
+ PRODUCT_BUNDLE_IDENTIFIER = "org.imgui.example.apple-metal-ios";
+ PRODUCT_NAME = example_apple_metal;
+ SDKROOT = iphoneos;
+ TARGETED_DEVICE_FAMILY = "1,2";
+ USER_HEADER_SEARCH_PATHS = "$(SRCROOT)/../../**";
+ VALIDATE_PRODUCT = YES;
+ };
+ name = Release;
+ };
+ 8307E7F420E9F9C900473790 /* Debug */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ CODE_SIGN_IDENTITY = "-";
+ CODE_SIGN_STYLE = Automatic;
+ COMBINE_HIDPI_IMAGES = YES;
+ DEAD_CODE_STRIPPING = YES;
+ DEVELOPMENT_TEAM = "";
+ INFOPLIST_FILE = "$(SRCROOT)/macOS/Info-macOS.plist";
+ LD_RUNPATH_SEARCH_PATHS = (
+ "$(inherited)",
+ "@executable_path/../Frameworks",
+ );
+ MACOSX_DEPLOYMENT_TARGET = 26.0;
+ PRODUCT_BUNDLE_IDENTIFIER = "org.imgui.example.apple-metal-macos";
+ PRODUCT_NAME = example_apple_metal;
+ SDKROOT = macosx;
+ USER_HEADER_SEARCH_PATHS = "$(SRCROOT)/../../**";
+ };
+ name = Debug;
+ };
+ 8307E7F520E9F9C900473790 /* Release */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ CODE_SIGN_IDENTITY = "-";
+ CODE_SIGN_STYLE = Automatic;
+ COMBINE_HIDPI_IMAGES = YES;
+ DEAD_CODE_STRIPPING = YES;
+ DEVELOPMENT_TEAM = "";
+ INFOPLIST_FILE = "$(SRCROOT)/macOS/Info-macOS.plist";
+ LD_RUNPATH_SEARCH_PATHS = (
+ "$(inherited)",
+ "@executable_path/../Frameworks",
+ );
+ MACOSX_DEPLOYMENT_TARGET = 26.0;
+ PRODUCT_BUNDLE_IDENTIFIER = "org.imgui.example.apple-metal-macos";
+ PRODUCT_NAME = example_apple_metal;
+ SDKROOT = macosx;
+ USER_HEADER_SEARCH_PATHS = "$(SRCROOT)/../../**";
+ };
+ name = Release;
+ };
+/* End XCBuildConfiguration section */
+
+/* Begin XCConfigurationList section */
+ 8307E7B920E9F9C700473790 /* Build configuration list for PBXProject "example_apple_metal" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ 8307E7EE20E9F9C900473790 /* Debug */,
+ 8307E7EF20E9F9C900473790 /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
+ 8307E7F020E9F9C900473790 /* Build configuration list for PBXNativeTarget "example_apple_metal_ios" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ 8307E7F120E9F9C900473790 /* Debug */,
+ 8307E7F220E9F9C900473790 /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
+ 8307E7F320E9F9C900473790 /* Build configuration list for PBXNativeTarget "example_apple_metal_macos" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ 8307E7F420E9F9C900473790 /* Debug */,
+ 8307E7F520E9F9C900473790 /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
+/* End XCConfigurationList section */
+ };
+ rootObject = 8307E7B620E9F9C700473790 /* Project object */;
+}
diff --git a/include/imgui/examples/example_apple_metal4/iOS/Info-iOS.plist b/include/imgui/examples/example_apple_metal4/iOS/Info-iOS.plist
new file mode 100644
index 0000000..93ef078
--- /dev/null
+++ b/include/imgui/examples/example_apple_metal4/iOS/Info-iOS.plist
@@ -0,0 +1,49 @@
+
+
+
+
+ CFBundleDevelopmentRegion
+ $(DEVELOPMENT_LANGUAGE)
+ CFBundleExecutable
+ $(EXECUTABLE_NAME)
+ CFBundleIdentifier
+ $(PRODUCT_BUNDLE_IDENTIFIER)
+ CFBundleInfoDictionaryVersion
+ 6.0
+ CFBundleName
+ imgui
+ CFBundlePackageType
+ APPL
+ CFBundleShortVersionString
+ 1.0
+ CFBundleVersion
+ 1
+ LSRequiresIPhoneOS
+
+ UILaunchStoryboardName
+ LaunchScreen
+ UIRequiredDeviceCapabilities
+
+ armv7
+ metal
+
+ UIRequiresFullScreen
+
+ UIStatusBarHidden
+
+ UISupportedInterfaceOrientations
+
+ UIInterfaceOrientationPortrait
+ UIInterfaceOrientationLandscapeLeft
+ UIInterfaceOrientationLandscapeRight
+ UIInterfaceOrientationPortraitUpsideDown
+
+ UISupportedInterfaceOrientations~ipad
+
+ UIInterfaceOrientationPortrait
+ UIInterfaceOrientationPortraitUpsideDown
+ UIInterfaceOrientationLandscapeLeft
+ UIInterfaceOrientationLandscapeRight
+
+
+
diff --git a/include/imgui/examples/example_apple_metal4/iOS/LaunchScreen.storyboard b/include/imgui/examples/example_apple_metal4/iOS/LaunchScreen.storyboard
new file mode 100644
index 0000000..12c52cf
--- /dev/null
+++ b/include/imgui/examples/example_apple_metal4/iOS/LaunchScreen.storyboard
@@ -0,0 +1,27 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/include/imgui/examples/example_apple_metal4/macOS/Info-macOS.plist b/include/imgui/examples/example_apple_metal4/macOS/Info-macOS.plist
new file mode 100644
index 0000000..6f4a2b2
--- /dev/null
+++ b/include/imgui/examples/example_apple_metal4/macOS/Info-macOS.plist
@@ -0,0 +1,30 @@
+
+
+
+
+ CFBundleDevelopmentRegion
+ $(DEVELOPMENT_LANGUAGE)
+ CFBundleExecutable
+ $(EXECUTABLE_NAME)
+ CFBundleIconFile
+
+ CFBundleIdentifier
+ $(PRODUCT_BUNDLE_IDENTIFIER)
+ CFBundleInfoDictionaryVersion
+ 6.0
+ CFBundleName
+ imgui
+ CFBundlePackageType
+ APPL
+ CFBundleShortVersionString
+ 1.0
+ CFBundleVersion
+ 1
+ LSMinimumSystemVersion
+ $(MACOSX_DEPLOYMENT_TARGET)
+ NSMainStoryboardFile
+ MainMenu
+ NSPrincipalClass
+ NSApplication
+
+
diff --git a/include/imgui/examples/example_apple_metal4/macOS/MainMenu.storyboard b/include/imgui/examples/example_apple_metal4/macOS/MainMenu.storyboard
new file mode 100644
index 0000000..38ad432
--- /dev/null
+++ b/include/imgui/examples/example_apple_metal4/macOS/MainMenu.storyboard
@@ -0,0 +1,93 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/include/imgui/examples/example_apple_metal4/main.mm b/include/imgui/examples/example_apple_metal4/main.mm
new file mode 100644
index 0000000..2bfb415
--- /dev/null
+++ b/include/imgui/examples/example_apple_metal4/main.mm
@@ -0,0 +1,381 @@
+// Dear ImGui: standalone example application for OSX + Metal.
+
+// Learn about Dear ImGui:
+// - FAQ https://dearimgui.com/faq
+// - Getting Started https://dearimgui.com/getting-started
+// - Documentation https://dearimgui.com/docs (same as your local docs/ folder).
+// - Introduction, links and more at the top of imgui.cpp
+
+#import
+
+#if TARGET_OS_OSX
+#import
+#else
+#import
+#endif
+
+#import
+#import
+
+#include "imgui.h"
+#include "imgui_impl_metal4.h"
+#if TARGET_OS_OSX
+#include "imgui_impl_osx.h"
+@interface AppViewController : NSViewController
+@end
+#else
+@interface AppViewController : UIViewController
+@end
+#endif
+
+@interface AppViewController ()
+@property (nonatomic, readonly) MTKView *mtkView;
+@property (nonatomic, strong) id device;
+@property (nonatomic, strong) id commandQueue;
+@property (nonatomic, strong) id commandAllocator;
+@end
+
+#define FRAMES_IN_FLIGHT 2
+
+//-----------------------------------------------------------------------------------
+// AppViewController
+//-----------------------------------------------------------------------------------
+
+@implementation AppViewController
+
+-(instancetype)initWithNibName:(nullable NSString *)nibNameOrNil bundle:(nullable NSBundle *)nibBundleOrNil
+{
+ self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
+
+ _device = MTLCreateSystemDefaultDevice();
+ _commandQueue = [_device newMTL4CommandQueue];
+ _commandAllocator = [_device newCommandAllocator];
+
+ if (!self.device)
+ {
+ NSLog(@"Metal is not supported");
+ abort();
+ }
+
+ // Setup Dear ImGui context
+ // FIXME: This example doesn't have proper cleanup...
+ IMGUI_CHECKVERSION();
+ ImGui::CreateContext();
+ ImGuiIO& io = ImGui::GetIO(); (void)io;
+ io.ConfigFlags |= ImGuiConfigFlags_NavEnableKeyboard; // Enable Keyboard Controls
+ io.ConfigFlags |= ImGuiConfigFlags_NavEnableGamepad; // Enable Gamepad Controls
+ io.ConfigFlags |= ImGuiConfigFlags_DockingEnable; // Enable Docking
+ io.ConfigFlags |= ImGuiConfigFlags_ViewportsEnable; // Enable Multi-Viewport / Platform Windows
+
+ // Setup Dear ImGui style
+ ImGui::StyleColorsDark();
+ //ImGui::StyleColorsLight();
+
+ // When viewports are enabled we tweak WindowRounding/WindowBg so platform windows can look identical to regular ones.
+ ImGuiStyle& style = ImGui::GetStyle();
+ if (io.ConfigFlags & ImGuiConfigFlags_ViewportsEnable)
+ {
+ style.WindowRounding = 0.0f;
+ style.Colors[ImGuiCol_WindowBg].w = 1.0f;
+ }
+
+ // Setup Renderer backend
+ ImGui_ImplMetal4_Init(_device, _commandQueue, FRAMES_IN_FLIGHT);
+
+ // Load Fonts
+ // - If fonts are not explicitly loaded, Dear ImGui will select an embedded font: either AddFontDefaultVector() or AddFontDefaultBitmap().
+ // This selection is based on (style.FontSizeBase * style.FontScaleMain * style.FontScaleDpi) reaching a small threshold.
+ // - You can load multiple fonts and use ImGui::PushFont()/PopFont() to select them.
+ // - If a file cannot be loaded, AddFont functions will return a nullptr. Please handle those errors in your code (e.g. use an assertion, display an error and quit).
+ // - Read 'docs/FONTS.md' for more instructions and details.
+ // - Use '#define IMGUI_ENABLE_FREETYPE' in your imconfig file to use FreeType for higher quality font rendering.
+ // - Remember that in C/C++ if you want to include a backslash \ in a string literal you need to write a double backslash \\ !
+ //style.FontSizeBase = 20.0f;
+ //io.Fonts->AddFontDefaultVector();
+ //io.Fonts->AddFontDefaultBitmap();
+ //io.Fonts->AddFontFromFileTTF("c:\\Windows\\Fonts\\segoeui.ttf");
+ //io.Fonts->AddFontFromFileTTF("../../misc/fonts/DroidSans.ttf");
+ //io.Fonts->AddFontFromFileTTF("../../misc/fonts/Roboto-Medium.ttf");
+ //io.Fonts->AddFontFromFileTTF("../../misc/fonts/Cousine-Regular.ttf");
+ //ImFont* font = io.Fonts->AddFontFromFileTTF("c:\\Windows\\Fonts\\ArialUni.ttf");
+ //IM_ASSERT(font != nullptr);
+
+ return self;
+}
+
+-(MTKView *)mtkView
+{
+ return (MTKView *)self.view;
+}
+
+-(void)loadView
+{
+ self.view = [[MTKView alloc] initWithFrame:CGRectMake(0, 0, 1200, 800)];
+}
+
+-(void)viewDidLoad
+{
+ [super viewDidLoad];
+
+ self.mtkView.device = self.device;
+ self.mtkView.delegate = self;
+
+#if TARGET_OS_OSX
+ ImGui_ImplOSX_Init(self.view);
+ [NSApp activateIgnoringOtherApps:YES];
+#endif
+}
+
+-(void)drawInMTKView:(MTKView*)view
+{
+ ImGuiIO& io = ImGui::GetIO();
+ io.DisplaySize.x = view.bounds.size.width;
+ io.DisplaySize.y = view.bounds.size.height;
+
+#if TARGET_OS_OSX
+ CGFloat framebufferScale = view.window.screen.backingScaleFactor ?: NSScreen.mainScreen.backingScaleFactor;
+#else
+ CGFloat framebufferScale = view.window.screen.scale ?: UIScreen.mainScreen.scale;
+#endif
+ io.DisplayFramebufferScale = ImVec2(framebufferScale, framebufferScale);
+ [self.commandAllocator reset];
+
+ id commandBuffer = [self.device newCommandBuffer];
+ [commandBuffer beginCommandBufferWithAllocator:self.commandAllocator];
+
+ MTL4RenderPassDescriptor* renderPassDescriptor = view.currentMTL4RenderPassDescriptor;
+ if (renderPassDescriptor == nil)
+ {
+ [commandBuffer endCommandBuffer];
+ [self.commandQueue commit:&commandBuffer count:1];
+ return;
+ }
+
+ // Start the Dear ImGui frame
+ static int frameIndex = 0;
+ ImGui_ImplMetal4_NewFrame(renderPassDescriptor, frameIndex);
+ frameIndex++;
+ frameIndex = (frameIndex + 1) % FRAMES_IN_FLIGHT;
+
+#if TARGET_OS_OSX
+ ImGui_ImplOSX_NewFrame(view);
+#endif
+ ImGui::NewFrame();
+
+ // Our state (make them static = more or less global) as a convenience to keep the example terse.
+ static bool show_demo_window = true;
+ static bool show_another_window = false;
+ static ImVec4 clear_color = ImVec4(0.45f, 0.55f, 0.60f, 1.00f);
+
+ // 1. Show the big demo window (Most of the sample code is in ImGui::ShowDemoWindow()! You can browse its code to learn more about Dear ImGui!).
+ if (show_demo_window)
+ ImGui::ShowDemoWindow(&show_demo_window);
+
+ // 2. Show a simple window that we create ourselves. We use a Begin/End pair to create a named window.
+ {
+ static float f = 0.0f;
+ static int counter = 0;
+
+ ImGui::Begin("Hello, world!"); // Create a window called "Hello, world!" and append into it.
+
+ ImGui::Text("This is some useful text."); // Display some text (you can use a format strings too)
+ ImGui::Checkbox("Demo Window", &show_demo_window); // Edit bools storing our window open/close state
+ ImGui::Checkbox("Another Window", &show_another_window);
+
+ ImGui::SliderFloat("float", &f, 0.0f, 1.0f); // Edit 1 float using a slider from 0.0f to 1.0f
+ ImGui::ColorEdit3("clear color", (float*)&clear_color); // Edit 3 floats representing a color
+
+ if (ImGui::Button("Button")) // Buttons return true when clicked (most widgets return true when edited/activated)
+ counter++;
+ ImGui::SameLine();
+ ImGui::Text("counter = %d", counter);
+
+ ImGui::Text("Application average %.3f ms/frame (%.1f FPS)", 1000.0f / io.Framerate, io.Framerate);
+ ImGui::End();
+ }
+
+ // 3. Show another simple window.
+ if (show_another_window)
+ {
+ ImGui::Begin("Another Window", &show_another_window); // Pass a pointer to our bool variable (the window will have a closing button that will clear the bool when clicked)
+ ImGui::Text("Hello from another window!");
+ if (ImGui::Button("Close Me"))
+ show_another_window = false;
+ ImGui::End();
+ }
+
+ // Rendering
+ ImGui::Render();
+ ImDrawData* draw_data = ImGui::GetDrawData();
+
+ renderPassDescriptor.colorAttachments[0].clearColor = MTLClearColorMake(clear_color.x * clear_color.w, clear_color.y * clear_color.w, clear_color.z * clear_color.w, clear_color.w);
+ id renderEncoder = [commandBuffer renderCommandEncoderWithDescriptor:renderPassDescriptor];
+ [renderEncoder pushDebugGroup:@"Dear ImGui rendering"];
+ ImGui_ImplMetal4_RenderDrawData(draw_data, commandBuffer, renderEncoder);
+ [renderEncoder popDebugGroup];
+ [renderEncoder endEncoding];
+
+ // Present
+ [commandBuffer endCommandBuffer];
+ [self.commandQueue waitForDrawable:view.currentDrawable];
+ [self.commandQueue commit:&commandBuffer count:1];
+ [self.commandQueue signalDrawable:view.currentDrawable];
+ [view.currentDrawable present];
+
+ // Update and Render additional Platform Windows
+ if (io.ConfigFlags & ImGuiConfigFlags_ViewportsEnable)
+ {
+ ImGui::UpdatePlatformWindows();
+ ImGui::RenderPlatformWindowsDefault();
+ }
+}
+
+-(void)mtkView:(MTKView*)view drawableSizeWillChange:(CGSize)size
+{
+}
+
+//-----------------------------------------------------------------------------------
+// Input processing
+//-----------------------------------------------------------------------------------
+
+#if TARGET_OS_OSX
+
+- (void)viewWillAppear
+{
+ [super viewWillAppear];
+ self.view.window.delegate = self;
+}
+
+- (void)windowWillClose:(NSNotification *)notification
+{
+ ImGui_ImplMetal4_Shutdown();
+ ImGui_ImplOSX_Shutdown();
+ ImGui::DestroyContext();
+}
+
+#else
+
+// This touch mapping is super cheesy/hacky. We treat any touch on the screen
+// as if it were a depressed left mouse button, and we don't bother handling
+// multitouch correctly at all. This causes the "cursor" to behave very erratically
+// when there are multiple active touches. But for demo purposes, single-touch
+// interaction actually works surprisingly well.
+-(void)updateIOWithTouchEvent:(UIEvent *)event
+{
+ UITouch *anyTouch = event.allTouches.anyObject;
+ CGPoint touchLocation = [anyTouch locationInView:self.view];
+ ImGuiIO &io = ImGui::GetIO();
+ io.AddMouseSourceEvent(ImGuiMouseSource_TouchScreen);
+ io.AddMousePosEvent(touchLocation.x, touchLocation.y);
+
+ BOOL hasActiveTouch = NO;
+ for (UITouch *touch in event.allTouches)
+ {
+ if (touch.phase != UITouchPhaseEnded && touch.phase != UITouchPhaseCancelled)
+ {
+ hasActiveTouch = YES;
+ break;
+ }
+ }
+ io.AddMouseButtonEvent(0, hasActiveTouch);
+}
+
+-(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event { [self updateIOWithTouchEvent:event]; }
+-(void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event { [self updateIOWithTouchEvent:event]; }
+-(void)touchesCancelled:(NSSet *)touches withEvent:(UIEvent *)event { [self updateIOWithTouchEvent:event]; }
+-(void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event { [self updateIOWithTouchEvent:event]; }
+
+#endif
+
+@end
+
+//-----------------------------------------------------------------------------------
+// AppDelegate
+//-----------------------------------------------------------------------------------
+
+#if TARGET_OS_OSX
+
+@interface AppDelegate : NSObject
+@property (nonatomic, strong) NSWindow *window;
+@end
+
+@implementation AppDelegate
+
+-(BOOL)applicationShouldTerminateAfterLastWindowClosed:(NSApplication *)sender
+{
+ return YES;
+}
+
+-(instancetype)init
+{
+ if (self = [super init])
+ {
+ NSViewController *rootViewController = [[AppViewController alloc] initWithNibName:nil bundle:nil];
+ self.window = [[NSWindow alloc] initWithContentRect:NSZeroRect
+ styleMask:NSWindowStyleMaskTitled | NSWindowStyleMaskClosable | NSWindowStyleMaskResizable | NSWindowStyleMaskMiniaturizable
+ backing:NSBackingStoreBuffered
+ defer:NO];
+ self.window.contentViewController = rootViewController;
+ [self.window center];
+ [self.window makeKeyAndOrderFront:self];
+ }
+ return self;
+}
+
+@end
+
+#else
+
+@interface AppDelegate : UIResponder
+@property (strong, nonatomic) UIWindow *window;
+@end
+
+@implementation AppDelegate
+
+-(BOOL)application:(UIApplication *)application
+ didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
+{
+ UIViewController *rootViewController = [[AppViewController alloc] init];
+ self.window = [[UIWindow alloc] initWithFrame:UIScreen.mainScreen.bounds];
+ self.window.rootViewController = rootViewController;
+ [self.window makeKeyAndVisible];
+ return YES;
+}
+
+@end
+
+#endif
+
+//-----------------------------------------------------------------------------------
+// Application main() function
+//-----------------------------------------------------------------------------------
+
+#if TARGET_OS_OSX
+
+int main(int, const char**)
+{
+ @autoreleasepool
+ {
+ [NSApplication sharedApplication];
+ [NSApp setActivationPolicy:NSApplicationActivationPolicyRegular];
+
+ AppDelegate *appDelegate = [[AppDelegate alloc] init]; // creates window
+ [NSApp setDelegate:appDelegate];
+
+ [NSApp activateIgnoringOtherApps:YES];
+ [NSApp run];
+ }
+ return 0;
+}
+
+#else
+
+int main(int argc, char * argv[])
+{
+ @autoreleasepool
+ {
+ return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
+ }
+}
+
+#endif
diff --git a/include/imgui/examples/example_glfw_opengl2/example_glfw_opengl2.vcxproj b/include/imgui/examples/example_glfw_opengl2/example_glfw_opengl2.vcxproj
index 2aa2550..bce5781 100644
--- a/include/imgui/examples/example_glfw_opengl2/example_glfw_opengl2.vcxproj
+++ b/include/imgui/examples/example_glfw_opengl2/example_glfw_opengl2.vcxproj
@@ -28,27 +28,27 @@
Application
true
MultiByte
- v140
+ v141
Application
true
MultiByte
- v140
+ v141
Application
false
true
MultiByte
- v140
+ v141
Application
false
true
MultiByte
- v140
+ v141
diff --git a/include/imgui/examples/example_glfw_opengl3/example_glfw_opengl3.vcxproj b/include/imgui/examples/example_glfw_opengl3/example_glfw_opengl3.vcxproj
index 4bd503a..cd59dae 100644
--- a/include/imgui/examples/example_glfw_opengl3/example_glfw_opengl3.vcxproj
+++ b/include/imgui/examples/example_glfw_opengl3/example_glfw_opengl3.vcxproj
@@ -28,27 +28,27 @@
Application
true
MultiByte
- v140
+ v141
Application
true
MultiByte
- v140
+ v141
Application
false
true
MultiByte
- v140
+ v141
Application
false
true
MultiByte
- v140
+ v141
diff --git a/include/imgui/examples/example_glfw_opengl3/main.cpp b/include/imgui/examples/example_glfw_opengl3/main.cpp
index e487fe7..97c7532 100644
--- a/include/imgui/examples/example_glfw_opengl3/main.cpp
+++ b/include/imgui/examples/example_glfw_opengl3/main.cpp
@@ -41,29 +41,26 @@ int main(int, char**)
if (!glfwInit())
return 1;
- // Decide GL+GLSL versions
+ // Select GL version + let the backend select a GLSL version
+ const char* glsl_version = nullptr;
#if defined(IMGUI_IMPL_OPENGL_ES2)
// GL ES 2.0 + GLSL 100 (WebGL 1.0)
- const char* glsl_version = "#version 100";
glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 2);
glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 0);
glfwWindowHint(GLFW_CLIENT_API, GLFW_OPENGL_ES_API);
#elif defined(IMGUI_IMPL_OPENGL_ES3)
// GL ES 3.0 + GLSL 300 es (WebGL 2.0)
- const char* glsl_version = "#version 300 es";
glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3);
glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 0);
glfwWindowHint(GLFW_CLIENT_API, GLFW_OPENGL_ES_API);
#elif defined(__APPLE__)
- // GL 3.2 + GLSL 150
- const char* glsl_version = "#version 150";
+ // GL 3.2 + generally GLSL 150
glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3);
glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 2);
glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE); // 3.2+ only
glfwWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GL_TRUE); // Required on Mac
#else
- // GL 3.0 + GLSL 130
- const char* glsl_version = "#version 130";
+ // GL 3.0 + generally GLSL 130
glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3);
glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 0);
//glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE); // 3.2+ only
diff --git a/include/imgui/examples/example_glfw_vulkan/example_glfw_vulkan.vcxproj b/include/imgui/examples/example_glfw_vulkan/example_glfw_vulkan.vcxproj
index a81d328..6f44abf 100644
--- a/include/imgui/examples/example_glfw_vulkan/example_glfw_vulkan.vcxproj
+++ b/include/imgui/examples/example_glfw_vulkan/example_glfw_vulkan.vcxproj
@@ -28,27 +28,27 @@
Application
true
MultiByte
- v140
+ v141
Application
true
MultiByte
- v140
+ v141
Application
false
true
MultiByte
- v140
+ v141
Application
false
true
MultiByte
- v140
+ v141
diff --git a/include/imgui/examples/example_glfw_vulkan/main.cpp b/include/imgui/examples/example_glfw_vulkan/main.cpp
index 5b25ef9..d9b5b2c 100644
--- a/include/imgui/examples/example_glfw_vulkan/main.cpp
+++ b/include/imgui/examples/example_glfw_vulkan/main.cpp
@@ -193,7 +193,8 @@ static void SetupVulkan(ImVector instance_extensions)
{
VkDescriptorPoolSize pool_sizes[] =
{
- { VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, IMGUI_IMPL_VULKAN_MINIMUM_IMAGE_SAMPLER_POOL_SIZE },
+ { VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE, IMGUI_IMPL_VULKAN_MINIMUM_SAMPLED_IMAGE_POOL_SIZE },
+ { VK_DESCRIPTOR_TYPE_SAMPLER, IMGUI_IMPL_VULKAN_MINIMUM_SAMPLER_POOL_SIZE },
};
VkDescriptorPoolCreateInfo pool_info = {};
pool_info.sType = VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_CREATE_INFO;
diff --git a/include/imgui/examples/example_glfw_wgpu/CMakeLists.txt b/include/imgui/examples/example_glfw_wgpu/CMakeLists.txt
index 53bcda3..4eaaee7 100644
--- a/include/imgui/examples/example_glfw_wgpu/CMakeLists.txt
+++ b/include/imgui/examples/example_glfw_wgpu/CMakeLists.txt
@@ -14,7 +14,7 @@
# * build/example_glfw_wgpu[.exe] or build/Debug/example_glfw_wgpu[.exe]
# Building for desktop with WGVK (MUCH EASIER)
-# 1. git clone https://github.com/manuel5975p/WGVK dawn
+# 1. git clone https://github.com/manuel5975p/WGVK wgvk
# 2. cmake -B build -DIMGUI_WGVK_DIR=wgvk
# 3. cmake --build build
# The resulting binary will be found at one of the following locations:
@@ -37,7 +37,7 @@ if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Debug CACHE STRING "" FORCE)
endif()
-set(CMAKE_CXX_STANDARD 17) # Dawn requires C++17
+set(CMAKE_CXX_STANDARD 20) # Dawn requires C++20
# Dear ImGui
set(IMGUI_DIR ../../)
@@ -146,6 +146,28 @@ else() # Native/Desktop build
endif()
if(IMGUI_WGVK_DIR)
+ find_package(Vulkan REQUIRED)
+ set(WGVK_PLATFORM_LIBS)
+ set(WGVK_PLATFORM_DEFS)
+ if(WIN32)
+ list(APPEND WGVK_PLATFORM_DEFS SUPPORT_WIN32_SURFACE=1)
+ elseif(APPLE)
+ list(APPEND WGVK_PLATFORM_DEFS SUPPORT_METAL_SURFACE=1)
+ elseif(UNIX)
+ find_package(PkgConfig QUIET)
+ pkg_check_modules(WAYLAND_CLIENT QUIET wayland-client)
+ if(WAYLAND_CLIENT_FOUND)
+ list(APPEND WGVK_PLATFORM_DEFS SUPPORT_WAYLAND_SURFACE=1)
+ list(APPEND WGVK_PLATFORM_LIBS ${WAYLAND_CLIENT_LIBRARIES})
+ endif()
+ find_package(X11 QUIET)
+ if(X11_FOUND)
+ list(APPEND WGVK_PLATFORM_DEFS SUPPORT_XLIB_SURFACE=1)
+ list(APPEND WGVK_PLATFORM_LIBS X11::X11)
+ endif()
+ list(APPEND WGVK_PLATFORM_LIBS m dl pthread)
+ endif()
+ set(LIBRARIES glfw Vulkan::Vulkan ${WGVK_PLATFORM_LIBS})
endif()
endif()
@@ -187,6 +209,7 @@ if(NOT EMSCRIPTEN) # WegGPU-Native settings
if(IMGUI_WGVK_DIR)
target_sources(${IMGUI_EXECUTABLE} PRIVATE ${IMGUI_WGVK_DIR}/src/wgvk.c)
target_compile_definitions(${IMGUI_EXECUTABLE} PUBLIC "IMGUI_IMPL_WEBGPU_BACKEND_WGVK")
+ target_compile_definitions(${IMGUI_EXECUTABLE} PRIVATE ${WGVK_PLATFORM_DEFS})
target_include_directories(${IMGUI_EXECUTABLE} PUBLIC ${IMGUI_WGVK_DIR}/include)
if (MSVC)
target_compile_options(${IMGUI_EXECUTABLE} PUBLIC /std:clatest /experimental:c11atomics)
diff --git a/include/imgui/examples/example_glut_opengl2/example_glut_opengl2.vcxproj b/include/imgui/examples/example_glut_opengl2/example_glut_opengl2.vcxproj
index c56452b..2e12665 100644
--- a/include/imgui/examples/example_glut_opengl2/example_glut_opengl2.vcxproj
+++ b/include/imgui/examples/example_glut_opengl2/example_glut_opengl2.vcxproj
@@ -28,27 +28,27 @@
Application
true
MultiByte
- v140
+ v141
Application
true
MultiByte
- v140
+ v141
Application
false
true
MultiByte
- v140
+ v141
Application
false
true
MultiByte
- v140
+ v141
diff --git a/include/imgui/examples/example_null/example_null.vcxproj b/include/imgui/examples/example_null/example_null.vcxproj
index 8ef991f..75fd43b 100644
--- a/include/imgui/examples/example_null/example_null.vcxproj
+++ b/include/imgui/examples/example_null/example_null.vcxproj
@@ -21,33 +21,34 @@
{1A0BF63C-18EF-4BAE-A8DA-055481B11F5D}
example_win32_directx11
+ 8.1
Application
true
Unicode
- v140
+ v141
Application
true
Unicode
- v140
+ v141
Application
false
true
Unicode
- v140
+ v141
Application
false
true
Unicode
- v140
+ v141
diff --git a/include/imgui/examples/example_sdl2_directx11/example_sdl2_directx11.vcxproj b/include/imgui/examples/example_sdl2_directx11/example_sdl2_directx11.vcxproj
index c23800c..2bcc709 100644
--- a/include/imgui/examples/example_sdl2_directx11/example_sdl2_directx11.vcxproj
+++ b/include/imgui/examples/example_sdl2_directx11/example_sdl2_directx11.vcxproj
@@ -29,27 +29,27 @@
Application
true
MultiByte
- v140
+ v141
Application
true
MultiByte
- v140
+ v141
Application
false
true
MultiByte
- v140
+ v141
Application
false
true
MultiByte
- v140
+ v141
diff --git a/include/imgui/examples/example_sdl2_opengl2/example_sdl2_opengl2.vcxproj b/include/imgui/examples/example_sdl2_opengl2/example_sdl2_opengl2.vcxproj
index 036463f..aca6edc 100644
--- a/include/imgui/examples/example_sdl2_opengl2/example_sdl2_opengl2.vcxproj
+++ b/include/imgui/examples/example_sdl2_opengl2/example_sdl2_opengl2.vcxproj
@@ -28,27 +28,27 @@
Application
true
MultiByte
- v140
+ v141
Application
true
MultiByte
- v140
+ v141
Application
false
true
MultiByte
- v140
+ v141
Application
false
true
MultiByte
- v140
+ v141
diff --git a/include/imgui/examples/example_sdl2_opengl3/example_sdl2_opengl3.vcxproj b/include/imgui/examples/example_sdl2_opengl3/example_sdl2_opengl3.vcxproj
index 6a81c67..d0cb96b 100644
--- a/include/imgui/examples/example_sdl2_opengl3/example_sdl2_opengl3.vcxproj
+++ b/include/imgui/examples/example_sdl2_opengl3/example_sdl2_opengl3.vcxproj
@@ -28,27 +28,27 @@
Application
true
MultiByte
- v140
+ v141
Application
true
MultiByte
- v140
+ v141
Application
false
true
MultiByte
- v140
+ v141
Application
false
true
MultiByte
- v140
+ v141
diff --git a/include/imgui/examples/example_sdl2_opengl3/main.cpp b/include/imgui/examples/example_sdl2_opengl3/main.cpp
index 1c51e59..f7c934f 100644
--- a/include/imgui/examples/example_sdl2_opengl3/main.cpp
+++ b/include/imgui/examples/example_sdl2_opengl3/main.cpp
@@ -39,31 +39,28 @@ int main(int, char**)
return 1;
}
- // Decide GL+GLSL versions
+ // Select GL version + let the backend select a GLSL version
+ const char* glsl_version = nullptr;
#if defined(IMGUI_IMPL_OPENGL_ES2)
// GL ES 2.0 + GLSL 100 (WebGL 1.0)
- const char* glsl_version = "#version 100";
SDL_GL_SetAttribute(SDL_GL_CONTEXT_FLAGS, 0);
SDL_GL_SetAttribute(SDL_GL_CONTEXT_PROFILE_MASK, SDL_GL_CONTEXT_PROFILE_ES);
SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 2);
SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 0);
#elif defined(IMGUI_IMPL_OPENGL_ES3)
// GL ES 3.0 + GLSL 300 es (WebGL 2.0)
- const char* glsl_version = "#version 300 es";
SDL_GL_SetAttribute(SDL_GL_CONTEXT_FLAGS, 0);
SDL_GL_SetAttribute(SDL_GL_CONTEXT_PROFILE_MASK, SDL_GL_CONTEXT_PROFILE_ES);
SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 3);
SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 0);
#elif defined(__APPLE__)
- // GL 3.2 Core + GLSL 150
- const char* glsl_version = "#version 150";
+ // GL 3.2 Core + generally GLSL 150
SDL_GL_SetAttribute(SDL_GL_CONTEXT_FLAGS, SDL_GL_CONTEXT_FORWARD_COMPATIBLE_FLAG); // Always required on Mac
SDL_GL_SetAttribute(SDL_GL_CONTEXT_PROFILE_MASK, SDL_GL_CONTEXT_PROFILE_CORE);
SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 3);
SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 2);
#else
- // GL 3.0 + GLSL 130
- const char* glsl_version = "#version 130";
+ // GL 3.0 + generally GLSL 130
SDL_GL_SetAttribute(SDL_GL_CONTEXT_FLAGS, 0);
SDL_GL_SetAttribute(SDL_GL_CONTEXT_PROFILE_MASK, SDL_GL_CONTEXT_PROFILE_CORE);
SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 3);
diff --git a/include/imgui/examples/example_sdl2_sdlrenderer2/example_sdl2_sdlrenderer2.vcxproj b/include/imgui/examples/example_sdl2_sdlrenderer2/example_sdl2_sdlrenderer2.vcxproj
index cf2c890..86b883a 100644
--- a/include/imgui/examples/example_sdl2_sdlrenderer2/example_sdl2_sdlrenderer2.vcxproj
+++ b/include/imgui/examples/example_sdl2_sdlrenderer2/example_sdl2_sdlrenderer2.vcxproj
@@ -29,27 +29,27 @@
Application
true
MultiByte
- v140
+ v141
Application
true
MultiByte
- v140
+ v141
Application
false
true
MultiByte
- v140
+ v141
Application
false
true
MultiByte
- v140
+ v141
@@ -184,4 +184,4 @@
-
+
\ No newline at end of file
diff --git a/include/imgui/examples/example_sdl2_vulkan/example_sdl2_vulkan.vcxproj b/include/imgui/examples/example_sdl2_vulkan/example_sdl2_vulkan.vcxproj
index bcf99a4..4bedc45 100644
--- a/include/imgui/examples/example_sdl2_vulkan/example_sdl2_vulkan.vcxproj
+++ b/include/imgui/examples/example_sdl2_vulkan/example_sdl2_vulkan.vcxproj
@@ -28,27 +28,27 @@
Application
true
MultiByte
- v140
+ v141
Application
true
MultiByte
- v140
+ v141
Application
false
true
MultiByte
- v140
+ v141
Application
false
true
MultiByte
- v140
+ v141
@@ -187,4 +187,4 @@
-
+
\ No newline at end of file
diff --git a/include/imgui/examples/example_sdl2_vulkan/main.cpp b/include/imgui/examples/example_sdl2_vulkan/main.cpp
index c8c2ae4..295f618 100644
--- a/include/imgui/examples/example_sdl2_vulkan/main.cpp
+++ b/include/imgui/examples/example_sdl2_vulkan/main.cpp
@@ -184,7 +184,8 @@ static void SetupVulkan(ImVector instance_extensions)
{
VkDescriptorPoolSize pool_sizes[] =
{
- { VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, IMGUI_IMPL_VULKAN_MINIMUM_IMAGE_SAMPLER_POOL_SIZE },
+ { VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE, IMGUI_IMPL_VULKAN_MINIMUM_SAMPLED_IMAGE_POOL_SIZE },
+ { VK_DESCRIPTOR_TYPE_SAMPLER, IMGUI_IMPL_VULKAN_MINIMUM_SAMPLER_POOL_SIZE },
};
VkDescriptorPoolCreateInfo pool_info = {};
pool_info.sType = VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_CREATE_INFO;
@@ -385,7 +386,7 @@ int main(int, char**)
// Create Framebuffers
int w, h;
- SDL_GetWindowSize(window, &w, &h);
+ SDL_GetWindowSizeInPixels(window, &w, &h);
ImGui_ImplVulkanH_Window* wd = &g_MainWindowData;
SetupVulkanWindow(wd, surface, w, h);
@@ -487,7 +488,7 @@ int main(int, char**)
// Resize swap chain?
int fb_width, fb_height;
- SDL_GetWindowSize(window, &fb_width, &fb_height);
+ SDL_GetWindowSizeInPixels(window, &fb_width, &fb_height);
if (fb_width > 0 && fb_height > 0 && (g_SwapChainRebuild || g_MainWindowData.Width != fb_width || g_MainWindowData.Height != fb_height))
{
ImGui_ImplVulkan_SetMinImageCount(g_MinImageCount);
diff --git a/include/imgui/examples/example_sdl2_wgpu/CMakeLists.txt b/include/imgui/examples/example_sdl2_wgpu/CMakeLists.txt
index 3bed79f..aff4a18 100644
--- a/include/imgui/examples/example_sdl2_wgpu/CMakeLists.txt
+++ b/include/imgui/examples/example_sdl2_wgpu/CMakeLists.txt
@@ -14,7 +14,7 @@
# * build/example_sdl2_wgpu[.exe] or build/Debug/example_sdl2_wgpu[.exe]
# Building for desktop with WGVK (MUCH EASIER)
-# 1. git clone https://github.com/manuel5975p/WGVK dawn
+# 1. git clone https://github.com/manuel5975p/WGVK wgvk
# 2. cmake -B build -DIMGUI_WGVK_DIR=wgvk
# 3. cmake --build build
# The resulting binary will be found at one of the following locations:
@@ -37,7 +37,7 @@ if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Debug CACHE STRING "" FORCE)
endif()
-set(CMAKE_CXX_STANDARD 17) # Dawn requires C++17
+set(CMAKE_CXX_STANDARD 10) # Dawn requires C++20
# Dear ImGui
set(IMGUI_DIR ../../)
@@ -141,6 +141,28 @@ else() # Native/Desktop build
endif()
if(IMGUI_WGVK_DIR)
+ find_package(Vulkan REQUIRED)
+ set(WGVK_PLATFORM_LIBS)
+ set(WGVK_PLATFORM_DEFS)
+ if(WIN32)
+ list(APPEND WGVK_PLATFORM_DEFS SUPPORT_WIN32_SURFACE=1)
+ elseif(APPLE)
+ list(APPEND WGVK_PLATFORM_DEFS SUPPORT_METAL_SURFACE=1)
+ elseif(UNIX)
+ find_package(PkgConfig QUIET)
+ pkg_check_modules(WAYLAND_CLIENT QUIET wayland-client)
+ if(WAYLAND_CLIENT_FOUND)
+ list(APPEND WGVK_PLATFORM_DEFS SUPPORT_WAYLAND_SURFACE=1)
+ list(APPEND WGVK_PLATFORM_LIBS ${WAYLAND_CLIENT_LIBRARIES})
+ endif()
+ find_package(X11 QUIET)
+ if(X11_FOUND)
+ list(APPEND WGVK_PLATFORM_DEFS SUPPORT_XLIB_SURFACE=1)
+ list(APPEND WGVK_PLATFORM_LIBS X11::X11)
+ endif()
+ list(APPEND WGVK_PLATFORM_LIBS m dl pthread)
+ endif()
+ set(LIBRARIES Vulkan::Vulkan ${WGVK_PLATFORM_LIBS})
endif()
endif()
@@ -183,6 +205,7 @@ if(NOT EMSCRIPTEN) # WegGPU-Native settings
if(IMGUI_WGVK_DIR)
target_sources(${IMGUI_EXECUTABLE} PRIVATE ${IMGUI_WGVK_DIR}/src/wgvk.c)
target_compile_definitions(${IMGUI_EXECUTABLE} PUBLIC "IMGUI_IMPL_WEBGPU_BACKEND_WGVK")
+ target_compile_definitions(${IMGUI_EXECUTABLE} PRIVATE ${WGVK_PLATFORM_DEFS})
target_include_directories(${IMGUI_EXECUTABLE} PUBLIC ${IMGUI_WGVK_DIR}/include)
if (MSVC)
target_compile_options(${IMGUI_EXECUTABLE} PUBLIC /std:clatest /experimental:c11atomics)
diff --git a/include/imgui/examples/example_sdl3_directx11/example_sdl3_directx11.vcxproj b/include/imgui/examples/example_sdl3_directx11/example_sdl3_directx11.vcxproj
index 340901c..f38d290 100644
--- a/include/imgui/examples/example_sdl3_directx11/example_sdl3_directx11.vcxproj
+++ b/include/imgui/examples/example_sdl3_directx11/example_sdl3_directx11.vcxproj
@@ -29,27 +29,27 @@
Application
true
MultiByte
- v140
+ v141
Application
true
MultiByte
- v140
+ v141
Application
false
true
MultiByte
- v140
+ v141
Application
false
true
MultiByte
- v140
+ v141
diff --git a/include/imgui/examples/example_sdl3_metal4/main.mm b/include/imgui/examples/example_sdl3_metal4/main.mm
new file mode 100644
index 0000000..1f0cb69
--- /dev/null
+++ b/include/imgui/examples/example_sdl3_metal4/main.mm
@@ -0,0 +1,258 @@
+// Dear ImGui: standalone example application for SDL3 + Metal 4
+// (SDL is a cross-platform general purpose library for handling windows, inputs, OpenGL/Vulkan/Metal graphics context creation, etc.)
+// (Metal 4 requires Apple Silicon and macOS 26+.)
+
+// Learn about Dear ImGui:
+// - FAQ https://dearimgui.com/faq
+// - Getting Started https://dearimgui.com/getting-started
+// - Documentation https://dearimgui.com/docs (same as your local docs/ folder).
+// - Introduction, links and more at the top of imgui.cpp
+
+#include "imgui.h"
+#include "imgui_impl_sdl3.h"
+#include "imgui_impl_metal4.h"
+#include // printf, fprintf
+#include
+
+#import
+#import
+
+#define FRAMES_IN_FLIGHT 3
+
+// Main code
+int main(int, char**)
+{
+ // Setup SDL
+ // [If using SDL_MAIN_USE_CALLBACKS: all code below until the main loop starts would likely be your SDL_AppInit() function]
+ if (!SDL_Init(SDL_INIT_VIDEO | SDL_INIT_GAMEPAD))
+ {
+ printf("Error: SDL_Init(): %s\n", SDL_GetError());
+ return 1;
+ }
+
+ // Create SDL window graphics context
+ float main_scale = SDL_GetDisplayContentScale(SDL_GetPrimaryDisplay());
+ SDL_WindowFlags window_flags = SDL_WINDOW_METAL | SDL_WINDOW_RESIZABLE | SDL_WINDOW_HIDDEN | SDL_WINDOW_HIGH_PIXEL_DENSITY;
+ SDL_Window* window = SDL_CreateWindow("Dear ImGui SDL3+Metal4 example", (int)(1280 * main_scale), (int)(800 * main_scale), window_flags);
+ if (window == nullptr)
+ {
+ printf("Error: SDL_CreateWindow(): %s\n", SDL_GetError());
+ return 1;
+ }
+ SDL_SetWindowPosition(window, SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED);
+ SDL_ShowWindow(window);
+
+ // Create Metal device _before_ creating the view/layer
+ id metalDevice = MTLCreateSystemDefaultDevice();
+ if (!metalDevice)
+ {
+ printf("Error: failed to create Metal device.\n");
+ SDL_DestroyWindow(window);
+ SDL_Quit();
+ return 1;
+ }
+ SDL_MetalView view = SDL_Metal_CreateView(window);
+ CAMetalLayer* layer = (__bridge CAMetalLayer*)SDL_Metal_GetLayer(view);
+ layer.device = metalDevice;
+ layer.pixelFormat = MTLPixelFormatBGRA8Unorm;
+
+ id commandQueue = [layer.device newMTL4CommandQueue];
+ id sharedEvent = [layer.device newSharedEvent];
+ MTL4RenderPassDescriptor* renderPassDescriptor = [MTL4RenderPassDescriptor new];
+
+ [commandQueue addResidencySet:layer.residencySet];
+
+ id commandBuffers[FRAMES_IN_FLIGHT];
+ id commandAllocators[FRAMES_IN_FLIGHT];
+ for (int i = 0; i < FRAMES_IN_FLIGHT; i++)
+ {
+ commandAllocators[i] = [layer.device newCommandAllocator];
+ commandBuffers[i] = [layer.device newCommandBuffer];
+ }
+ uint32_t frameIndex = 0;
+ uint32_t frameInFlight = 0;
+
+ // Setup Dear ImGui context
+ IMGUI_CHECKVERSION();
+ ImGui::CreateContext();
+ ImGuiIO& io = ImGui::GetIO(); (void)io;
+ io.ConfigFlags |= ImGuiConfigFlags_NavEnableKeyboard; // Enable Keyboard Controls
+ io.ConfigFlags |= ImGuiConfigFlags_NavEnableGamepad; // Enable Gamepad Controls
+ io.ConfigFlags |= ImGuiConfigFlags_DockingEnable; // Enable Docking
+ io.ConfigFlags |= ImGuiConfigFlags_ViewportsEnable; // Enable Multi-Viewport / Platform Windows
+
+
+ // Setup Dear ImGui style
+ ImGui::StyleColorsDark();
+ //ImGui::StyleColorsLight();
+
+ // When viewports are enabled we tweak WindowRounding/WindowBg so platform windows can look identical to regular ones.
+ ImGuiStyle& style = ImGui::GetStyle();
+ if (io.ConfigFlags & ImGuiConfigFlags_ViewportsEnable)
+ {
+ style.WindowRounding = 0.0f;
+ style.Colors[ImGuiCol_WindowBg].w = 1.0f;
+ }
+
+ // Setup scaling
+ style.ScaleAllSizes(main_scale); // Bake a fixed style scale. (until we have a solution for dynamic style scaling, changing this requires resetting Style + calling this again)
+ style.FontScaleDpi = main_scale; // Set initial font scale. (in docking branch: using io.ConfigDpiScaleFonts=true automatically overrides this for every window depending on the current monitor)
+
+ // Setup Platform/Renderer backends
+ ImGui_ImplMetal4_Init(layer.device, commandQueue, FRAMES_IN_FLIGHT);
+ ImGui_ImplSDL3_InitForMetal(window);
+
+ // Load Fonts
+ // - If fonts are not explicitly loaded, Dear ImGui will select an embedded font: either AddFontDefaultVector() or AddFontDefaultBitmap().
+ // This selection is based on (style.FontSizeBase * style.FontScaleMain * style.FontScaleDpi) reaching a small threshold.
+ // - You can load multiple fonts and use ImGui::PushFont()/PopFont() to select them.
+ // - If a file cannot be loaded, AddFont functions will return a nullptr. Please handle those errors in your code (e.g. use an assertion, display an error and quit).
+ // - Read 'docs/FONTS.md' for more instructions and details.
+ // - Use '#define IMGUI_ENABLE_FREETYPE' in your imconfig file to use FreeType for higher quality font rendering.
+ // - Remember that in C/C++ if you want to include a backslash \ in a string literal you need to write a double backslash \\ !
+ //style.FontSizeBase = 20.0f;
+ //io.Fonts->AddFontDefaultVector();
+ //io.Fonts->AddFontDefaultBitmap();
+ //io.Fonts->AddFontFromFileTTF("c:\\Windows\\Fonts\\segoeui.ttf");
+ //io.Fonts->AddFontFromFileTTF("../../misc/fonts/DroidSans.ttf");
+ //io.Fonts->AddFontFromFileTTF("../../misc/fonts/Roboto-Medium.ttf");
+ //io.Fonts->AddFontFromFileTTF("../../misc/fonts/Cousine-Regular.ttf");
+ //ImFont* font = io.Fonts->AddFontFromFileTTF("c:\\Windows\\Fonts\\ArialUni.ttf");
+ //IM_ASSERT(font != nullptr);
+
+ // Our state
+ bool show_demo_window = true;
+ bool show_another_window = false;
+ float clear_color[4] = { 0.45f, 0.55f, 0.60f, 1.00f };
+
+ // Main loop
+ bool done = false;
+ while (!done)
+ {
+ @autoreleasepool
+ {
+ // Poll and handle events (inputs, window resize, etc.)
+ // You can read the io.WantCaptureMouse, io.WantCaptureKeyboard flags to tell if dear imgui wants to use your inputs.
+ // - When io.WantCaptureMouse is true, do not dispatch mouse input data to your main application, or clear/overwrite your copy of the mouse data.
+ // - When io.WantCaptureKeyboard is true, do not dispatch keyboard input data to your main application, or clear/overwrite your copy of the keyboard data.
+ // Generally you may always pass all inputs to dear imgui, and hide them from your application based on those two flags.
+ // [If using SDL_MAIN_USE_CALLBACKS: call ImGui_ImplSDL3_ProcessEvent() from your SDL_AppEvent() function]
+ SDL_Event event;
+ while (SDL_PollEvent(&event))
+ {
+ ImGui_ImplSDL3_ProcessEvent(&event);
+ if (event.type == SDL_EVENT_QUIT)
+ done = true;
+ if (event.type == SDL_EVENT_WINDOW_CLOSE_REQUESTED && event.window.windowID == SDL_GetWindowID(window))
+ done = true;
+ }
+
+ // [If using SDL_MAIN_USE_CALLBACKS: all code below would likely be your SDL_AppIterate() function]
+ if (SDL_GetWindowFlags(window) & SDL_WINDOW_MINIMIZED)
+ {
+ SDL_Delay(10);
+ continue;
+ }
+
+ int width, height;
+ SDL_GetWindowSizeInPixels(window, &width, &height);
+
+ layer.drawableSize = CGSizeMake(width, height);
+ id drawable = [layer nextDrawable];
+
+ uint64_t waitValue = (frameIndex >= FRAMES_IN_FLIGHT) ? (frameIndex - FRAMES_IN_FLIGHT + 1) : 0;
+ [sharedEvent waitUntilSignaledValue:waitValue timeoutMS:1000];
+ [commandAllocators[frameInFlight] reset];
+ [commandBuffers[frameInFlight] beginCommandBufferWithAllocator:commandAllocators[frameInFlight]];
+
+ renderPassDescriptor.colorAttachments[0].clearColor = MTLClearColorMake(clear_color[0] * clear_color[3], clear_color[1] * clear_color[3], clear_color[2] * clear_color[3], clear_color[3]);
+ renderPassDescriptor.colorAttachments[0].texture = drawable.texture;
+ renderPassDescriptor.colorAttachments[0].loadAction = MTLLoadActionClear;
+ renderPassDescriptor.colorAttachments[0].storeAction = MTLStoreActionStore;
+ id renderEncoder = [commandBuffers[frameInFlight] renderCommandEncoderWithDescriptor:renderPassDescriptor];
+ [renderEncoder pushDebugGroup:@"ImGui demo"];
+
+ // Start the Dear ImGui frame
+ ImGui_ImplMetal4_NewFrame(renderPassDescriptor, frameInFlight);
+ ImGui_ImplSDL3_NewFrame();
+ ImGui::NewFrame();
+
+ // 1. Show the big demo window (Most of the sample code is in ImGui::ShowDemoWindow()! You can browse its code to learn more about Dear ImGui!).
+ if (show_demo_window)
+ ImGui::ShowDemoWindow(&show_demo_window);
+
+ // 2. Show a simple window that we create ourselves. We use a Begin/End pair to create a named window.
+ {
+ static float f = 0.0f;
+ static int counter = 0;
+
+ ImGui::Begin("Hello, world!"); // Create a window called "Hello, world!" and append into it.
+
+ ImGui::Text("This is some useful text."); // Display some text (you can use a format strings too)
+ ImGui::Checkbox("Demo Window", &show_demo_window); // Edit bools storing our window open/close state
+ ImGui::Checkbox("Another Window", &show_another_window);
+
+ ImGui::SliderFloat("float", &f, 0.0f, 1.0f); // Edit 1 float using a slider from 0.0f to 1.0f
+ ImGui::ColorEdit3("clear color", (float*)&clear_color); // Edit 3 floats representing a color
+
+ if (ImGui::Button("Button")) // Buttons return true when clicked (most widgets return true when edited/activated)
+ counter++;
+ ImGui::SameLine();
+ ImGui::Text("counter = %d", counter);
+
+ ImGui::Text("Application average %.3f ms/frame (%.1f FPS)", 1000.0f / io.Framerate, io.Framerate);
+ ImGui::End();
+ }
+
+ // 3. Show another simple window.
+ if (show_another_window)
+ {
+ ImGui::Begin("Another Window", &show_another_window); // Pass a pointer to our bool variable (the window will have a closing button that will clear the bool when clicked)
+ ImGui::Text("Hello from another window!");
+ if (ImGui::Button("Close Me"))
+ show_another_window = false;
+ ImGui::End();
+ }
+
+ // Rendering
+ ImGui::Render();
+ ImDrawData* draw_data = ImGui::GetDrawData();
+ ImGui_ImplMetal4_RenderDrawData(draw_data, commandBuffers[frameInFlight], renderEncoder);
+
+ [renderEncoder popDebugGroup];
+ [renderEncoder endEncoding];
+ [commandBuffers[frameInFlight] endCommandBuffer];
+
+ id to_commit[] = { commandBuffers[frameInFlight] };
+
+ [commandQueue waitForDrawable:drawable];
+ [commandQueue commit:to_commit count:1];
+
+ [commandQueue signalEvent:sharedEvent value:frameIndex + 1];
+ [commandQueue signalDrawable:drawable];
+ [drawable present];
+
+
+ // Update and Render additional Platform Windows
+ if (io.ConfigFlags & ImGuiConfigFlags_ViewportsEnable)
+ {
+ ImGui::UpdatePlatformWindows();
+ ImGui::RenderPlatformWindowsDefault();
+ }
+
+ frameIndex++;
+ frameInFlight = (frameInFlight + 1) % FRAMES_IN_FLIGHT;
+ }
+ }
+
+ // Cleanup
+ // [If using SDL_MAIN_USE_CALLBACKS: all code below would likely be your SDL_AppQuit() function]
+ ImGui_ImplMetal4_Shutdown();
+ ImGui_ImplSDL3_Shutdown();
+ ImGui::DestroyContext();
+
+ SDL_DestroyWindow(window);
+ SDL_Quit();
+
+ return 0;
+}
diff --git a/include/imgui/examples/example_sdl3_opengl3/example_sdl3_opengl3.vcxproj b/include/imgui/examples/example_sdl3_opengl3/example_sdl3_opengl3.vcxproj
index 051f87d..c470f88 100644
--- a/include/imgui/examples/example_sdl3_opengl3/example_sdl3_opengl3.vcxproj
+++ b/include/imgui/examples/example_sdl3_opengl3/example_sdl3_opengl3.vcxproj
@@ -28,27 +28,27 @@
Application
true
MultiByte
- v140
+ v141
Application
true
MultiByte
- v140
+ v141
Application
false
true
MultiByte
- v140
+ v141
Application
false
true
MultiByte
- v140
+ v141
diff --git a/include/imgui/examples/example_sdl3_opengl3/main.cpp b/include/imgui/examples/example_sdl3_opengl3/main.cpp
index 07f0cd0..6900f34 100644
--- a/include/imgui/examples/example_sdl3_opengl3/main.cpp
+++ b/include/imgui/examples/example_sdl3_opengl3/main.cpp
@@ -33,31 +33,28 @@ int main(int, char**)
return 1;
}
- // Decide GL+GLSL versions
+ // Select GL version + let the backend select a GLSL version
+ const char* glsl_version = nullptr;
#if defined(IMGUI_IMPL_OPENGL_ES2)
// GL ES 2.0 + GLSL 100 (WebGL 1.0)
- const char* glsl_version = "#version 100";
SDL_GL_SetAttribute(SDL_GL_CONTEXT_FLAGS, 0);
SDL_GL_SetAttribute(SDL_GL_CONTEXT_PROFILE_MASK, SDL_GL_CONTEXT_PROFILE_ES);
SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 2);
SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 0);
#elif defined(IMGUI_IMPL_OPENGL_ES3)
// GL ES 3.0 + GLSL 300 es (WebGL 2.0)
- const char* glsl_version = "#version 300 es";
SDL_GL_SetAttribute(SDL_GL_CONTEXT_FLAGS, 0);
SDL_GL_SetAttribute(SDL_GL_CONTEXT_PROFILE_MASK, SDL_GL_CONTEXT_PROFILE_ES);
SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 3);
SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 0);
#elif defined(__APPLE__)
- // GL 3.2 Core + GLSL 150
- const char* glsl_version = "#version 150";
+ // GL 3.2 Core + generally GLSL 150
SDL_GL_SetAttribute(SDL_GL_CONTEXT_FLAGS, SDL_GL_CONTEXT_FORWARD_COMPATIBLE_FLAG); // Always required on Mac
SDL_GL_SetAttribute(SDL_GL_CONTEXT_PROFILE_MASK, SDL_GL_CONTEXT_PROFILE_CORE);
SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 3);
SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 2);
#else
- // GL 3.0 + GLSL 130
- const char* glsl_version = "#version 130";
+ // GL 3.0 + generally GLSL 130
SDL_GL_SetAttribute(SDL_GL_CONTEXT_FLAGS, 0);
SDL_GL_SetAttribute(SDL_GL_CONTEXT_PROFILE_MASK, SDL_GL_CONTEXT_PROFILE_CORE);
SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 3);
diff --git a/include/imgui/examples/example_sdl3_sdlgpu3/example_sdl3_sdlgpu3.vcxproj b/include/imgui/examples/example_sdl3_sdlgpu3/example_sdl3_sdlgpu3.vcxproj
index 3d034f5..02b0d35 100644
--- a/include/imgui/examples/example_sdl3_sdlgpu3/example_sdl3_sdlgpu3.vcxproj
+++ b/include/imgui/examples/example_sdl3_sdlgpu3/example_sdl3_sdlgpu3.vcxproj
@@ -28,27 +28,27 @@
Application
true
MultiByte
- v140
+ v141
Application
true
MultiByte
- v140
+ v141
Application
false
true
MultiByte
- v140
+ v141
Application
false
true
MultiByte
- v140
+ v141
@@ -186,4 +186,4 @@
-
+
\ No newline at end of file
diff --git a/include/imgui/examples/example_sdl3_sdlrenderer3/example_sdl3_sdlrenderer3.vcxproj b/include/imgui/examples/example_sdl3_sdlrenderer3/example_sdl3_sdlrenderer3.vcxproj
index 8b71324..f420145 100644
--- a/include/imgui/examples/example_sdl3_sdlrenderer3/example_sdl3_sdlrenderer3.vcxproj
+++ b/include/imgui/examples/example_sdl3_sdlrenderer3/example_sdl3_sdlrenderer3.vcxproj
@@ -28,27 +28,27 @@
Application
true
MultiByte
- v140
+ v141
Application
true
MultiByte
- v140
+ v141
Application
false
true
MultiByte
- v140
+ v141
Application
false
true
MultiByte
- v140
+ v141
diff --git a/include/imgui/examples/example_sdl3_vulkan/example_sdl3_vulkan.vcxproj b/include/imgui/examples/example_sdl3_vulkan/example_sdl3_vulkan.vcxproj
index d48e4af..af11447 100644
--- a/include/imgui/examples/example_sdl3_vulkan/example_sdl3_vulkan.vcxproj
+++ b/include/imgui/examples/example_sdl3_vulkan/example_sdl3_vulkan.vcxproj
@@ -28,27 +28,27 @@
Application
true
MultiByte
- v140
+ v141
Application
true
MultiByte
- v140
+ v141
Application
false
true
MultiByte
- v140
+ v141
Application
false
true
MultiByte
- v140
+ v141
diff --git a/include/imgui/examples/example_sdl3_vulkan/main.cpp b/include/imgui/examples/example_sdl3_vulkan/main.cpp
index bae033d..b992a99 100644
--- a/include/imgui/examples/example_sdl3_vulkan/main.cpp
+++ b/include/imgui/examples/example_sdl3_vulkan/main.cpp
@@ -186,7 +186,8 @@ static void SetupVulkan(ImVector instance_extensions)
{
VkDescriptorPoolSize pool_sizes[] =
{
- { VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, IMGUI_IMPL_VULKAN_MINIMUM_IMAGE_SAMPLER_POOL_SIZE },
+ { VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE, IMGUI_IMPL_VULKAN_MINIMUM_SAMPLED_IMAGE_POOL_SIZE },
+ { VK_DESCRIPTOR_TYPE_SAMPLER, IMGUI_IMPL_VULKAN_MINIMUM_SAMPLER_POOL_SIZE },
};
VkDescriptorPoolCreateInfo pool_info = {};
pool_info.sType = VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_CREATE_INFO;
@@ -382,7 +383,7 @@ int main(int, char**)
// Create Framebuffers
int w, h;
- SDL_GetWindowSize(window, &w, &h);
+ SDL_GetWindowSizeInPixels(window, &w, &h);
ImGui_ImplVulkanH_Window* wd = &g_MainWindowData;
SetupVulkanWindow(wd, surface, w, h);
SDL_SetWindowPosition(window, SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED);
@@ -489,7 +490,7 @@ int main(int, char**)
// Resize swap chain?
int fb_width, fb_height;
- SDL_GetWindowSize(window, &fb_width, &fb_height);
+ SDL_GetWindowSizeInPixels(window, &fb_width, &fb_height);
if (fb_width > 0 && fb_height > 0 && (g_SwapChainRebuild || g_MainWindowData.Width != fb_width || g_MainWindowData.Height != fb_height))
{
ImGui_ImplVulkan_SetMinImageCount(g_MinImageCount);
diff --git a/include/imgui/examples/example_sdl3_wgpu/CMakeLists.txt b/include/imgui/examples/example_sdl3_wgpu/CMakeLists.txt
index 85de861..b7b0588 100644
--- a/include/imgui/examples/example_sdl3_wgpu/CMakeLists.txt
+++ b/include/imgui/examples/example_sdl3_wgpu/CMakeLists.txt
@@ -14,7 +14,7 @@
# * build/example_sdl3_wgpu[.exe] or build/Debug/example_sdl3_wgpu[.exe]
# Building for desktop with WGVK (MUCH EASIER)
-# 1. git clone https://github.com/manuel5975p/WGVK dawn
+# 1. git clone https://github.com/manuel5975p/WGVK wgvk
# 2. cmake -B build -DIMGUI_WGVK_DIR=wgvk
# 3. cmake --build build
# The resulting binary will be found at one of the following locations:
@@ -37,7 +37,7 @@ if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Debug CACHE STRING "" FORCE)
endif()
-set(CMAKE_CXX_STANDARD 17) # Dawn requires C++17
+set(CMAKE_CXX_STANDARD 20) # Dawn requires C++20
# Dear ImGui
set(IMGUI_DIR ../../)
@@ -141,6 +141,28 @@ else() # Native/Desktop build
endif()
if(IMGUI_WGVK_DIR)
+ find_package(Vulkan REQUIRED)
+ set(WGVK_PLATFORM_LIBS)
+ set(WGVK_PLATFORM_DEFS)
+ if(WIN32)
+ list(APPEND WGVK_PLATFORM_DEFS SUPPORT_WIN32_SURFACE=1)
+ elseif(APPLE)
+ list(APPEND WGVK_PLATFORM_DEFS SUPPORT_METAL_SURFACE=1)
+ elseif(UNIX)
+ find_package(PkgConfig QUIET)
+ pkg_check_modules(WAYLAND_CLIENT QUIET wayland-client)
+ if(WAYLAND_CLIENT_FOUND)
+ list(APPEND WGVK_PLATFORM_DEFS SUPPORT_WAYLAND_SURFACE=1)
+ list(APPEND WGVK_PLATFORM_LIBS ${WAYLAND_CLIENT_LIBRARIES})
+ endif()
+ find_package(X11 QUIET)
+ if(X11_FOUND)
+ list(APPEND WGVK_PLATFORM_DEFS SUPPORT_XLIB_SURFACE=1)
+ list(APPEND WGVK_PLATFORM_LIBS X11::X11)
+ endif()
+ list(APPEND WGVK_PLATFORM_LIBS m dl pthread)
+ endif()
+ set(LIBRARIES Vulkan::Vulkan ${WGVK_PLATFORM_LIBS})
endif()
endif()
@@ -182,6 +204,7 @@ if(NOT EMSCRIPTEN) # WegGPU-Native settings
if(IMGUI_WGVK_DIR)
target_sources(${IMGUI_EXECUTABLE} PRIVATE ${IMGUI_WGVK_DIR}/src/wgvk.c)
target_compile_definitions(${IMGUI_EXECUTABLE} PUBLIC "IMGUI_IMPL_WEBGPU_BACKEND_WGVK")
+ target_compile_definitions(${IMGUI_EXECUTABLE} PRIVATE ${WGVK_PLATFORM_DEFS})
target_include_directories(${IMGUI_EXECUTABLE} PUBLIC ${IMGUI_WGVK_DIR}/include)
if (MSVC)
target_compile_options(${IMGUI_EXECUTABLE} PUBLIC /std:clatest /experimental:c11atomics)
diff --git a/include/imgui/examples/example_sdl3_wgpu/main.cpp b/include/imgui/examples/example_sdl3_wgpu/main.cpp
index 4aee4ef..bc17878 100644
--- a/include/imgui/examples/example_sdl3_wgpu/main.cpp
+++ b/include/imgui/examples/example_sdl3_wgpu/main.cpp
@@ -155,7 +155,7 @@ int main(int, char**)
// [If using SDL_MAIN_USE_CALLBACKS: all code below would likely be your SDL_AppIterate() function]
// React to changes in screen size
int width, height;
- SDL_GetWindowSize(window, &width, &height);
+ SDL_GetWindowSizeInPixels(window, &width, &height);
if (width != wgpu_surface_width || height != wgpu_surface_height)
ResizeSurface(width, height);
diff --git a/include/imgui/examples/example_win32_directx10/example_win32_directx10.vcxproj b/include/imgui/examples/example_win32_directx10/example_win32_directx10.vcxproj
index d11aed8..7fb7677 100644
--- a/include/imgui/examples/example_win32_directx10/example_win32_directx10.vcxproj
+++ b/include/imgui/examples/example_win32_directx10/example_win32_directx10.vcxproj
@@ -28,27 +28,27 @@
Application
true
Unicode
- v140
+ v141
Application
true
Unicode
- v140
+ v141
Application
false
true
Unicode
- v140
+ v141
Application
false
true
Unicode
- v140
+ v141
diff --git a/include/imgui/examples/example_win32_directx11/example_win32_directx11.vcxproj b/include/imgui/examples/example_win32_directx11/example_win32_directx11.vcxproj
index bace6a2..9e89353 100644
--- a/include/imgui/examples/example_win32_directx11/example_win32_directx11.vcxproj
+++ b/include/imgui/examples/example_win32_directx11/example_win32_directx11.vcxproj
@@ -21,33 +21,34 @@
{9F316E83-5AE5-4939-A723-305A94F48005}
example_win32_directx11
+ 8.1
Application
true
Unicode
- v140
+ v141
Application
true
Unicode
- v140
+ v141
Application
false
true
Unicode
- v140
+ v141
Application
false
true
Unicode
- v140
+ v141
diff --git a/include/imgui/examples/example_win32_directx9/example_win32_directx9.vcxproj b/include/imgui/examples/example_win32_directx9/example_win32_directx9.vcxproj
index 8c3f995..c5efda3 100644
--- a/include/imgui/examples/example_win32_directx9/example_win32_directx9.vcxproj
+++ b/include/imgui/examples/example_win32_directx9/example_win32_directx9.vcxproj
@@ -28,27 +28,27 @@
Application
true
Unicode
- v140
+ v141
Application
true
Unicode
- v140
+ v141
Application
false
true
Unicode
- v140
+ v141
Application
false
true
Unicode
- v140
+ v141
diff --git a/include/imgui/examples/example_win32_opengl3/example_win32_opengl3.vcxproj b/include/imgui/examples/example_win32_opengl3/example_win32_opengl3.vcxproj
index 98fc38f..b9b4267 100644
--- a/include/imgui/examples/example_win32_opengl3/example_win32_opengl3.vcxproj
+++ b/include/imgui/examples/example_win32_opengl3/example_win32_opengl3.vcxproj
@@ -28,27 +28,27 @@
Application
true
Unicode
- v140
+ v141
Application
true
Unicode
- v140
+ v141
Application
false
true
Unicode
- v140
+ v141
Application
false
true
Unicode
- v140
+ v141
diff --git a/include/imgui/examples/example_win32_opengl3/main.cpp b/include/imgui/examples/example_win32_opengl3/main.cpp
index ee77ee2..7652fa8 100644
--- a/include/imgui/examples/example_win32_opengl3/main.cpp
+++ b/include/imgui/examples/example_win32_opengl3/main.cpp
@@ -17,12 +17,13 @@
#include
#include
#include
+#include
// Data stored per platform window
struct WGL_WindowData { HDC hDC; };
// Data
-static HGLRC g_hRC;
+static HGLRC g_hRC; // Rendering context
static WGL_WindowData g_MainWindow;
static int g_Width;
static int g_Height;
@@ -279,8 +280,57 @@ bool CreateDeviceWGL(HWND hWnd, WGL_WindowData* data)
::ReleaseDC(hWnd, hDc);
data->hDC = ::GetDC(hWnd);
- if (!g_hRC)
- g_hRC = wglCreateContext(data->hDC);
+ if (g_hRC)
+ return true;
+
+ // Create legacy context
+ HGLRC tempRC = wglCreateContext(data->hDC);
+ if (!tempRC) { ::ReleaseDC(hWnd, data->hDC); return false; }
+ if (!wglMakeCurrent(data->hDC, tempRC))
+ {
+ wglDeleteContext(tempRC);
+ ::ReleaseDC(hWnd, data->hDC);
+ return false;
+ }
+
+ // Get context version
+ GLint major = 0, minor = 0;
+ glGetIntegerv(0x821B, &major); // GL_MAJOR_VERSION
+ glGetIntegerv(0x821C, &minor); // GL_MINOR_VERSION
+ const char* gl_version_str = (const char*)glGetString(GL_VERSION);
+ if (major == 0 && minor == 0)
+ sscanf_s(gl_version_str, "%d.%d", &major, &minor); // Query GL_VERSION in desktop GL 2.x, the string will start with "."
+ const GLuint gl_version = (GLuint)(major * 100 + minor * 10);
+
+ // Keep temporary context: already OpenGL 3.0+.
+ g_hRC = tempRC;
+ if (gl_version >= 300)
+ return true;
+
+ typedef HGLRC(WINAPI* PFNWGLCREATECONTEXTATTRIBSARBPROC)(HDC, HGLRC, const int*);
+ const PFNWGLCREATECONTEXTATTRIBSARBPROC wglCreateContextAttribsARB = (PFNWGLCREATECONTEXTATTRIBSARBPROC)wglGetProcAddress("wglCreateContextAttribsARB");
+
+ // GL 3.0
+ const int attribs[] =
+ {
+ 0x2091, 3, // WGL_CONTEXT_MAJOR_VERSION_ARB
+ 0x2092, 0, // WGL_CONTEXT_MINOR_VERSION_ARB
+ 0x9126, 0x0001, // WGL_CONTEXT_PROFILE_MASK_ARB, WGL_CONTEXT_CORE_PROFILE_BIT_ARB
+ 0
+ };
+ HGLRC newRC = nullptr;
+ if (wglCreateContextAttribsARB)
+ newRC = wglCreateContextAttribsARB(data->hDC, 0, attribs);
+
+ // If we managed to create 3.0+ context: use that one and destroy the temporary OpenGL 2.x compatibility context.
+ if (newRC)
+ {
+ wglMakeCurrent(nullptr, nullptr);
+ wglDeleteContext(tempRC);
+ g_hRC = newRC;
+ wglMakeCurrent(data->hDC, g_hRC);
+ }
+
return true;
}
diff --git a/include/imgui/examples/example_win32_vulkan/example_win32_vulkan.vcxproj b/include/imgui/examples/example_win32_vulkan/example_win32_vulkan.vcxproj
index dab8afd..f3ba4aa 100644
--- a/include/imgui/examples/example_win32_vulkan/example_win32_vulkan.vcxproj
+++ b/include/imgui/examples/example_win32_vulkan/example_win32_vulkan.vcxproj
@@ -21,33 +21,34 @@
{0A1E32DF-E0F4-4CCE-B3DC-9644C503BD88}
example_win32_directx11
+ 8.1
Application
true
Unicode
- v140
+ v141
Application
true
Unicode
- v140
+ v141
Application
false
true
Unicode
- v140
+ v141
Application
false
true
Unicode
- v140
+ v141
diff --git a/include/imgui/examples/example_win32_vulkan/main.cpp b/include/imgui/examples/example_win32_vulkan/main.cpp
index eaaa67e..6f0b1f9 100644
--- a/include/imgui/examples/example_win32_vulkan/main.cpp
+++ b/include/imgui/examples/example_win32_vulkan/main.cpp
@@ -182,7 +182,8 @@ static void SetupVulkan(ImVector instance_extensions)
{
VkDescriptorPoolSize pool_sizes[] =
{
- { VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, IMGUI_IMPL_VULKAN_MINIMUM_IMAGE_SAMPLER_POOL_SIZE },
+ { VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE, IMGUI_IMPL_VULKAN_MINIMUM_SAMPLED_IMAGE_POOL_SIZE },
+ { VK_DESCRIPTOR_TYPE_SAMPLER, IMGUI_IMPL_VULKAN_MINIMUM_SAMPLER_POOL_SIZE },
};
VkDescriptorPoolCreateInfo pool_info = {};
pool_info.sType = VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_CREATE_INFO;
diff --git a/include/imgui/examples/imgui_examples.sln b/include/imgui/examples/imgui_examples.sln
index 96087ae..3deffd1 100644
--- a/include/imgui/examples/imgui_examples.sln
+++ b/include/imgui/examples/imgui_examples.sln
@@ -3,12 +3,12 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.2.32616.157
MinimumVisualStudioVersion = 10.0.40219.1
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "example_win32_directx11", "example_win32_directx11\example_win32_directx11.vcxproj", "{9F316E83-5AE5-4939-A723-305A94F48005}"
+EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "example_win32_directx9", "example_win32_directx9\example_win32_directx9.vcxproj", "{4165A294-21F2-44CA-9B38-E3F935ABADF5}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "example_win32_directx10", "example_win32_directx10\example_win32_directx10.vcxproj", "{345A953E-A004-4648-B442-DC5F9F11068C}"
EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "example_win32_directx11", "example_win32_directx11\example_win32_directx11.vcxproj", "{9F316E83-5AE5-4939-A723-305A94F48005}"
-EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "example_win32_directx12", "example_win32_directx12\example_win32_directx12.vcxproj", "{B4CF9797-519D-4AFE-A8F4-5141A6B521D3}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "example_glfw_opengl2", "example_glfw_opengl2\example_glfw_opengl2.vcxproj", "{9CDA7840-B7A5-496D-A527-E95571496D18}"
diff --git a/include/imgui/imconfig.h b/include/imgui/imconfig.h
index 0d843be..b40db38 100644
--- a/include/imgui/imconfig.h
+++ b/include/imgui/imconfig.h
@@ -43,17 +43,20 @@
//#define IMGUI_DISABLE_WIN32_DEFAULT_IME_FUNCTIONS // [Win32] [Default with non-Visual Studio compilers] Don't implement default IME handler (won't require imm32.lib/.a)
//#define IMGUI_DISABLE_WIN32_FUNCTIONS // [Win32] Won't use and link with any Win32 function (clipboard, IME).
//#define IMGUI_ENABLE_OSX_DEFAULT_CLIPBOARD_FUNCTIONS // [OSX] Implement default OSX clipboard handler (need to link with '-framework ApplicationServices', this is why this is not the default).
+//#define IMGUI_DISABLE_TIME_FUNCTIONS // Don't setup default platform_io.Platform_SessionDate value using time(), localtime_r().
//#define IMGUI_DISABLE_DEFAULT_SHELL_FUNCTIONS // Don't implement default platform_io.Platform_OpenInShellFn() handler (Win32: ShellExecute(), require shell32.lib/.a, Mac/Linux: use system("")).
//#define IMGUI_DISABLE_DEFAULT_FORMAT_FUNCTIONS // Don't implement ImFormatString/ImFormatStringV so you can implement them yourself (e.g. if you don't want to link with vsnprintf)
//#define IMGUI_DISABLE_DEFAULT_MATH_FUNCTIONS // Don't implement ImFabs/ImSqrt/ImPow/ImFmod/ImCos/ImSin/ImAcos/ImAtan2 so you can implement them yourself.
//#define IMGUI_DISABLE_FILE_FUNCTIONS // Don't implement ImFileOpen/ImFileClose/ImFileRead/ImFileWrite and ImFileHandle at all (replace them with dummies)
//#define IMGUI_DISABLE_DEFAULT_FILE_FUNCTIONS // Don't implement ImFileOpen/ImFileClose/ImFileRead/ImFileWrite and ImFileHandle so you can implement them yourself if you don't want to link with fopen/fclose/fread/fwrite. This will also disable the LogToTTY() function.
//#define IMGUI_DISABLE_DEFAULT_ALLOCATORS // Don't implement default allocators calling malloc()/free() to avoid linking with them. You will need to call ImGui::SetAllocatorFunctions().
-//#define IMGUI_DISABLE_DEFAULT_FONT // Disable default embedded fonts (ProggyClean/ProggyForever), remove ~9 KB + ~14 KB from output binary. AddFontDefaultXXX() functions will assert.
+//#define IMGUI_DISABLE_DEFAULT_FONT // Disable default embedded fonts (ProggyClean + ProggyForever). Remove ~9 KB + ~14 KB from output binary. AddFontDefaultXXX() functions will assert.
+//#define IMGUI_DISABLE_DEFAULT_FONT_BITMAP // Disable default embedded bitmap font (ProggyClean). Remove ~9 KB from output binary. AddFontDefaultBitmap() will assert.
+//#define IMGUI_DISABLE_DEFAULT_FONT_VECTOR // Disable default embedded vector font (ProggyForever), Remove ~14 KB from output binary. AddFontDefaultVector() will assert.
//#define IMGUI_DISABLE_SSE // Disable use of SSE intrinsics even if available
//---- Enable Test Engine / Automation features.
-//#define IMGUI_ENABLE_TEST_ENGINE // Enable imgui_test_engine hooks. Generally set automatically by include "imgui_te_config.h", see Test Engine for details.
+//#define IMGUI_ENABLE_TEST_ENGINE // Enable imgui_test_engine hooks. Generally set automatically by include "imgui_te_imconfig.h", see Test Engine for details.
//---- Include imgui_user.h at the end of imgui.h as a convenience
// May be convenient for some users to only explicitly include vanilla imgui.h and have extra stuff included.
diff --git a/include/imgui/imgui.cpp b/include/imgui/imgui.cpp
index 306ca57..a943bcc 100644
--- a/include/imgui/imgui.cpp
+++ b/include/imgui/imgui.cpp
@@ -1,4 +1,4 @@
-// dear imgui, v1.92.7
+// dear imgui, v1.92.9b
// (main code and documentation)
// Help:
@@ -32,7 +32,7 @@
// See LICENSE.txt for copyright and licensing details (standard MIT License).
// This library is free but needs your support to sustain development and maintenance.
// Businesses: you can support continued development via B2B invoiced technical support, maintenance and sponsoring contracts.
-// PLEASE reach out at omar AT dearimgui DOT com. See https://github.com/ocornut/imgui/wiki/Funding
+// PLEASE reach out at omar AT discohello DOT com. See https://github.com/ocornut/imgui/wiki/Funding
// Businesses: you can also purchase licenses for the Dear ImGui Automation/Test Engine.
// It is recommended that you don't modify imgui.cpp! It will become difficult for you to update the library.
@@ -402,7 +402,44 @@ IMPLEMENTING SUPPORT for ImGuiBackendFlags_RendererHasTextures:
you may use GetMainViewport()->Pos to offset hard-coded positions, e.g. SetNextWindowPos(GetMainViewport()->Pos)
- likewise io.MousePos and GetMousePos() will use OS coordinates.
If you query mouse positions to interact with non-imgui coordinates you will need to offset them, e.g. subtract GetWindowViewport()->Pos.
-
+ - 2026/07/20 (1.92.9) - DragXXX, SliderXXX, InputScalar: with `ImGuiItemFlags_LiveEditOnInputScalar` now defaulting to being disabled:
+ inputting a value with the keyboard doesn't write intermediate values to backing variable. (#9476)
+ - Before: DragFloat() with user typing "123" --> write back 1, then 12, then 123.
+ - After: DragFloat() with user typing "123" --> write back 123 when validated/unfocused.
+ You can enable the flag back for a given scope if needed by specific widget/behavior.
+ - 2026/07/20 (1.92.9) - ImDrawData: marked ImDrawData::CmdListsCount as obsolete (technically was obsoleted in 1.89.8).
+ - Before: draw_data->CmdListsCount
+ - After: draw_data->CmdLists.Size
+ - 2026/07/08 (1.92.9) - Drag and Drop: commented out legacy name `ImGuiDragDropFlags_SourceAutoExpirePayload` which obsoleted in 1.90.9 (July 2024). Use `ImGuiDragDropFlags_PayloadAutoExpire`.
+ - 2026/07/06 (1.92.9) - ColorEdit: obsoleted SetColorEditOptions() function added in 1.51 (June 2017) in favor of directly poking to io.ConfigColorEditFlags. More consistent and easier to discover.
+ - 2026/06/02 (1.92.9) - TreeNode: commented out legacy name ImGuiTreeNodeFlags_SpanTextWidth which was obsoleted in 1.90.7 (May 2024). Use ImGuiTreeNodeFlags_SpanLabelWidth instead.
+ - 2026/05/07 (1.92.8) - DrawList: swapped the last two arguments of AddRect(), AddPolyline(), PathStroke().
+ - Before: void ImDrawList::AddRect(ImVec2 p_min, ImVec2 p_max, ImU32 col, float rounding = 0.0f, ImDrawFlags flags = 0, float thickness = 1.0f);
+ - After: void ImDrawList::AddRect(ImVec2 p_min, ImVec2 p_max, ImU32 col, float rounding = 0.0f, float thickness = 1.0f, ImDrawFlags flags = 0);
+ - Before: void ImDrawList::AddPolyline(const ImVec2* points, int num_points, ImU32 col, ImDrawFlags flags, float thickness);
+ - After: void ImDrawList::AddPolyline(const ImVec2* points, int num_points, ImU32 col, float thickness, ImDrawFlags flags = 0);
+ - Before: void ImDrawList::PathStroke(ImU32 col, ImDrawFlags flags = 0, float thickness = 1.0f);
+ - After: void ImDrawList::PathStroke(ImU32 col, float thickness = 1.0f, ImDrawFlags flags = 0);
+ Added inline redirection functions when IMGUI_DISABLE_OBSOLETE_FUNCTIONS is off.
+ Marked the old functions are =delete when IMGUI_DISABLE_OBSOLETE_FUNCTIONS is on, to allow for better type-checking.
+ Effectively the typical call site is changing from:
+ - Before: window->DrawList->AddRect(p_min, p_max, color, rounding, ImDrawFlags_None, border_size);
+ - After: window->DrawList->AddRect(p_min, p_max, color, rounding, border_size);
+ Notes:
+ - Users of C++ and other languages with type-checking will be notified at compile-time of any mistakes.
+ - Users of high-level bindings or languages with no type-checking will be notified at runtime via an assert for invalid flags value.
+ If you are a binding maintainer consider doing something to facilitate transition or error detection.
+ - This is perhaps the worst breaking change in our history :( but it makes ImDrawList function signatures consistent.
+ As we are aiming to add flags and features to variety of ImDrawList functions, that consistency becomes more important.
+ The new order is also more convenient as `flags` are less frequently used than `thickness` in real code.
+ - As a general policy in Dear ImGui, all our flags default to 0 so ImDrawFlags_None was likely written 0 in some call sites.
+ - Consider adding `#define IMGUI_DISABLE_OBSOLETE_FUNCTIONS` in your imconfig.h, even temporarily, to clean up legacy code.
+ - 2026/05/07 (1.92.8) - DrawList: changed value of `ImDrawFlags_Closed`. It was previously advertised as "always == 1" when introduced in 1.82 (2021/02), in order to facilitate backward compatibility with the legacy `bool closed` flag.
+ This guarantee has been removed. The bit is reserved and `AddPolyline()`, `PathStroke()` will assert when it is used.
+ - 2026/04/23 (1.92.8) - DrawList: obsoleted `ImDrawCallback_ResetRenderState` in favor of using `ImGui::GetPlatformIO().DrawCallback_ResetRenderState`, which is part of our new standard draw callbacks. (#9378)
+ - 2026/04/22 (1.92.8) - Backends: Vulkan: redesigned to use separate ImageView + Sampler instead of Combined Image Sampler.
+ - When registering custom textures: changed ImGui_ImplVulkan_AddTexture() signature to remove Sampler.
+ - When creating your own descriptor pool (instead of letting backend creates its own): need at least IMGUI_IMPL_VULKAN_MINIMUM_SAMPLED_IMAGE_POOL_SIZE descriptors of type VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE + IMGUI_IMPL_VULKAN_MINIMUM_SAMPLER_POOL_SIZE descriptors of type VK_DESCRIPTOR_TYPE_SAMPLER.
- 2026/03/19 (1.92.7) - MultiSelect: renamed ImGuiMultiSelectFlags_SelectOnClick to ImGuiMultiSelectFlags_SelectOnAuto.
- 2026/02/26 (1.92.7) - Separator: fixed a legacy quirk where Separator() was submitting a zero-height item for layout purpose, even though it draws a 1-pixel separator.
The fix could affect code e.g. computing height from multiple widgets in order to allocate vertical space for a footer or multi-line status bar. (#2657, #9263)
@@ -716,7 +753,9 @@ IMPLEMENTING SUPPORT for ImGuiBackendFlags_RendererHasTextures:
- ImDrawCornerFlags_XXX -> use ImDrawFlags_RoundCornersXXX flags. Read 1.82 Changelog for details + grep commented names in sources.
- commented out runtime support for hardcoded ~0 or 0x01..0x0F rounding flags values for AddRect()/AddRectFilled()/PathRect()/AddImageRounded() -> use ImDrawFlags_RoundCornersXXX flags. Read 1.82 Changelog for details
- 2023/08/25 (1.89.9) - clipper: Renamed IncludeRangeByIndices() (also called ForceDisplayRangeByIndices() before 1.89.6) to IncludeItemsByIndex(). Kept inline redirection function. Sorry!
- - 2023/07/12 (1.89.8) - ImDrawData: CmdLists now owned, changed from ImDrawList** to ImVector. Majority of users shouldn't be affected, but you cannot compare to NULL nor reassign manually anymore. Instead use AddDrawList(). (#6406, #4879, #1878)
+ - 2023/07/12 (1.89.8) - ImDrawData: CmdLists now owned, changed from ImDrawList** to ImVector. Majority of users shouldn't be affected, but you cannot compare to NULL nor reassign manually anymore. (#6406, #4879, #1878)
+ - use `draw_data->CmdLists.Size` instead of `draw_list->CmdListsCount`.
+ - use `draw_data->AddDrawList()` to add to a ImDrawData.
- 2023/06/28 (1.89.7) - overlapping items: obsoleted 'SetItemAllowOverlap()' (called after item) in favor of calling 'SetNextItemAllowOverlap()' (called before item). 'SetItemAllowOverlap()' didn't and couldn't work reliably since 1.89 (2022-11-15).
- 2023/06/28 (1.89.7) - overlapping items: renamed 'ImGuiTreeNodeFlags_AllowItemOverlap' to 'ImGuiTreeNodeFlags_AllowOverlap', 'ImGuiSelectableFlags_AllowItemOverlap' to 'ImGuiSelectableFlags_AllowOverlap'. Kept redirecting enums (will obsolete).
- 2023/06/28 (1.89.7) - overlapping items: IsItemHovered() now by default return false when querying an item using AllowOverlap mode which is being overlapped. Use ImGuiHoveredFlags_AllowWhenOverlappedByItem to revert to old behavior.
@@ -1173,6 +1212,7 @@ IMPLEMENTING SUPPORT for ImGuiBackendFlags_RendererHasTextures:
Q: How can I use my own math types instead of ImVec2?
Q: How can I interact with standard C++ types (such as std::string and std::vector)?
Q: How can I display custom shapes? (using low-level ImDrawList API)
+ Q: About Multi-Threading
>> See https://www.dearimgui.com/faq
Q&A: Fonts, Text
@@ -1198,7 +1238,7 @@ IMPLEMENTING SUPPORT for ImGuiBackendFlags_RendererHasTextures:
==============
Q: How can I help?
- A: - Businesses: please reach out to "omar AT dearimgui DOT com" if you work in a place using Dear ImGui!
+ A: - Businesses: please reach out to "omar AT discohello DOT com" if you work in a place using Dear ImGui!
We can discuss ways for your company to fund development via invoiced technical support, maintenance or sponsoring contacts.
This is among the most useful thing you can do for Dear ImGui. With increased funding, we sustain and grow work on this project.
>>> See https://github.com/ocornut/imgui/wiki/Funding
@@ -1230,6 +1270,12 @@ IMPLEMENTING SUPPORT for ImGuiBackendFlags_RendererHasTextures:
// System includes
#include // vsnprintf, sscanf, printf
#include // intptr_t
+#ifndef IMGUI_DISABLE_TIME_FUNCTIONS
+#include // time(), localtime_r()/localtime_s()
+#if defined(_WIN32)
+static tm* localtime_r(const time_t* timep, tm* result) { return localtime_s(result, timep) == 0 ? result : NULL; }
+#endif
+#endif
// [Windows] On non-Visual Studio compilers, we default to IMGUI_DISABLE_WIN32_DEFAULT_IME_FUNCTIONS unless explicitly enabled
#if defined(_WIN32) && !defined(_MSC_VER) && !defined(IMGUI_ENABLE_WIN32_DEFAULT_IME_FUNCTIONS) && !defined(IMGUI_DISABLE_WIN32_DEFAULT_IME_FUNCTIONS)
@@ -1349,6 +1395,7 @@ static void AddWindowToSortBuffer(ImVector* out_sorted
// Settings
static void WindowSettingsHandler_ClearAll(ImGuiContext*, ImGuiSettingsHandler*);
+static void WindowSettingsHandler_Cleanup(ImGuiContext*, ImGuiSettingsHandler*, ImGuiSettingsCleanupArgs* args);
static void* WindowSettingsHandler_ReadOpen(ImGuiContext*, ImGuiSettingsHandler*, const char* name);
static void WindowSettingsHandler_ReadLine(ImGuiContext*, ImGuiSettingsHandler*, void* entry, const char* line);
static void WindowSettingsHandler_ApplyAll(ImGuiContext*, ImGuiSettingsHandler*);
@@ -1520,11 +1567,11 @@ ImGuiStyle::ImGuiStyle()
GrabRounding = 0.0f; // Radius of grabs corners rounding. Set to 0.0f to have rectangular slider grabs.
LogSliderDeadzone = 4.0f; // The size in pixels of the dead-zone around zero on logarithmic sliders that cross zero.
ImageRounding = 0.0f; // Rounding of Image() calls.
- ImageBorderSize = 0.0f; // Thickness of border around tabs.
+ ImageBorderSize = 0.0f; // Thickness of border around Image() calls.
TabRounding = 5.0f; // Radius of upper corners of a tab. Set to 0.0f to have rectangular tabs.
TabBorderSize = 0.0f; // Thickness of border around tabs.
TabMinWidthBase = 1.0f; // Minimum tab width, to make tabs larger than their contents. TabBar buttons are not affected.
- TabMinWidthShrink = 80.0f; // Minimum tab width after shrinking, when using ImGuiTabBarFlags_FittingPolicyMixed policy.
+ TabMinWidthShrink = 80.0f; // Minimum tab width after shrinking, when using ImGuiTabBarFlags_FittingPolicyMixed policy. FLT_MAX: never shrink, will behave like ImGuiTabBarFlags_FittingPolicyScroll.
TabCloseButtonMinWidthSelected = -1.0f; // -1: always visible. 0.0f: visible when hovered. >0.0f: visible when hovered if minimum width.
TabCloseButtonMinWidthUnselected = 0.0f; // -1: always visible. 0.0f: visible when hovered. >0.0f: visible when hovered if minimum width. FLT_MAX: never show close button when unselected.
TabBarBorderSize = 1.0f; // Thickness of tab-bar separator, which takes on the tab active color to denote focus.
@@ -1534,6 +1581,8 @@ ImGuiStyle::ImGuiStyle()
TreeLinesFlags = ImGuiTreeNodeFlags_DrawLinesNone;
TreeLinesSize = 1.0f; // Thickness of outlines when using ImGuiTreeNodeFlags_DrawLines.
TreeLinesRounding = 0.0f; // Radius of lines connecting child nodes to the vertical line.
+ MenuItemRounding = 0.0f; // Radius of MenuItem, BeginMenu rounding.
+ SelectableRounding = 0.0f; // Radius of selectable rounding. MODIFYING THIS IS DISCOURAGED. CONTIGUOUS SELECTIONS WILL NOT LOOK RIGHT. (#7589)
DragDropTargetRounding = 0.0f; // Radius of the drag and drop target frame.
DragDropTargetBorderSize = 2.0f; // Thickness of the drag and drop target border.
DragDropTargetPadding = 3.0f; // Size to expand the drag and drop target from actual target item size.
@@ -1541,6 +1590,7 @@ ImGuiStyle::ImGuiStyle()
ColorButtonPosition = ImGuiDir_Right; // Side of the color button in the ColorEdit4 widget (left/right). Defaults to ImGuiDir_Right.
ButtonTextAlign = ImVec2(0.5f,0.5f);// Alignment of button text when button is larger than text.
SelectableTextAlign = ImVec2(0.0f,0.0f);// Alignment of selectable text. Defaults to (0.0f, 0.0f) (top-left aligned). It's generally important to keep this left-aligned if you want to lay multiple items on a same line.
+ InputTextCursorSize = 1.0f; // Thickness of cursor/caret in InputText().
SeparatorSize = 1.0f; // Thickness of border in Separator().
SeparatorTextBorderSize = 3.0f; // Thickness of border in SeparatorText().
SeparatorTextAlign = ImVec2(0.0f,0.5f);// Alignment of text within the separator. Defaults to (0.0f, 0.5f) (left aligned, center).
@@ -1573,6 +1623,7 @@ ImGuiStyle::ImGuiStyle()
// Scale all spacing/padding/thickness values. Do not scale fonts.
+// Consider not calling this if your initial scale factor if <1.0.
// Important: This operation is lossy because we round all sizes to integer. If you need to change your scale multiples, call this over a freshly initialized ImGuiStyle structure rather than scaling multiple times.
void ImGuiStyle::ScaleAllSizes(float scale_factor)
{
@@ -1613,10 +1664,13 @@ void ImGuiStyle::ScaleAllSizes(float scale_factor)
TabBarOverlineSize = ImTrunc(TabBarOverlineSize * scale_factor);
TreeLinesSize = ImTrunc(TreeLinesSize * scale_factor);
TreeLinesRounding = ImTrunc(TreeLinesRounding * scale_factor);
+ MenuItemRounding = ImTrunc(MenuItemRounding * scale_factor);
+ SelectableRounding = ImTrunc(SelectableRounding * scale_factor);
DragDropTargetRounding = ImTrunc(DragDropTargetRounding * scale_factor);
DragDropTargetBorderSize = ImTrunc(DragDropTargetBorderSize * scale_factor);
DragDropTargetPadding = ImTrunc(DragDropTargetPadding * scale_factor);
ColorMarkerSize = ImTrunc(ColorMarkerSize * scale_factor);
+ InputTextCursorSize = ImTrunc(InputTextCursorSize * scale_factor);
SeparatorSize = ImTrunc(SeparatorSize * scale_factor);
SeparatorTextBorderSize = ImTrunc(SeparatorTextBorderSize * scale_factor);
SeparatorTextPadding = ImTrunc(SeparatorTextPadding * scale_factor);
@@ -1673,8 +1727,7 @@ ImGuiIO::ImGuiIO()
ConfigViewportsNoDefaultParent = true;
ConfigViewportsPlatformFocusSetsImGuiFocus = true;
- // Miscellaneous options
- MouseDrawCursor = false;
+ // Widget options
#ifdef __APPLE__
ConfigMacOSXBehaviors = true; // Set Mac OS X style defaults based on __APPLE__ compile time flag
#else
@@ -1684,11 +1737,21 @@ ImGuiIO::ImGuiIO()
ConfigInputTextCursorBlink = true;
ConfigInputTextEnterKeepActive = false;
ConfigDragClickToInputText = false;
+ ConfigColorEditFlags = ImGuiColorEditFlags_DefaultOptions_; // Current settings for ColorEdit/ColorPicker widgets. May be further edited by users, unless you also set ImGuiColorEditFlags_NoOptions.
ConfigWindowsResizeFromEdges = true;
ConfigWindowsMoveFromTitleBarOnly = false;
ConfigWindowsCopyContentsWithCtrlC = false;
ConfigScrollbarScrollByPage = true;
+
+ // Ini Settings options
+ ConfigIniSettingsSaveLastUsedDate = true;
+ ConfigIniSettingsAutoDiscardMonths = 0;
+ ConfigDebugIniSettings = false;
+
+ // Miscellaneous options
+ MouseDrawCursor = false;
ConfigMemoryCompactTimer = 60.0f;
+
ConfigDebugIsDebuggerPresent = false;
ConfigDebugHighlightIdConflicts = true;
ConfigDebugHighlightIdConflictsShowItemPicker = true;
@@ -1703,6 +1766,7 @@ ImGuiIO::ImGuiIO()
// Inputs Behaviors
MouseDoubleClickTime = 0.30f;
MouseDoubleClickMaxDist = 6.0f;
+ MouseSingleClickDelay = 0.50f;
MouseDragThreshold = 6.0f;
KeyRepeatDelay = 0.275f;
KeyRepeatRate = 0.050f;
@@ -2861,7 +2925,7 @@ IM_MSVC_RUNTIME_CHECKS_RESTORE
IMGUI_API ImU32 ImAlphaBlendColors(ImU32 col_a, ImU32 col_b)
{
- float t = ((col_b >> IM_COL32_A_SHIFT) & 0xFF) / 255.f;
+ float t = ((col_b >> IM_COL32_A_SHIFT) & 0xFF) / 255.0f;
int r = ImLerp((int)(col_a >> IM_COL32_R_SHIFT) & 0xFF, (int)(col_b >> IM_COL32_R_SHIFT) & 0xFF, t);
int g = ImLerp((int)(col_a >> IM_COL32_G_SHIFT) & 0xFF, (int)(col_b >> IM_COL32_G_SHIFT) & 0xFF, t);
int b = ImLerp((int)(col_a >> IM_COL32_B_SHIFT) & 0xFF, (int)(col_b >> IM_COL32_B_SHIFT) & 0xFF, t);
@@ -2892,20 +2956,20 @@ ImU32 ImGui::ColorConvertFloat4ToU32(const ImVec4& in)
// Optimized http://lolengine.net/blog/2013/01/13/fast-rgb-to-hsv
void ImGui::ColorConvertRGBtoHSV(float r, float g, float b, float& out_h, float& out_s, float& out_v)
{
- float K = 0.f;
+ float K = 0.0f;
if (g < b)
{
ImSwap(g, b);
- K = -1.f;
+ K = -1.0f;
}
if (r < g)
{
ImSwap(r, g);
- K = -2.f / 6.f - K;
+ K = -2.0f / 6.0f - K;
}
const float chroma = r - (g < b ? g : b);
- out_h = ImFabs(K + (g - b) / (6.f * chroma + 1e-20f));
+ out_h = ImFabs(K + (g - b) / (6.0f * chroma + 1e-20f));
out_s = chroma / (r + 1e-20f);
out_v = r;
}
@@ -3454,9 +3518,6 @@ static bool ImGuiListClipper_StepInternal(ImGuiListClipper* clipper)
if (clipper->ItemsHeight <= 0.0f)
{
IM_ASSERT(data->StepNo == 1);
- if (table)
- IM_ASSERT(table->RowPosY1 == clipper->StartPosY && table->RowPosY2 == window->DC.CursorPos.y);
-
bool affected_by_floating_point_precision = ImIsFloatAboveGuaranteedIntegerPrecision((float)clipper->StartPosY) || ImIsFloatAboveGuaranteedIntegerPrecision(window->DC.CursorPos.y);
if (affected_by_floating_point_precision)
{
@@ -3470,7 +3531,14 @@ static bool ImGuiListClipper_StepInternal(ImGuiListClipper* clipper)
}
if (clipper->ItemsHeight == 0.0f && clipper->ItemsCount == INT_MAX) // Accept that no item have been submitted if in indeterminate mode.
return false;
- IM_ASSERT(clipper->ItemsHeight > 0.0f && "Unable to calculate item height! First item hasn't moved the cursor vertically!");
+ if (clipper->ItemsHeight <= 0.0f)
+ {
+ IM_ASSERT_USER_ERROR(clipper->ItemsHeight > 0.0f, "ImGuiListClipper: Failed to calculate item height! First item hasn't been submitted by user code, or has not moved the cursor vertically!");
+ return false;
+ }
+ if (table)
+ IM_ASSERT(table->RowPosY1 == clipper->StartPosY && table->RowPosY2 == window->DC.CursorPos.y);
+
calc_clipping = true; // If item height had to be calculated, calculate clipping afterwards.
}
@@ -3516,12 +3584,14 @@ static bool ImGuiListClipper_StepInternal(ImGuiListClipper* clipper)
// FIXME: Selectable() use of half-ItemSpacing isn't consistent in matter of layout, as ItemAdd(bb) stray above ItemSize()'s CursorPos.
// RangeSelect's BoxSelect relies on comparing overlap of previous and current rectangle and is sensitive to that.
// As a workaround we currently half ItemSpacing worth on each side.
- min_y -= g.Style.ItemSpacing.y;
- max_y += g.Style.ItemSpacing.y;
+ float pad_y = g.Style.ItemSpacing.y;
+ min_y -= pad_y;
+ max_y += pad_y;
// Box-select on 2D area requires different clipping.
+ // (best adding pad_y here than in BeginBoxSelect() as we are closer to current state)
if (bs->UnclipMode)
- data->Ranges.push_back(ImGuiListClipperRange::FromPositions(bs->UnclipRect.Min.y, bs->UnclipRect.Max.y, 0, 0));
+ data->Ranges.push_back(ImGuiListClipperRange::FromPositions(bs->UnclipRect.Min.y - pad_y, bs->UnclipRect.Max.y + pad_y, 0, 0));
}
// Add main visible range
@@ -3720,6 +3790,9 @@ static const ImGuiStyleVarInfo GStyleVarsInfo[] =
{ 2, ImGuiDataType_Float, (ImU32)offsetof(ImGuiStyle, TableAngledHeadersTextAlign)},// ImGuiStyleVar_TableAngledHeadersTextAlign
{ 1, ImGuiDataType_Float, (ImU32)offsetof(ImGuiStyle, TreeLinesSize)}, // ImGuiStyleVar_TreeLinesSize
{ 1, ImGuiDataType_Float, (ImU32)offsetof(ImGuiStyle, TreeLinesRounding)}, // ImGuiStyleVar_TreeLinesRounding
+ { 1, ImGuiDataType_Float, (ImU32)offsetof(ImGuiStyle, MenuItemRounding)}, // ImGuiStyleVar_MenuItemRounding
+ { 1, ImGuiDataType_Float, (ImU32)offsetof(ImGuiStyle, SelectableRounding)}, // ImGuiStyleVar_SelectableRounding
+ { 1, ImGuiDataType_Float, (ImU32)offsetof(ImGuiStyle, DragDropTargetRounding)}, // ImGuiStyleVar_DragDropTargetRounding
{ 2, ImGuiDataType_Float, (ImU32)offsetof(ImGuiStyle, ButtonTextAlign) }, // ImGuiStyleVar_ButtonTextAlign
{ 2, ImGuiDataType_Float, (ImU32)offsetof(ImGuiStyle, SelectableTextAlign) }, // ImGuiStyleVar_SelectableTextAlign
{ 1, ImGuiDataType_Float, (ImU32)offsetof(ImGuiStyle, SeparatorSize)}, // ImGuiStyleVar_SeparatorSize
@@ -3821,6 +3894,7 @@ const char* ImGui::GetStyleColorName(ImGuiCol idx)
case ImGuiCol_ScrollbarGrabHovered: return "ScrollbarGrabHovered";
case ImGuiCol_ScrollbarGrabActive: return "ScrollbarGrabActive";
case ImGuiCol_CheckMark: return "CheckMark";
+ case ImGuiCol_CheckboxSelectedBg: return "CheckboxSelectedBg";
case ImGuiCol_SliderGrab: return "SliderGrab";
case ImGuiCol_SliderGrabActive: return "SliderGrabActive";
case ImGuiCol_Button: return "Button";
@@ -3903,7 +3977,7 @@ void ImGui::RenderText(ImVec2 pos, const char* text, const char* text_end, bool
else
{
if (!text_end)
- text_end = text + ImStrlen(text); // FIXME-OPT
+ text_end = text + ImStrlen(text); // FIXME-OPT (not reached by our internal calls)
text_display_end = text_end;
}
@@ -3921,7 +3995,7 @@ void ImGui::RenderTextWrapped(ImVec2 pos, const char* text, const char* text_end
ImGuiWindow* window = g.CurrentWindow;
if (!text_end)
- text_end = text + ImStrlen(text); // FIXME-OPT
+ text_end = text + ImStrlen(text); // FIXME-OPT (not reached by our internal calls)
if (text != text_end)
{
@@ -3990,8 +4064,8 @@ void ImGui::RenderTextEllipsis(ImDrawList* draw_list, const ImVec2& pos_min, con
text_end_full = FindRenderedTextEnd(text);
const ImVec2 text_size = text_size_if_known ? *text_size_if_known : CalcTextSize(text, text_end_full, false, 0.0f);
- //draw_list->AddLine(ImVec2(pos_max.x, pos_min.y - 4), ImVec2(pos_max.x, pos_max.y + 6), IM_COL32(0, 0, 255, 255));
- //draw_list->AddLine(ImVec2(ellipsis_max_x, pos_min.y - 2), ImVec2(ellipsis_max_x, pos_max.y + 3), IM_COL32(0, 255, 0, 255));
+ //draw_list->AddLineV(pos_max.x, pos_min.y - 4, pos_max.y + 6, IM_COL32(0, 0, 255, 255));
+ //draw_list->AddLineV(ellipsis_max_x, pos_min.y - 2, pos_max.y + 3, IM_COL32(0, 255, 0, 255));
// FIXME: We could technically remove (last_glyph->AdvanceX - last_glyph->X1) from text_size.x here and save a few pixels.
if (text_size.x > pos_max.x - pos_min.x)
@@ -4036,8 +4110,8 @@ void ImGui::RenderFrame(ImVec2 p_min, ImVec2 p_max, ImU32 fill_col, bool borders
const float border_size = g.Style.FrameBorderSize;
if (borders && border_size > 0.0f)
{
- window->DrawList->AddRect(p_min + ImVec2(1, 1), p_max + ImVec2(1, 1), GetColorU32(ImGuiCol_BorderShadow), rounding, 0, border_size);
- window->DrawList->AddRect(p_min, p_max, GetColorU32(ImGuiCol_Border), rounding, 0, border_size);
+ window->DrawList->AddRect(p_min + ImVec2(1, 1), p_max + ImVec2(1, 1), GetColorU32(ImGuiCol_BorderShadow), rounding, border_size);
+ window->DrawList->AddRect(p_min, p_max, GetColorU32(ImGuiCol_Border), rounding, border_size);
}
}
@@ -4048,8 +4122,8 @@ void ImGui::RenderFrameBorder(ImVec2 p_min, ImVec2 p_max, float rounding)
const float border_size = g.Style.FrameBorderSize;
if (border_size > 0.0f)
{
- window->DrawList->AddRect(p_min + ImVec2(1, 1), p_max + ImVec2(1, 1), GetColorU32(ImGuiCol_BorderShadow), rounding, 0, border_size);
- window->DrawList->AddRect(p_min, p_max, GetColorU32(ImGuiCol_Border), rounding, 0, border_size);
+ window->DrawList->AddRect(p_min + ImVec2(1, 1), p_max + ImVec2(1, 1), GetColorU32(ImGuiCol_BorderShadow), rounding, border_size);
+ window->DrawList->AddRect(p_min, p_max, GetColorU32(ImGuiCol_Border), rounding, border_size);
}
}
@@ -4062,7 +4136,7 @@ void ImGui::RenderColorComponentMarker(const ImRect& bb, ImU32 col, float roundi
RenderRectFilledInRangeH(window->DrawList, bb, col, bb.Min.x, ImMin(bb.Min.x + g.Style.ColorMarkerSize, bb.Max.x), rounding);
}
-void ImGui::RenderNavCursor(const ImRect& bb, ImGuiID id, ImGuiNavRenderCursorFlags flags)
+void ImGui::RenderNavCursor(const ImRect& bb, ImGuiID id, ImGuiNavRenderCursorFlags flags, float rounding)
{
ImGuiContext& g = *GImGui;
if (id != g.NavId)
@@ -4078,22 +4152,29 @@ void ImGui::RenderNavCursor(const ImRect& bb, ImGuiID id, ImGuiNavRenderCursorFl
if (window->DC.NavHideHighlightOneFrame)
return;
- float rounding = (flags & ImGuiNavRenderCursorFlags_NoRounding) ? 0.0f : g.Style.FrameRounding;
+#ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS
+ if (rounding < 0.0f && (flags & ImGuiNavRenderCursorFlags_NoRounding))
+ rounding = 0.0f;
+#endif
+ if (rounding < 0.0f)
+ rounding = g.Style.FrameRounding;
+
ImRect display_rect = bb;
display_rect.ClipWith(window->ClipRect);
- const float thickness = 2.0f;
+ const float scale_factor = GetScale(); // FIXME-DPI
+ const float thickness = (float)(int)ImMax(2.0f, 1.5f * scale_factor);
if (flags & ImGuiNavRenderCursorFlags_Compact)
{
- window->DrawList->AddRect(display_rect.Min, display_rect.Max, GetColorU32(ImGuiCol_NavCursor), rounding, 0, thickness);
+ window->DrawList->AddRect(display_rect.Min, display_rect.Max, GetColorU32(ImGuiCol_NavCursor), rounding, thickness);
}
else
{
- const float distance = 3.0f + thickness * 0.5f;
+ const float distance = (float)(int)(3.0f + thickness * 0.5f);
display_rect.Expand(ImVec2(distance, distance));
bool fully_visible = window->ClipRect.Contains(display_rect);
if (!fully_visible)
window->DrawList->PushClipRect(display_rect.Min, display_rect.Max);
- window->DrawList->AddRect(display_rect.Min, display_rect.Max, GetColorU32(ImGuiCol_NavCursor), rounding, 0, thickness);
+ window->DrawList->AddRect(display_rect.Min, display_rect.Max, GetColorU32(ImGuiCol_NavCursor), rounding, thickness);
if (!fully_visible)
window->DrawList->PopClipRect();
}
@@ -4127,7 +4208,7 @@ void ImGui::RenderMouseCursor(ImVec2 base_pos, float base_scale, ImGuiMouseCurso
float a_min = ImFmod((float)g.Time * 5.0f, 2.0f * IM_PI);
float a_max = a_min + IM_PI * 1.65f;
draw_list->PathArcTo(pos + ImVec2(14, -1) * scale, 6.0f * scale, a_min, a_max);
- draw_list->PathStroke(col_fill, ImDrawFlags_None, 3.0f * scale);
+ draw_list->PathStroke(col_fill, 3.0f * scale);
}
draw_list->PopTexture();
}
@@ -4197,7 +4278,10 @@ static const ImGuiLocEntry GLocalizationEntriesEnUS[] =
{ ImGuiLocKey_TableSizeOne, "Size column to fit###SizeOne" },
{ ImGuiLocKey_TableSizeAllFit, "Size all columns to fit###SizeAll" },
{ ImGuiLocKey_TableSizeAllDefault, "Size all columns to default###SizeAll" },
+ { ImGuiLocKey_TableReset, "Reset" },
+ //{ ImGuiLocKey_TableResetAll, "Reset to default###ResetAll" },
{ ImGuiLocKey_TableResetOrder, "Reset order###ResetOrder" },
+ { ImGuiLocKey_TableResetVisibility, "Reset visibility###ResetVisibility" },
{ ImGuiLocKey_WindowingMainMenuBar, "(Main menu bar)" },
{ ImGuiLocKey_WindowingPopup, "(Popup)" },
{ ImGuiLocKey_WindowingUntitled, "(Untitled)" },
@@ -4229,7 +4313,7 @@ ImGuiContext::ImGuiContext(ImFontAtlas* shared_font_atlas)
IO.Fonts = shared_font_atlas ? shared_font_atlas : IM_NEW(ImFontAtlas)();
if (shared_font_atlas == NULL)
IO.Fonts->OwnerContext = this;
- WithinEndChildID = 0;
+ WithinEndChildID = WithinEndPopupID = 0;
TestEngine = NULL;
InputEventsNextMouseSource = ImGuiMouseSource_Mouse;
@@ -4254,10 +4338,12 @@ ImGuiContext::ImGuiContext(ImFontAtlas* shared_font_atlas)
HoveredIdIsDisabled = false;
HoveredIdTimer = HoveredIdNotActiveTimer = 0.0f;
ItemUnclipByLog = false;
+ AnyIdHasBeenEditedThisFrame = false;
ActiveId = 0;
ActiveIdIsAlive = 0;
ActiveIdTimer = 0.0f;
ActiveIdIsJustActivated = false;
+ ActiveIdWasSelected = ActiveIdWasSoleSelected = false;
ActiveIdAllowOverlap = false;
ActiveIdNoClearOnFocusLoss = false;
ActiveIdHasBeenPressedBefore = false;
@@ -4274,6 +4360,7 @@ ImGuiContext::ImGuiContext(ImFontAtlas* shared_font_atlas)
memset(&ActiveIdValueOnActivation, 0, sizeof(ActiveIdValueOnActivation));
LastActiveId = 0;
LastActiveIdTimer = 0.0f;
+ LastActiveIdWasSelected = LastActiveIdWasSoleSelected = false;
LastKeyboardKeyPressTime = LastKeyModsChangeTime = LastKeyModsChangeFromNoneTime = -1.0;
@@ -4374,7 +4461,6 @@ ImGuiContext::ImGuiContext(ImFontAtlas* shared_font_atlas)
TempInputId = 0;
memset(&DataTypeZeroValue, 0, sizeof(DataTypeZeroValue));
BeginMenuDepth = BeginComboDepth = 0;
- ColorEditOptions = ImGuiColorEditFlags_DefaultOptions_;
ColorEditCurrentID = ColorEditSavedID = 0;
ColorEditSavedHue = ColorEditSavedSat = 0.0f;
ColorEditSavedColor = 0;
@@ -4465,6 +4551,7 @@ void ImGui::Initialize()
ini_handler.TypeName = "Window";
ini_handler.TypeHash = ImHashStr("Window");
ini_handler.ClearAllFn = WindowSettingsHandler_ClearAll;
+ ini_handler.CleanupFn = WindowSettingsHandler_Cleanup;
ini_handler.ReadOpenFn = WindowSettingsHandler_ReadOpen;
ini_handler.ReadLineFn = WindowSettingsHandler_ReadLine;
ini_handler.ApplyAllFn = WindowSettingsHandler_ApplyAll;
@@ -4482,6 +4569,14 @@ void ImGui::Initialize()
g.PlatformIO.Platform_OpenInShellFn = Platform_OpenInShellFn_DefaultImpl;
g.PlatformIO.Platform_SetImeDataFn = Platform_SetImeDataFn_DefaultImpl;
+ // Setup session starting date
+#ifndef IMGUI_DISABLE_TIME_FUNCTIONS
+ const time_t session_time = time(NULL);
+ struct tm session_datetime = {};
+ if (localtime_r(&session_time, &session_datetime))
+ g.PlatformIO.Platform_SessionDate = (session_datetime.tm_year + 1900) * 10000 + (session_datetime.tm_mon + 1) * 100 + session_datetime.tm_mday;
+#endif
+
// Create default viewport
ImGuiViewportP* viewport = IM_NEW(ImGuiViewportP)();
viewport->ID = IMGUI_VIEWPORT_DEFAULT_ID;
@@ -4537,10 +4632,14 @@ void ImGui::Shutdown()
for (ImFontAtlas* atlas : g.FontAtlases)
{
UnregisterFontAtlas(atlas);
- if (atlas->RefCount == 0)
+ if (atlas->OwnerContext == &g)
{
- atlas->Locked = false;
- IM_DELETE(atlas);
+ IM_ASSERT(atlas->RefCount == 0 && "Destroying context owning a ImFontAtlas which is still used elsewhere!");
+ if (atlas->RefCount == 0)
+ {
+ atlas->Locked = false;
+ IM_DELETE(atlas);
+ }
}
}
g.DrawListSharedData.TempBuffer.clear();
@@ -4795,7 +4894,8 @@ void ImGui::SetActiveID(ImGuiID id, ImGuiWindow* window)
g.ActiveIdIsJustActivated = (g.ActiveId != id);
if (g.ActiveIdIsJustActivated)
{
- IMGUI_DEBUG_LOG_ACTIVEID("SetActiveID() old:0x%08X (window \"%s\") -> new:0x%08X (window \"%s\")\n", g.ActiveId, g.ActiveIdWindow ? g.ActiveIdWindow->Name : "", id, window ? window->Name : "");
+ IMGUI_DEBUG_LOG_ACTIVEID("SetActiveID() 0x%08X in \"%s\"%*s(previously 0x%08X in \"%s\")\n", id, window ? window->Name : "",
+ ImMax(0, 20 - (int)(window ? strlen(window->Name) : 0)), "", g.ActiveId, g.ActiveIdWindow ? g.ActiveIdWindow->Name : "");
g.ActiveIdTimer = 0.0f;
g.ActiveIdHasBeenPressedBefore = false;
g.ActiveIdHasBeenEditedBefore = false;
@@ -4851,24 +4951,25 @@ void ImGui::MarkItemEdited(ImGuiID id)
// This marking is to be able to provide info for IsItemDeactivatedAfterEdit().
// ActiveId might have been released by the time we call this (as in the typical press/release button behavior) but still need to fill the data.
ImGuiContext& g = *GImGui;
+
+ //IM_ASSERT(g.LastItemData.ID == id); // Failing cases include: "widgets_inputtext_scrolling", "widgets_inputtext_multiline_status", "widgets_selectable_input" = case of e.g TempInputText() overlayed manually with different ID (#2718)
+ g.LastItemData.StatusFlags |= ImGuiItemStatusFlags_EditedInternal;
if (g.LastItemData.ItemFlags & ImGuiItemFlags_NoMarkEdited)
return;
+ g.LastItemData.StatusFlags |= ImGuiItemStatusFlags_Edited;
+
if (g.ActiveId == id || g.ActiveId == 0)
{
// FIXME: Can't we fully rely on LastItemData yet?
- g.ActiveIdHasBeenEditedThisFrame = true;
- g.ActiveIdHasBeenEditedBefore = true;
- if (g.DeactivatedItemData.ID == id)
- g.DeactivatedItemData.HasBeenEditedBefore = true;
+ g.AnyIdHasBeenEditedThisFrame = g.ActiveIdHasBeenEditedThisFrame = g.ActiveIdHasBeenEditedBefore = true;
}
+ if (g.DeactivatedItemData.ID == id)
+ g.DeactivatedItemData.HasBeenEditedBefore = true;
// We accept a MarkItemEdited() on drag and drop targets (see https://github.com/ocornut/imgui/issues/1875#issuecomment-978243343)
// We accept 'ActiveIdPreviousFrame == id' for InputText() returning an edit after it has been taken ActiveId away (#4714)
// FIXME: This assert is getting a bit meaningless over time. It helped detect some unusual use cases but eventually it is becoming an unnecessary restriction.
- IM_ASSERT(g.DragDropActive || g.ActiveId == id || g.ActiveId == 0 || g.ActiveIdPreviousFrame == id || g.NavJustMovedToId || (g.CurrentMultiSelect != NULL && g.BoxSelectState.IsActive));
-
- //IM_ASSERT(g.CurrentWindow->DC.LastItemId == id);
- g.LastItemData.StatusFlags |= ImGuiItemStatusFlags_Edited;
+ IM_ASSERT(g.DragDropActive || g.ActiveId == id || g.ActiveId == 0 || g.DeactivatedItemData.ID == id || g.ActiveIdPreviousFrame == id || g.NavJustMovedToId || (g.CurrentMultiSelect != NULL && g.BoxSelectState.IsActive));
}
bool ImGui::IsWindowContentHoverable(ImGuiWindow* window, ImGuiHoveredFlags flags)
@@ -5042,7 +5143,7 @@ bool ImGui::ItemHoverable(const ImRect& bb, ImGuiID id, ImGuiItemFlags item_flag
{
g.HoveredIdPreviousFrameItemCount++;
if (g.DebugDrawIdConflictsId == id)
- window->DrawList->AddRect(bb.Min - ImVec2(1,1), bb.Max + ImVec2(1,1), IM_COL32(255, 0, 0, 255), 0.0f, ImDrawFlags_None, 2.0f);
+ window->DrawList->AddRect(bb.Min - ImVec2(1,1), bb.Max + ImVec2(1,1), IM_COL32(255, 0, 0, 255), 0.0f, 2.0f);
}
#endif
@@ -5487,14 +5588,15 @@ void ImGui::UpdateMouseMovingWindowEndFrame()
// Click on empty space to focus window and start moving
// (after we're done with all our widgets, so e.g. clicking on docking tab-bar which have set HoveredId already and not get us here!)
- if (g.IO.MouseClicked[0])
+ if (IsMouseClicked(0, ImGuiInputFlags_None, ImGuiKeyOwner_NoOwner))
{
// Handle the edge case of a popup being closed while clicking in its empty space.
// If we try to focus it, FocusWindow() > ClosePopupsOverWindow() will accidentally close any parent popups because they are not linked together any more.
ImGuiWindow* hovered_root = hovered_window ? hovered_window->RootWindow : NULL;
const bool is_closed_popup = hovered_root && (hovered_root->Flags & ImGuiWindowFlags_Popup) && !IsPopupOpen(hovered_root->PopupId, ImGuiPopupFlags_AnyPopupLevel);
+ const bool is_queued_focus_request = g.NavMoveSubmitted && (g.NavMoveFlags & ImGuiNavMoveFlags_FocusApi);
- if (hovered_window != NULL && !is_closed_popup)
+ if (hovered_window != NULL && !is_closed_popup && !is_queued_focus_request)
{
StartMouseMovingWindow(hovered_window); //-V595
@@ -5525,7 +5627,7 @@ void ImGui::UpdateMouseMovingWindowEndFrame()
// With right mouse button we close popups without changing focus based on where the mouse is aimed
// Instead, focus will be restored to the window under the bottom-most closed popup.
// (The left mouse button path calls FocusWindow on the hovered window, which will lead NewFrame->ClosePopupsOverWindow to trigger)
- if (g.IO.MouseClicked[1] && g.HoveredId == 0)
+ if (g.HoveredId == 0 && IsMouseClicked(1, ImGuiInputFlags_None, ImGuiKeyOwner_NoOwner))
{
// Find the top-most window between HoveredWindow and the top-most Modal Window.
// This is where we can trim the popup stack.
@@ -5695,6 +5797,7 @@ void ImGui::NewFrame()
g.Time += g.IO.DeltaTime;
g.FrameCount += 1;
+ g.SessionDate = ImGuiPackedDate(g.PlatformIO.Platform_SessionDate);
g.TooltipOverrideCount = 0;
g.WindowsActiveCount = 0;
g.MenusIdSubmittedThisFrame.resize(0);
@@ -5766,9 +5869,15 @@ void ImGui::NewFrame()
// Update ActiveId data (clear reference to active widget if the widget isn't alive anymore)
if (g.ActiveId)
g.ActiveIdTimer += g.IO.DeltaTime;
+ if (g.ActiveId && g.ActiveId == g.LastActiveId)
+ {
+ g.LastActiveIdWasSelected = g.ActiveIdWasSelected;
+ g.LastActiveIdWasSoleSelected = g.ActiveIdWasSoleSelected;
+ }
g.LastActiveIdTimer += g.IO.DeltaTime;
g.ActiveIdPreviousFrame = g.ActiveId;
g.ActiveIdIsAlive = 0;
+ g.AnyIdHasBeenEditedThisFrame = false;
g.ActiveIdHasBeenEditedThisFrame = false;
g.ActiveIdIsJustActivated = false;
if (g.TempInputId != 0 && g.ActiveId != g.TempInputId)
@@ -5783,6 +5892,8 @@ void ImGui::NewFrame()
if (g.DeactivatedItemData.ElapseFrame < g.FrameCount)
g.DeactivatedItemData.ID = 0;
g.DeactivatedItemData.IsAlive = false;
+ if (g.InputTextDeactivatedState.ElapseFrame < g.FrameCount)
+ g.InputTextDeactivatedState.ID = 0;
// Record when we have been stationary as this state is preserved while over same item.
// FIXME: The way this is expressed means user cannot alter HoverStationaryDelay during the frame to use varying values.
@@ -5905,8 +6016,11 @@ void ImGui::NewFrame()
if (g.TablesLastTimeActive[i] >= 0.0f && g.TablesLastTimeActive[i] < memory_compact_start_time)
TableGcCompactTransientBuffers(g.Tables.GetByIndex(i));
for (ImGuiTableTempData& table_temp_data : g.TablesTempData)
+ {
+ table_temp_data.ReconcileColumnsRequests.clear(); // Unusual: clear every frame because this is rarely used.
if (table_temp_data.LastTimeActive >= 0.0f && table_temp_data.LastTimeActive < memory_compact_start_time)
TableGcCompactTransientBuffers(&table_temp_data);
+ }
if (g.GcCompactAll)
GcCompactTransientMiscBuffers();
g.GcCompactAll = false;
@@ -5920,7 +6034,7 @@ void ImGui::NewFrame()
g.CurrentWindowStack.resize(0);
g.BeginPopupStack.resize(0);
g.ItemFlagsStack.resize(0);
- g.ItemFlagsStack.push_back(ImGuiItemFlags_AutoClosePopups); // Default flags
+ g.ItemFlagsStack.push_back(ImGuiItemFlags_Default_); // Default flags
g.CurrentItemFlags = g.ItemFlagsStack.back();
g.GroupStack.resize(0);
@@ -6042,7 +6156,7 @@ static void FlattenDrawDataIntoSingleLayer(ImDrawDataBuilder* builder)
static void InitViewportDrawData(ImGuiViewportP* viewport)
{
- ImGuiIO& io = ImGui::GetIO();
+ ImGuiContext& g = *GImGui;
ImDrawData* draw_data = &viewport->DrawDataP;
viewport->DrawData = draw_data; // Make publicly accessible
@@ -6059,13 +6173,16 @@ static void InitViewportDrawData(ImGuiViewportP* viewport)
const bool is_minimized = (viewport->Flags & ImGuiViewportFlags_IsMinimized) != 0;
draw_data->Valid = true;
- draw_data->CmdListsCount = 0;
+ draw_data->FrameCount = g.FrameCount;
draw_data->TotalVtxCount = draw_data->TotalIdxCount = 0;
draw_data->DisplayPos = viewport->Pos;
draw_data->DisplaySize = is_minimized ? ImVec2(0.0f, 0.0f) : viewport->Size;
- draw_data->FramebufferScale = (viewport->FramebufferScale.x != 0.0f) ? viewport->FramebufferScale : io.DisplayFramebufferScale;
+ draw_data->FramebufferScale = (viewport->FramebufferScale.x != 0.0f) ? viewport->FramebufferScale : g.IO.DisplayFramebufferScale;
draw_data->OwnerViewport = viewport;
- draw_data->Textures = &ImGui::GetPlatformIO().Textures;
+ draw_data->Textures = &g.PlatformIO.Textures;
+#ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS
+ draw_data->CmdListsCount = 0;
+#endif
}
// Push a clipping rectangle for both ImGui logic (hit-testing etc.) and low-level ImDrawList rendering.
@@ -6090,14 +6207,6 @@ void ImGui::PopClipRect()
window->ClipRect = window->DrawList->_ClipRectStack.back();
}
-static ImGuiWindow* FindFrontMostVisibleChildWindow(ImGuiWindow* window)
-{
- for (int n = window->DC.ChildWindows.Size - 1; n >= 0; n--)
- if (IsWindowActiveAndVisible(window->DC.ChildWindows[n]))
- return FindFrontMostVisibleChildWindow(window->DC.ChildWindows[n]);
- return window;
-}
-
static void ImGui::RenderDimmedBackgroundBehindWindow(ImGuiWindow* window, ImU32 col)
{
if ((col & IM_COL32_A_MASK) == 0)
@@ -6199,7 +6308,7 @@ static void ImGui::RenderDimmedBackgrounds()
if (window->DrawList->CmdBuffer.Size == 0)
window->DrawList->AddDrawCmd();
window->DrawList->PushClipRect(viewport->Pos, viewport->Pos + viewport->Size);
- window->DrawList->AddRect(bb.Min, bb.Max, GetColorU32(ImGuiCol_NavWindowingHighlight, g.NavWindowingHighlightAlpha), window->WindowRounding, 0, 3.0f); // FIXME-DPI
+ window->DrawList->AddRect(bb.Min, bb.Max, GetColorU32(ImGuiCol_NavWindowingHighlight, g.NavWindowingHighlightAlpha), window->WindowRounding, 3.0f); // FIXME-DPI
window->DrawList->PopClipRect();
}
@@ -6386,10 +6495,11 @@ void ImGui::Render()
// We call _PopUnusedDrawCmd() last thing, as RenderDimmedBackgrounds() rely on a valid command being there (especially in docking branch).
ImDrawData* draw_data = &viewport->DrawDataP;
- IM_ASSERT(draw_data->CmdLists.Size == draw_data->CmdListsCount);
for (ImDrawList* draw_list : draw_data->CmdLists)
draw_list->_PopUnusedDrawCmd();
-
+#ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS
+ draw_data->CmdListsCount = draw_data->CmdLists.Size;
+#endif
g.IO.MetricsRenderVertices += draw_data->TotalVtxCount;
g.IO.MetricsRenderIndices += draw_data->TotalIdxCount;
}
@@ -6422,11 +6532,9 @@ ImVec2 ImGui::CalcTextSize(const char* text, const char* text_end, bool hide_tex
ImVec2 text_size = font->CalcTextSizeA(font_size, FLT_MAX, wrap_width, text, text_display_end, NULL);
// Round
- // FIXME: This has been here since Dec 2015 (7b0bf230) but down the line we want this out.
- // FIXME: Investigate using ceilf or e.g.
- // - https://git.musl-libc.org/cgit/musl/tree/src/math/ceilf.c
- // - https://embarkstudios.github.io/rust-gpu/api/src/libm/math/ceilf.rs.html
- text_size.x = IM_TRUNC(text_size.x + 0.99999f);
+ // (see 7b0bf230, 4622fa4b6, #791 for details about this.)
+ // FIXME: Add a way to disable this.
+ text_size.x = ImCeilFast(text_size.x);
return text_size;
}
@@ -6531,6 +6639,7 @@ bool ImGui::IsItemDeactivated()
return g.DeactivatedItemData.ID == g.LastItemData.ID && g.LastItemData.ID != 0 && g.DeactivatedItemData.ElapseFrame >= g.FrameCount;
}
+// Since 1.92.9: consider using NoLiveEdit flags if all you need to that values are not written bo backing variable while typing.
bool ImGui::IsItemDeactivatedAfterEdit()
{
ImGuiContext& g = *GImGui;
@@ -6566,11 +6675,12 @@ bool ImGui::IsItemToggledOpen()
return (g.LastItemData.StatusFlags & ImGuiItemStatusFlags_ToggledOpen) ? true : false;
}
-// Call after a Selectable() or TreeNode() involved in multi-selection.
-// Useful if you need the per-item information before reaching EndMultiSelect(), e.g. for rendering purpose.
-// This is only meant to be called inside a BeginMultiSelect()/EndMultiSelect() block.
-// (Outside of multi-select, it would be misleading/ambiguous to report this signal, as widgets
-// return e.g. a pressed event and user code is in charge of altering selection in ways we cannot predict.)
+// Call after a Selectable() or TreeNode() items inside a BeginMultiSelect()/EndMultiSelect() scope.
+// - Useful if you need the per-item information before reaching EndMultiSelect(), e.g. for rendering purpose.
+// Outside of a multi-select block:
+// - It would be misleading/ambiguous to report this signal, as widgets return e.g. a pressed event,
+// and user code is in charge of altering selection in ways we cannot predict.
+// Prefer using 'if (IsItemClicked() && !IsItemToggledOpen())' for a manual reimplementation of selection.
bool ImGui::IsItemToggledSelection()
{
ImGuiContext& g = *GImGui;
@@ -6617,7 +6727,7 @@ bool ImGui::IsItemEdited()
void ImGui::SetNextItemAllowOverlap()
{
ImGuiContext& g = *GImGui;
- g.NextItemData.ItemFlags |= ImGuiItemFlags_AllowOverlap;
+ g.NextItemData.ItemFlagsSet |= ImGuiItemFlags_AllowOverlap;
}
#ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS
@@ -6717,7 +6827,7 @@ bool ImGui::BeginChildEx(const char* name, ImGuiID id, const ImVec2& size_arg, I
window_flags |= ImGuiWindowFlags_ChildWindow | ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_NoDocking;
window_flags |= (parent_window->Flags & ImGuiWindowFlags_NoMove); // Inherit the NoMove flag
if (child_flags & (ImGuiChildFlags_AutoResizeX | ImGuiChildFlags_AutoResizeY | ImGuiChildFlags_AlwaysAutoResize))
- window_flags |= ImGuiWindowFlags_AlwaysAutoResize;
+ window_flags |= ImGuiWindowFlags_AlwaysAutoResize; // FIXME: Would be sane to not make single-axis flag set this. (#9355)
if ((child_flags & (ImGuiChildFlags_ResizeX | ImGuiChildFlags_ResizeY)) == 0)
window_flags |= ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoSavedSettings;
@@ -6866,6 +6976,14 @@ void ImGui::EndChild()
g.LogLinePosY = -FLT_MAX; // To enforce a carriage return
}
+ImGuiWindow* ImGui::FindFrontMostVisibleChildWindow(ImGuiWindow* window)
+{
+ for (int n = window->DC.ChildWindows.Size - 1; n >= 0; n--)
+ if (IsWindowActiveAndVisible(window->DC.ChildWindows[n]))
+ return FindFrontMostVisibleChildWindow(window->DC.ChildWindows[n]);
+ return window;
+}
+
static void SetWindowConditionAllowFlags(ImGuiWindow* window, ImGuiCond flags, bool enabled)
{
window->SetWindowPosAllowFlags = enabled ? (window->SetWindowPosAllowFlags | flags) : (window->SetWindowPosAllowFlags & ~flags);
@@ -6888,38 +7006,28 @@ ImGuiWindow* ImGui::FindWindowByName(const char* name)
static void ApplyWindowSettings(ImGuiWindow* window, ImGuiWindowSettings* settings)
{
- const ImGuiViewport* main_viewport = ImGui::GetMainViewport();
- window->ViewportPos = main_viewport->Pos;
- if (settings->ViewportId)
- {
- window->ViewportId = settings->ViewportId;
- window->ViewportPos = ImVec2(settings->ViewportPos.x, settings->ViewportPos.y);
- }
- window->Pos = ImTrunc(ImVec2(settings->Pos.x + window->ViewportPos.x, settings->Pos.y + window->ViewportPos.y));
- if (settings->Size.x > 0 && settings->Size.y > 0)
- window->Size = window->SizeFull = ImTrunc(ImVec2(settings->Size.x, settings->Size.y));
- window->Collapsed = settings->Collapsed;
- window->DockId = settings->DockId;
- window->DockOrder = settings->DockOrder;
-}
-
-static void InitOrLoadWindowSettings(ImGuiWindow* window, ImGuiWindowSettings* settings)
-{
- // Initial window state with e.g. default/arbitrary window position
- // Use SetNextWindowPos() with the appropriate condition flag to change the initial position of a window.
- const ImGuiViewport* main_viewport = ImGui::GetMainViewport();
- window->Pos = main_viewport->Pos + ImVec2(60, 60);
- window->Size = window->SizeFull = ImVec2(0, 0);
- window->ViewportPos = main_viewport->Pos;
- window->SetWindowPosAllowFlags = window->SetWindowSizeAllowFlags = window->SetWindowCollapsedAllowFlags = window->SetWindowDockAllowFlags = ImGuiCond_Always | ImGuiCond_Once | ImGuiCond_FirstUseEver | ImGuiCond_Appearing;
-
if (settings != NULL)
{
+ const ImGuiViewport* main_viewport = ImGui::GetMainViewport();
+ window->ViewportPos = main_viewport->Pos;
+ if (settings->ViewportId)
+ {
+ window->ViewportId = settings->ViewportId;
+ window->ViewportPos = ImVec2(settings->ViewportPos.x, settings->ViewportPos.y);
+ }
+ window->Pos = ImTrunc(ImVec2(settings->Pos.x + window->ViewportPos.x, settings->Pos.y + window->ViewportPos.y));
+ if (settings->Size.x > 0 && settings->Size.y > 0)
+ {
+ window->Size = window->SizeFull = ImTrunc(ImVec2(settings->Size.x, settings->Size.y));
+ window->AutoFitFramesX = window->AutoFitFramesY = 0;
+ }
+ window->Collapsed = settings->Collapsed;
+ window->DockId = settings->DockId;
+ window->DockOrder = settings->DockOrder;
SetWindowConditionAllowFlags(window, ImGuiCond_FirstUseEver, false);
- ApplyWindowSettings(window, settings);
}
- window->DC.CursorStartPos = window->DC.CursorMaxPos = window->DC.IdealMaxPos = window->Pos; // So first call to CalcWindowContentSizes() doesn't return crazy values
+ window->DC.CursorStartPos = window->DC.CursorMaxPos = window->DC.IdealMaxPos = window->Pos; // So first call to CalcWindowContentSizes() doesn't return crazy values
if ((window->Flags & ImGuiWindowFlags_AlwaysAutoResize) != 0)
{
window->AutoFitFramesX = window->AutoFitFramesY = 2;
@@ -6927,14 +7035,29 @@ static void InitOrLoadWindowSettings(ImGuiWindow* window, ImGuiWindowSettings* s
}
else
{
- if (window->Size.x <= 0.0f)
- window->AutoFitFramesX = 2;
- if (window->Size.y <= 0.0f)
- window->AutoFitFramesY = 2;
+ window->AutoFitFramesX = (window->Size.x <= 0.0f) ? 2 : 0;
+ window->AutoFitFramesY = (window->Size.y <= 0.0f) ? 2 : 0;
window->AutoFitOnlyGrows = (window->AutoFitFramesX > 0) || (window->AutoFitFramesY > 0);
}
}
+// Note that 'settings' may be NULL.
+// Sets _Once, _Appearing, _FirstUseEver. _FirstUseEver will be cleared again if there are settings.
+static void InitOrLoadWindowSettings(ImGuiWindow* window, ImGuiWindowSettings* settings)
+{
+ // Initial window state with e.g. default/arbitrary window position
+ // Use SetNextWindowPos() with the appropriate condition flag to change the initial position of a window.
+ ImGuiContext& g = *GImGui;
+ const ImGuiViewport* main_viewport = ImGui::GetMainViewport();
+ window->Pos = main_viewport->Pos + ImVec2(60, 60);
+ window->Size = window->SizeFull = ImVec2(0, 0);
+ window->ViewportPos = main_viewport->Pos;
+ window->SetWindowPosAllowFlags = window->SetWindowSizeAllowFlags = window->SetWindowCollapsedAllowFlags = window->SetWindowDockAllowFlags = ImGuiCond_Always | ImGuiCond_Once | ImGuiCond_FirstUseEver | ImGuiCond_Appearing;
+ ApplyWindowSettings(window, settings);
+ if (settings != NULL)
+ settings->LastUsedDate = g.SessionDate;
+}
+
static ImGuiWindow* CreateNewWindow(const char* name, ImGuiWindowFlags flags)
{
// Create window the first time
@@ -7050,8 +7173,8 @@ static ImVec2 CalcWindowAutoFitSize(ImGuiWindow* window, const ImVec2& size_cont
const float decoration_h_without_scrollbars = window->DecoOuterSizeY1 + window->DecoOuterSizeY2 - window->ScrollbarSizes.y;
ImVec2 size_pad = window->WindowPadding * 2.0f;
ImVec2 size_desired;
- size_desired[ImGuiAxis_X] = (axis_mask & 1) ? size_contents.x + size_pad.x + decoration_w_without_scrollbars : window->Size.x;
- size_desired[ImGuiAxis_Y] = (axis_mask & 2) ? size_contents.y + size_pad.y + decoration_h_without_scrollbars : window->Size.y;
+ size_desired.x = (axis_mask & 1) ? size_contents.x + size_pad.x + decoration_w_without_scrollbars : window->Size.x;
+ size_desired.y = (axis_mask & 2) ? size_contents.y + size_pad.y + decoration_h_without_scrollbars : window->Size.y;
// Determine maximum window size
// Child windows are laid within their parent (unless they are also popups/menus) and thus have no restriction
@@ -7078,8 +7201,10 @@ static ImVec2 CalcWindowAutoFitSize(ImGuiWindow* window, const ImVec2& size_cont
// When the window cannot fit all contents (either because of constraints, either because screen is too small),
// we are growing the size on the other axis to compensate for expected scrollbar. FIXME: Might turn bigger than ViewportSize-WindowPadding.
ImVec2 size_auto_fit_after_constraint = CalcWindowSizeAfterConstraint(window, size_auto_fit);
- bool will_have_scrollbar_x = (size_auto_fit_after_constraint.x - size_pad.x - decoration_w_without_scrollbars < size_contents.x && !(window->Flags & ImGuiWindowFlags_NoScrollbar) && (window->Flags & ImGuiWindowFlags_HorizontalScrollbar)) || (window->Flags & ImGuiWindowFlags_AlwaysHorizontalScrollbar);
- bool will_have_scrollbar_y = (size_auto_fit_after_constraint.y - size_pad.y - decoration_h_without_scrollbars < size_contents.y && !(window->Flags & ImGuiWindowFlags_NoScrollbar)) || (window->Flags & ImGuiWindowFlags_AlwaysVerticalScrollbar);
+ float size_contents_for_scrollbar_x = (axis_mask & 1) ? size_contents.x : window->ContentSize.x; // See #9352. In theory this should use same logic as `window->ScrollbarY = ...` codepath in Begin(). Needs some plumbling.
+ float size_contents_for_scrollbar_y = (axis_mask & 2) ? size_contents.y : window->ContentSize.y;
+ bool will_have_scrollbar_x = (size_auto_fit_after_constraint.x < size_contents_for_scrollbar_x + size_pad.x + decoration_w_without_scrollbars && !(window->Flags & ImGuiWindowFlags_NoScrollbar) && (window->Flags & ImGuiWindowFlags_HorizontalScrollbar)) || (window->Flags & ImGuiWindowFlags_AlwaysHorizontalScrollbar);
+ bool will_have_scrollbar_y = (size_auto_fit_after_constraint.y < size_contents_for_scrollbar_y + size_pad.y + decoration_h_without_scrollbars && !(window->Flags & ImGuiWindowFlags_NoScrollbar)) || (window->Flags & ImGuiWindowFlags_AlwaysVerticalScrollbar);
if (will_have_scrollbar_x)
size_auto_fit.y += style.ScrollbarSize;
if (will_have_scrollbar_y)
@@ -7433,7 +7558,7 @@ static void RenderWindowOuterSingleBorder(ImGuiWindow* window, int border_n, ImU
const ImRect border_r = GetResizeBorderRect(window, border_n, rounding, 0.0f);
window->DrawList->PathArcTo(ImLerp(border_r.Min, border_r.Max, def.SegmentN1) + ImVec2(0.5f, 0.5f) + def.InnerDir * rounding, rounding, def.OuterAngle - IM_PI * 0.25f, def.OuterAngle);
window->DrawList->PathArcTo(ImLerp(border_r.Min, border_r.Max, def.SegmentN2) + ImVec2(0.5f, 0.5f) + def.InnerDir * rounding, rounding, def.OuterAngle, def.OuterAngle + IM_PI * 0.25f);
- window->DrawList->PathStroke(border_col, ImDrawFlags_None, border_size);
+ window->DrawList->PathStroke(border_col, border_size);
}
static void ImGui::RenderWindowOuterBorders(ImGuiWindow* window)
@@ -7442,7 +7567,7 @@ static void ImGui::RenderWindowOuterBorders(ImGuiWindow* window)
const float border_size = window->WindowBorderSize;
const ImU32 border_col = GetColorU32(ImGuiCol_Border);
if (border_size > 0.0f && (window->Flags & ImGuiWindowFlags_NoBackground) == 0)
- window->DrawList->AddRect(window->Pos, window->Pos + window->Size, border_col, window->WindowRounding, 0, window->WindowBorderSize);
+ window->DrawList->AddRect(window->Pos, window->Pos + window->Size, border_col, window->WindowRounding, window->WindowBorderSize);
else if (border_size > 0.0f)
{
if (window->ChildFlags & ImGuiChildFlags_ResizeX) // Similar code as 'resize_border_mask' computation in UpdateWindowManualResize() but we specifically only always draw explicit child resize border.
@@ -7459,7 +7584,7 @@ static void ImGui::RenderWindowOuterBorders(ImGuiWindow* window)
if (g.Style.FrameBorderSize > 0 && !(window->Flags & ImGuiWindowFlags_NoTitleBar) && !window->DockIsActive)
{
float y = window->Pos.y + window->TitleBarHeight - 1;
- window->DrawList->AddLine(ImVec2(window->Pos.x + border_size * 0.5f, y), ImVec2(window->Pos.x + window->Size.x - border_size * 0.5f, y), border_col, g.Style.FrameBorderSize);
+ window->DrawList->AddLineH(window->Pos.x + border_size * 0.5f, window->Pos.x + window->Size.x - border_size * 0.5f, y, border_col, g.Style.FrameBorderSize);
}
}
@@ -7569,7 +7694,7 @@ void ImGui::RenderWindowDecorations(ImGuiWindow* window, const ImRect& title_bar
menu_bar_rect.ClipWith(window->Rect()); // Soft clipping, in particular child window don't have minimum size covering the menu bar so this is useful for them.
window->DrawList->AddRectFilled(menu_bar_rect.Min, menu_bar_rect.Max, GetColorU32(ImGuiCol_MenuBarBg), (flags & ImGuiWindowFlags_NoTitleBar) ? window_rounding : 0.0f, ImDrawFlags_RoundCornersTop);
if (style.FrameBorderSize > 0.0f && menu_bar_rect.Max.y < window->Pos.y + window->Size.y)
- window->DrawList->AddLine(menu_bar_rect.GetBL() + ImVec2(window_border_size * 0.5f, 0.0f), menu_bar_rect.GetBR() - ImVec2(window_border_size * 0.5f, 0.0f), GetColorU32(ImGuiCol_Border), style.FrameBorderSize);
+ window->DrawList->AddLineH(menu_bar_rect.Min.x + window_border_size * 0.5f, menu_bar_rect.Max.x - window_border_size * 0.5f, menu_bar_rect.Max.y, GetColorU32(ImGuiCol_Border), style.FrameBorderSize);
}
// Docking: Unhide tab bar (small triangle in the corner), drag from small triangle to quickly undock
@@ -8064,10 +8189,10 @@ bool ImGui::Begin(const char* name, bool* p_open, ImGuiWindowFlags flags)
if (flags & ImGuiWindowFlags_AlwaysAutoResize)
{
if (!window_size_x_set_by_api)
- window->Size.x = window->SizeFull.x = 0.f;
+ window->Size.x = window->SizeFull.x = 0.0f;
if (!window_size_y_set_by_api)
- window->Size.y = window->SizeFull.y = 0.f;
- window->ContentSize = window->ContentSizeIdeal = ImVec2(0.f, 0.f);
+ window->Size.y = window->SizeFull.y = 0.0f;
+ window->ContentSize = window->ContentSizeIdeal = ImVec2(0.0f, 0.0f);
}
}
@@ -8115,7 +8240,10 @@ bool ImGui::Begin(const char* name, bool* p_open, ImGuiWindowFlags flags)
ImRect title_bar_rect = window->TitleBarRect();
if (g.HoveredWindow == window && g.HoveredId == 0 && g.HoveredIdPreviousFrame == 0 && g.ActiveId == 0 && IsMouseHoveringRect(title_bar_rect.Min, title_bar_rect.Max))
if (g.IO.MouseClickedCount[0] == 2 && GetKeyOwner(ImGuiKey_MouseLeft) == ImGuiKeyOwner_NoOwner)
+ {
window->WantCollapseToggle = true;
+ SetKeyOwner(ImGuiKey_MouseLeft, window->MoveId); // Claim input the same way ButtonBehavior() does. Prevent a same-frame move from triggering other items. (#9439)
+ }
if (window->WantCollapseToggle)
{
window->Collapsed = !window->Collapsed;
@@ -8357,12 +8485,12 @@ bool ImGui::Begin(const char* name, bool* p_open, ImGuiWindowFlags flags)
ImVec2 avail_size_from_current_frame = ImVec2(window->SizeFull.x, window->SizeFull.y - (window->DecoOuterSizeY1 + window->DecoOuterSizeY2));
ImVec2 avail_size_from_last_frame = window->InnerRect.GetSize() + scrollbar_sizes_from_last_frame;
ImVec2 needed_size_from_last_frame = window_just_created ? ImVec2(0, 0) : window->ContentSize + window->WindowPadding * 2.0f;
- float size_x_for_scrollbars = use_current_size_for_scrollbar_x ? avail_size_from_current_frame.x : avail_size_from_last_frame.x;
- float size_y_for_scrollbars = use_current_size_for_scrollbar_y ? avail_size_from_current_frame.y : avail_size_from_last_frame.y;
+ float size_for_scrollbars_x = use_current_size_for_scrollbar_x ? avail_size_from_current_frame.x : avail_size_from_last_frame.x;
+ float size_for_scrollbars_y = use_current_size_for_scrollbar_y ? avail_size_from_current_frame.y : avail_size_from_last_frame.y;
bool scrollbar_x_prev = window->ScrollbarX;
//bool scrollbar_y_from_last_frame = window->ScrollbarY; // FIXME: May want to use that in the ScrollbarX expression? How many pros vs cons?
- window->ScrollbarY = (flags & ImGuiWindowFlags_AlwaysVerticalScrollbar) || ((needed_size_from_last_frame.y > size_y_for_scrollbars) && !(flags & ImGuiWindowFlags_NoScrollbar));
- window->ScrollbarX = (flags & ImGuiWindowFlags_AlwaysHorizontalScrollbar) || ((needed_size_from_last_frame.x > size_x_for_scrollbars - (window->ScrollbarY ? style.ScrollbarSize : 0.0f)) && !(flags & ImGuiWindowFlags_NoScrollbar) && (flags & ImGuiWindowFlags_HorizontalScrollbar));
+ window->ScrollbarY = (flags & ImGuiWindowFlags_AlwaysVerticalScrollbar) || ((needed_size_from_last_frame.y > size_for_scrollbars_y) && !(flags & ImGuiWindowFlags_NoScrollbar));
+ window->ScrollbarX = (flags & ImGuiWindowFlags_AlwaysHorizontalScrollbar) || ((needed_size_from_last_frame.x > size_for_scrollbars_x - (window->ScrollbarY ? style.ScrollbarSize : 0.0f)) && !(flags & ImGuiWindowFlags_NoScrollbar) && (flags & ImGuiWindowFlags_HorizontalScrollbar));
// Track when ScrollbarX visibility keeps toggling, which is a sign of a feedback loop, and stabilize by enforcing visibility (#3285, #8488)
// (Feedback loops of this sort can manifest in various situations, but combining horizontal + vertical scrollbar + using a clipper with varying width items is one frequent cause.
@@ -8377,7 +8505,7 @@ bool ImGui::Begin(const char* name, bool* p_open, ImGuiWindowFlags flags)
window->ScrollbarXStabilizeEnabled = scrollbar_x_stabilize;
if (window->ScrollbarX && !window->ScrollbarY)
- window->ScrollbarY = (needed_size_from_last_frame.y > size_y_for_scrollbars - style.ScrollbarSize) && !(flags & ImGuiWindowFlags_NoScrollbar);
+ window->ScrollbarY = (needed_size_from_last_frame.y > size_for_scrollbars_y - style.ScrollbarSize) && !(flags & ImGuiWindowFlags_NoScrollbar);
window->ScrollbarSizes = ImVec2(window->ScrollbarY ? style.ScrollbarSize : 0.0f, window->ScrollbarX ? style.ScrollbarSize : 0.0f);
// Amend the partially filled window->DecorationXXX values.
@@ -8546,9 +8674,14 @@ bool ImGui::Begin(const char* name, bool* p_open, ImGuiWindowFlags flags)
window->DC.LayoutType = ImGuiLayoutType_Vertical;
window->DC.ParentLayoutType = parent_window ? parent_window->DC.LayoutType : ImGuiLayoutType_Vertical;
- // Default item width. Make it proportional to window size if window manually resizes
- const bool is_resizable_window = (window->Size.x > 0.0f && !(flags & ImGuiWindowFlags_Tooltip) && !(flags & ImGuiWindowFlags_AlwaysAutoResize));
- if (is_resizable_window)
+ // Default item width. Make it proportional to window size if window can be manually resized.
+ // (we cannot use AutoFitFramesX/AutoFitFramesY which is a temporary state)
+ bool is_resizable_width;
+ if ((flags & ImGuiWindowFlags_ChildWindow) && !window->DockIsActive)
+ is_resizable_width = (window->Size.x > 0.0f) && !(window->ChildFlags & (ImGuiChildFlags_AutoResizeX | ImGuiChildFlags_AlwaysAutoResize));
+ else
+ is_resizable_width = (window->Size.x > 0.0f) && !(flags & ImGuiWindowFlags_AlwaysAutoResize);
+ if (is_resizable_width)
window->DC.ItemWidthDefault = ImTrunc(window->Size.x * 0.65f);
else
window->DC.ItemWidthDefault = ImTrunc(g.FontSize * 16.0f);
@@ -8770,6 +8903,8 @@ void ImGui::End()
ImGuiWindowStackData& window_stack_data = g.CurrentWindowStack.back();
// Error checking: verify that user doesn't directly call End() on a child window.
+ if (window->Flags & ImGuiWindowFlags_Popup)
+ IM_ASSERT_USER_ERROR(g.WithinEndPopupID == window->ID, "Must call EndPopup() and not End()!");
if ((window->Flags & ImGuiWindowFlags_ChildWindow) && !(window->Flags & ImGuiWindowFlags_DockNodeHost) && !window->DockIsActive)
IM_ASSERT_USER_ERROR(g.WithinEndChildID == window->ID, "Must call EndChild() and not End()!");
@@ -9367,6 +9502,17 @@ void ImGui::PopFocusScope()
g.CurrentFocusScopeId = g.FocusScopeStack.Size ? g.FocusScopeStack.back().ID : 0;
}
+bool ImGui::IsInNavFocusRoute(ImGuiID focus_scope_id)
+{
+ ImGuiContext& g = *GImGui;
+ if (g.NavFocusScopeId == focus_scope_id)
+ return true;
+ for (const ImGuiFocusScopeData& focus_scope : g.NavFocusRoute)
+ if (focus_scope.ID == focus_scope_id)
+ return true;
+ return false;
+}
+
void ImGui::SetNavFocusScope(ImGuiID focus_scope_id)
{
ImGuiContext& g = *GImGui;
@@ -9540,6 +9686,8 @@ static void ImGui::UpdateTexturesNewFrame()
IM_ASSERT(atlas->RendererHasTextures == has_textures);
}
}
+ for (ImTextureData* tex : g.UserTextures)
+ ImTextureDataUpdateNewFrame(tex);
}
// Build a single texture list
@@ -9601,7 +9749,7 @@ ImFont* ImGui::GetDefaultFont()
return g.IO.FontDefault ? g.IO.FontDefault : atlas->Fonts[0];
}
-// EXPERIMENTAL: DO NOT USE YET.
+// EXPERIMENTAL. Use ImTextureDataQueueUpload() to queue updates. Textures logic will be automatically be updated in NewFrame().
void ImGui::RegisterUserTexture(ImTextureData* tex)
{
ImGuiContext& g = *GImGui;
@@ -9723,7 +9871,7 @@ void ImGui::UpdateCurrentFontSize(float restore_font_size_after_scaling)
}
g.FontBaked = (g.Font != NULL && window != NULL) ? g.Font->GetFontBaked(final_size) : NULL;
- g.FontBakedScale = (g.Font != NULL && window != NULL) ? (g.FontSize / g.FontBaked->Size) : 0.0f;
+ g.FontBakedScale = (g.FontBaked != NULL) ? (g.FontSize / g.FontBaked->Size) : 0.0f;
g.DrawListSharedData.FontScale = g.FontBakedScale;
}
@@ -9956,6 +10104,7 @@ IM_MSVC_RUNTIME_CHECKS_RESTORE
// - IsMouseReleased()
// - IsMouseDoubleClicked()
// - GetMouseClickedCount()
+// - GetItemClickedCountWithSingleClickDelay()
// - IsMouseHoveringRect() [Internal]
// - IsMouseDragPastThreshold() [Internal]
// - IsMouseDragging()
@@ -10535,6 +10684,8 @@ bool ImGui::IsMouseReleased(ImGuiMouseButton button, ImGuiID owner_id)
return g.IO.MouseReleased[button] && TestKeyOwner(MouseButtonToKey(button), owner_id); // Should be same as IsKeyReleased(MouseButtonToKey(button), owner_id)
}
+
+// Prefer higher-level helper GetItemClickedCountWithSingleClickDelay()
// Use if you absolutely need to distinguish single-click from double-click by introducing a delay.
// Generally use with 'delay >= io.MouseDoubleClickTime' + combined with a 'io.MouseClickedLastCount == 1' test.
// This is a very rarely used UI idiom, but some apps use this: e.g. MS Explorer single click on an icon to rename.
@@ -10542,8 +10693,12 @@ bool ImGui::IsMouseReleasedWithDelay(ImGuiMouseButton button, float delay)
{
ImGuiContext& g = *GImGui;
IM_ASSERT(button >= 0 && button < IM_COUNTOF(g.IO.MouseDown));
+ if (IsMouseDown(button))
+ return false;
+ if (delay < 0.0f)
+ delay = g.IO.MouseSingleClickDelay;
const float time_since_release = (float)(g.Time - g.IO.MouseReleasedTime[button]);
- return !IsMouseDown(button) && (time_since_release - g.IO.DeltaTime < delay) && (time_since_release >= delay);
+ return (time_since_release - g.IO.DeltaTime < delay) && (time_since_release >= delay);
}
bool ImGui::IsMouseDoubleClicked(ImGuiMouseButton button)
@@ -10567,6 +10722,62 @@ int ImGui::GetMouseClickedCount(ImGuiMouseButton button)
return g.IO.MouseClickedCount[button];
}
+// FIXME: This is close to what BeginDragDropSource() is doing, maybe rework.
+static ImGuiID LastItemOverlayButtonForNullId(ImGuiMouseButton mouse_button)
+{
+ ImGuiContext& g = *GImGui;
+ IM_ASSERT(g.LastItemData.ID == 0);
+ ImGuiWindow* window = g.CurrentWindow;
+ ImGuiID id = window->GetIDFromRectangle(g.LastItemData.Rect);
+ if (g.IO.MouseClicked[mouse_button] && ImGui::ItemHoverable(g.LastItemData.Rect, id, g.LastItemData.ItemFlags))
+ {
+ ImGui::SetActiveID(id, window);
+ ImGui::FocusWindow(window);
+ }
+ else if (g.ActiveId == id)
+ {
+ ImGui::KeepAliveID(id);
+ if (!g.IO.MouseDown[mouse_button])
+ ImGui::ClearActiveID();
+ }
+ return id;
+}
+
+// [BETA] Building block for disambiguation between single-click and double-click.
+// - Returns 1 on single-click but delayed by io.MouseSingleClickDelay (which is always > io.MouseDoubleClickTime) after mouse release.
+// - Returns 2+ on double-click and subsequent repeated clicks.
+// In order use that to replicate Windows Explorer's "click on label to rename after a delay",
+// When the function returns 1 for a delayed single click, you can add with further tests:
+// - If you want to test that the mouse position AT THE TIME of the click (before the delay): you can use the 'io.MouseClickedPos[mouse_button]' position.
+// - If you want to test that the mouse position is still over the item at the end of delay: you can use '&& IsItemHovered()'.
+// - If you want to test that the item was selected or the sole selection AT THE TIME of the click (before the delay): you can test for 'g.LastActiveIdWasSelected' or 'g.LastActiveIdWasSoleSelected'.
+// e.g.
+// int click_count = ImGui::GetItemClickedCountWithSingleClickDelay(mouse_button);
+// if (click_count == 1 && ImGui::GetCurrentContext()->LastActiveIdWasSoleSelected)
+// StartRename();
+// if (click_count == 2)
+// Launch();
+int ImGui::GetItemClickedCountWithSingleClickDelay(ImGuiMouseButton mouse_button, float delay)
+{
+ // Action: double-click and subsequent clicks
+ ImGuiContext& g = *GImGui;
+ if (g.IO.MouseClickedCount[mouse_button] >= 2 && IsItemClicked(mouse_button))
+ return g.IO.MouseClickedCount[mouse_button];
+
+ // Action: second click, delayed
+ ImGuiID id = g.LastItemData.ID;
+ if (id == 0)
+ id = LastItemOverlayButtonForNullId(mouse_button);
+ if (g.LastActiveId == id)
+ {
+ if (delay >= 0.0f)
+ delay = ImMax(delay, g.IO.MouseDoubleClickTime + 0.01f);
+ if (IsMouseReleasedWithDelay(mouse_button, delay) && g.IO.MouseClickedLastCount[mouse_button] == 1)
+ return 1;
+ }
+ return 0;
+}
+
// Test if mouse cursor is hovering given rectangle
// NB- Rectangle is clipped by our current clip setting
// NB- Expand the rectangle to be generous on imprecise inputs systems (g.Style.TouchExtraPadding)
@@ -10936,15 +11147,21 @@ void ImGui::UpdateMouseWheel()
LockWheelingWindow(NULL, 0.0f);
}
- ImVec2 wheel;
- wheel.x = TestKeyOwner(ImGuiKey_MouseWheelX, ImGuiKeyOwner_NoOwner) ? g.IO.MouseWheelH : 0.0f;
- wheel.y = TestKeyOwner(ImGuiKey_MouseWheelY, ImGuiKeyOwner_NoOwner) ? g.IO.MouseWheel : 0.0f;
-
- //IMGUI_DEBUG_LOG("MouseWheel X:%.3f Y:%.3f\n", wheel_x, wheel_y);
ImGuiWindow* mouse_window = g.WheelingWindow ? g.WheelingWindow : g.HoveredWindow;
if (!mouse_window || mouse_window->Collapsed)
return;
+ ImGuiID owner_id = mouse_window->ID;
+ ImVec2 wheel;
+ wheel.x = TestKeyOwner(ImGuiKey_MouseWheelX, owner_id) ? g.IO.MouseWheelH : 0.0f;
+ wheel.y = TestKeyOwner(ImGuiKey_MouseWheelY, owner_id) ? g.IO.MouseWheel : 0.0f;
+ //IMGUI_DEBUG_LOG("MouseWheel X:%.3f Y:%.3f\n", wheel_x, wheel_y);
+ if (g.WheelingWindow != NULL)
+ {
+ SetKeyOwner(ImGuiKey_MouseWheelX, owner_id);
+ SetKeyOwner(ImGuiKey_MouseWheelY, owner_id);
+ }
+
// Zoom / Scale window
// FIXME-OBSOLETE: This is an old feature, it still works but pretty much nobody is using it and may be best redesigned.
if (wheel.y != 0.0f && g.IO.KeyCtrl && g.IO.FontAllowUserScaling)
@@ -11253,6 +11470,7 @@ bool ImGui::TestKeyOwner(ImGuiKey key, ImGuiID owner_id)
// - SetKeyOwner(..., None) : clears owner
// - SetKeyOwner(..., Any, !Lock) : illegal (assert)
// - SetKeyOwner(..., Any or None, Lock) : set lock
+// Ownership is automatically released on the frame after a release, see code in UpdateKeyboardInputs().
void ImGui::SetKeyOwner(ImGuiKey key, ImGuiID owner_id, ImGuiInputFlags flags)
{
ImGuiContext& g = *GImGui;
@@ -11279,30 +11497,34 @@ void ImGui::SetKeyOwnersForKeyChord(ImGuiKeyChord key_chord, ImGuiID owner_id, I
if (key_chord & ~ImGuiMod_Mask_) { SetKeyOwner((ImGuiKey)(key_chord & ~ImGuiMod_Mask_), owner_id, flags); }
}
-// This is more or less equivalent to:
+// This is more or less equivalent to a fancier version of:
// if (IsItemHovered() || IsItemActive())
// SetKeyOwner(key, GetItemID());
// Extensive uses of that (e.g. many calls for a single item) may want to manually perform the tests once and then call SetKeyOwner() multiple times.
// More advanced usage scenarios may want to call SetKeyOwner() manually based on different condition.
// Worth noting is that only one item can be hovered and only one item can be active, therefore this usage pattern doesn't need to bother with routing and priority.
-void ImGui::SetItemKeyOwner(ImGuiKey key, ImGuiInputFlags flags)
+bool ImGui::SetItemKeyOwner(ImGuiKey key, ImGuiInputFlags flags)
{
ImGuiContext& g = *GImGui;
ImGuiID id = g.LastItemData.ID;
if (id == 0 || (g.HoveredId != id && g.ActiveId != id))
- return;
+ return false;
if ((flags & ImGuiInputFlags_CondMask_) == 0)
flags |= ImGuiInputFlags_CondDefault_;
if ((g.HoveredId == id && (flags & ImGuiInputFlags_CondHovered)) || (g.ActiveId == id && (flags & ImGuiInputFlags_CondActive)))
{
IM_ASSERT((flags & ~ImGuiInputFlags_SupportedBySetItemKeyOwner) == 0); // Passing flags not supported by this function!
+ if (!TestKeyOwner(key, id))
+ return false;
SetKeyOwner(key, id, flags & ~ImGuiInputFlags_CondMask_);
+ return true;
}
+ return false;
}
-void ImGui::SetItemKeyOwner(ImGuiKey key)
+bool ImGui::SetItemKeyOwner(ImGuiKey key)
{
- SetItemKeyOwner(key, ImGuiInputFlags_None);
+ return SetItemKeyOwner(key, ImGuiInputFlags_None);
}
// This is the only public API until we expose owner_id versions of the API as replacements.
@@ -11443,7 +11665,8 @@ bool ImGui::DebugCheckVersionAndDataLayout(const char* version, size_t sz_io, si
// to extend contents size of our parent container (e.g. window contents size, which is used for auto-resizing
// windows, table column contents size used for auto-resizing columns, group size).
// This was causing issues and ambiguities and we needed to retire that.
-// From 1.89, extending contents size boundaries REQUIRES AN ITEM TO BE SUBMITTED.
+// 2022/08/05 (1.89): extending contents size boundaries REQUIRES AN ITEM TO BE SUBMITTED. However we gated the new logic behind a '#ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS' block.
+// 2025/06/25 (1.92): removed the legacy path and turned into an assert. It was a mistake that there was a #ifndef before: our obsolescence schedule gets pushed back a bit more :(
//
// Previously this would make the window content size ~200x200:
// Begin(...) + SetCursorScreenPos(GetCursorScreenPos() + ImVec2(200,200)) + End(); // NOT OK ANYMORE
@@ -11511,7 +11734,13 @@ static void ImGui::ErrorCheckNewFrameSanityChecks()
IM_ASSERT(g.Style.WindowBorderHoverPadding > 0.0f && "Invalid style setting!"); // Required otherwise cannot resize from borders.
IM_ASSERT(g.Style.WindowMenuButtonPosition == ImGuiDir_None || g.Style.WindowMenuButtonPosition == ImGuiDir_Left || g.Style.WindowMenuButtonPosition == ImGuiDir_Right);
IM_ASSERT(g.Style.ColorButtonPosition == ImGuiDir_Left || g.Style.ColorButtonPosition == ImGuiDir_Right);
+ IM_ASSERT(ImIsPowerOfTwo(g.IO.ConfigColorEditFlags & ImGuiColorEditFlags_DisplayMask_)); // Check only 1 option is selected
+ IM_ASSERT(ImIsPowerOfTwo(g.IO.ConfigColorEditFlags & ImGuiColorEditFlags_DataTypeMask_)); // "
+ IM_ASSERT(ImIsPowerOfTwo(g.IO.ConfigColorEditFlags & ImGuiColorEditFlags_PickerMask_)); // "
+ IM_ASSERT(ImIsPowerOfTwo(g.IO.ConfigColorEditFlags & ImGuiColorEditFlags_InputMask_)); // "
+
IM_ASSERT(g.Style.TreeLinesFlags == ImGuiTreeNodeFlags_DrawLinesNone || g.Style.TreeLinesFlags == ImGuiTreeNodeFlags_DrawLinesFull || g.Style.TreeLinesFlags == ImGuiTreeNodeFlags_DrawLinesToNodes);
+ IM_ASSERT(g.IO.MouseSingleClickDelay > g.IO.MouseDoubleClickTime);
// Error handling: we do not accept 100% silent recovery! Please contact me if you feel this is getting in your way.
if (g.IO.ConfigErrorRecovery)
@@ -11911,7 +12140,7 @@ bool ImGui::ItemAdd(const ImRect& bb, ImGuiID id, const ImRect* nav_bb_arg, ImGu
g.LastItemData.ID = id;
g.LastItemData.Rect = bb;
g.LastItemData.NavRect = nav_bb_arg ? *nav_bb_arg : bb;
- g.LastItemData.ItemFlags = g.CurrentItemFlags | g.NextItemData.ItemFlags | extra_flags;
+ g.LastItemData.ItemFlags = g.CurrentItemFlags | g.NextItemData.ItemFlagsSet | extra_flags;
g.LastItemData.StatusFlags = ImGuiItemStatusFlags_None;
// Note: we don't copy 'g.NextItemData.SelectionUserData' to an hypothetical g.LastItemData.SelectionUserData: since the former is not cleared.
@@ -11945,7 +12174,7 @@ bool ImGui::ItemAdd(const ImRect& bb, ImGuiID id, const ImRect* nav_bb_arg, ImGu
// Lightweight clear of SetNextItemXXX data.
g.NextItemData.HasFlags = ImGuiNextItemDataFlags_None;
- g.NextItemData.ItemFlags = ImGuiItemFlags_None;
+ g.NextItemData.ItemFlagsSet = ImGuiItemFlags_None;
#ifdef IMGUI_ENABLE_TEST_ENGINE
if (id != 0)
@@ -11984,7 +12213,7 @@ bool ImGui::ItemAdd(const ImRect& bb, ImGuiID id, const ImRect* nav_bb_arg, ImGu
*p_highlight = g.FrameCount;
*p_alive = g.FrameCount;
if (*p_highlight >= g.FrameCount - 1)
- window->DrawList->AddRect(bb.Min - ImVec2(1, 1), bb.Max + ImVec2(1, 1), IM_COL32(255, 0, 0, 255), 0.0f, ImDrawFlags_None, 2.0f);
+ window->DrawList->AddRect(bb.Min - ImVec2(1, 1), bb.Max + ImVec2(1, 1), IM_COL32(255, 0, 0, 255), 0.0f, 2.0f);
}
#endif
}
@@ -12355,7 +12584,7 @@ void ImGui::BeginGroup()
group_data.BackupActiveIdIsAlive = g.ActiveIdIsAlive;
group_data.BackupHoveredIdIsAlive = g.HoveredId != 0;
group_data.BackupIsSameLine = window->DC.IsSameLine;
- group_data.BackupActiveIdHasBeenEditedThisFrame = g.ActiveIdHasBeenEditedThisFrame;
+ group_data.BackupAnyIdHasBeenEditedThisFrame = g.AnyIdHasBeenEditedThisFrame;
group_data.BackupDeactivatedIdIsAlive = g.DeactivatedItemData.IsAlive;
group_data.EmitItem = true;
@@ -12420,7 +12649,7 @@ void ImGui::EndGroup()
g.LastItemData.StatusFlags |= ImGuiItemStatusFlags_HoveredWindow;
// Forward Edited flag
- if (g.ActiveIdHasBeenEditedThisFrame && !group_data.BackupActiveIdHasBeenEditedThisFrame)
+ if (g.AnyIdHasBeenEditedThisFrame && !group_data.BackupAnyIdHasBeenEditedThisFrame)
g.LastItemData.StatusFlags |= ImGuiItemStatusFlags_Edited;
// Forward Deactivated flag
@@ -12882,24 +13111,26 @@ ImGuiWindow* ImGui::FindBlockingModal(ImGuiWindow* window)
return NULL;
}
-void ImGui::OpenPopup(const char* str_id, ImGuiPopupFlags popup_flags)
+bool ImGui::OpenPopup(const char* str_id, ImGuiPopupFlags popup_flags)
{
ImGuiContext& g = *GImGui;
ImGuiID id = g.CurrentWindow->GetID(str_id);
IMGUI_DEBUG_LOG_POPUP("[popup] OpenPopup(\"%s\" -> 0x%08X)\n", str_id, id);
- OpenPopupEx(id, popup_flags);
+ return OpenPopupEx(id, popup_flags);
}
-void ImGui::OpenPopup(ImGuiID id, ImGuiPopupFlags popup_flags)
+bool ImGui::OpenPopup(ImGuiID id, ImGuiPopupFlags popup_flags)
{
- OpenPopupEx(id, popup_flags);
+ return OpenPopupEx(id, popup_flags);
}
// Mark popup as open (toggle toward open state).
-// Popups are closed when user click outside, or activate a pressable item, or CloseCurrentPopup() is called within a BeginPopup()/EndPopup() block.
-// Popup identifiers are relative to the current ID-stack (so OpenPopup and BeginPopup needs to be at the same level).
-// One open popup per level of the popup hierarchy (NB: when assigning we reset the Window member of ImGuiPopupRef to NULL)
-void ImGui::OpenPopupEx(ImGuiID id, ImGuiPopupFlags popup_flags)
+// - Return true when the popup is toggled open, which allows you to capture local state if needed.
+// You may also call IsWindowAppearing() inside the later BeginPopup() scope if you need to prepare/compute data for the popup.
+// - Popups are closed when user click outside, or activate a pressable item, or CloseCurrentPopup() is called within a BeginPopup()/EndPopup() block.
+// - Popup identifiers are relative to the current ID-stack (so OpenPopup and BeginPopup needs to be at the same level).
+// - One open popup per level of the popup hierarchy (NB: when assigning we reset the Window member of ImGuiPopupRef to NULL).
+bool ImGui::OpenPopupEx(ImGuiID id, ImGuiPopupFlags popup_flags)
{
ImGuiContext& g = *GImGui;
ImGuiWindow* parent_window = g.CurrentWindow;
@@ -12907,7 +13138,7 @@ void ImGui::OpenPopupEx(ImGuiID id, ImGuiPopupFlags popup_flags)
if (popup_flags & ImGuiPopupFlags_NoOpenOverExistingPopup)
if (IsPopupOpen((ImGuiID)0, ImGuiPopupFlags_AnyPopupId))
- return;
+ return false;
ImGuiPopupData popup_ref; // Tagged as new ref as Window will be set back to NULL if we write this into OpenPopupStack.
popup_ref.PopupId = id;
@@ -12922,6 +13153,7 @@ void ImGui::OpenPopupEx(ImGuiID id, ImGuiPopupFlags popup_flags)
if (g.OpenPopupStack.Size < current_stack_size + 1)
{
g.OpenPopupStack.push_back(popup_ref);
+ return true;
}
else
{
@@ -12949,6 +13181,8 @@ void ImGui::OpenPopupEx(ImGuiID id, ImGuiPopupFlags popup_flags)
// This is equivalent to what ClosePopupToLevel() does.
//if (g.OpenPopupStack[current_stack_size].PopupId == id)
// FocusWindow(parent_window);
+
+ return !keep_existing;
}
}
@@ -13102,6 +13336,17 @@ bool ImGui::BeginPopupMenuEx(ImGuiID id, const char* label, ImGuiWindowFlags ext
return false;
}
+ // As we bypass BeginChild(), set ImGuiChildFlags_AlwaysAutoResize as it is checked independently from ImGuiWindowFlags_AlwaysAutoResize for now (see #9355)
+ // Ideally we should remove setting ImGuiWindowFlags_AlwaysAutoResize in BeginChild().
+ if ((extra_window_flags & ImGuiWindowFlags_ChildWindow) && (extra_window_flags & ImGuiWindowFlags_AlwaysAutoResize))
+ {
+ if (g.NextWindowData.HasFlags & ImGuiNextWindowDataFlags_HasChildFlags)
+ g.NextWindowData.ChildFlags |= ImGuiChildFlags_AlwaysAutoResize;
+ else
+ g.NextWindowData.ChildFlags = ImGuiChildFlags_AlwaysAutoResize;
+ g.NextWindowData.HasFlags |= ImGuiNextWindowDataFlags_HasChildFlags;
+ }
+
char name[128];
IM_ASSERT(extra_window_flags & ImGuiWindowFlags_ChildMenu);
ImFormatString(name, IM_COUNTOF(name), "%s###Menu_%02d", label, g.BeginMenuDepth); // Recycle windows based on depth
@@ -13174,10 +13419,13 @@ void ImGui::EndPopup()
NavMoveRequestTryWrapping(window, ImGuiNavMoveFlags_LoopY);
// Child-popups don't need to be laid out
+ const ImGuiID backup_within_end_popup_id = g.WithinEndPopupID;
const ImGuiID backup_within_end_child_id = g.WithinEndChildID;
+ g.WithinEndPopupID = window->ID;
if (window->Flags & ImGuiWindowFlags_ChildWindow)
g.WithinEndChildID = window->ID;
End();
+ g.WithinEndPopupID = backup_within_end_popup_id;
g.WithinEndChildID = backup_within_end_child_id;
}
@@ -13220,16 +13468,17 @@ bool ImGui::IsPopupOpenRequestForWindow(ImGuiPopupFlags popup_flags)
// Helper to open a popup if mouse button is released over the item
// - This is essentially the same as BeginPopupContextItem() but without the trailing BeginPopup()
-void ImGui::OpenPopupOnItemClick(const char* str_id, ImGuiPopupFlags popup_flags)
+bool ImGui::OpenPopupOnItemClick(const char* str_id, ImGuiPopupFlags popup_flags)
{
ImGuiContext& g = *GImGui;
- ImGuiWindow* window = g.CurrentWindow;
if (IsPopupOpenRequestForItem(popup_flags, g.LastItemData.ID))
{
+ ImGuiWindow* window = g.CurrentWindow;
ImGuiID id = str_id ? window->GetID(str_id) : g.LastItemData.ID; // If user hasn't passed an ID, we can use the LastItemID. Using LastItemID as a Popup ID won't conflict!
IM_ASSERT(id != 0); // You cannot pass a NULL str_id if the last item has no identifier (e.g. a Text() item)
- OpenPopupEx(id, popup_flags);
+ return OpenPopupEx(id, popup_flags);
}
+ return false;
}
// This is a helper to handle the simplest case of associating one named popup to one given widget.
@@ -14025,7 +14274,7 @@ static void ImGui::NavProcessItem()
const ImGuiID id = g.LastItemData.ID;
const ImGuiItemFlags item_flags = g.LastItemData.ItemFlags;
- // When inside a container that isn't scrollable with Left<>Right, clip NavRect accordingly (#2221, #8816)
+ // When inside a container that isn't scrollable with Left<>Right, clip NavRect accordingly (#2221, #8816, #7994)
ImRect nav_bb = g.LastItemData.NavRect;
if (window->DC.NavIsScrollPushableX == false)
{
@@ -14428,13 +14677,13 @@ static void ImGui::NavUpdate()
// FIXME-NAV: Now that keys are separated maybe we can get rid of NavInputSource?
const bool nav_gamepad_active = (io.ConfigFlags & ImGuiConfigFlags_NavEnableGamepad) != 0 && (io.BackendFlags & ImGuiBackendFlags_HasGamepad) != 0;
const ImGuiKey nav_gamepad_keys_to_change_source[] = { ImGuiKey_GamepadFaceRight, ImGuiKey_GamepadFaceLeft, ImGuiKey_GamepadFaceUp, ImGuiKey_GamepadFaceDown, ImGuiKey_GamepadDpadRight, ImGuiKey_GamepadDpadLeft, ImGuiKey_GamepadDpadUp, ImGuiKey_GamepadDpadDown };
- if (nav_gamepad_active)
+ if (nav_gamepad_active && g.NavInputSource != ImGuiInputSource_Gamepad)
for (ImGuiKey key : nav_gamepad_keys_to_change_source)
if (IsKeyDown(key))
g.NavInputSource = ImGuiInputSource_Gamepad;
const bool nav_keyboard_active = (io.ConfigFlags & ImGuiConfigFlags_NavEnableKeyboard) != 0;
const ImGuiKey nav_keyboard_keys_to_change_source[] = { ImGuiKey_Space, ImGuiKey_Enter, ImGuiKey_Escape, ImGuiKey_RightArrow, ImGuiKey_LeftArrow, ImGuiKey_UpArrow, ImGuiKey_DownArrow };
- if (nav_keyboard_active)
+ if (nav_keyboard_active && g.NavInputSource != ImGuiInputSource_Keyboard)
for (ImGuiKey key : nav_keyboard_keys_to_change_source)
if (IsKeyDown(key))
g.NavInputSource = ImGuiInputSource_Keyboard;
@@ -14974,7 +15223,7 @@ static void ImGui::NavUpdateContextMenuRequest()
ImGuiContext& g = *GImGui;
g.NavOpenContextMenuItemId = g.NavOpenContextMenuWindowId = 0;
const bool nav_keyboard_active = (g.IO.ConfigFlags & ImGuiConfigFlags_NavEnableKeyboard) != 0;
- const bool nav_gamepad_active = (g.IO.ConfigFlags & ImGuiConfigFlags_NavEnableKeyboard) != 0;
+ const bool nav_gamepad_active = (g.IO.ConfigFlags & ImGuiConfigFlags_NavEnableGamepad) != 0;
if ((!nav_keyboard_active && !nav_gamepad_active) || g.NavWindow == NULL)
return;
@@ -15807,7 +16056,7 @@ const ImGuiPayload* ImGui::AcceptDragDropPayload(const char* type, ImGuiDragDrop
IM_ASSERT(viewport != NULL);
ImRect bb = g.DragDropTargetRect;
bb.Expand(-3.5f);
- RenderDragDropTargetRectEx(GetForegroundDrawList(viewport), bb);
+ RenderDragDropTargetRectEx(GetForegroundDrawList(viewport), bb, g.Style.DragDropTargetRounding);
}
else if (draw_target_rect)
{
@@ -15838,16 +16087,16 @@ void ImGui::RenderDragDropTargetRectForItem(const ImRect& bb)
bool push_clip_rect = !window->ClipRect.Contains(bb_display);
if (push_clip_rect)
window->DrawList->PushClipRectFullScreen();
- RenderDragDropTargetRectEx(window->DrawList, bb_display);
+ RenderDragDropTargetRectEx(window->DrawList, bb_display, g.Style.DragDropTargetRounding);
if (push_clip_rect)
window->DrawList->PopClipRect();
}
-void ImGui::RenderDragDropTargetRectEx(ImDrawList* draw_list, const ImRect& bb)
+void ImGui::RenderDragDropTargetRectEx(ImDrawList* draw_list, const ImRect& bb, float rounding)
{
ImGuiContext& g = *GImGui;
- draw_list->AddRectFilled(bb.Min, bb.Max, GetColorU32(ImGuiCol_DragDropTargetBg), g.Style.DragDropTargetRounding, 0);
- draw_list->AddRect(bb.Min, bb.Max, GetColorU32(ImGuiCol_DragDropTarget), g.Style.DragDropTargetRounding, 0, g.Style.DragDropTargetBorderSize);
+ draw_list->AddRectFilled(bb.Min, bb.Max, GetColorU32(ImGuiCol_DragDropTargetBg), rounding, 0);
+ draw_list->AddRect(bb.Min, bb.Max, GetColorU32(ImGuiCol_DragDropTarget), rounding, g.Style.DragDropTargetBorderSize);
}
const ImGuiPayload* ImGui::GetDragDropPayload()
@@ -16212,6 +16461,26 @@ void ImGui::ClearIniSettings()
handler.ClearAllFn(&g, &handler);
}
+void ImGui::CleanupIniSettings(ImGuiSettingsCleanupArgs* args)
+{
+ ImGuiContext& g = *GImGui;
+ if (args->DiscardAll)
+ for (ImGuiSettingsHandler& handler : g.SettingsHandlers)
+ if (args->TypeHashFilter == 0 || handler.TypeHash == args->TypeHashFilter)
+ if (handler.ClearAllFn != NULL)
+ handler.ClearAllFn(&g, &handler);
+ if (g.PlatformIO.Platform_SessionDate != 0 && args->DiscardOlderThanMonths != 0)
+ {
+ ImGuiPackedDate discard_older_than_date_p = g.PlatformIO.Platform_SessionDate;
+ discard_older_than_date_p.SubtractMonths(args->DiscardOlderThanMonths);
+ args->_DiscardOlderThanDate = discard_older_than_date_p.Unpack();
+ }
+ for (ImGuiSettingsHandler& handler : g.SettingsHandlers)
+ if (args->TypeHashFilter == 0 || handler.TypeHash == args->TypeHashFilter)
+ if (handler.CleanupFn != NULL)
+ handler.CleanupFn(&g, &handler, args);
+}
+
void ImGui::LoadIniSettingsFromDisk(const char* ini_filename)
{
size_t file_data_size = 0;
@@ -16290,6 +16559,12 @@ void ImGui::LoadIniSettingsFromMemory(const char* ini_data, size_t ini_size)
memcpy(buf, ini_data, ini_size);
// Call post-read handlers
+ ImGuiSettingsCleanupArgs cleanup_args;
+ if (g.IO.ConfigIniSettingsAutoDiscardMonths > 0)
+ {
+ cleanup_args.DiscardOlderThanMonths = g.IO.ConfigIniSettingsAutoDiscardMonths;
+ CleanupIniSettings(&cleanup_args);
+ }
for (ImGuiSettingsHandler& handler : g.SettingsHandlers)
if (handler.ApplyAllFn != NULL)
handler.ApplyAllFn(&g, &handler);
@@ -16389,6 +16664,19 @@ static void WindowSettingsHandler_ClearAll(ImGuiContext* ctx, ImGuiSettingsHandl
g.SettingsWindows.clear();
}
+static void WindowSettingsHandler_Cleanup(ImGuiContext* ctx, ImGuiSettingsHandler*, ImGuiSettingsCleanupArgs* args)
+{
+ ImGuiContext& g = *ctx;
+ for (ImGuiWindowSettings* settings = g.SettingsWindows.begin(); settings != NULL; settings = g.SettingsWindows.next_chunk(settings))
+ {
+ const bool is_valid = settings->LastUsedDate.IsValid();
+ if ((args->_DiscardOlderThanDate != 0 && settings->LastUsedDate.Unpack() < args->_DiscardOlderThanDate) || (args->DiscardWhenMissingDate && !is_valid))
+ settings->WantDelete = true;
+ if (args->SetCurrentSessionDateToAll || (args->SetCurrentSessionDateWhenMissingDate && !is_valid))
+ settings->LastUsedDate = g.SessionDate;
+ }
+}
+
static void* WindowSettingsHandler_ReadOpen(ImGuiContext*, ImGuiSettingsHandler*, const char* name)
{
ImGuiID id = ImHashStr(name);
@@ -16414,6 +16702,7 @@ static void WindowSettingsHandler_ReadLine(ImGuiContext*, ImGuiSettingsHandler*,
else if (sscanf(line, "ViewportPos=%i,%i", &x, &y) == 2){ settings->ViewportPos = ImVec2ih((short)x, (short)y); }
else if (sscanf(line, "Collapsed=%d", &i) == 1) { settings->Collapsed = (i != 0); }
else if (sscanf(line, "IsChild=%d", &i) == 1) { settings->IsChild = (i != 0); }
+ else if (sscanf(line, "LastUsed=%d", &i) == 1) { settings->LastUsedDate = i; }
else if (sscanf(line, "DockId=0x%X,%d", &u1, &i) == 2) { settings->DockId = u1; settings->DockOrder = (short)i; }
else if (sscanf(line, "DockId=0x%X", &u1) == 1) { settings->DockId = u1; settings->DockOrder = -1; }
else if (sscanf(line, "ClassId=0x%X", &u1) == 1) { settings->ClassId = u1; }
@@ -16446,6 +16735,7 @@ static void WindowSettingsHandler_WriteAll(ImGuiContext* ctx, ImGuiSettingsHandl
if (!settings)
{
settings = ImGui::CreateNewWindowSettings(window->Name);
+ settings->LastUsedDate = g.SessionDate;
window->SettingsOffset = g.SettingsWindows.offset_from_ptr(settings);
}
IM_ASSERT(settings->ID == window->ID);
@@ -16460,6 +16750,7 @@ static void WindowSettingsHandler_WriteAll(ImGuiContext* ctx, ImGuiSettingsHandl
settings->Collapsed = window->Collapsed;
settings->IsChild = (window->RootWindow != window); // Cannot rely on ImGuiWindowFlags_ChildWindow here as docked windows have this set.
settings->WantDelete = false;
+ settings->LastUsedDate = g.SessionDate;
}
// Write to text buffer
@@ -16469,7 +16760,7 @@ static void WindowSettingsHandler_WriteAll(ImGuiContext* ctx, ImGuiSettingsHandl
if (settings->WantDelete)
continue;
const char* settings_name = settings->GetName();
- buf->appendf("[%s][%s]\n", handler->TypeName, settings_name);
+ buf->appendf("[%s][%s]\n", handler->TypeName, settings_name); // [Window][name]
if (settings->IsChild)
{
buf->appendf("IsChild=1\n");
@@ -16498,6 +16789,9 @@ static void WindowSettingsHandler_WriteAll(ImGuiContext* ctx, ImGuiSettingsHandl
buf->appendf("ClassId=0x%08X\n", settings->ClassId);
}
}
+ if (g.IO.ConfigIniSettingsSaveLastUsedDate)
+ if (int last_used_date = settings->LastUsedDate.Unpack())
+ buf->appendf("LastUsed=%08d\n", last_used_date);
buf->append("\n");
}
}
@@ -16576,6 +16870,7 @@ void ImGuiPlatformIO::ClearRendererHandlers()
Renderer_CreateWindow = Renderer_DestroyWindow = NULL;
Renderer_SetWindowSize = NULL;
Renderer_RenderWindow = Renderer_SwapBuffers = NULL;
+ DrawCallback_ResetRenderState = DrawCallback_SetSamplerLinear = DrawCallback_SetSamplerNearest = NULL;
}
ImGuiViewport* ImGui::GetMainViewport()
@@ -16691,7 +16986,7 @@ static bool ImGui::UpdateTryMergeWindowIntoHostViewport(ImGuiWindow* window, ImG
for (ImGuiViewportP* viewport_obstructing : g.Viewports)
{
- if (viewport_obstructing == viewport_src || viewport_obstructing == viewport_dst)
+ if (viewport_obstructing == viewport_src || viewport_obstructing == viewport_dst || !viewport_obstructing->PlatformWindowCreated)
continue;
if (viewport_obstructing->GetMainRect().Overlaps(window->Rect()))
if (IsViewportAbove(viewport_obstructing, viewport_dst))
@@ -17366,6 +17661,8 @@ void ImGui::WindowSyncOwnedViewport(ImGuiWindow* window, ImGuiWindow* parent_win
window->Viewport->Flags = viewport_flags;
+ window->Viewport->PlatformIconData = window->WindowClass.PlatformIconData;
+
// Update parent viewport ID
// (the !IsFallbackWindow test mimic the one done in WindowSelectViewport())
if (window->WindowClass.ParentViewportId != (ImGuiID)-1)
@@ -18883,10 +19180,13 @@ static void ImGui::DockNodeUpdateFlagsAndCollapse(ImGuiDockNode* node)
node->WantHiddenTabBarToggle = false;
// Apply toggles at a single point of the frame (here!)
+ const ImGuiDockNodeFlags prev_local_flags = node->LocalFlags;
if (node->Windows.Size > 1)
node->SetLocalFlags(node->LocalFlags & ~ImGuiDockNodeFlags_HiddenTabBar);
else if (node->WantHiddenTabBarToggle)
node->SetLocalFlags(node->LocalFlags ^ ImGuiDockNodeFlags_HiddenTabBar);
+ if ((node->LocalFlags ^ prev_local_flags) & ImGuiDockNodeFlags_SavedFlagsMask_)
+ MarkIniSettingsDirty(); // Bit flaky to only do this here. Perhaps compare node flags every frame? #9380
node->WantHiddenTabBarToggle = false;
DockNodeUpdateVisibleFlag(node);
@@ -20039,24 +20339,26 @@ static void ImGui::DockNodePreviewDockRender(ImGuiWindow* host_window, ImGuiDock
}
// Display drop boxes
- const float overlay_rounding = ImMax(3.0f, g.Style.FrameRounding);
+ const float scale = g.Style._MainScale; // FIXME-DPI
+ const float overlay_rounding = ImMax((float)(int)(3.0f * scale), g.Style.FrameRounding);
for (int dir = ImGuiDir_None; dir < ImGuiDir_COUNT; dir++)
{
if (!data->DropRectsDraw[dir + 1].IsInverted())
{
ImRect draw_r = data->DropRectsDraw[dir + 1];
ImRect draw_r_in = draw_r;
- draw_r_in.Expand(-2.0f);
+ draw_r_in.Expand((float)(int)(-2.0f * scale));
ImU32 overlay_col = (data->SplitDir == (ImGuiDir)dir && data->IsSplitDirExplicit) ? overlay_col_drop_hovered : overlay_col_drop;
+ float thickness = (float)(int)(1.0f * scale);
for (int overlay_n = 0; overlay_n < overlay_draw_lists_count; overlay_n++)
{
ImVec2 center = ImFloor(draw_r_in.GetCenter());
overlay_draw_lists[overlay_n]->AddRectFilled(draw_r.Min, draw_r.Max, overlay_col, overlay_rounding);
- overlay_draw_lists[overlay_n]->AddRect(draw_r_in.Min, draw_r_in.Max, overlay_col_lines, overlay_rounding);
+ overlay_draw_lists[overlay_n]->AddRect(draw_r_in.Min, draw_r_in.Max, overlay_col_lines, overlay_rounding, thickness);
if (dir == ImGuiDir_Left || dir == ImGuiDir_Right)
- overlay_draw_lists[overlay_n]->AddLine(ImVec2(center.x, draw_r_in.Min.y), ImVec2(center.x, draw_r_in.Max.y), overlay_col_lines);
+ overlay_draw_lists[overlay_n]->AddLineV(center.x, draw_r_in.Min.y, draw_r_in.Max.y, overlay_col_lines, thickness);
if (dir == ImGuiDir_Up || dir == ImGuiDir_Down)
- overlay_draw_lists[overlay_n]->AddLine(ImVec2(draw_r_in.Min.x, center.y), ImVec2(draw_r_in.Max.x, center.y), overlay_col_lines);
+ overlay_draw_lists[overlay_n]->AddLineH(draw_r_in.Min.x, draw_r_in.Max.x, center.y, overlay_col_lines, thickness);
}
}
@@ -20766,8 +21068,8 @@ void ImGui::DockBuilderRemoveNodeChildNodes(ImGuiID root_id)
return;
bool has_central_node = false;
- ImGuiDataAuthority backup_root_node_authority_for_pos = root_node ? root_node->AuthorityForPos : ImGuiDataAuthority_Auto;
- ImGuiDataAuthority backup_root_node_authority_for_size = root_node ? root_node->AuthorityForSize : ImGuiDataAuthority_Auto;
+ ImGuiDataAuthority backup_root_node_authority_for_pos = root_node ? (ImGuiDataAuthority_)root_node->AuthorityForPos : ImGuiDataAuthority_Auto;
+ ImGuiDataAuthority backup_root_node_authority_for_size = root_node ? (ImGuiDataAuthority_)root_node->AuthorityForSize : ImGuiDataAuthority_Auto;
// Process active windows
ImVector nodes_to_remove;
@@ -20794,8 +21096,8 @@ void ImGui::DockBuilderRemoveNodeChildNodes(ImGuiID root_id)
// Make sure we don't lose our current pos/size. (FIXME-DOCK: Consider tidying up that code in DockNodeAddWindow instead)
if (root_node)
{
- root_node->AuthorityForPos = backup_root_node_authority_for_pos;
- root_node->AuthorityForSize = backup_root_node_authority_for_size;
+ root_node->AuthorityForPos = (ImU8)backup_root_node_authority_for_pos;
+ root_node->AuthorityForSize = (ImU8)backup_root_node_authority_for_size;
}
// Apply to settings
@@ -21987,7 +22289,7 @@ void ImGui::DebugRenderKeyboardPreview(ImDrawList* draw_list)
draw_list->AddRect(key_min, key_max, IM_COL32(24, 24, 24, 255), key_rounding);
ImVec2 face_min = ImVec2(key_min.x + key_face_pos.x, key_min.y + key_face_pos.y);
ImVec2 face_max = ImVec2(face_min.x + key_face_size.x, face_min.y + key_face_size.y);
- draw_list->AddRect(face_min, face_max, IM_COL32(193, 193, 193, 255), key_face_rounding, ImDrawFlags_None, 2.0f);
+ draw_list->AddRect(face_min, face_max, IM_COL32(193, 193, 193, 255), key_face_rounding, 2.0f);
draw_list->AddRectFilled(face_min, face_max, IM_COL32(252, 252, 252, 255), key_face_rounding);
ImVec2 label_min = ImVec2(key_min.x + key_label_pos.x, key_min.y + key_label_pos.y);
draw_list->AddText(label_min, IM_COL32(64, 64, 64, 255), key_data->Label);
@@ -22277,6 +22579,7 @@ void ImGui::ShowMetricsWindow(bool* p_open)
{
ImGuiContext& g = *GImGui;
ImGuiIO& io = g.IO;
+ ImGuiPlatformIO& platform_io = g.PlatformIO;
ImGuiMetricsConfig* cfg = &g.DebugMetricsConfig;
if (cfg->ShowDebugLog)
ShowDebugLogWindow(&cfg->ShowDebugLog);
@@ -22410,7 +22713,7 @@ void ImGui::ShowMetricsWindow(bool* p_open)
BulletText("Table 0x%08X (%d columns, in '%s')", table->ID, table->ColumnsCount, table->OuterWindow->Name);
if (IsItemHovered())
- GetForegroundDrawList(table->OuterWindow)->AddRect(table->OuterRect.Min - ImVec2(1, 1), table->OuterRect.Max + ImVec2(1, 1), IM_COL32(255, 255, 0, 255), 0.0f, 0, 2.0f);
+ GetForegroundDrawList(table->OuterWindow)->AddRect(table->OuterRect.Min - ImVec2(1, 1), table->OuterRect.Max + ImVec2(1, 1), IM_COL32(255, 255, 0, 255), 0.0f, 2.0f);
Indent();
char buf[128];
for (int rect_n = 0; rect_n < TRT_Count; rect_n++)
@@ -22425,7 +22728,7 @@ void ImGui::ShowMetricsWindow(bool* p_open)
ImFormatString(buf, IM_COUNTOF(buf), "(%6.1f,%6.1f) (%6.1f,%6.1f) Size (%6.1f,%6.1f) Col %d %s", r.Min.x, r.Min.y, r.Max.x, r.Max.y, r.GetWidth(), r.GetHeight(), column_n, trt_rects_names[rect_n]);
Selectable(buf);
if (IsItemHovered())
- GetForegroundDrawList(table->OuterWindow)->AddRect(r.Min - ImVec2(1, 1), r.Max + ImVec2(1, 1), IM_COL32(255, 255, 0, 255), 0.0f, 0, 2.0f);
+ GetForegroundDrawList(table->OuterWindow)->AddRect(r.Min - ImVec2(1, 1), r.Max + ImVec2(1, 1), IM_COL32(255, 255, 0, 255), 0.0f, 2.0f);
}
}
else
@@ -22434,7 +22737,7 @@ void ImGui::ShowMetricsWindow(bool* p_open)
ImFormatString(buf, IM_COUNTOF(buf), "(%6.1f,%6.1f) (%6.1f,%6.1f) Size (%6.1f,%6.1f) %s", r.Min.x, r.Min.y, r.Max.x, r.Max.y, r.GetWidth(), r.GetHeight(), trt_rects_names[rect_n]);
Selectable(buf);
if (IsItemHovered())
- GetForegroundDrawList(table->OuterWindow)->AddRect(r.Min - ImVec2(1, 1), r.Max + ImVec2(1, 1), IM_COL32(255, 255, 0, 255), 0.0f, 0, 2.0f);
+ GetForegroundDrawList(table->OuterWindow)->AddRect(r.Min - ImVec2(1, 1), r.Max + ImVec2(1, 1), IM_COL32(255, 255, 0, 255), 0.0f, 2.0f);
}
}
Unindent();
@@ -22664,8 +22967,36 @@ void ImGui::ShowMetricsWindow(bool* p_open)
Text("\"%s\"", g.IO.IniFilename);
else
TextUnformatted("");
- Checkbox("io.ConfigDebugIniSettings", &io.ConfigDebugIniSettings);
Text("SettingsDirtyTimer %.2f", g.SettingsDirtyTimer);
+
+ int highlight_older_than_date = 0;
+ Text("SessionDate: %d", platform_io.Platform_SessionDate);
+ BeginDisabled(platform_io.Platform_SessionDate == 0);
+ Checkbox("Highlight Entries Older Than", &cfg->SettingsHighlightOldEntries);
+ SetNextItemWidth(GetFontSize() * 8);
+ SameLine();
+ SliderInt("Months", &cfg->SettingsDiscardMonths, 1, 24);
+ if (cfg->SettingsHighlightOldEntries && cfg->SettingsDiscardMonths > 0)
+ {
+ ImGuiPackedDate cutoff_date = platform_io.Platform_SessionDate;
+ cutoff_date.SubtractMonths(cfg->SettingsDiscardMonths);
+ highlight_older_than_date = cutoff_date.Unpack();
+ SameLine();
+ ImGuiSettingsCleanupArgs cleanup_args;
+ cleanup_args.DiscardOlderThanMonths = cfg->SettingsDiscardMonths;
+ if (Button("Discard"))
+ CleanupIniSettings(&cleanup_args);
+ }
+ EndDisabled();
+ Checkbox("io.ConfigDebugIniSettings", &io.ConfigDebugIniSettings);
+
+ struct ScopedHighlightOlderThan
+ {
+ bool Highlight;
+ ScopedHighlightOlderThan(int cutoff_date, ImGuiPackedDate in_date) { Highlight = cutoff_date != 0 && in_date.Unpack() < cutoff_date; if (Highlight) PushStyleColor(ImGuiCol_Text, ImVec4(1.0f, 0.4f, 0.4f, 1.0f)); }
+ ~ScopedHighlightOlderThan() { if (Highlight) PopStyleColor(); }
+ };
+
if (TreeNode("SettingsHandlers", "Settings handlers: (%d)", g.SettingsHandlers.Size))
{
for (ImGuiSettingsHandler& handler : g.SettingsHandlers)
@@ -22675,14 +23006,20 @@ void ImGui::ShowMetricsWindow(bool* p_open)
if (TreeNode("SettingsWindows", "Settings packed data: Windows: %d bytes", g.SettingsWindows.size()))
{
for (ImGuiWindowSettings* settings = g.SettingsWindows.begin(); settings != NULL; settings = g.SettingsWindows.next_chunk(settings))
+ {
+ ScopedHighlightOlderThan scoped_highlight(highlight_older_than_date, settings->LastUsedDate);
DebugNodeWindowSettings(settings);
+ }
TreePop();
}
if (TreeNode("SettingsTables", "Settings packed data: Tables: %d bytes", g.SettingsTables.size()))
{
for (ImGuiTableSettings* settings = g.SettingsTables.begin(); settings != NULL; settings = g.SettingsTables.next_chunk(settings))
- DebugNodeTableSettings(settings);
+ {
+ ScopedHighlightOlderThan scoped_highlight(highlight_older_than_date, settings->LastUsedDate);
+ DebugNodeTableSettings(settings, NULL);
+ }
TreePop();
}
@@ -22922,7 +23259,7 @@ void ImGui::ShowMetricsWindow(bool* p_open)
ImRect r = Funcs::GetTableRect(table, cfg->ShowTablesRectsType, column_n);
ImU32 col = (table->HoveredColumnBody == column_n) ? IM_COL32(255, 255, 128, 255) : IM_COL32(255, 0, 128, 255);
float thickness = (table->HoveredColumnBody == column_n) ? 3.0f : 1.0f;
- draw_list->AddRect(r.Min, r.Max, col, 0.0f, 0, thickness);
+ draw_list->AddRect(r.Min, r.Max, col, 0.0f, thickness);
}
}
else
@@ -23199,7 +23536,7 @@ void ImGui::DebugNodeDrawList(ImGuiWindow* window, ImGuiViewportP* viewport, con
{
ImDrawListFlags backup_flags = fg_draw_list->Flags;
fg_draw_list->Flags &= ~ImDrawListFlags_AntiAliasedLines; // Disable AA on triangle outlines is more readable for very large and thin triangles.
- fg_draw_list->AddPolyline(triangle, 3, IM_COL32(255, 255, 0, 255), ImDrawFlags_Closed, 1.0f);
+ fg_draw_list->AddPolyline(triangle, 3, IM_COL32(255, 255, 0, 255), 1.0f, ImDrawFlags_Closed);
fg_draw_list->Flags = backup_flags;
}
}
@@ -23227,7 +23564,7 @@ void ImGui::DebugNodeDrawCmdShowMeshAndBoundingBox(ImDrawList* out_draw_list, co
for (int n = 0; n < 3; n++, idx_n++)
vtxs_rect.Add((triangle[n] = vtx_buffer[idx_buffer ? idx_buffer[idx_n] : idx_n].pos));
if (show_mesh)
- out_draw_list->AddPolyline(triangle, 3, IM_COL32(255, 255, 0, 255), ImDrawFlags_Closed, 1.0f); // In yellow: mesh triangles
+ out_draw_list->AddPolyline(triangle, 3, IM_COL32(255, 255, 0, 255), 1.0f, ImDrawFlags_Closed); // In yellow: mesh triangles
}
// Draw bounding boxes
if (show_aabb)
@@ -23508,8 +23845,8 @@ void ImGui::DebugNodeTabBar(ImGuiTabBar* tab_bar, const char* label)
{
ImDrawList* draw_list = GetForegroundDrawList(tab_bar->Window);
draw_list->AddRect(tab_bar->BarRect.Min, tab_bar->BarRect.Max, IM_COL32(255, 255, 0, 255));
- draw_list->AddLine(ImVec2(tab_bar->ScrollingRectMinX, tab_bar->BarRect.Min.y), ImVec2(tab_bar->ScrollingRectMinX, tab_bar->BarRect.Max.y), IM_COL32(0, 255, 0, 255));
- draw_list->AddLine(ImVec2(tab_bar->ScrollingRectMaxX, tab_bar->BarRect.Min.y), ImVec2(tab_bar->ScrollingRectMaxX, tab_bar->BarRect.Max.y), IM_COL32(0, 255, 0, 255));
+ draw_list->AddLineV(tab_bar->ScrollingRectMinX, tab_bar->BarRect.Min.y, tab_bar->BarRect.Max.y, IM_COL32(0, 255, 0, 255));
+ draw_list->AddLineV(tab_bar->ScrollingRectMaxX, tab_bar->BarRect.Min.y, tab_bar->BarRect.Max.y, IM_COL32(0, 255, 0, 255));
}
if (open)
{
@@ -23653,7 +23990,7 @@ void ImGui::DebugNodeWindowSettings(ImGuiWindowSettings* settings)
{
if (settings->WantDelete)
BeginDisabled();
- Text("0x%08X \"%s\" Pos (%d,%d) Size (%d,%d) Collapsed=%d",
+ BulletText("0x%08X \"%s\" Pos (%d,%d) Size (%d,%d) Collapsed=%d",
settings->ID, settings->GetName(), settings->Pos.x, settings->Pos.y, settings->Size.x, settings->Size.y, settings->Collapsed);
if (settings->WantDelete)
EndDisabled();
@@ -23792,6 +24129,7 @@ void ImGui::ShowDebugLogWindow(bool* p_open)
ShowDebugLogFlag("Nav", ImGuiDebugLogFlags_EventNav);
ShowDebugLogFlag("Popup", ImGuiDebugLogFlags_EventPopup);
ShowDebugLogFlag("Selection", ImGuiDebugLogFlags_EventSelection);
+ ShowDebugLogFlag("Table", ImGuiDebugLogFlags_EventTable);
ShowDebugLogFlag("Viewport", ImGuiDebugLogFlags_EventViewport);
ShowDebugLogFlag("InputRouting", ImGuiDebugLogFlags_EventInputRouting);
@@ -23871,8 +24209,8 @@ void ImGui::DebugDrawCursorPos(ImU32 col)
ImGuiContext& g = *GImGui;
ImGuiWindow* window = g.CurrentWindow;
ImVec2 pos = window->DC.CursorPos;
- window->DrawList->AddLine(ImVec2(pos.x, pos.y - 3.0f), ImVec2(pos.x, pos.y + 4.0f), col, 1.0f);
- window->DrawList->AddLine(ImVec2(pos.x - 3.0f, pos.y), ImVec2(pos.x + 4.0f, pos.y), col, 1.0f);
+ window->DrawList->AddLineV(pos.x, pos.y - 3.0f, pos.y + 4.0f, col, 1.0f);
+ window->DrawList->AddLineH(pos.x - 3.0f, pos.x + 4.0f, pos.y, col, 1.0f);
}
// Draw a 10px wide rectangle around CurposPos.x using Line Y1/Y2 in current window's DrawList
@@ -23883,9 +24221,9 @@ void ImGui::DebugDrawLineExtents(ImU32 col)
float curr_x = window->DC.CursorPos.x;
float line_y1 = (window->DC.IsSameLine ? window->DC.CursorPosPrevLine.y : window->DC.CursorPos.y);
float line_y2 = line_y1 + (window->DC.IsSameLine ? window->DC.PrevLineSize.y : window->DC.CurrLineSize.y);
- window->DrawList->AddLine(ImVec2(curr_x - 5.0f, line_y1), ImVec2(curr_x + 5.0f, line_y1), col, 1.0f);
- window->DrawList->AddLine(ImVec2(curr_x - 0.5f, line_y1), ImVec2(curr_x - 0.5f, line_y2), col, 1.0f);
- window->DrawList->AddLine(ImVec2(curr_x - 5.0f, line_y2), ImVec2(curr_x + 5.0f, line_y2), col, 1.0f);
+ window->DrawList->AddLineH(curr_x - 5.0f, curr_x + 5.0f, line_y1, col, 1.0f);
+ window->DrawList->AddLineV(curr_x - 0.5f, line_y1, line_y2, col, 1.0f);
+ window->DrawList->AddLineH(curr_x - 5.0f, curr_x + 5.0f, line_y2, col, 1.0f);
}
// Draw last item rect in ForegroundDrawList (so it is always visible)
@@ -24163,7 +24501,7 @@ void ImGui::ShowIDStackToolWindow(bool* p_open)
Checkbox("Ctrl+C: copy path", &tool->OptCopyToClipboardOnCtrlC);
PopStyleVar();
SameLine();
- TextColored((time_since_copy >= 0.0f && time_since_copy < 0.75f && ImFmod(time_since_copy, 0.25f) < 0.25f * 0.5f) ? ImVec4(1.f, 1.f, 0.3f, 1.f) : ImVec4(), "*COPIED*");
+ TextColored((time_since_copy >= 0.0f && time_since_copy < 0.75f && ImFmod(time_since_copy, 0.25f) < 0.25f * 0.5f) ? ImVec4(1.0f, 1.0f, 0.3f, 1.0f) : ImVec4(), "*COPIED*");
if (tool->OptCopyToClipboardOnCtrlC && Shortcut(ImGuiMod_Ctrl | ImGuiKey_C, ImGuiInputFlags_RouteGlobal | ImGuiInputFlags_RouteOverFocused))
{
tool->CopyToClipboardLastTime = (float)g.Time;
@@ -24255,7 +24593,7 @@ void ImGui::ShowFontSelector(const char* label)
"- Load additional fonts with io.Fonts->AddFontXXX() functions.\n"
"- The font atlas is built when calling io.Fonts->GetTexDataAsXXXX() or io.Fonts->Build().\n"
"- Read FAQ and docs/FONTS.md for more details.\n"
- "- If you need to add/remove fonts at runtime (e.g. for DPI change), do it before calling NewFrame().");
+ "- Legacy backend: if you need to add/remove fonts at runtime (e.g. for DPI change), do it before calling NewFrame().");
}
#endif // #if !defined(IMGUI_DISABLE_DEMO_WINDOWS) || !defined(IMGUI_DISABLE_DEBUG_TOOLS)
diff --git a/include/imgui/imgui.h b/include/imgui/imgui.h
index 7bf34c8..adc96b7 100644
--- a/include/imgui/imgui.h
+++ b/include/imgui/imgui.h
@@ -1,4 +1,4 @@
-// dear imgui, v1.92.7
+// dear imgui, v1.92.9b
// (headers)
// Help:
@@ -29,8 +29,8 @@
// Library Version
// (Integer encoded as XYYZZ for use in #if preprocessor conditionals, e.g. '#if IMGUI_VERSION_NUM >= 12345')
-#define IMGUI_VERSION "1.92.7"
-#define IMGUI_VERSION_NUM 19270
+#define IMGUI_VERSION "1.92.9b"
+#define IMGUI_VERSION_NUM 19291
#define IMGUI_HAS_TABLE // Added BeginTable() - from IMGUI_VERSION_NUM >= 18000
#define IMGUI_HAS_TEXTURES // Added ImGuiBackendFlags_RendererHasTextures - from IMGUI_VERSION_NUM >= 19198
#define IMGUI_HAS_VIEWPORT // In 'docking' WIP branch.
@@ -247,7 +247,7 @@ typedef int ImFontAtlasFlags; // -> enum ImFontAtlasFlags_ // Flags: f
typedef int ImGuiBackendFlags; // -> enum ImGuiBackendFlags_ // Flags: for io.BackendFlags
typedef int ImGuiButtonFlags; // -> enum ImGuiButtonFlags_ // Flags: for InvisibleButton()
typedef int ImGuiChildFlags; // -> enum ImGuiChildFlags_ // Flags: for BeginChild()
-typedef int ImGuiColorEditFlags; // -> enum ImGuiColorEditFlags_ // Flags: for ColorEdit4(), ColorPicker4() etc.
+typedef int ImGuiColorEditFlags; // -> enum ImGuiColorEditFlags_ // Flags: for ColorEdit4(), ColorPicker4(), io.ConfigColorEditFlags etc.
typedef int ImGuiConfigFlags; // -> enum ImGuiConfigFlags_ // Flags: for io.ConfigFlags
typedef int ImGuiComboFlags; // -> enum ImGuiComboFlags_ // Flags: for BeginCombo()
typedef int ImGuiDockNodeFlags; // -> enum ImGuiDockNodeFlags_ // Flags: for DockSpace()
@@ -621,7 +621,8 @@ namespace ImGui
IMGUI_API ImGuiID GetID(int int_id);
// Widgets: Text
- IMGUI_API void TextUnformatted(const char* text, const char* text_end = NULL); // raw text without formatting. Roughly equivalent to Text("%s", text) but: A) doesn't require null terminated string if 'text_end' is specified, B) it's faster, no memory copy is done, no buffer size limits, recommended for long chunks of text.
+ // - Note that all functions taking format strings in the API may be passed ("%s", text) or ("%.*s", text_len, text): which will automatically bypass the formatter.
+ IMGUI_API void TextUnformatted(const char* text, const char* text_end = NULL); // raw text without formatting. Practically equivalent to 'Text("%s", text)' but doesn't require null terminated string if 'text_end' is specified.
IMGUI_API void Text(const char* fmt, ...) IM_FMTARGS(1); // formatted text
IMGUI_API void TextV(const char* fmt, va_list args) IM_FMTLIST(1);
IMGUI_API void TextColored(const ImVec4& col, const char* fmt, ...) IM_FMTARGS(2); // shortcut for PushStyleColor(ImGuiCol_Text, col); Text(fmt, ...); PopStyleColor();
@@ -656,7 +657,7 @@ namespace ImGui
// Widgets: Images
// - Read about ImTextureID/ImTextureRef here: https://github.com/ocornut/imgui/wiki/Image-Loading-and-Displaying-Examples
// - 'uv0' and 'uv1' are texture coordinates. Read about them from the same link above.
- // - Image() pads adds style.ImageBorderSize on each side, ImageButton() adds style.FramePadding on each side.
+ // - Image() adds style.ImageBorderSize on each side, ImageButton() adds style.FramePadding on each side.
// - ImageButton() draws a background based on regular Button() color + optionally an inner background if specified.
// - An obsolete version of Image(), before 1.91.9 (March 2025), had a 'tint_col' parameter which is now supported by the ImageWithBg() function.
IMGUI_API void Image(ImTextureRef tex_ref, const ImVec2& image_size, const ImVec2& uv0 = ImVec2(0, 0), const ImVec2& uv1 = ImVec2(1, 1));
@@ -744,7 +745,6 @@ namespace ImGui
IMGUI_API bool ColorPicker3(const char* label, float col[3], ImGuiColorEditFlags flags = 0);
IMGUI_API bool ColorPicker4(const char* label, float col[4], ImGuiColorEditFlags flags = 0, const float* ref_col = NULL);
IMGUI_API bool ColorButton(const char* desc_id, const ImVec4& col, ImGuiColorEditFlags flags = 0, const ImVec2& size = ImVec2(0, 0)); // display a color square/button, hover for details, return true when pressed.
- IMGUI_API void SetColorEditOptions(ImGuiColorEditFlags flags); // initialize current options (generally on application startup) if you want to select a default format, picker type, etc. User will be able to change many settings, unless you pass the _NoOptions flag to your calls.
// Widgets: Trees
// - TreeNode functions return true when the node is open, in which case you need to also call TreePop() when you are finished displaying the tree node contents.
@@ -816,7 +816,7 @@ namespace ImGui
// - Use BeginMenuBar() on a window ImGuiWindowFlags_MenuBar to append to its menu bar.
// - Use BeginMainMenuBar() to create a menu bar at the top of the screen and append to it.
// - Use BeginMenu() to create a menu. You can call BeginMenu() multiple time with the same identifier to append more items to it.
- // - Not that MenuItem() keyboardshortcuts are displayed as a convenience but _not processed_ by Dear ImGui at the moment.
+ // - Note that MenuItem() keyboard shortcuts are displayed as a convenience but _not processed_ by Dear ImGui at the moment.
IMGUI_API bool BeginMenuBar(); // append to menu-bar of current window (requires ImGuiWindowFlags_MenuBar flag set on parent window).
IMGUI_API void EndMenuBar(); // only call EndMenuBar() if BeginMenuBar() returns true!
IMGUI_API bool BeginMainMenuBar(); // create and append to a full screen menu-bar.
@@ -845,7 +845,7 @@ namespace ImGui
// Popups, Modals
// - They block normal mouse hovering detection (and therefore most mouse interactions) behind them.
- // - If not modal: they can be closed by clicking anywhere outside them, or by pressing ESCAPE.
+ // - If not modal: they can be closed by clicking anywhere outside them, or by pressing Escape (call 'Shortcut(ImGuiKey_Escape)' to claim a higher-priority shortcut).
// - Their visibility state (~bool) is held internally instead of being held by the programmer as we are used to with regular Begin*() calls.
// - The 3 properties above are related: we need to retain popup visibility state in the library because popups may be closed as any time.
// - You can bypass the hovering restriction by using ImGuiHoveredFlags_AllowWhenBlockedByPopup when calling IsItemHovered() or IsWindowHovered().
@@ -858,15 +858,17 @@ namespace ImGui
IMGUI_API void EndPopup(); // only call EndPopup() if BeginPopupXXX() returns true!
// Popups: open/close functions
- // - OpenPopup(): set popup state to open. ImGuiPopupFlags are available for opening options.
+ // - OpenPopup(): set popup state to open (unless one of the specified ImGuiPopupFlags prevent opening).
+ // - OpenPopupXXX() functions return true when the popup is toggled open, which allows you to capture local state if needed.
+ // You may also call IsWindowAppearing() inside the later BeginPopup() scope if you need to prepare/compute data for the popup.
// - If not modal: they can be closed by clicking anywhere outside them, or by pressing ESCAPE.
// - CloseCurrentPopup(): use inside the BeginPopup()/EndPopup() scope to close manually.
// - CloseCurrentPopup() is called by default by Selectable()/MenuItem() when activated (FIXME: need some options).
// - Use ImGuiPopupFlags_NoOpenOverExistingPopup to avoid opening a popup if there's already one at the same level. This is equivalent to e.g. testing for !IsAnyPopupOpen() prior to OpenPopup().
// - Use IsWindowAppearing() after BeginPopup() to tell if a window just opened.
- IMGUI_API void OpenPopup(const char* str_id, ImGuiPopupFlags popup_flags = 0); // call to mark popup as open (don't call every frame!).
- IMGUI_API void OpenPopup(ImGuiID id, ImGuiPopupFlags popup_flags = 0); // id overload to facilitate calling from nested stacks
- IMGUI_API void OpenPopupOnItemClick(const char* str_id = NULL, ImGuiPopupFlags popup_flags = 0); // helper to open popup when clicked on last item. Default to ImGuiPopupFlags_MouseButtonRight == 1. (note: actually triggers on the mouse _released_ event to be consistent with popup behaviors)
+ IMGUI_API bool OpenPopup(const char* str_id, ImGuiPopupFlags popup_flags = 0); // call to mark popup as open (don't call every frame!).
+ IMGUI_API bool OpenPopup(ImGuiID id, ImGuiPopupFlags popup_flags = 0); // id overload to facilitate calling from nested stacks
+ IMGUI_API bool OpenPopupOnItemClick(const char* str_id = NULL, ImGuiPopupFlags popup_flags = 0); // helper to open popup when clicked on last item. Default to ImGuiPopupFlags_MouseButtonRight == 1. (note: actually triggers on the mouse _released_ event to be consistent with popup behaviors)
IMGUI_API void CloseCurrentPopup(); // manually close the popup we have begin-ed into.
// Popups: Open+Begin popup combined functions helpers to create context menus.
@@ -916,14 +918,15 @@ namespace ImGui
IMGUI_API bool TableSetColumnIndex(int column_n); // append into the specified column. Return true when column is visible.
// Tables: Headers & Columns declaration
- // - Use TableSetupColumn() to specify label, resizing policy, default width/weight, id, various other flags etc.
+ // - Use TableSetupColumn() to specify label, resizing policy, default width/weight, various other flags etc.
+ // (the trailing 'ImGuiID user_data', which used to be referred to as 'ImGuiID user_id', is merely user data that is blindly copied in ImGuiTableColumnSortSpecs).
// - Use TableHeadersRow() to create a header row and automatically submit a TableHeader() for each column.
// Headers are required to perform: reordering, sorting, and opening the context menu.
// The context menu can also be made available in columns body using ImGuiTableFlags_ContextMenuInBody.
// - You may manually submit headers using TableNextRow() + TableHeader() calls, but this is only useful in
// some advanced use cases (e.g. adding custom widgets in header row).
// - Use TableSetupScrollFreeze() to lock columns/rows so they stay visible when scrolled. When freezing columns you would usually also use ImGuiTableColumnFlags_NoHide on them.
- IMGUI_API void TableSetupColumn(const char* label, ImGuiTableColumnFlags flags = 0, float init_width_or_weight = 0.0f, ImGuiID user_id = 0);
+ IMGUI_API void TableSetupColumn(const char* label, ImGuiTableColumnFlags flags = 0, float init_width_or_weight = 0.0f, ImGuiID user_data = 0);
IMGUI_API void TableSetupScrollFreeze(int cols, int rows); // lock columns/rows so they stay visible when scrolled.
IMGUI_API void TableHeader(const char* label); // submit one header cell manually (rarely used)
IMGUI_API void TableHeadersRow(); // submit a row with headers cells based on data provided to TableSetupColumn() + submit context menu
@@ -1060,6 +1063,7 @@ namespace ImGui
IMGUI_API ImVec2 GetItemRectMax(); // get lower-right bounding rectangle of the last item (screen space)
IMGUI_API ImVec2 GetItemRectSize(); // get size of last item
IMGUI_API ImGuiItemFlags GetItemFlags(); // get generic flags of last item
+ IMGUI_API int GetItemClickedCountWithSingleClickDelay(ImGuiMouseButton mouse_button = 0, float delay = -1.0f); // [BETA] building block for disambiguation between single-click and double-click. Returns 1 on single-click but delayed by io.MouseSingleClickDelay after mouse release. Returns 2+ on double-click or repeated clicks.
// Viewports
// - Currently represents the Platform Window created by the application which is hosting our Dear ImGui windows.
@@ -1128,10 +1132,11 @@ namespace ImGui
// Inputs Utilities: Key/Input Ownership [BETA]
// - One common use case would be to allow your items to disable standard inputs behaviors such
// as Tab or Alt key handling, Mouse Wheel scrolling, etc.
- // e.g. Button(...); SetItemKeyOwner(ImGuiKey_MouseWheelY); to make hovering/activating a button disable wheel for scrolling.
+ // e.g. `Button(...); if (SetItemKeyOwner(ImGuiKey_MouseWheelY)) { ... }` to make hovering/activating a button disable wheel for scrolling.
// - Reminder ImGuiKey enum include access to mouse buttons and gamepad, so key ownership can apply to them.
+ // - The return value of SetItemKeyOwner() says if ownership has been requested for the item, which is a shortcut to calling yet non-public TestKeyOwner() function.
// - Many related features are still in imgui_internal.h. For instance, most IsKeyXXX()/IsMouseXXX() functions have an owner-id-aware version.
- IMGUI_API void SetItemKeyOwner(ImGuiKey key); // Set key owner to last item ID if it is hovered or active. Equivalent to 'if (IsItemHovered() || IsItemActive()) { SetKeyOwner(key, GetItemID());'.
+ IMGUI_API bool SetItemKeyOwner(ImGuiKey key); // Set key owner to last item ID if it is hovered or active. Return true when ownership has been set. Roughly equivalent to 'if (TestKeyOwner(key, GetItemID()) && (IsItemHovered() || IsItemActive())) { SetKeyOwner(key, GetItemID());'.
// Inputs Utilities: Mouse
// - To refer to a mouse button, you may use named enums in your code e.g. ImGuiMouseButton_Left, ImGuiMouseButton_Right.
@@ -1141,7 +1146,7 @@ namespace ImGui
IMGUI_API bool IsMouseClicked(ImGuiMouseButton button, bool repeat = false); // did mouse button clicked? (went from !Down to Down). Same as GetMouseClickedCount() == 1.
IMGUI_API bool IsMouseReleased(ImGuiMouseButton button); // did mouse button released? (went from Down to !Down)
IMGUI_API bool IsMouseDoubleClicked(ImGuiMouseButton button); // did mouse button double-clicked? Same as GetMouseClickedCount() == 2. (note that a double-click will also report IsMouseClicked() == true)
- IMGUI_API bool IsMouseReleasedWithDelay(ImGuiMouseButton button, float delay); // delayed mouse release (use very sparingly!). Generally used with 'delay >= io.MouseDoubleClickTime' + combined with a 'io.MouseClickedLastCount==1' test. This is a very rarely used UI idiom, but some apps use this: e.g. MS Explorer single click on an icon to rename.
+ IMGUI_API bool IsMouseReleasedWithDelay(ImGuiMouseButton button, float delay=-1.f);// delayed mouse release. Use sparingly. Prefer higher-level helper GetItemClickedCountWithSingleClickDelay(). Generally used with 'delay >= io.MouseDoubleClickTime' + combined with a 'io.MouseClickedLastCount==1' test.
IMGUI_API int GetMouseClickedCount(ImGuiMouseButton button); // return the number of successive mouse-clicks at the time where a click happen (otherwise 0).
IMGUI_API bool IsMouseHoveringRect(const ImVec2& r_min, const ImVec2& r_max, bool clip = true);// is mouse hovering given bounding rect (in screen space). clipped by current clipping settings, but disregarding of other consideration of focus/window ordering/popup-block.
IMGUI_API bool IsMousePosValid(const ImVec2* mouse_pos = NULL); // by convention we use (-FLT_MAX,-FLT_MAX) to denote that there is no mouse available
@@ -1282,14 +1287,27 @@ enum ImGuiChildFlags_
// (Those are shared by all submitted items)
enum ImGuiItemFlags_
{
- ImGuiItemFlags_None = 0, // (Default)
+ ImGuiItemFlags_None = 0, // Default:
ImGuiItemFlags_NoTabStop = 1 << 0, // false // Disable keyboard tabbing. This is a "lighter" version of ImGuiItemFlags_NoNav.
- ImGuiItemFlags_NoNav = 1 << 1, // false // Disable any form of focusing (keyboard/gamepad directional navigation and SetKeyboardFocusHere() calls).
+ ImGuiItemFlags_NoNav = 1 << 1, // false // Disable any form of focusing: keyboard/gamepad directional navigation and SetKeyboardFocusHere() calls.
ImGuiItemFlags_NoNavDefaultFocus = 1 << 2, // false // Disable item being a candidate for default focus (e.g. used by title bar items).
ImGuiItemFlags_ButtonRepeat = 1 << 3, // false // Any button-like behavior will have repeat mode enabled (based on io.KeyRepeatDelay and io.KeyRepeatRate values). Note that you can also call IsItemActive() after any button to tell if it is being held.
ImGuiItemFlags_AutoClosePopups = 1 << 4, // true // MenuItem()/Selectable() automatically close their parent popup window.
ImGuiItemFlags_AllowDuplicateId = 1 << 5, // false // Allow submitting an item with the same identifier as an item already submitted this frame without triggering a warning tooltip if io.ConfigDebugHighlightIdConflicts is set.
ImGuiItemFlags_Disabled = 1 << 6, // false // [Internal] Disable interactions. DOES NOT affect visuals. This is used by BeginDisabled()/EndDisabled() and only provided here so you can read back via GetItemFlags().
+
+ //---------------------------------------------------------------------------------
+ // LiveEdit refers to applying edits to backing variables _while_ typing a value using the keyboard.
+ // Widget: | Input: | w/ LiveEdit: | Output:
+ // InputText() | "123" | on(default) | "1" then "12" then "123"
+ // InputText() | "123" | off | "123" after validating or tabbing out or losing focus.
+ // DragFloat(), SliderInt(), etc. | "123" | on* | 1 then 12 then 123
+ // DragFloat(), SliderInt(), etc. | "123" | off(default)* | 123 after validation or tabbing out or losing focus.
+ // (*) Since 1.92.9 (July 2026), ImGuiItemFlags_LiveEditOnInputScalar is OFF by default. In prior version it was ON for everything.
+ //---------------------------------------------------------------------------------
+ ImGuiItemFlags_LiveEditOnInputText = 1 << 7, // true // InputText: apply keyboard edits to backing value while typing. Otherwise, edits are applied when validating, tabbing out or losing focus.
+ ImGuiItemFlags_LiveEditOnInputScalar = 1 << 8, // false // DragXXX, SliderXXX, InputScalar: apply keyboard edits to backing value while typing. Otherwise, edits are applied when validating, tabbing out or losing focus.
+ ImGuiItemFlags_LiveEditOnInput = ImGuiItemFlags_LiveEditOnInputText | ImGuiItemFlags_LiveEditOnInputScalar,
};
// Flags for ImGui::InputText()
@@ -1306,7 +1324,7 @@ enum ImGuiInputTextFlags_
// Inputs
ImGuiInputTextFlags_AllowTabInput = 1 << 5, // Pressing TAB input a '\t' character into the text field
- ImGuiInputTextFlags_EnterReturnsTrue = 1 << 6, // Return 'true' when Enter is pressed (as opposed to every time the value was modified). Consider using IsItemDeactivatedAfterEdit() instead!
+ ImGuiInputTextFlags_EnterReturnsTrue = 1 << 6, // Return 'true' when Enter is pressed (as opposed to every time the value was modified). Consider disabling LiveEdit! or using IsItemDeactivatedAfterEdit() instead!
ImGuiInputTextFlags_EscapeClearsAll = 1 << 7, // Escape key clears content if not empty, and deactivate otherwise (contrast to default behavior of Escape to revert)
ImGuiInputTextFlags_CtrlEnterForNewLine = 1 << 8, // In multi-line mode: validate with Enter, add new line with Ctrl+Enter (default is opposite: validate with Ctrl+Enter, add line with Enter). Note that Shift+Enter always enter a new line either way.
@@ -1319,6 +1337,7 @@ enum ImGuiInputTextFlags_
ImGuiInputTextFlags_DisplayEmptyRefVal = 1 << 14, // InputFloat(), InputInt(), InputScalar() etc. only: when value is zero, do not display it. Generally used with ImGuiInputTextFlags_ParseEmptyRefVal.
ImGuiInputTextFlags_NoHorizontalScroll = 1 << 15, // Disable following the cursor horizontally
ImGuiInputTextFlags_NoUndoRedo = 1 << 16, // Disable undo/redo. Note that input text owns the text data while active, if you want to provide your own undo/redo stack you need e.g. to call ClearActiveID().
+ //ImGuiInputTextFlags_NoLiveEdit = 1 << 25, // Disable applying output to backing variable while typing. Same as setting ImGuiItemFlags_LiveEditOnInput to false.
// Elide display / Alignment
ImGuiInputTextFlags_ElideLeft = 1 << 17, // When text doesn't fit, elide left side to ensure right side stays visible. Useful for path/filenames. Single-line only!
@@ -1376,7 +1395,7 @@ enum ImGuiTreeNodeFlags_
#ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS
ImGuiTreeNodeFlags_NavLeftJumpsBackHere = ImGuiTreeNodeFlags_NavLeftJumpsToParent, // Renamed in 1.92.0
- ImGuiTreeNodeFlags_SpanTextWidth = ImGuiTreeNodeFlags_SpanLabelWidth, // Renamed in 1.90.7
+ //ImGuiTreeNodeFlags_SpanTextWidth = ImGuiTreeNodeFlags_SpanLabelWidth, // Renamed in 1.90.7
//ImGuiTreeNodeFlags_AllowItemOverlap = ImGuiTreeNodeFlags_AllowOverlap, // Renamed in 1.89.7
#endif
};
@@ -1448,7 +1467,7 @@ enum ImGuiTabBarFlags_
ImGuiTabBarFlags_DrawSelectedOverline = 1 << 6, // Draw selected overline markers over selected tab
// Fitting/Resize policy
- ImGuiTabBarFlags_FittingPolicyMixed = 1 << 7, // Shrink down tabs when they don't fit, until width is style.TabMinWidthShrink, then enable scrolling buttons.
+ ImGuiTabBarFlags_FittingPolicyMixed = 1 << 7, // Shrink down tabs when they don't fit, until width is style.TabMinWidthShrink, then enable scrolling. Setting TabMinWidthShrink to FLT_MAX makes this behave like ImGuiTabBarFlags_FittingPolicyScroll.
ImGuiTabBarFlags_FittingPolicyShrink = 1 << 8, // Shrink down tabs when they don't fit
ImGuiTabBarFlags_FittingPolicyScroll = 1 << 9, // Enable scrolling buttons when tabs don't fit
ImGuiTabBarFlags_FittingPolicyMask_ = ImGuiTabBarFlags_FittingPolicyMixed | ImGuiTabBarFlags_FittingPolicyShrink | ImGuiTabBarFlags_FittingPolicyScroll,
@@ -1568,7 +1587,7 @@ enum ImGuiDragDropFlags_
ImGuiDragDropFlags_AcceptPeekOnly = ImGuiDragDropFlags_AcceptBeforeDelivery | ImGuiDragDropFlags_AcceptNoDrawDefaultRect, // For peeking ahead and inspecting the payload before delivery.
#ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS
- ImGuiDragDropFlags_SourceAutoExpirePayload = ImGuiDragDropFlags_PayloadAutoExpire, // Renamed in 1.90.9
+ //ImGuiDragDropFlags_SourceAutoExpirePayload = ImGuiDragDropFlags_PayloadAutoExpire, // Renamed in 1.90.9
#endif
};
@@ -1813,7 +1832,7 @@ enum ImGuiBackendFlags_
ImGuiBackendFlags_RendererHasViewports = 1 << 10, // Backend Renderer supports multiple viewports.
ImGuiBackendFlags_PlatformHasViewports = 1 << 11, // Backend Platform supports multiple viewports.
ImGuiBackendFlags_HasMouseHoveredViewport=1 << 12, // Backend Platform supports calling io.AddMouseViewportEvent() with the viewport under the mouse. IF POSSIBLE, ignore viewports with the ImGuiViewportFlags_NoInputs flag (Win32 backend, GLFW 3.30+ backend can do this, SDL backend cannot). If this cannot be done, Dear ImGui needs to use a flawed heuristic to find the viewport under.
- ImGuiBackendFlags_HasParentViewport = 1 << 13, // Backend Platform supports honoring viewport->ParentViewport/ParentViewportId value, by applying the corresponding parent/child relation at the Platform level.
+ ImGuiBackendFlags_HasParentViewport = 1 << 13, // Backend Platform supports honoring viewport->ParentViewport/ParentViewportId value, by applying the corresponding parent/child relationship at the Platform level. Child windows always appear in front of their parent window.
};
// Enumeration for PushStyleColor() / PopStyleColor()
@@ -1838,6 +1857,7 @@ enum ImGuiCol_
ImGuiCol_ScrollbarGrabHovered,
ImGuiCol_ScrollbarGrabActive,
ImGuiCol_CheckMark, // Checkbox tick and RadioButton circle
+ ImGuiCol_CheckboxSelectedBg, // Checkbox background when Selected, otherwise use FrameBg
ImGuiCol_SliderGrab,
ImGuiCol_SliderGrabActive,
ImGuiCol_Button,
@@ -1937,6 +1957,9 @@ enum ImGuiStyleVar_
ImGuiStyleVar_TableAngledHeadersTextAlign,// ImVec2 TableAngledHeadersTextAlign
ImGuiStyleVar_TreeLinesSize, // float TreeLinesSize
ImGuiStyleVar_TreeLinesRounding, // float TreeLinesRounding
+ ImGuiStyleVar_MenuItemRounding, // float MenuItemRounding
+ ImGuiStyleVar_SelectableRounding, // float SelectableRounding
+ ImGuiStyleVar_DragDropTargetRounding, // float DragDropTargetRounding
ImGuiStyleVar_ButtonTextAlign, // ImVec2 ButtonTextAlign
ImGuiStyleVar_SelectableTextAlign, // ImVec2 SelectableTextAlign
ImGuiStyleVar_SeparatorSize, // float SeparatorSize
@@ -1983,7 +2006,8 @@ enum ImGuiColorEditFlags_
ImGuiColorEditFlags_AlphaNoBg = 1 << 13, // // ColorEdit, ColorPicker, ColorButton: disable rendering a checkerboard background behind transparent color.
ImGuiColorEditFlags_AlphaPreviewHalf= 1 << 14, // // ColorEdit, ColorPicker, ColorButton: display half opaque / half transparent preview.
- // User Options (right-click on widget to change some of them).
+ // User Options (right-click on widget to change some of them)
+ // Current settings are stored in style.ColorEditFlags.
ImGuiColorEditFlags_AlphaBar = 1 << 18, // // ColorEdit, ColorPicker: show vertical alpha bar/gradient in picker.
ImGuiColorEditFlags_HDR = 1 << 19, // // (WIP) ColorEdit: Currently only disable 0.0f..1.0f limits in RGBA edition (note: you probably want to use ImGuiColorEditFlags_Float flag as well).
ImGuiColorEditFlags_DisplayRGB = 1 << 20, // [Display] // ColorEdit: override _display_ type among RGB/HSV/Hex. ColorPicker: select any combination using one or more of RGB/HSV/Hex.
@@ -1993,11 +2017,13 @@ enum ImGuiColorEditFlags_
ImGuiColorEditFlags_Float = 1 << 24, // [DataType] // ColorEdit, ColorPicker, ColorButton: _display_ values formatted as 0.0f..1.0f floats instead of 0..255 integers. No round-trip of value via integers.
ImGuiColorEditFlags_PickerHueBar = 1 << 25, // [Picker] // ColorPicker: bar for Hue, rectangle for Sat/Value.
ImGuiColorEditFlags_PickerHueWheel = 1 << 26, // [Picker] // ColorPicker: wheel for Hue, triangle for Sat/Value.
- ImGuiColorEditFlags_InputRGB = 1 << 27, // [Input] // ColorEdit, ColorPicker: input and output data in RGB format.
- ImGuiColorEditFlags_InputHSV = 1 << 28, // [Input] // ColorEdit, ColorPicker: input and output data in HSV format.
+ ImGuiColorEditFlags_PickerNoRotate = 1 << 27, // [Picker] // ColorPicker: disable rotating Sat/Value triangle. Best set in io.ConfigColorEditFlags once.
+ ImGuiColorEditFlags_InputRGB = 1 << 28, // [Input] // ColorEdit, ColorPicker: input and output data in RGB format.
+ ImGuiColorEditFlags_InputHSV = 1 << 29, // [Input] // ColorEdit, ColorPicker: input and output data in HSV format.
- // Defaults Options. You can set application defaults using SetColorEditOptions(). The intent is that you probably don't want to
- // override them in most of your calls. Let the user choose via the option menu and/or call SetColorEditOptions() once during startup.
+ // Defaults Options copied to io.ConfigColorEditFlags during initialization.
+ // The intent is that you probably don't want to override them in most of your calls.
+ // Let the user choose via the option menu and/or modify io.ConfigColorEditFlags directly during startup if you want.
ImGuiColorEditFlags_DefaultOptions_ = ImGuiColorEditFlags_Uint8 | ImGuiColorEditFlags_DisplayRGB | ImGuiColorEditFlags_InputRGB | ImGuiColorEditFlags_PickerHueBar,
// [Internal] Masks
@@ -2010,8 +2036,8 @@ enum ImGuiColorEditFlags_
// Obsolete names
#ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS
ImGuiColorEditFlags_AlphaPreview = 0, // Removed in 1.91.8. This is the default now. Will display a checkerboard unless ImGuiColorEditFlags_AlphaNoBg is set.
-#endif
//ImGuiColorEditFlags_RGB = ImGuiColorEditFlags_DisplayRGB, ImGuiColorEditFlags_HSV = ImGuiColorEditFlags_DisplayHSV, ImGuiColorEditFlags_HEX = ImGuiColorEditFlags_DisplayHex // [renamed in 1.69]
+#endif
};
// Flags for DragFloat(), DragInt(), SliderFloat(), SliderInt() etc.
@@ -2029,6 +2055,8 @@ enum ImGuiSliderFlags_
ImGuiSliderFlags_NoSpeedTweaks = 1 << 11, // Disable keyboard modifiers altering tweak speed. Useful if you want to alter tweak speed yourself based on your own logic.
ImGuiSliderFlags_ColorMarkers = 1 << 12, // DragScalarN(), SliderScalarN(): Draw R/G/B/A color markers on each component.
ImGuiSliderFlags_AlwaysClamp = ImGuiSliderFlags_ClampOnInput | ImGuiSliderFlags_ClampZeroRange,
+ //ImGuiSliderFlags_LiveEditOnInput = 1 << 13, // Shortcut to enable LiveEdit for this field.
+ //ImGuiSliderFlags_NoLiveEditOnInput= 1 << 14, // Shortcut to disable LiveEdit for this field.
ImGuiSliderFlags_InvalidMask_ = 0x7000000F, // [Internal] We treat using those bits as being potentially a 'float power' argument from legacy API (obsoleted 2020-08) that has got miscast to this enum, and will trigger an assert if needed.
};
@@ -2241,7 +2269,7 @@ struct ImGuiTableSortSpecs
// Sorting specification for one column of a table (sizeof == 12 bytes)
struct ImGuiTableColumnSortSpecs
{
- ImGuiID ColumnUserID; // User id of the column (if specified by a TableSetupColumn() call)
+ ImGuiID ColumnUserID; // User data for the column (if specified by a TableSetupColumn() call in the 'ImGuiID user_data' field). FIXME: Should be called 'UserData'..
ImS16 ColumnIndex; // Index of the column
ImS16 SortOrder; // Index within parent ImGuiTableSortSpecs (always stored in order starting from 0, tables sorted on a single criteria will always have a 0 here)
ImGuiSortDirection SortDirection; // ImGuiSortDirection_Ascending or ImGuiSortDirection_Descending
@@ -2405,7 +2433,7 @@ struct ImGuiStyle
float TabBorderSize; // Thickness of border around tabs.
float TabMinWidthBase; // Minimum tab width, to make tabs larger than their contents. TabBar buttons are not affected.
float TabMinWidthShrink; // Minimum tab width after shrinking, when using ImGuiTabBarFlags_FittingPolicyMixed policy.
- float TabCloseButtonMinWidthSelected; // -1: always visible. 0.0f: visible when hovered. >0.0f: visible when hovered if minimum width.
+ float TabCloseButtonMinWidthSelected; // -1: always visible. 0.0f: visible when hovered. >0.0f: visible when hovered if minimum width. FLT_MAX: never shrink, will behave like ImGuiTabBarFlags_FittingPolicyScroll.
float TabCloseButtonMinWidthUnselected; // -1: always visible. 0.0f: visible when hovered. >0.0f: visible when hovered if minimum width. FLT_MAX: never show close button when unselected.
float TabBarBorderSize; // Thickness of tab-bar separator, which takes on the tab active color to denote focus.
float TabBarOverlineSize; // Thickness of tab-bar overline, which highlights the selected tab-bar.
@@ -2414,14 +2442,17 @@ struct ImGuiStyle
ImGuiTreeNodeFlags TreeLinesFlags; // Default way to draw lines connecting TreeNode hierarchy. ImGuiTreeNodeFlags_DrawLinesNone or ImGuiTreeNodeFlags_DrawLinesFull or ImGuiTreeNodeFlags_DrawLinesToNodes.
float TreeLinesSize; // Thickness of outlines when using ImGuiTreeNodeFlags_DrawLines.
float TreeLinesRounding; // Radius of lines connecting child nodes to the vertical line.
- float DragDropTargetRounding; // Radius of the drag and drop target frame.
+ float MenuItemRounding; // Radius of MenuItem, BeginMenu rounding.
+ float SelectableRounding; // Radius of Selectable rounding. MODIFYING THIS IS DISCOURAGED. CONTIGUOUS SELECTIONS WILL NOT LOOK RIGHT. (#7589)
+ float DragDropTargetRounding; // Radius of the drag and drop target frame. When <0.0f: use FrameRounding.
float DragDropTargetBorderSize; // Thickness of the drag and drop target border.
float DragDropTargetPadding; // Size to expand the drag and drop target from actual target item size.
float ColorMarkerSize; // Size of R/G/B/A color markers for ColorEdit4() and for Drags/Sliders when using ImGuiSliderFlags_ColorMarkers.
ImGuiDir ColorButtonPosition; // Side of the color button in the ColorEdit4 widget (left/right). Defaults to ImGuiDir_Right.
ImVec2 ButtonTextAlign; // Alignment of button text when button is larger than text. Defaults to (0.5f, 0.5f) (centered).
ImVec2 SelectableTextAlign; // Alignment of selectable text. Defaults to (0.0f, 0.0f) (top-left aligned). It's generally important to keep this left-aligned if you want to lay multiple items on a same line.
- float SeparatorSize; // Thickness of border in Separator()
+ float InputTextCursorSize; // Thickness of cursor/caret in InputText().
+ float SeparatorSize; // Thickness of border in Separator(). Must be >= 1.0f.
float SeparatorTextBorderSize; // Thickness of border in SeparatorText()
ImVec2 SeparatorTextAlign; // Alignment of text within the separator. Defaults to (0.0f, 0.5f) (left aligned, center).
ImVec2 SeparatorTextPadding; // Horizontal offset of text from each edge of the separator + spacing on other axis. Generally small values. .y is recommended to be == FramePadding.y.
@@ -2453,7 +2484,7 @@ struct ImGuiStyle
// Functions
IMGUI_API ImGuiStyle();
- IMGUI_API void ScaleAllSizes(float scale_factor); // Scale all spacing/padding/thickness values. Do not scale fonts.
+ IMGUI_API void ScaleAllSizes(float scale_factor); // Scale all spacing/padding/thickness values. Do not scale fonts. See comments in definition. Consider not calling this if your initial scale factor if <1.0.
// Obsolete names
#ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS
@@ -2521,10 +2552,11 @@ struct ImGuiIO
bool ConfigDockingTransparentPayload;// = false // [BETA] Make window or viewport transparent when docking and only display docking boxes on the target viewport. Useful if rendering of multiple viewport cannot be synced. Best used with ConfigViewportsNoAutoMerge.
// Viewport options (when ImGuiConfigFlags_ViewportsEnable is set)
+ // (sorry for the amount of "NoXXXX" flags, which may be harder to reason about! may rework someday)
bool ConfigViewportsNoAutoMerge; // = false; // Set to make all floating imgui windows always create their own viewport. Otherwise, they are merged into the main host viewports when overlapping it. May also set ImGuiViewportFlags_NoAutoMerge on individual viewport.
bool ConfigViewportsNoTaskBarIcon; // = false // Disable default OS task bar icon flag for secondary viewports. When a viewport doesn't want a task bar icon, ImGuiViewportFlags_NoTaskBarIcon will be set on it.
bool ConfigViewportsNoDecoration; // = true // Disable default OS window decoration flag for secondary viewports. When a viewport doesn't want window decorations, ImGuiViewportFlags_NoDecoration will be set on it. Enabling decoration can create subsequent issues at OS levels (e.g. minimum window size).
- bool ConfigViewportsNoDefaultParent; // = true // When false: set secondary viewports' ParentViewportId to main viewport ID by default. Expects the platform backend to setup a parent/child relationship between the OS windows based on this value. Some backend may ignore this. Set to true if you want viewports to automatically be parent of main viewport, otherwise all viewports will be top-level OS windows.
+ bool ConfigViewportsNoDefaultParent; // = true // Disable setting OS window parent to main viewport by default. The platform backend is expected to honor `viewport->ParentViewportID` to setup a parent/child relationship between the OS windows (supported if ImGuiBackendFlags_HasParentViewport is set). When parented: child windows always appear in front of their parent. Set to false if you want viewports to automatically be parent of main viewport, otherwise all viewports will be top-level OS windows. Parent/child relationship may be set on a per-window basis using ImGuiWindowClass.
bool ConfigViewportsPlatformFocusSetsImGuiFocus;//= true // When a platform window is focused (e.g. using Alt+Tab, clicking Platform Title Bar), apply corresponding focus on imgui windows (may clear focus/active id from imgui windows location in other platform windows). In principle this is better enabled but we provide an opt-out, because some Linux window managers tend to eagerly focus windows (e.g. on mouse hover, or even a simple window pos/size change).
// DPI/Scaling options
@@ -2532,24 +2564,33 @@ struct ImGuiIO
bool ConfigDpiScaleFonts; // = false // [EXPERIMENTAL] Automatically overwrite style.FontScaleDpi when Monitor DPI changes. This will scale fonts but _NOT_ scale sizes/padding for now.
bool ConfigDpiScaleViewports; // = false // [EXPERIMENTAL] Scale Dear ImGui and Platform Windows when Monitor DPI changes.
- // Miscellaneous options
- // (you can visualize and interact with all options in 'Demo->Configuration')
- bool MouseDrawCursor; // = false // Request ImGui to draw a mouse cursor for you (if you are on a platform without a mouse cursor). Cannot be easily renamed to 'io.ConfigXXX' because this is frequently used by backend implementations.
+ // Widget options
bool ConfigMacOSXBehaviors; // = defined(__APPLE__) // Swap Cmd<>Ctrl keys + OS X style text editing cursor movement using Alt instead of Ctrl, Shortcuts using Cmd/Super instead of Ctrl, Line/Text Start and End using Cmd+Arrows instead of Home/End, Double click selects by word instead of selecting whole text, Multi-selection in lists uses Cmd/Super instead of Ctrl.
bool ConfigInputTrickleEventQueue; // = true // Enable input queue trickling: some types of events submitted during the same frame (e.g. button down + up) will be spread over multiple frames, improving interactions with low framerates.
bool ConfigInputTextCursorBlink; // = true // Enable blinking cursor (optional as some users consider it to be distracting).
- bool ConfigInputTextEnterKeepActive; // = false // [BETA] Pressing Enter will reactivate item and select all text (single-line only).
+ bool ConfigInputTextEnterKeepActive; // = false // [BETA] Pressing Enter will reactivate item and select all text (single-line only). Ctrl+Enter or Shift+Enter will deactivate normally.
+ ImGuiColorEditFlags ConfigColorEditFlags; // = // Current settings for ColorEdit/ColorPicker widgets. Must have one bit of ImGuiColorEditFlags_DisplayMask_, one bit of ImGuiColorEditFlags_DataTypeMask_, one bit of ImGuiColorEditFlags_PickerMask_, one bit of ImGuiColorEditFlags_InputMask_. Defaults to ImGuiColorEditFlags_DefaultOptions_. May be further edited by users, unless you also set ImGuiColorEditFlags_NoOptions.
bool ConfigDragClickToInputText; // = false // [BETA] Enable turning DragXXX widgets into text input with a simple mouse click-release (without moving). Not desirable on devices without a keyboard.
bool ConfigWindowsResizeFromEdges; // = true // Enable resizing of windows from their edges and from the lower-left corner. This requires ImGuiBackendFlags_HasMouseCursors for better mouse cursor feedback. (This used to be a per-window ImGuiWindowFlags_ResizeFromAnySide flag)
bool ConfigWindowsMoveFromTitleBarOnly; // = false // Enable allowing to move windows only when clicking on their title bar. Does not apply to windows without a title bar.
bool ConfigWindowsCopyContentsWithCtrlC; // = false // [EXPERIMENTAL] Ctrl+C copy the contents of focused window into the clipboard. Experimental because: (1) has known issues with nested Begin/End pairs (2) text output quality varies (3) text output is in submission order rather than spatial order.
bool ConfigScrollbarScrollByPage; // = true // Enable scrolling page by page when clicking outside the scrollbar grab. When disabled, always scroll to clicked location. When enabled, Shift+Click scrolls to clicked location.
+
+ // Ini Settings options
+ bool ConfigIniSettingsSaveLastUsedDate;// = true // Enable loading/saving last used day (YYYYMMDD) in some .ini struct, making things easier to audit and allowing custom tools to cleanup old data.
+ int ConfigIniSettingsAutoDiscardMonths; // = 0 // [BETA] Set number of months after which unused .ini entries are discarded on load. Require platform_io.Platform_SessionDate to be set. For systems supporting the feature, .ini entries without a LastUsed field will always be discarded! Please report if you are using this.
+ bool ConfigDebugIniSettings; // = false // Save .ini data with extra comments (particularly helpful for Docking, but makes saving slower)
+
+ // Miscellaneous options
+ // (you can visualize and interact with all options in 'Demo->Configuration')
+ bool MouseDrawCursor; // = false // Request ImGui to draw a mouse cursor for you (if you are on a platform without a mouse cursor). Cannot be easily renamed to 'io.ConfigXXX' because this is frequently used by backend implementations.
float ConfigMemoryCompactTimer; // = 60.0f // Timer (in seconds) to free transient windows/tables memory buffers when unused. Set to -1.0f to disable.
// Inputs Behaviors
// (other variables, ones which are expected to be tweaked within UI code, are exposed in ImGuiStyle)
- float MouseDoubleClickTime; // = 0.30f // Time for a double-click, in seconds.
- float MouseDoubleClickMaxDist; // = 6.0f // Distance threshold to stay in to validate a double-click, in pixels.
+ float MouseDoubleClickTime; // = 0.30f // Time for consecutive clicks to account as a double-click, in seconds.
+ float MouseDoubleClickMaxDist; // = 6.0f // Distance threshold to stay in to validate a double-click or multiple clicks, in pixels.
+ float MouseSingleClickDelay; // = 0.60f // Time for a delayed click when using GetItemClickedCountWithSingleClickDelay() or IsMouseReleasedWithDelay(), in seconds. Must be > io.MouseDoubleClickTime.
float MouseDragThreshold; // = 6.0f // Distance threshold before considering we are dragging.
float KeyRepeatDelay; // = 0.275f // When holding a key/button, time before it starts repeating, in seconds (for buttons in Repeat mode, etc.).
float KeyRepeatRate; // = 0.050f // When holding a key/button, rate at which it repeats, in seconds.
@@ -2602,9 +2643,6 @@ struct ImGuiIO
// - Backends may have other side-effects on focus loss, so this will reduce side-effects but not necessary remove all of them.
bool ConfigDebugIgnoreFocusLoss; // = false // Ignore io.AddFocusEvent(false), consequently not calling io.ClearInputKeys()/io.ClearInputMouse() in input processing.
- // Option to audit .ini data
- bool ConfigDebugIniSettings; // = false // Save .ini data with extra comments (particularly helpful for Docking, but makes saving slower)
-
//------------------------------------------------------------------
// Platform Identifiers
// (the imgui_impl_xxxx backend files are setting those up for you)
@@ -2719,7 +2757,7 @@ struct ImGuiIO
//void* ImeWindowHandle; // [Obsoleted in 1.87] Set ImGuiViewport::PlatformHandleRaw instead. Set this to your HWND to get automatic IME cursor positioning.
#ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS
- float FontGlobalScale; // Moved io.FontGlobalScale to style.FontScaleMain in 1.92 (June 2025)
+ float FontGlobalScale; // Moved io.FontGlobalScale to style.FontScaleMain in 1.92.0 (June 2025)
// Legacy: before 1.91.1, clipboard functions were stored in ImGuiIO instead of ImGuiPlatformIO.
// As this is will affect all users of custom engines/backends, we are providing proper legacy redirection (will obsolete).
@@ -2752,7 +2790,7 @@ struct ImGuiInputTextCallbackData
ImGuiInputTextFlags EventFlag; // One ImGuiInputTextFlags_Callback* // Read-only
ImGuiInputTextFlags Flags; // What user passed to InputText() // Read-only
void* UserData; // What user passed to InputText() // Read-only
- ImGuiID ID; // Widget ID // Read-only
+ ImGuiID ID; // Widget ID // Read-only
// Arguments for the different callback events
// - During Resize callback, Buf will be same as your input buffer.
@@ -2766,9 +2804,9 @@ struct ImGuiInputTextCallbackData
char* Buf; // Text buffer // Read-write // [Resize] Can replace pointer / [Completion,History,Always] Only write to pointed data, don't replace the actual pointer!
int BufTextLen; // Text length (in bytes) // Read-write // [Resize,Completion,History,Always] Exclude zero-terminator storage. In C land: == strlen(some_text), in C++ land: string.length()
int BufSize; // Buffer size (in bytes) = capacity+1 // Read-only // [Resize,Completion,History,Always] Include zero-terminator storage. In C land: == ARRAYSIZE(my_char_array), in C++ land: string.capacity()+1
- int CursorPos; // // Read-write // [Completion,History,Always]
- int SelectionStart; // // Read-write // [Completion,History,Always] == to SelectionEnd when no selection
- int SelectionEnd; // // Read-write // [Completion,History,Always]
+ int CursorPos; // // Read-write // [Completion,History,Always,CharFilter]
+ int SelectionStart; // // Read-write // [Completion,History,Always,CharFilter] == to SelectionEnd when no selection
+ int SelectionEnd; // // Read-write // [Completion,History,Always,CharFilter]
// Helper functions for text manipulation.
// Use those function to benefit from the CallbackResize behaviors. Calling those function reset the selection.
@@ -2796,7 +2834,7 @@ struct ImGuiSizeCallbackData
// before we stabilize Docking features. Please be mindful if using this.
// Provide hints:
// - To the platform backend via altered viewport flags (enable/disable OS decoration, OS task bar icons, etc.)
-// - To the platform backend for OS level parent/child relationships of viewport.
+// - To the platform backend for OS level parent/child relationships of viewport (otherwise: default is configured via io.ConfigViewportsNoDefaultParent)
// - To the docking system for various options and filtering.
struct ImGuiWindowClass
{
@@ -2809,6 +2847,7 @@ struct ImGuiWindowClass
ImGuiDockNodeFlags DockNodeFlagsOverrideSet; // [EXPERIMENTAL] Dock node flags to set when a window of this class is hosted by a dock node (it doesn't have to be selected!)
bool DockingAlwaysTabBar; // Set to true to enforce single floating windows of this class always having their own docking node (equivalent of setting the global io.ConfigDockingAlwaysTabBar)
bool DockingAllowUnclassed; // Set to true to allow windows of this class to be docked/merged with an unclassed window. // FIXME-DOCK: Move to DockNodeFlags override?
+ void* PlatformIconData; // [EXPERIMENTAL] Pass opaque data for Platform backend to handle.
ImGuiWindowClass() { memset((void*)this, 0, sizeof(*this)); ParentViewportId = (ImGuiID)-1; DockingAllowUnclassed = true; }
};
@@ -3178,6 +3217,7 @@ enum ImGuiMultiSelectFlags_
ImGuiMultiSelectFlags_NavWrapX = 1 << 16, // [Temporary] Enable navigation wrapping on X axis. Provided as a convenience because we don't have a design for the general Nav API for this yet. When the more general feature be public we may obsolete this flag in favor of new one.
ImGuiMultiSelectFlags_NoSelectOnRightClick = 1 << 17, // Disable default right-click processing, which selects item on mouse down, and is designed for context-menus.
ImGuiMultiSelectFlags_SelectOnMask_ = ImGuiMultiSelectFlags_SelectOnAuto | ImGuiMultiSelectFlags_SelectOnClickAlways | ImGuiMultiSelectFlags_SelectOnClickRelease,
+ ImGuiMultiSelectFlags_CheckboxMode_ = 1 << 20, // [Internal]
// Obsolete names
#ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS
@@ -3298,12 +3338,6 @@ typedef unsigned short ImDrawIdx; // Default: 16-bit (for maximum compatibilit
typedef void (*ImDrawCallback)(const ImDrawList* parent_list, const ImDrawCmd* cmd);
#endif
-// Special Draw callback value to request renderer backend to reset the graphics/render state.
-// The renderer backend needs to handle this special value, otherwise it will crash trying to call a function at this address.
-// This is useful, for example, if you submitted callbacks which you know have altered the render state and you want it to be restored.
-// Render state is not reset by default because they are many perfectly useful way of altering render state (e.g. changing shader/blending settings before an Image call).
-#define ImDrawCallback_ResetRenderState (ImDrawCallback)(-8)
-
// Typically, 1 command = 1 GPU draw call (unless command is a callback)
// - VtxOffset: When 'io.BackendFlags & ImGuiBackendFlags_RendererHasVtxOffset' is enabled,
// this fields allow us to render meshes larger than 64K vertices while keeping 16-bit indices.
@@ -3377,23 +3411,30 @@ struct ImDrawListSplitter
};
// Flags for ImDrawList functions
-// (Legacy: bit 0 must always correspond to ImDrawFlags_Closed to be backward compatible with old API using a bool. Bits 1..3 must be unused)
enum ImDrawFlags_
{
ImDrawFlags_None = 0,
- ImDrawFlags_Closed = 1 << 0, // PathStroke(), AddPolyline(): specify that shape should be closed (Important: this is always == 1 for legacy reason)
- ImDrawFlags_RoundCornersTopLeft = 1 << 4, // AddRect(), AddRectFilled(), PathRect(): enable rounding top-left corner only (when rounding > 0.0f, we default to all corners). Was 0x01.
- ImDrawFlags_RoundCornersTopRight = 1 << 5, // AddRect(), AddRectFilled(), PathRect(): enable rounding top-right corner only (when rounding > 0.0f, we default to all corners). Was 0x02.
- ImDrawFlags_RoundCornersBottomLeft = 1 << 6, // AddRect(), AddRectFilled(), PathRect(): enable rounding bottom-left corner only (when rounding > 0.0f, we default to all corners). Was 0x04.
- ImDrawFlags_RoundCornersBottomRight = 1 << 7, // AddRect(), AddRectFilled(), PathRect(): enable rounding bottom-right corner only (when rounding > 0.0f, we default to all corners). Wax 0x08.
- ImDrawFlags_RoundCornersNone = 1 << 8, // AddRect(), AddRectFilled(), PathRect(): disable rounding on all corners (when rounding > 0.0f). This is NOT zero, NOT an implicit flag!
+
+ // Rounding for AddRect(), AddRectFilled(), PathRect()
+ // - When not specified, we defaults to ImDrawFlags_RoundCornersAll! So you only need to use those flags if you want another configuration.
+ ImDrawFlags_RoundCornersTopLeft = 1 << 4, // Round top-left corner only (when rounding > 0.0f, we default to all corners).
+ ImDrawFlags_RoundCornersTopRight = 1 << 5, // Round top-right corner only (when rounding > 0.0f, we default to all corners).
+ ImDrawFlags_RoundCornersBottomLeft = 1 << 6, // Round bottom-left corner only (when rounding > 0.0f, we default to all corners).
+ ImDrawFlags_RoundCornersBottomRight = 1 << 7, // Round bottom-right corner only (when rounding > 0.0f, we default to all corners).
+ ImDrawFlags_RoundCornersNone = 1 << 8, // Disable rounding even if `float rounding > 0.0f`. This is NOT zero, NOT an implicit flag!
+ ImDrawFlags_RoundCornersAll = ImDrawFlags_RoundCornersTopLeft | ImDrawFlags_RoundCornersTopRight | ImDrawFlags_RoundCornersBottomLeft | ImDrawFlags_RoundCornersBottomRight, // (Default!!)
+ ImDrawFlags_RoundCornersDefault_ = ImDrawFlags_RoundCornersAll, // Default to ALL corners if none of the _RoundCornersXX flags are specified!
ImDrawFlags_RoundCornersTop = ImDrawFlags_RoundCornersTopLeft | ImDrawFlags_RoundCornersTopRight,
ImDrawFlags_RoundCornersBottom = ImDrawFlags_RoundCornersBottomLeft | ImDrawFlags_RoundCornersBottomRight,
ImDrawFlags_RoundCornersLeft = ImDrawFlags_RoundCornersBottomLeft | ImDrawFlags_RoundCornersTopLeft,
ImDrawFlags_RoundCornersRight = ImDrawFlags_RoundCornersBottomRight | ImDrawFlags_RoundCornersTopRight,
- ImDrawFlags_RoundCornersAll = ImDrawFlags_RoundCornersTopLeft | ImDrawFlags_RoundCornersTopRight | ImDrawFlags_RoundCornersBottomLeft | ImDrawFlags_RoundCornersBottomRight,
- ImDrawFlags_RoundCornersDefault_ = ImDrawFlags_RoundCornersAll, // Default to ALL corners if none of the _RoundCornersXX flags are specified.
ImDrawFlags_RoundCornersMask_ = ImDrawFlags_RoundCornersAll | ImDrawFlags_RoundCornersNone,
+
+ // Stroke options
+ ImDrawFlags_Closed = 1 << 9, // PathStroke(), AddPolyline(): specify that shape should be closed.
+ //ImDrawFlags_Closed = 1, // Prior to 1.92.8 (May 2026), ImDrawFlags_Closed was guaranteed to be == 1<<0 == 1 for legacy compatibility reason. Hardcoded use of 1 or true should be replaced.
+
+ ImDrawFlags_InvalidMask_ = ~0x7FFFFFF0, // == 0x8000000F,
};
// Flags for ImDrawList instance. Those are set automatically by ImGui:: functions from ImGuiIO settings, and generally not manipulated directly.
@@ -3405,6 +3446,7 @@ enum ImDrawListFlags_
ImDrawListFlags_AntiAliasedLinesUseTex = 1 << 1, // Enable anti-aliased lines/borders using textures when possible. Require backend to render with bilinear filtering (NOT point/nearest filtering).
ImDrawListFlags_AntiAliasedFill = 1 << 2, // Enable anti-aliased edge around filled shapes (rounded rectangles, circles).
ImDrawListFlags_AllowVtxOffset = 1 << 3, // Can emit 'VtxOffset > 0' to allow large meshes. Set when 'ImGuiBackendFlags_RendererHasVtxOffset' is enabled.
+ ImDrawListFlags_TextNoPixelSnap = 1 << 4, // Disable automatically snapping AddText() calls to pixel boundaries.
};
// Draw command list
@@ -3459,7 +3501,9 @@ struct ImDrawList
// In future versions we will use textures to provide cheaper and higher-quality circles.
// Use AddNgon() and AddNgonFilled() functions if you need to guarantee a specific number of sides.
IMGUI_API void AddLine(const ImVec2& p1, const ImVec2& p2, ImU32 col, float thickness = 1.0f);
- IMGUI_API void AddRect(const ImVec2& p_min, const ImVec2& p_max, ImU32 col, float rounding = 0.0f, ImDrawFlags flags = 0, float thickness = 1.0f); // a: upper-left, b: lower-right (== upper-left + size)
+ IMGUI_API void AddLineH(float min_x, float max_x, float y, ImU32 col, float thickness = 1.0f);
+ IMGUI_API void AddLineV(float x, float min_y, float max_y, ImU32 col, float thickness = 1.0f);
+ IMGUI_API void AddRect(const ImVec2& p_min, const ImVec2& p_max, ImU32 col, float rounding = 0.0f, float thickness = 1.0f, ImDrawFlags flags = 0); // a: upper-left, b: lower-right (== upper-left + size)
IMGUI_API void AddRectFilled(const ImVec2& p_min, const ImVec2& p_max, ImU32 col, float rounding = 0.0f, ImDrawFlags flags = 0); // a: upper-left, b: lower-right (== upper-left + size)
IMGUI_API void AddRectFilledMultiColor(const ImVec2& p_min, const ImVec2& p_max, ImU32 col_upr_left, ImU32 col_upr_right, ImU32 col_bot_right, ImU32 col_bot_left);
IMGUI_API void AddQuad(const ImVec2& p1, const ImVec2& p2, const ImVec2& p3, const ImVec2& p4, ImU32 col, float thickness = 1.0f);
@@ -3480,7 +3524,7 @@ struct ImDrawList
// General polygon
// - Only simple polygons are supported by filling functions (no self-intersections, no holes).
// - Concave polygon fill is more expensive than convex one: it has O(N^2) complexity. Provided as a convenience for the user but not used by the main library.
- IMGUI_API void AddPolyline(const ImVec2* points, int num_points, ImU32 col, ImDrawFlags flags, float thickness);
+ IMGUI_API void AddPolyline(const ImVec2* points, int num_points, ImU32 col, float thickness, ImDrawFlags flags = 0);
IMGUI_API void AddConvexPolyFilled(const ImVec2* points, int num_points, ImU32 col);
IMGUI_API void AddConcavePolyFilled(const ImVec2* points, int num_points, ImU32 col);
@@ -3500,7 +3544,7 @@ struct ImDrawList
inline void PathLineToMergeDuplicate(const ImVec2& pos) { if (_Path.Size == 0 || memcmp(&_Path.Data[_Path.Size - 1], &pos, 8) != 0) _Path.push_back(pos); }
inline void PathFillConvex(ImU32 col) { AddConvexPolyFilled(_Path.Data, _Path.Size, col); _Path.Size = 0; }
inline void PathFillConcave(ImU32 col) { AddConcavePolyFilled(_Path.Data, _Path.Size, col); _Path.Size = 0; }
- inline void PathStroke(ImU32 col, ImDrawFlags flags = 0, float thickness = 1.0f) { AddPolyline(_Path.Data, _Path.Size, col, flags, thickness); _Path.Size = 0; }
+ inline void PathStroke(ImU32 col, float thickness = 1.0f, ImDrawFlags flags = 0) { AddPolyline(_Path.Data, _Path.Size, col, thickness, flags); _Path.Size = 0; }
IMGUI_API void PathArcTo(const ImVec2& center, float radius, float a_min, float a_max, int num_segments = 0);
IMGUI_API void PathArcToFast(const ImVec2& center, float radius, int a_min_of_12, int a_max_of_12); // Use precomputed angles for a 12 steps circle
IMGUI_API void PathEllipticalArcTo(const ImVec2& center, const ImVec2& radius, float rot, float a_min, float a_max, int num_segments = 0); // Ellipse
@@ -3510,14 +3554,15 @@ struct ImDrawList
// Advanced: Draw Callbacks
// - May be used to alter render state (change sampler, blending, current shader). May be used to emit custom rendering commands (difficult to do correctly, but possible).
- // - Use special ImDrawCallback_ResetRenderState callback to instruct backend to reset its render state to the default.
+ // - Use special GetPlatformIO().DrawCallback_ResetRenderState callback to instruct backend to reset its render state to the default.
+ // - See other standard callbacks in GetPlatformIO(), which may or not be supported by your backend.
// - Your rendering loop must check for 'UserCallback' in ImDrawCmd and call the function instead of rendering triangles. All standard backends are honoring this.
// - For some backends, the callback may access selected render-states exposed by the backend in a ImGui_ImplXXXX_RenderState structure pointed to by platform_io.Renderer_RenderState.
// - IMPORTANT: please be mindful of the different level of indirection between using size==0 (copying argument) and using size>0 (copying pointed data into a buffer).
// - If userdata_size == 0: we copy/store the 'userdata' argument as-is. It will be available unmodified in ImDrawCmd::UserCallbackData during render.
// - If userdata_size > 0, we copy/store 'userdata_size' bytes pointed to by 'userdata'. We store them in a buffer stored inside the drawlist. ImDrawCmd::UserCallbackData will point inside that buffer so you have to retrieve data from there. Your callback may need to use ImDrawCmd::UserCallbackDataSize if you expect dynamically-sized data.
// - Support for userdata_size > 0 was added in v1.91.4, October 2024. So earlier code always only allowed to copy/store a simple void*.
- IMGUI_API void AddCallback(ImDrawCallback callback, void* userdata, size_t userdata_size = 0);
+ IMGUI_API void AddCallback(ImDrawCallback callback, void* userdata = NULL, size_t userdata_size = 0);
// Advanced: Miscellaneous
IMGUI_API void AddDrawCmd(); // This is useful if you need to forcefully create a new draw call (to allow for dependent rendering / blending). Otherwise primitives are merged into the same draw-call as much as possible
@@ -3547,8 +3592,15 @@ struct ImDrawList
// Obsolete names
#ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS
+ inline void AddRect(const ImVec2& p_min, const ImVec2& p_max, ImU32 col, float rounding, ImDrawFlags flags, float thickness) { AddRect(p_min, p_max, col, rounding, thickness, flags); } // OBSOLETED in 1.92.8: NEW FUNCTION SIGNATURE HAS 'thickness' AND 'flags' SWAPPED.
+ inline void AddPolyline(const ImVec2* points, int num_points, ImU32 col, ImDrawFlags flags, float thickness) { AddPolyline(points, num_points, col, thickness, flags); } // OBSOLETED in 1.92.8: NEW FUNCTION SIGNATURE HAS 'thickness' AND 'flags' SWAPPED.
+ inline void PathStroke(ImU32 col, ImDrawFlags flags, float thickness) { PathStroke(col, thickness, flags); } // OBSOLETED in 1.92.8: NEW FUNCTION SIGNATURE HAS 'thickness' AND 'flags' SWAPPED.
inline void PushTextureID(ImTextureRef tex_ref) { PushTexture(tex_ref); } // RENAMED in 1.92.0
inline void PopTextureID() { PopTexture(); } // RENAMED in 1.92.0
+#else
+ void AddRect(const ImVec2& p_min, const ImVec2& p_max, ImU32 col, float rounding /*= 0.0f*/, ImDrawFlags flags /*= 0*/, float thickness /*= 1.0f*/) = delete;
+ void AddPolyline(const ImVec2* points, int num_points, ImU32 col, ImDrawFlags flags, float thickness) = delete;
+ inline void PathStroke(ImU32 col, ImDrawFlags flags /*= 0*/, float thickness /*= 1.0f*/) = delete;
#endif
//inline void AddEllipse(const ImVec2& center, float radius_x, float radius_y, ImU32 col, float rot = 0.0f, int num_segments = 0, float thickness = 1.0f) { AddEllipse(center, ImVec2(radius_x, radius_y), col, rot, num_segments, thickness); } // OBSOLETED in 1.90.5 (Mar 2024)
//inline void AddEllipseFilled(const ImVec2& center, float radius_x, float radius_y, ImU32 col, float rot = 0.0f, int num_segments = 0) { AddEllipseFilled(center, ImVec2(radius_x, radius_y), col, rot, num_segments); } // OBSOLETED in 1.90.5 (Mar 2024)
@@ -3577,7 +3629,7 @@ struct ImDrawList
struct ImDrawData
{
bool Valid; // Only valid after Render() is called and before the next NewFrame() is called.
- int CmdListsCount; // == CmdLists.Size. (OBSOLETE: exists for legacy reasons). Number of ImDrawList* to render.
+ int FrameCount; // Frame counter of the emitter context. Mostly for debugging purpose.
int TotalIdxCount; // For convenience, sum of all ImDrawList's IdxBuffer.Size
int TotalVtxCount; // For convenience, sum of all ImDrawList's VtxBuffer.Size
ImVector CmdLists; // Array of ImDrawList* to render. The ImDrawLists are owned by ImGuiContext and only pointed to from here.
@@ -3587,6 +3639,10 @@ struct ImDrawData
ImGuiViewport* OwnerViewport; // Viewport carrying the ImDrawData instance, might be of use to the renderer (generally not).
ImVector* Textures; // List of textures to update. Most of the times the list is shared by all ImDrawData, has only 1 texture and it doesn't need any update. This almost always points to ImGui::GetPlatformIO().Textures[]. May be overridden or set to NULL if you want to manually update textures.
+#ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS
+ int CmdListsCount; // Use CmdLists.Size instead. Number of ImDrawList* to render.
+#endif
+
// Functions
ImDrawData() { Clear(); }
IMGUI_API void Clear();
@@ -3628,7 +3684,7 @@ enum ImTextureStatus
// You may use ImTextureData::Updates[] for the list, or ImTextureData::UpdateBox for a single bounding box.
struct ImTextureRect
{
- unsigned short x, y; // Upper-left coordinates of rectangle to update
+ unsigned short x, y; // Upper-left coordinates of rectangle to update, within the parent Pixels[] array.
unsigned short w, h; // Size of rectangle to update (in pixels)
};
@@ -3638,19 +3694,20 @@ struct ImTextureRect
// Why does we store two identifiers: TexID and BackendUserData?
// - ImTextureID TexID = lower-level identifier stored in ImDrawCmd. ImDrawCmd can refer to textures not created by the backend, and for which there's no ImTextureData.
// - void* BackendUserData = higher-level opaque storage for backend own book-keeping. Some backends may have enough with TexID and not need both.
- // In columns below: who reads/writes each fields? 'r'=read, 'w'=write, 'core'=main library, 'backend'=renderer backend
+// In columns below: who reads/writes each fields? 'r'=read, 'w'=write, 'core'=main library, 'backend'=renderer backend
struct ImTextureData
{
//------------------------------------------ core / backend ---------------------------------------
int UniqueID; // w - // [DEBUG] Sequential index to facilitate identifying a texture when debugging/printing. Unique per atlas.
ImTextureStatus Status; // rw rw // ImTextureStatus_OK/_WantCreate/_WantUpdates/_WantDestroy. Always use SetStatus() to modify!
void* BackendUserData; // - rw // Convenience storage for backend. Some backends may have enough with TexID.
+ void* QueueUserData; // r - // Convenience storage for a staged/multi-threaded rendering texture queue (e.g. imgui_threaded_rendering.h. See #8597). When != NULL, core assumes the texture is referenced by the queue.
ImTextureID TexID; // r w // Backend-specific texture identifier. Always use SetTexID() to modify! The identifier will stored in ImDrawCmd::GetTexID() and passed to backend's RenderDrawData function.
ImTextureFormat Format; // w r // ImTextureFormat_RGBA32 (default) or ImTextureFormat_Alpha8
int Width; // w r // Texture width
int Height; // w r // Texture height
int BytesPerPixel; // w r // 4 or 1
- unsigned char* Pixels; // w r // Pointer to buffer holding 'Width*Height' pixels and 'Width*Height*BytesPerPixels' bytes.
+ unsigned char* Pixels; // w r // Pointer to whole texture buffer holding 'Width*Height' pixels and 'Width*Height*BytesPerPixels' bytes.
ImTextureRect UsedRect; // w r // Bounding box encompassing all past and queued Updates[].
ImTextureRect UpdateRect; // w r // Bounding box encompassing all queued Updates[].
ImVector Updates; // w r // Array of individual updates.
@@ -3660,6 +3717,7 @@ struct ImTextureData
bool WantDestroyNextFrame; // rw - // [Internal] Queued to set ImTextureStatus_WantDestroy next frame. May still be used in the current frame.
// Functions
+ // - If GetPixels() functions asserts while being called by your render loop, it could be caused by calling ImFontAtlas::Clear()/ClearFonts()?
ImTextureData() { memset((void*)this, 0, sizeof(*this)); Status = ImTextureStatus_Destroyed; TexID = ImTextureID_Invalid; }
~ImTextureData() { DestroyPixels(); }
IMGUI_API void Create(ImTextureFormat format, int w, int h);
@@ -3813,15 +3871,17 @@ struct ImFontAtlas
IMGUI_API ImFont* AddFontFromMemoryTTF(void* font_data, int font_data_size, float size_pixels = 0.0f, const ImFontConfig* font_cfg = NULL, const ImWchar* glyph_ranges = NULL); // Note: Transfer ownership of 'ttf_data' to ImFontAtlas! Will be deleted after destruction of the atlas. Set font_cfg->FontDataOwnedByAtlas=false to keep ownership of your data and it won't be freed.
IMGUI_API ImFont* AddFontFromMemoryCompressedTTF(const void* compressed_font_data, int compressed_font_data_size, float size_pixels = 0.0f, const ImFontConfig* font_cfg = NULL, const ImWchar* glyph_ranges = NULL); // 'compressed_font_data' still owned by caller. Compress with binary_to_compressed_c.cpp.
IMGUI_API ImFont* AddFontFromMemoryCompressedBase85TTF(const char* compressed_font_data_base85, float size_pixels = 0.0f, const ImFontConfig* font_cfg = NULL, const ImWchar* glyph_ranges = NULL); // 'compressed_font_data_base85' still owned by caller. Compress with binary_to_compressed_c.cpp with -base85 parameter.
- IMGUI_API void RemoveFont(ImFont* font);
-
- IMGUI_API void Clear(); // Clear everything (input fonts, output glyphs/textures).
- IMGUI_API void CompactCache(); // Compact cached glyphs and texture.
+ IMGUI_API void RemoveFont(ImFont* font); // Remove a font
+ IMGUI_API void CompactCache(); // Compact cached glyphs and texture.
IMGUI_API void SetFontLoader(const ImFontLoader* font_loader); // Change font loader at runtime.
- // As we are transitioning toward a new font system, we expect to obsolete those soon:
+ // Clearing the atlas/fonts has little use nowadays, unless you want to batch remove all fonts.
+ // - Since 1.92, you can call ClearFonts() mid-frame, if you load new fonts afterwards.
+ // - As we are transitioning toward our new font system the semantic for those functions gets increasingly misleading and are often a source of issues.
+ // TL;DR; most likely, don't use any of those functions. We expect to obsolete/rework them.
+ IMGUI_API void Clear(); // Clear everything (fonts + textures). Don't call mid-frame!
+ IMGUI_API void ClearFonts(); // Clear input+output font data/glyphs. New fonts and textures will be recreated afterwards.
IMGUI_API void ClearInputData(); // [OBSOLETE] Clear input data (all ImFontConfig structures including sizes, TTF data, glyph ranges, etc.) = all the data used to build the texture and fonts.
- IMGUI_API void ClearFonts(); // [OBSOLETE] Clear input+output font data (same as ClearInputData() + glyphs storage, UV coordinates).
IMGUI_API void ClearTexData(); // [OBSOLETE] Clear CPU-side copy of the texture data. Saves RAM once the texture has been copied to graphics memory.
#ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS
@@ -3993,6 +4053,7 @@ enum ImFontFlags_
ImFontFlags_NoLoadError = 1 << 1, // Disable throwing an error/assert when calling AddFontXXX() with missing file/data. Calling code is expected to check AddFontXXX() return value.
ImFontFlags_NoLoadGlyphs = 1 << 2, // [Internal] Disable loading new glyphs.
ImFontFlags_LockBakedSizes = 1 << 3, // [Internal] Disable loading new baked sizes, disable garbage collecting current ones. e.g. if you want to lock a font to a single size. Important: if you use this to preload given sizes, consider the possibility of multiple font density used on Retina display.
+ ImFontFlags_ImplicitRefSize = 1 << 4, // [Internal] Reference size was not set explicitly.
};
// Font runtime data and rendering
@@ -4038,7 +4099,7 @@ struct ImFont
IMGUI_API void RenderChar(ImDrawList* draw_list, float size, const ImVec2& pos, ImU32 col, ImWchar c, const ImVec4* cpu_fine_clip = NULL);
IMGUI_API void RenderText(ImDrawList* draw_list, float size, const ImVec2& pos, ImU32 col, const ImVec4& clip_rect, const char* text_begin, const char* text_end, float wrap_width = 0.0f, ImDrawTextFlags flags = 0);
#ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS
- inline const char* CalcWordWrapPositionA(float scale, const char* text, const char* text_end, float wrap_width) { return CalcWordWrapPosition(LegacySize * scale, text, text_end, wrap_width); }
+ inline const char* CalcWordWrapPositionA(float scale, const char* text, const char* text_end, float wrap_width) { return CalcWordWrapPosition(LegacySize * scale, text, text_end, wrap_width); } // Obsoleted old name in 1.92.0. Note how `scale` was to `size`.
#endif
// [Internal] Don't use!
@@ -4121,6 +4182,7 @@ struct ImGuiViewport
// The library never uses those fields, they are merely storage to facilitate backend implementation.
void* RendererUserData; // void* to hold custom data structure for the renderer (e.g. swap chain, framebuffers etc.). generally set by your Renderer_CreateWindow function.
void* PlatformUserData; // void* to hold custom data structure for the OS / platform (e.g. windowing info, render context). generally set by your Platform_CreateWindow function.
+ void* PlatformIconData; // void* to hold custom data structure for the OS / platform to specify an icon. Currently unused for exposed to allow experiments.
void* PlatformHandle; // void* to hold higher-level, platform window handle (e.g. HWND for Win32 backend, Uint32 WindowID for SDL, GLFWWindow* for GLFW), for FindViewportByPlatformHandle().
void* PlatformHandleRaw; // void* to hold lower-level, platform-native window handle (always HWND on Win32 platform, unused for other platforms).
bool PlatformWindowCreated; // Platform window has been created (Platform_CreateWindow() has been called). This is false during the first frame where a viewport is being created.
@@ -4215,7 +4277,11 @@ struct ImGuiPlatformIO
// Optional: Platform locale
// [Experimental] Configure decimal point e.g. '.' or ',' useful for some languages (e.g. German), generally pulled from *localeconv()->decimal_point
- ImWchar Platform_LocaleDecimalPoint; // '.'
+ ImWchar Platform_LocaleDecimalPoint; // '.'
+
+ // Optional: Platform time/date
+ // This is automatically filled on startup. Used to store a "last used date" in some .ini structures. Facilitate creating tools to clean up old/unused data.
+ int Platform_SessionDate; // Integer storing YYYYMMDD e.g. 20261231 corresponding to the beginning of application session.
//------------------------------------------------------------------
// Input - Interface with Renderer Backend
@@ -4228,6 +4294,12 @@ struct ImGuiPlatformIO
// Written by some backends during ImGui_ImplXXXX_RenderDrawData() call to point backend_specific ImGui_ImplXXXX_RenderState* structure.
void* Renderer_RenderState;
+ // Standard draw callbacks provided by renderer backend.
+ ImDrawCallback DrawCallback_ResetRenderState; // Request to reset the graphics/render state.
+ ImDrawCallback DrawCallback_SetSamplerLinear; // Request backend to set texture sampling to Linear.
+ ImDrawCallback DrawCallback_SetSamplerNearest; // Request backend to set texture sampling to Nearest/Point.
+ //ImDrawCallback DrawCallback_SetSamplerCustom; // Request backend to set texture sampling using Backend Specific data.
+
//------------------------------------------------------------------
// Input - Interface with Platform & Renderer backends for Multi-Viewport support
//------------------------------------------------------------------
@@ -4330,6 +4402,8 @@ struct ImGuiPlatformImeData
#ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS
namespace ImGui
{
+ // OBSOLETED in 1.92.9 (from July 2026)
+ IMGUI_API void SetColorEditOptions(ImGuiColorEditFlags flags); // set current options for if you want to select a default format, picker type, etc. User will be able to change those settings, unless you pass the _NoOptions flag to your calls.
// OBSOLETED in 1.92.0 (from June 2025)
inline void PushFont(ImFont* font) { PushFont(font, font ? font->LegacySize : 0.0f); }
IMGUI_API void SetWindowFontScale(float scale); // Set font scale factor for current window. Prefer using PushFont(NULL, style.FontSizeBase * factor) or use style.FontScaleMain to scale all windows.
@@ -4421,6 +4495,8 @@ namespace ImGui
//static inline void SetScrollPosHere() { SetScrollHere(); } // OBSOLETED in 1.42
}
+#define ImDrawCallback_ResetRenderState (ImDrawCallback)(-8) // OBSOLETED in 1.92.8: Use ImGui::GetPlatformIO().DrawCallback_ResetRenderState
+
//-- OBSOLETED in 1.92.0: ImFontAtlasCustomRect becomes ImTextureRect
// - ImFontAtlasCustomRect::X,Y --> ImTextureRect::x,y
// - ImFontAtlasCustomRect::Width,Height --> ImTextureRect::w,h
diff --git a/include/imgui/imgui_demo.cpp b/include/imgui/imgui_demo.cpp
index 9f4bc8d..7832b37 100644
--- a/include/imgui/imgui_demo.cpp
+++ b/include/imgui/imgui_demo.cpp
@@ -1,4 +1,4 @@
-// dear imgui, v1.92.7
+// dear imgui, v1.92.9b
// (demo code)
// Help:
@@ -73,6 +73,7 @@ Index of this file:
// [SECTION] Demo Window / ShowDemoWindow()
// [SECTION] DemoWindowMenuBar()
// [SECTION] Helpers: ExampleTreeNode, ExampleMemberInfo (for use by Property Editor & Multi-Select demos)
+// [SECTION] Helpers: ExampleImageViewer
// [SECTION] DemoWindowWidgetsBasic()
// [SECTION] DemoWindowWidgetsBullets()
// [SECTION] DemoWindowWidgetsCollapsingHeaders()
@@ -85,6 +86,7 @@ Index of this file:
// [SECTION] DemoWindowWidgetsFonts()
// [SECTION] DemoWindowWidgetsImages()
// [SECTION] DemoWindowWidgetsListBoxes()
+// [SECTION] DemoWindowWidgetsLiveEdit()
// [SECTION] DemoWindowWidgetsMultiComponents()
// [SECTION] DemoWindowWidgetsPlotting()
// [SECTION] DemoWindowWidgetsProgressBars()
@@ -108,6 +110,7 @@ Index of this file:
// [SECTION] User Guide / ShowUserGuide()
// [SECTION] Example App: Main Menu Bar / ShowExampleAppMainMenuBar()
// [SECTION] Example App: Debug Console / ShowExampleAppConsole()
+// [SECTION] Example App: Image Viewer / ShowExampleAppImageViewer()
// [SECTION] Example App: Debug Log / ShowExampleAppLog()
// [SECTION] Example App: Simple Layout / ShowExampleAppLayout()
// [SECTION] Example App: Property Editor / ShowExampleAppPropertyEditor()
@@ -240,6 +243,7 @@ static void ShowExampleAppConsole(bool* p_open);
static void ShowExampleAppCustomRendering(bool* p_open);
static void ShowExampleAppDockSpace(bool* p_open);
static void ShowExampleAppDocuments(bool* p_open);
+static void ShowExampleAppImageViewer(bool* p_open);
static void ShowExampleAppLog(bool* p_open);
static void ShowExampleAppLayout(bool* p_open);
static void ShowExampleAppPropertyEditor(bool* p_open, ImGuiDemoWindowData* demo_data);
@@ -321,6 +325,7 @@ struct ImGuiDemoWindowData
bool ShowAppCustomRendering = false;
bool ShowAppDocuments = false;
bool ShowAppDockSpace = false;
+ bool ShowAppImageViewer = false;
bool ShowAppLog = false;
bool ShowAppLayout = false;
bool ShowAppPropertyEditor = false;
@@ -340,6 +345,8 @@ struct ImGuiDemoWindowData
// Other data
bool DisableSections = false;
+ bool LiveEditOverride = false;
+ ImGuiItemFlags LiveEditFlags = ImGuiItemFlags_LiveEditOnInputText;
ExampleTreeNode* DemoTree = NULL;
~ImGuiDemoWindowData() { if (DemoTree) ExampleTree_DestroyNode(DemoTree); }
@@ -367,6 +374,7 @@ void ImGui::ShowDemoWindow(bool* p_open)
if (demo_data.ShowAppAssetsBrowser) { ShowExampleAppAssetsBrowser(&demo_data.ShowAppAssetsBrowser); }
if (demo_data.ShowAppConsole) { ShowExampleAppConsole(&demo_data.ShowAppConsole); }
if (demo_data.ShowAppCustomRendering) { ShowExampleAppCustomRendering(&demo_data.ShowAppCustomRendering); }
+ if (demo_data.ShowAppImageViewer) { ShowExampleAppImageViewer(&demo_data.ShowAppImageViewer); }
if (demo_data.ShowAppLog) { ShowExampleAppLog(&demo_data.ShowAppLog); }
if (demo_data.ShowAppLayout) { ShowExampleAppLayout(&demo_data.ShowAppLayout); }
if (demo_data.ShowAppPropertyEditor) { ShowExampleAppPropertyEditor(&demo_data.ShowAppPropertyEditor, &demo_data); }
@@ -597,6 +605,9 @@ void ImGui::ShowDemoWindow(bool* p_open)
ImGui::SameLine(); HelpMarker("Swap Cmd<>Ctrl keys, enable various MacOS style behaviors.");
ImGui::Text("Also see Style->Rendering for rendering options.");
+ ImGui::SeparatorText("Settings");
+ ImGui::Checkbox("io.ConfigIniSettingsSaveLastUsedDate", &io.ConfigIniSettingsSaveLastUsedDate);
+
// Also read: https://github.com/ocornut/imgui/wiki/Error-Handling
ImGui::SeparatorText("Error Handling");
@@ -748,6 +759,7 @@ static void DemoWindowMenuBar(ImGuiDemoWindowData* demo_data)
ImGui::MenuItem("Custom rendering", NULL, &demo_data->ShowAppCustomRendering);
ImGui::MenuItem("Documents", NULL, &demo_data->ShowAppDocuments);
ImGui::MenuItem("Dockspace", NULL, &demo_data->ShowAppDockSpace);
+ ImGui::MenuItem("Image Viewer", NULL, &demo_data->ShowAppImageViewer);
ImGui::MenuItem("Log", NULL, &demo_data->ShowAppLog);
ImGui::MenuItem("Property editor", NULL, &demo_data->ShowAppPropertyEditor);
ImGui::MenuItem("Simple layout", NULL, &demo_data->ShowAppLayout);
@@ -779,7 +791,7 @@ static void DemoWindowMenuBar(ImGuiDemoWindowData* demo_data)
ImGui::Checkbox("Highlight ID Conflicts", &io.ConfigDebugHighlightIdConflicts);
ImGui::EndDisabled();
ImGui::Checkbox("Assert on error recovery", &io.ConfigErrorRecoveryEnableAssert);
- ImGui::TextDisabled("(see Demo->Configuration for details & more)");
+ ImGui::TextDisabled("(see Demo->Configuration for more)");
ImGui::EndMenu();
}
ImGui::MenuItem("Debug Log", NULL, &demo_data->ShowDebugLog, has_debug_tools);
@@ -896,6 +908,87 @@ static ExampleTreeNode* ExampleTree_CreateDemoTree()
return node_L0;
}
+//-----------------------------------------------------------------------------
+// [SECTION] Helpers: ExampleImageViewer
+//-----------------------------------------------------------------------------
+
+struct ExampleImageViewerData
+{
+ ImU32 ImageBgColor = IM_COL32(100, 100, 100, 255);
+ ImU32 GridColor = IM_COL32(255, 255, 255, 100);
+ bool GridEnabled = true;
+ bool ViewReset = true;
+ ImVec2 ViewOffset; // in image space
+ float Zoom = 10.0f;
+ float ZoomMin = 1.0f;
+ float ZoomMax = 10000.0f;
+};
+
+static void ExampleImageViewer_DrawOptions(ExampleImageViewerData* data)
+{
+ ImGui::SetNextItemShortcut(ImGuiKey_G, ImGuiInputFlags_Tooltip); // | ImGuiInputFlags_RouteGlobal
+ ImGui::Checkbox("Grid", &data->GridEnabled);
+ ImGui::SameLine();
+ ImGui::SetNextItemWidth(ImGui::GetFontSize() * 10.0f);
+ float zoom_100 = data->Zoom * 100.0f;
+ if (ImGui::DragFloat("##Zoom", &zoom_100, 5.0f, data->ZoomMin * 100.0f, data->ZoomMax * 100.0f, "%.0f%%", ImGuiSliderFlags_AlwaysClamp))
+ data->Zoom = zoom_100 / 100.0f;
+}
+
+static void ExampleImageViewer_DrawCanvas(ExampleImageViewerData* data, ImVec2 canvas_size, ImTextureRef image_tex_ref, int image_w, int image_h)
+{
+ ImGuiIO& io = ImGui::GetIO();
+ ImGuiPlatformIO& platform_io = ImGui::GetPlatformIO();
+ ImDrawList* draw_list = ImGui::GetWindowDrawList();
+ IM_ASSERT(canvas_size.x >= 0.0f && canvas_size.y >= 0.0f);
+
+ // Layout canvas
+ ImGui::InvisibleButton("##Canvas", canvas_size);
+ ImVec2 canvas_min = ImGui::GetItemRectMin();
+ ImVec2 canvas_max = ImGui::GetItemRectMax();
+
+ if (data->ViewReset)
+ data->ViewOffset = ImVec2((canvas_size.x * 0.5f / data->Zoom) - 0.5f, (canvas_size.y * 0.5f / data->Zoom) - 0.5f); // Add half a pixel padding
+ data->ViewReset = false;
+
+ // Handle inputs
+ if (ImGui::SetItemKeyOwner(ImGuiKey_MouseWheelY))
+ if (io.MouseWheel != 0.0f)
+ data->Zoom = IM_CLAMP(data->Zoom * (1.0f + io.MouseWheel * 0.10f), data->ZoomMin, data->ZoomMax);
+ float zoom = data->Zoom; // (float)(int)ViewZoom;
+ if (ImGui::IsItemActive() && ImGui::IsMouseDragging(0))
+ {
+ data->ViewOffset.x -= io.MouseDelta.x / zoom;
+ data->ViewOffset.y -= io.MouseDelta.y / zoom;
+ }
+
+ // Display image
+ ImVec2 image_min, image_max;
+ image_min.x = (float)(int)((canvas_min.x - (data->ViewOffset.x * zoom)) + (canvas_size.x * 0.5f));
+ image_min.y = (float)(int)((canvas_min.y - (data->ViewOffset.y * zoom)) + (canvas_size.y * 0.5f));
+ image_max.x = (float)(int)(image_min.x + image_w * zoom);
+ image_max.y = (float)(int)(image_min.y + image_h * zoom);
+ draw_list->AddRect(ImVec2(canvas_min.x - 1.0f, canvas_min.y - 1.0f), ImVec2(canvas_max.x + 1.0f, canvas_max.y + 1.0f), IM_COL32(255, 255, 255, 255));
+ draw_list->PushClipRect(canvas_min, canvas_max, true);
+ draw_list->AddRectFilled(image_min, image_max, data->ImageBgColor);
+ if (platform_io.DrawCallback_SetSamplerNearest != NULL)
+ draw_list->AddCallback(platform_io.DrawCallback_SetSamplerNearest);
+ draw_list->AddImage(image_tex_ref, image_min, image_max);
+ if (platform_io.DrawCallback_SetSamplerLinear != NULL)
+ draw_list->AddCallback(ImGui::GetPlatformIO().DrawCallback_SetSamplerLinear);
+
+ // Display grid lines for visible pixels
+ if (data->GridEnabled && zoom > 6.0f)
+ {
+ const float step = (float)zoom;
+ for (int px = (int)((canvas_min.x - image_min.x) / step); px <= (int)((canvas_max.x - image_min.x) / step); px++)
+ draw_list->AddLineV(image_min.x + px * step, canvas_min.y, canvas_max.y, data->GridColor, 1.0f);
+ for (int py = (int)((canvas_min.y - image_min.y) / step); py <= (int)((canvas_max.y - image_min.y) / step); py++)
+ draw_list->AddLineH(canvas_min.x, canvas_max.x, image_min.y + py * step, data->GridColor, 1.0f);
+ }
+ draw_list->PopClipRect();
+}
+
//-----------------------------------------------------------------------------
// [SECTION] DemoWindowWidgetsBasic()
//-----------------------------------------------------------------------------
@@ -1307,6 +1400,7 @@ static void DemoWindowWidgetsColorAndPickers()
ImGui::ColorEdit4("##RefColor", &ref_color_v.x, ImGuiColorEditFlags_NoInputs | base_flags);
}
}
+ ImGui::CheckboxFlags("ImGuiColorEditFlags_PickerNoRotate", &color_picker_flags, ImGuiColorEditFlags_PickerNoRotate);
ImGui::Combo("Picker Mode", &picker_mode, "Auto/Current\0ImGuiColorEditFlags_PickerHueBar\0ImGuiColorEditFlags_PickerHueWheel\0");
ImGui::SameLine(); HelpMarker("When not specified explicitly, user can right-click the picker to change mode.");
@@ -1315,7 +1409,7 @@ static void DemoWindowWidgetsColorAndPickers()
ImGui::SameLine(); HelpMarker(
"ColorEdit defaults to displaying RGB inputs if you don't specify a display mode, "
"but the user can change it with a right-click on those inputs.\n\nColorPicker defaults to displaying RGB+HSV+Hex "
- "if you don't specify a display mode.\n\nYou can change the defaults using SetColorEditOptions().");
+ "if you don't specify a display mode.\n\nYou can change the defaults using io.ConfigColorEditFlags.");
ImGuiColorEditFlags flags = base_flags | color_picker_flags;
if (picker_mode == 1) flags |= ImGuiColorEditFlags_PickerHueBar;
@@ -1328,14 +1422,14 @@ static void DemoWindowWidgetsColorAndPickers()
ImGui::Text("Set defaults in code:");
ImGui::SameLine(); HelpMarker(
- "SetColorEditOptions() is designed to allow you to set boot-time default.\n"
+ "io.ConfigColorEditFlags is designed to allow you to set boot-time default.\n"
"We don't have Push/Pop functions because you can force options on a per-widget basis if needed, "
"and the user can change non-forced ones with the options menu.\nWe don't have a getter to avoid "
"encouraging you to persistently save values that aren't forward-compatible.");
- if (ImGui::Button("Default: Uint8 + HSV + Hue Bar"))
- ImGui::SetColorEditOptions(ImGuiColorEditFlags_Uint8 | ImGuiColorEditFlags_DisplayHSV | ImGuiColorEditFlags_PickerHueBar);
- if (ImGui::Button("Default: Float + HDR + Hue Wheel"))
- ImGui::SetColorEditOptions(ImGuiColorEditFlags_Float | ImGuiColorEditFlags_HDR | ImGuiColorEditFlags_PickerHueWheel);
+ if (ImGui::Button("Overwrite default: Uint8 + HSV + Hue Bar"))
+ ImGui::GetIO().ConfigColorEditFlags = ImGuiColorEditFlags_Uint8 | ImGuiColorEditFlags_DisplayHSV | ImGuiColorEditFlags_PickerHueBar;
+ if (ImGui::Button("Overwrite default: Float + HDR + Hue Wheel"))
+ ImGui::GetIO().ConfigColorEditFlags = ImGuiColorEditFlags_Float | ImGuiColorEditFlags_HDR | ImGuiColorEditFlags_PickerHueWheel;
// Always display a small version of both types of pickers
// (that's in order to make it more visible in the demo to people who are skimming quickly through it)
@@ -1724,7 +1818,7 @@ static void DemoWindowWidgetsDragAndDrop()
if (ImGui::IsItemActive() && !ImGui::IsItemHovered())
{
- int n_next = n + (ImGui::GetMouseDragDelta(0).y < 0.f ? -1 : 1);
+ int n_next = n + (ImGui::GetMouseDragDelta(0).y < 0.0f ? -1 : 1);
if (n_next >= 0 && n_next < IM_COUNTOF(item_names))
{
item_names[n] = item_names[n_next];
@@ -1873,40 +1967,29 @@ static void DemoWindowWidgetsImages()
// - Read https://github.com/ocornut/imgui/wiki/Image-Loading-and-Displaying-Examples
// Grab the current texture identifier used by the font atlas.
- ImTextureRef my_tex_id = io.Fonts->TexRef;
-
- // Regular user code should never have to care about TexData-> fields, but since we want to display the entire texture here, we pull Width/Height from it.
- float my_tex_w = (float)io.Fonts->TexData->Width;
- float my_tex_h = (float)io.Fonts->TexData->Height;
+ ImFontAtlas* atlas = io.Fonts;
+ ImTextureRef my_tex_id = atlas->TexRef;
+ float my_tex_w = (float)atlas->TexData->Width; // Regular user code should never have to care about TexData-> fields, but since we want to display the entire texture here, we pull Width/Height from it.
+ float my_tex_h = (float)atlas->TexData->Height;
+ ImGui::Text("%.0fx%.0f", my_tex_w, my_tex_h);
+
+ // Basic drawing
+ ImGui::SeparatorText("Image()/ImageWithBg() function");
+ ImVec2 uv_min = ImVec2(0.0f, 0.0f); // Top-left
+ ImVec2 uv_max = ImVec2(1.0f, 1.0f); // Lower-right
+ ImGui::PushStyleVar(ImGuiStyleVar_ImageBorderSize, IM_MAX(1.0f, ImGui::GetStyle().ImageBorderSize));
+ ImGui::ImageWithBg(my_tex_id, ImVec2(my_tex_w, my_tex_h), uv_min, uv_max, ImVec4(0.0f, 0.0f, 0.0f, 1.0f));
+ ImGui::PopStyleVar();
- {
- ImGui::Text("%.0fx%.0f", my_tex_w, my_tex_h);
- ImVec2 pos = ImGui::GetCursorScreenPos();
- ImVec2 uv_min = ImVec2(0.0f, 0.0f); // Top-left
- ImVec2 uv_max = ImVec2(1.0f, 1.0f); // Lower-right
- ImGui::PushStyleVar(ImGuiStyleVar_ImageBorderSize, IM_MAX(1.0f, ImGui::GetStyle().ImageBorderSize));
- ImGui::ImageWithBg(my_tex_id, ImVec2(my_tex_w, my_tex_h), uv_min, uv_max, ImVec4(0.0f, 0.0f, 0.0f, 1.0f));
- if (ImGui::BeginItemTooltip())
- {
- float region_sz = 32.0f;
- float region_x = io.MousePos.x - pos.x - region_sz * 0.5f;
- float region_y = io.MousePos.y - pos.y - region_sz * 0.5f;
- float zoom = 4.0f;
- if (region_x < 0.0f) { region_x = 0.0f; }
- else if (region_x > my_tex_w - region_sz) { region_x = my_tex_w - region_sz; }
- if (region_y < 0.0f) { region_y = 0.0f; }
- else if (region_y > my_tex_h - region_sz) { region_y = my_tex_h - region_sz; }
- ImGui::Text("Min: (%.2f, %.2f)", region_x, region_y);
- ImGui::Text("Max: (%.2f, %.2f)", region_x + region_sz, region_y + region_sz);
- ImVec2 uv0 = ImVec2((region_x) / my_tex_w, (region_y) / my_tex_h);
- ImVec2 uv1 = ImVec2((region_x + region_sz) / my_tex_w, (region_y + region_sz) / my_tex_h);
- ImGui::ImageWithBg(my_tex_id, ImVec2(region_sz * zoom, region_sz * zoom), uv0, uv1, ImVec4(0.0f, 0.0f, 0.0f, 1.0f));
- ImGui::EndTooltip();
- }
- ImGui::PopStyleVar();
- }
+ // Fancy widget
+ ImGui::SeparatorText("Interactive Image Viewer");
+ static ExampleImageViewerData image_viewer;
+ ImVec2 canvas_size(ImGui::GetContentRegionAvail().x, my_tex_h * 2.0f);
+ ExampleImageViewer_DrawOptions(&image_viewer);
+ ExampleImageViewer_DrawCanvas(&image_viewer, canvas_size, my_tex_id, (int)my_tex_w, (int)my_tex_h);
IMGUI_DEMO_MARKER("Widgets/Images/Textured buttons");
+ ImGui::SeparatorText("Textured Buttons");
ImGui::TextWrapped("And now some textured buttons..");
static int pressed_count = 0;
for (int i = 0; i < 8; i++)
@@ -2000,6 +2083,44 @@ static void DemoWindowWidgetsListBoxes()
}
}
+//-----------------------------------------------------------------------------
+// [SECTION] DemoWindowWidgetsLiveEdit()
+//-----------------------------------------------------------------------------
+
+static void DemoWindowWidgetsLiveEdit(ImGuiDemoWindowData* demo_data)
+{
+ if (ImGui::TreeNode("Live Edit Flags"))
+ {
+ IMGUI_DEMO_MARKER("Widgets/Live Edit Flgs");
+
+ ImGui::TextWrapped("Select whether to apply keyboard edits to backing variables _while_ typing.");
+
+ ImGui::Checkbox("Override Live Edit Flags in Demo Window", &demo_data->LiveEditOverride);
+ if (!demo_data->LiveEditOverride)
+ demo_data->LiveEditFlags = ImGui::GetItemFlags();
+
+ ImGui::BeginDisabled(demo_data->LiveEditOverride == false);
+ ImGui::Indent();
+ ImGui::CheckboxFlags("ImGuiItemFlags_LiveEditOnInputText", &demo_data->LiveEditFlags, ImGuiItemFlags_LiveEditOnInputText);
+ ImGui::CheckboxFlags("ImGuiItemFlags_LiveEditOnInputScalar", &demo_data->LiveEditFlags, ImGuiItemFlags_LiveEditOnInputScalar);
+ ImGui::Unindent();
+ ImGui::EndDisabled();
+
+ ImGui::Text("Try typing '123' and seeing effect on backing value:");
+ static char str[32] = "";
+ ImGui::InputText("str", str, IM_COUNTOF(str));
+ ImGui::Text("Backing value: \"%s\"", str);
+ static int i = 0;
+ ImGui::InputInt("int", &i, 0, 0);
+ ImGui::Text("Backing value: %d", i);
+ static float f = 0.0f;
+ ImGui::SliderFloat("float", &f, 0.0f, 100.0f);
+ ImGui::Text("Backing value: %f", f);
+
+ ImGui::TreePop();
+ }
+}
+
//-----------------------------------------------------------------------------
// [SECTION] DemoWindowWidgetsMultiComponents()
//-----------------------------------------------------------------------------
@@ -2151,7 +2272,7 @@ static void DemoWindowWidgetsProgressBars()
char buf[32];
sprintf(buf, "%d/%d", (int)(progress * 1753), 1753);
- ImGui::ProgressBar(progress, ImVec2(0.f, 0.f), buf);
+ ImGui::ProgressBar(progress, ImVec2(0.0f, 0.0f), buf);
// Pass an animated negative value, e.g. -1.0f * (float)ImGui::GetTime() is the recommended value.
// Adjust the factor if you want to adjust the animation speed.
@@ -2180,10 +2301,28 @@ static void DemoWindowWidgetsQueryingStatuses()
};
static int item_type = 4;
static bool item_disabled = false;
+ static bool liveedit_flags_override = false;
+ static ImGuiItemFlags liveedit_flags = 0;
ImGui::Combo("Item Type", &item_type, item_names, IM_COUNTOF(item_names), IM_COUNTOF(item_names));
ImGui::SameLine();
HelpMarker("Testing how various types of items are interacting with the IsItemXXX functions. Note that the bool return value of most ImGui function is generally equivalent to calling ImGui::IsItemHovered().");
ImGui::Checkbox("Item Disabled", &item_disabled);
+ ImGui::Checkbox("Override LiveEdit:", &liveedit_flags_override);
+ ImGui::SameLine();
+ if (!liveedit_flags_override)
+ liveedit_flags = ImGui::GetItemFlags();
+ ImGui::BeginDisabled(liveedit_flags_override == false);
+ ImGui::CheckboxFlags("_LiveEditOnInput", &liveedit_flags, ImGuiItemFlags_LiveEditOnInput);
+ ImGui::SameLine();
+ ImGui::CheckboxFlags("_LiveEditOnInputText", &liveedit_flags, ImGuiItemFlags_LiveEditOnInputText);
+ ImGui::SameLine();
+ ImGui::CheckboxFlags("_LiveEditOnInputScalar", &liveedit_flags, ImGuiItemFlags_LiveEditOnInputScalar);
+ ImGui::EndDisabled();
+ if (liveedit_flags_override)
+ {
+ ImGui::PushItemFlag(ImGuiItemFlags_LiveEditOnInputText, (liveedit_flags & ImGuiItemFlags_LiveEditOnInputText) != 0);
+ ImGui::PushItemFlag(ImGuiItemFlags_LiveEditOnInputScalar, (liveedit_flags & ImGuiItemFlags_LiveEditOnInputScalar) != 0);
+ }
// Submit selected items so we can query their status in the code following it.
bool ret = false;
@@ -2270,6 +2409,11 @@ static void DemoWindowWidgetsQueryingStatuses()
"IsItemHovered(_Tooltip) = %d",
hovered_delay_none, hovered_delay_stationary, hovered_delay_short, hovered_delay_normal, hovered_delay_tooltip);
+ if (liveedit_flags_override)
+ {
+ ImGui::PopItemFlag();
+ ImGui::PopItemFlag();
+ }
if (item_disabled)
ImGui::EndDisabled();
@@ -4131,7 +4275,7 @@ static void DemoWindowWidgetsTooltips()
ImGui::BeginDisabled();
ImGui::Button("Disabled item", sz);
if (ImGui::IsItemHovered(ImGuiHoveredFlags_ForTooltip))
- ImGui::SetTooltip("I am a a tooltip for a disabled item.");
+ ImGui::SetTooltip("I am a tooltip for a disabled item.");
ImGui::EndDisabled();
ImGui::TreePop();
@@ -4148,9 +4292,9 @@ static void DemoWindowWidgetsTreeNodes()
{
IMGUI_DEMO_MARKER("Widgets/Tree Nodes");
// See see "Examples -> Property Editor" (ShowExampleAppPropertyEditor() function) for a fancier, data-driven tree.
- if (ImGui::TreeNode("Basic trees"))
+ if (ImGui::TreeNode("Basic Trees"))
{
- IMGUI_DEMO_MARKER("Widgets/Tree Nodes/Basic trees");
+ IMGUI_DEMO_MARKER("Widgets/Tree Nodes/Basic Trees");
for (int i = 0; i < 5; i++)
{
// Use SetNextItemOpen() so set the default state of a node to be open. We could
@@ -4174,9 +4318,9 @@ static void DemoWindowWidgetsTreeNodes()
ImGui::TreePop();
}
- if (ImGui::TreeNode("Hierarchy lines"))
+ if (ImGui::TreeNode("Hierarchy Lines"))
{
- IMGUI_DEMO_MARKER("Widgets/Tree Nodes/Hierarchy lines");
+ IMGUI_DEMO_MARKER("Widgets/Tree Nodes/Hierarchy Lines");
static ImGuiTreeNodeFlags base_flags = ImGuiTreeNodeFlags_DrawLinesFull | ImGuiTreeNodeFlags_DefaultOpen;
HelpMarker("Default option for DrawLinesXXX is stored in style.TreeLinesFlags");
ImGui::CheckboxFlags("ImGuiTreeNodeFlags_DrawLinesNone", &base_flags, ImGuiTreeNodeFlags_DrawLinesNone);
@@ -4213,15 +4357,57 @@ static void DemoWindowWidgetsTreeNodes()
ImGui::TreePop();
}
- if (ImGui::TreeNode("Advanced, with Selectable nodes"))
+ if (ImGui::TreeNode("Selectable Nodes"))
{
- IMGUI_DEMO_MARKER("Widgets/Tree Nodes/Advanced, with Selectable nodes");
+ IMGUI_DEMO_MARKER("Widgets/Tree Nodes/Selectable Nodes");
HelpMarker(
- "This is a more typical looking tree with selectable nodes.\n"
- "Click to select, Ctrl+Click to toggle, click on arrows or double-click to open.");
+ "Manually implemented selectable nodes.\n"
+ "Click to select, Ctrl+Click to toggle, click on arrows or double-click to open.\n\n"
+ "You may also use the multi-select API (see 'Demo->Widgets->Selection State & Multi-Select') for more advanced multi-selection features.");
+
+ // Hold in 'selection_mask' a simple representation of what may be user-side selection state.
+ // - You may retain selection state inside or outside your objects in whatever format you see fit.
+ // You may use ImGuiSelectionBasicStorage which is conceptually close to a set<> of identifiers.
+ // - We record which node was clicked and then apply selection at the end of the loop.
+ // - This is a manual and simplified reimplementation of multi-selection, which the full
+ // BeginMultiSelect() API implements better, but which is not trivial to wire for trees.
+ static int selection_mask = 0x00;
+ int node_clicked_idx = -1;
+ for (int node_n = 0; node_n < 6; node_n++)
+ {
+ // Disable the default "open on single-click behavior" + set Selected flag according to our selection.
+ // To alter selection we use if 'IsItemClicked() && !IsItemToggledOpen()', so clicking on an arrow doesn't alter selection.
+ // In a BeginMultiSelect()/EndMultiSelect() we could use IsItemToggledSelection() but here we reimplement and use our own logic.
+ ImGuiTreeNodeFlags flags = ImGuiTreeNodeFlags_OpenOnArrow | ImGuiTreeNodeFlags_OpenOnDoubleClick | ImGuiTreeNodeFlags_SpanAvailWidth;
+ if (selection_mask & (1 << node_n))
+ flags |= ImGuiTreeNodeFlags_Selected;
+
+ bool is_open = ImGui::TreeNodeEx((void*)(intptr_t)node_n, flags, "Selectable Node %d", node_n);
+ if (ImGui::IsItemClicked() && !ImGui::IsItemToggledOpen())
+ node_clicked_idx = node_n;
+ if (is_open)
+ {
+ ImGui::BulletText("");
+ ImGui::TreePop();
+ }
+ }
+ if (node_clicked_idx != -1)
+ {
+ // Update selection state (process outside of tree loop to avoid visual inconsistencies during the clicking frame)
+ if (ImGui::GetIO().KeyCtrl)
+ selection_mask ^= (1 << node_clicked_idx); // Ctrl+Click to toggle
+ else //if (!(selection_mask & (1 << node_clicked_idx))) // Depending on selection behavior you want, may want to preserve selection when clicking on item that is part of the selection
+ selection_mask = (1 << node_clicked_idx); // Click to single-select
+ }
+ ImGui::TreePop();
+ }
+
+ if (ImGui::TreeNode("Advanced"))
+ {
+ IMGUI_DEMO_MARKER("Widgets/Tree Nodes/Advanced");
static ImGuiTreeNodeFlags base_flags = ImGuiTreeNodeFlags_OpenOnArrow | ImGuiTreeNodeFlags_OpenOnDoubleClick | ImGuiTreeNodeFlags_SpanAvailWidth;
static bool align_label_with_current_x_position = false;
- static bool test_drag_and_drop = false;
+ static bool use_drag_and_drop = false;
ImGui::CheckboxFlags("ImGuiTreeNodeFlags_OpenOnArrow", &base_flags, ImGuiTreeNodeFlags_OpenOnArrow);
ImGui::CheckboxFlags("ImGuiTreeNodeFlags_OpenOnDoubleClick", &base_flags, ImGuiTreeNodeFlags_OpenOnDoubleClick);
ImGui::CheckboxFlags("ImGuiTreeNodeFlags_SpanAvailWidth", &base_flags, ImGuiTreeNodeFlags_SpanAvailWidth); ImGui::SameLine(); HelpMarker("Extend hit area to all available width instead of allowing more items to be laid out after the node.");
@@ -4239,44 +4425,30 @@ static void DemoWindowWidgetsTreeNodes()
ImGui::CheckboxFlags("ImGuiTreeNodeFlags_DrawLinesToNodes", &base_flags, ImGuiTreeNodeFlags_DrawLinesToNodes);
ImGui::Checkbox("Align label with current X position", &align_label_with_current_x_position);
- ImGui::Checkbox("Test tree node as drag source", &test_drag_and_drop);
- ImGui::Text("Hello!");
+ ImGui::Checkbox("Make Tree Nodes as drag & drop sources", &use_drag_and_drop);
if (align_label_with_current_x_position)
ImGui::Unindent(ImGui::GetTreeNodeToLabelSpacing());
- // 'selection_mask' is dumb representation of what may be user-side selection state.
- // You may retain selection state inside or outside your objects in whatever format you see fit.
- // 'node_clicked' is temporary storage of what node we have clicked to process selection at the end
- /// of the loop. May be a pointer to your own node type, etc.
- static int selection_mask = (1 << 2);
- int node_clicked = -1;
- for (int i = 0; i < 6; i++)
+ for (int node_n = 0; node_n < 6; node_n++)
{
- // Disable the default "open on single-click behavior" + set Selected flag according to our selection.
- // To alter selection we use IsItemClicked() && !IsItemToggledOpen(), so clicking on an arrow doesn't alter selection.
ImGuiTreeNodeFlags node_flags = base_flags;
- const bool is_selected = (selection_mask & (1 << i)) != 0;
- if (is_selected)
- node_flags |= ImGuiTreeNodeFlags_Selected;
- if (i < 3)
+ if (node_n < 3)
{
// Items 0..2 are Tree Node
- bool node_open = ImGui::TreeNodeEx((void*)(intptr_t)i, node_flags, "Selectable Node %d", i);
- if (ImGui::IsItemClicked() && !ImGui::IsItemToggledOpen())
- node_clicked = i;
- if (test_drag_and_drop && ImGui::BeginDragDropSource())
+ bool is_open = ImGui::TreeNodeEx((void*)(intptr_t)node_n, node_flags, "Selectable Node %d", node_n);
+ if (use_drag_and_drop && ImGui::BeginDragDropSource())
{
- ImGui::SetDragDropPayload("_TREENODE", NULL, 0);
+ ImGui::SetDragDropPayload("MY_TREENODE_PAYLOAD_TYPE", NULL, 0);
ImGui::Text("This is a drag and drop source");
ImGui::EndDragDropSource();
}
- if (i == 2 && (base_flags & ImGuiTreeNodeFlags_SpanLabelWidth))
+ if (node_n == 2 && (base_flags & ImGuiTreeNodeFlags_SpanLabelWidth))
{
// Item 2 has an additional inline button to help demonstrate SpanLabelWidth.
ImGui::SameLine();
if (ImGui::SmallButton("button")) {}
}
- if (node_open)
+ if (is_open)
{
ImGui::BulletText("Blah blah\nBlah Blah");
ImGui::SameLine();
@@ -4290,26 +4462,15 @@ static void DemoWindowWidgetsTreeNodes()
// The only reason we use TreeNode at all is to allow selection of the leaf. Otherwise we can
// use BulletText() or advance the cursor by GetTreeNodeToLabelSpacing() and call Text().
node_flags |= ImGuiTreeNodeFlags_Leaf | ImGuiTreeNodeFlags_NoTreePushOnOpen; // ImGuiTreeNodeFlags_Bullet
- ImGui::TreeNodeEx((void*)(intptr_t)i, node_flags, "Selectable Leaf %d", i);
- if (ImGui::IsItemClicked() && !ImGui::IsItemToggledOpen())
- node_clicked = i;
- if (test_drag_and_drop && ImGui::BeginDragDropSource())
+ ImGui::TreeNodeEx((void*)(intptr_t)node_n, node_flags, "Selectable Leaf %d", node_n);
+ if (use_drag_and_drop && ImGui::BeginDragDropSource())
{
- ImGui::SetDragDropPayload("_TREENODE", NULL, 0);
+ ImGui::SetDragDropPayload("MY_TREENODE_PAYLOAD_TYPE", NULL, 0);
ImGui::Text("This is a drag and drop source");
ImGui::EndDragDropSource();
}
}
}
- if (node_clicked != -1)
- {
- // Update selection state
- // (process outside of tree loop to avoid visual inconsistencies during the clicking frame)
- if (ImGui::GetIO().KeyCtrl)
- selection_mask ^= (1 << node_clicked); // Ctrl+Click to toggle
- else //if (!(selection_mask & (1 << node_clicked))) // Depending on selection behavior you want, may want to preserve selection when clicking on item that is part of the selection
- selection_mask = (1 << node_clicked); // Click to single-select
- }
if (align_label_with_current_x_position)
ImGui::Indent(ImGui::GetTreeNodeToLabelSpacing());
ImGui::TreePop();
@@ -4402,8 +4563,14 @@ static void DemoWindowWidgets(ImGuiDemoWindowData* demo_data)
// IMGUI_DEMO_MARKER("Widgets");
const bool disable_all = demo_data->DisableSections; // The Checkbox for that is inside the "Disabled" section at the bottom
+ const bool override_liveedit = demo_data->LiveEditOverride;
if (disable_all)
ImGui::BeginDisabled();
+ if (override_liveedit)
+ {
+ ImGui::PushItemFlag(ImGuiItemFlags_LiveEditOnInputText, (demo_data->LiveEditFlags & ImGuiItemFlags_LiveEditOnInputText) != 0);
+ ImGui::PushItemFlag(ImGuiItemFlags_LiveEditOnInputScalar, (demo_data->LiveEditFlags & ImGuiItemFlags_LiveEditOnInputScalar) != 0);
+ }
DemoWindowWidgetsBasic();
DemoWindowWidgetsBullets();
@@ -4423,6 +4590,7 @@ static void DemoWindowWidgets(ImGuiDemoWindowData* demo_data)
DemoWindowWidgetsFonts();
DemoWindowWidgetsImages();
DemoWindowWidgetsListBoxes();
+ DemoWindowWidgetsLiveEdit(demo_data);
DemoWindowWidgetsMultiComponents();
DemoWindowWidgetsPlotting();
DemoWindowWidgetsProgressBars();
@@ -4437,6 +4605,11 @@ static void DemoWindowWidgets(ImGuiDemoWindowData* demo_data)
DemoWindowWidgetsTreeNodes();
DemoWindowWidgetsVerticalSliders();
+ if (override_liveedit)
+ {
+ ImGui::PopItemFlag();
+ ImGui::PopItemFlag();
+ }
if (disable_all)
ImGui::EndDisabled();
}
@@ -5081,7 +5254,8 @@ static void DemoWindowLayout()
// If you want to create your own time line for a real application you may be better off manipulating
// the cursor position yourself, aka using SetCursorPos/SetCursorScreenPos to position the widgets
// yourself. You may also want to use the lower-level ImDrawList API.
- int num_buttons = 10 + ((line & 1) ? line * 9 : line * 3);
+ const int num_buttons = 10 + ((line & 1) ? line * 9 : line * 3);
+ const float base_w = ImGui::GetFontSize() * 3;
for (int n = 0; n < num_buttons; n++)
{
if (n > 0) ImGui::SameLine();
@@ -5093,7 +5267,7 @@ static void DemoWindowLayout()
ImGui::PushStyleColor(ImGuiCol_Button, (ImVec4)ImColor::HSV(hue, 0.6f, 0.6f));
ImGui::PushStyleColor(ImGuiCol_ButtonHovered, (ImVec4)ImColor::HSV(hue, 0.7f, 0.7f));
ImGui::PushStyleColor(ImGuiCol_ButtonActive, (ImVec4)ImColor::HSV(hue, 0.8f, 0.8f));
- ImGui::Button(label, ImVec2(40.0f + sinf((float)(line + n)) * 20.0f, 0.0f));
+ ImGui::Button(label, ImVec2(base_w + sinf((float)(line + n)) * base_w * 0.5f, 0.0f));
ImGui::PopStyleColor(3);
ImGui::PopID();
}
@@ -8572,6 +8746,8 @@ void ImGui::ShowStyleEditor(ImGuiStyle* ref)
SliderFloat("FrameRounding", &style.FrameRounding, 0.0f, 12.0f, "%.0f");
SliderFloat("PopupRounding", &style.PopupRounding, 0.0f, 12.0f, "%.0f");
SliderFloat("GrabRounding", &style.GrabRounding, 0.0f, 12.0f, "%.0f");
+ SliderFloat("MenuItemRounding", &style.MenuItemRounding, 0.0f, 12.0f, "%.0f");
+ // NB: SelectableRounding is intentionally NOT made visible here. We don't want to encourage people using that.
SeparatorText("Scrollbar");
SliderFloat("ScrollbarSize", &style.ScrollbarSize, 1.0f, 20.0f, "%.0f");
@@ -8941,7 +9117,7 @@ static void ShowExampleMenuFile()
IMGUI_DEMO_MARKER("Examples/Menu/Options");
static bool enabled = true;
ImGui::MenuItem("Enabled", "", &enabled);
- ImGui::BeginChild("child", ImVec2(0, 60), ImGuiChildFlags_Borders);
+ ImGui::BeginChild("child", ImVec2(0, ImGui::GetTextLineHeightWithSpacing() * 5.0f), ImGuiChildFlags_Borders);
for (int i = 0; i < 10; i++)
ImGui::Text("Scrolling Text %d", i);
ImGui::EndChild();
@@ -9032,7 +9208,7 @@ struct ExampleAppConsole
static int Stricmp(const char* s1, const char* s2) { int d; while ((d = toupper(*s2) - toupper(*s1)) == 0 && *s1) { s1++; s2++; } return d; }
static int Strnicmp(const char* s1, const char* s2, int n) { int d = 0; while (n > 0 && (d = toupper(*s2) - toupper(*s1)) == 0 && *s1) { s1++; s2++; n--; } return d; }
static char* Strdup(const char* s) { IM_ASSERT(s); size_t len = strlen(s) + 1; void* buf = ImGui::MemAlloc(len); IM_ASSERT(buf); return (char*)memcpy(buf, (const void*)s, len); }
- static void Strtrim(char* s) { char* str_end = s + strlen(s); while (str_end > s && str_end[-1] == ' ') str_end--; *str_end = 0; }
+ static void Strtrimblanks(char* s) { char* str_end = s + strlen(s); while (str_end > s && str_end[-1] == ' ') str_end--; *str_end = 0; }
void ClearLog()
{
@@ -9181,10 +9357,10 @@ struct ExampleAppConsole
if (ImGui::InputText("Input", InputBuf, IM_COUNTOF(InputBuf), input_text_flags, &TextEditCallbackStub, (void*)this))
{
char* s = InputBuf;
- Strtrim(s);
+ Strtrimblanks(s);
if (s[0])
ExecCommand(s);
- strcpy(s, "");
+ s[0] = 0;
reclaim_focus = true;
}
@@ -9353,6 +9529,28 @@ static void ShowExampleAppConsole(bool* p_open)
console.Draw("Example: Console", p_open);
}
+//-----------------------------------------------------------------------------
+// [SECTION] Example App: Image Viewer / ShowExampleAppImageViewer()
+//-----------------------------------------------------------------------------
+
+static void ShowExampleAppImageViewer(bool* p_open)
+{
+ ImFontAtlas* atlas = ImGui::GetIO().Fonts;
+ ImTextureRef tex_ref = atlas->TexRef; // We don't have access to other textures in this demo!
+ int tex_w = atlas->TexData->Width;
+ int tex_h = atlas->TexData->Height;
+ if (ImGui::Begin("Example: Image Viewer", p_open))
+ {
+ static ExampleImageViewerData image_viewer;
+ ExampleImageViewer_DrawOptions(&image_viewer);
+ ImVec2 canvas_size = ImGui::GetContentRegionAvail();
+ ImVec2 canvas_min_size = ImGui::IsWindowAppearing() ? ImVec2(3.0f * tex_w, 4.0f * tex_h) : ImVec2(1.0f, 1.0f);
+ canvas_size = ImVec2(IM_MAX(canvas_size.x, canvas_min_size.x), IM_MAX(canvas_size.y, canvas_min_size.y));
+ ExampleImageViewer_DrawCanvas(&image_viewer, canvas_size, tex_ref, tex_w, tex_h);
+ }
+ ImGui::End();
+}
+
//-----------------------------------------------------------------------------
// [SECTION] Example App: Debug Log / ShowExampleAppLog()
//-----------------------------------------------------------------------------
@@ -10184,6 +10382,7 @@ static void ShowExampleAppCustomRendering(bool* p_open)
{
IMGUI_DEMO_MARKER("Examples/Custom rendering/Primitives");
ImGui::PushItemWidth(-ImGui::GetFontSize() * 15);
+ ImGui::PushItemFlag(ImGuiItemFlags_LiveEditOnInput, true);
ImDrawList* draw_list = ImGui::GetWindowDrawList();
// Draw gradients
@@ -10210,7 +10409,7 @@ static void ShowExampleAppCustomRendering(bool* p_open)
// Draw a bunch of primitives
ImGui::Text("All primitives");
- static float sz = 36.0f;
+ static float sz = 42.0f;
static float thickness = 3.0f;
static int ngon_sides = 6;
static bool circle_segments_override = false;
@@ -10248,20 +10447,20 @@ static void ShowExampleAppCustomRendering(bool* p_open)
draw_list->AddNgon(ImVec2(x + sz*0.5f, y + sz*0.5f), sz*0.5f, col, ngon_sides, th); x += sz + spacing; // N-gon
draw_list->AddCircle(ImVec2(x + sz*0.5f, y + sz*0.5f), sz*0.5f, col, circle_segments, th); x += sz + spacing; // Circle
draw_list->AddEllipse(ImVec2(x + sz*0.5f, y + sz*0.5f), ImVec2(sz*0.5f, sz*0.3f), col, -0.3f, circle_segments, th); x += sz + spacing; // Ellipse
- draw_list->AddRect(ImVec2(x, y), ImVec2(x + sz, y + sz), col, 0.0f, ImDrawFlags_None, th); x += sz + spacing; // Square
- draw_list->AddRect(ImVec2(x, y), ImVec2(x + sz, y + sz), col, rounding, ImDrawFlags_None, th); x += sz + spacing; // Square with all rounded corners
- draw_list->AddRect(ImVec2(x, y), ImVec2(x + sz, y + sz), col, rounding, corners_tl_br, th); x += sz + spacing; // Square with two rounded corners
+ draw_list->AddRect(ImVec2(x, y), ImVec2(x + sz, y + sz), col, 0.0f, th); x += sz + spacing; // Square
+ draw_list->AddRect(ImVec2(x, y), ImVec2(x + sz, y + sz), col, rounding, th); x += sz + spacing; // Square with all rounded corners
+ draw_list->AddRect(ImVec2(x, y), ImVec2(x + sz, y + sz), col, rounding, th, corners_tl_br); x += sz + spacing; // Square with two rounded corners
draw_list->AddTriangle(ImVec2(x+sz*0.5f,y), ImVec2(x+sz, y+sz-0.5f), ImVec2(x, y+sz-0.5f), col, th);x += sz + spacing; // Triangle
//draw_list->AddTriangle(ImVec2(x+sz*0.2f,y), ImVec2(x, y+sz-0.5f), ImVec2(x+sz*0.4f, y+sz-0.5f), col, th);x+= sz*0.4f + spacing; // Thin triangle
- PathConcaveShape(draw_list, x, y, sz); draw_list->PathStroke(col, ImDrawFlags_Closed, th); x += sz + spacing; // Concave Shape
+ PathConcaveShape(draw_list, x, y, sz); draw_list->PathStroke(col, th, ImDrawFlags_Closed); x += sz + spacing; // Concave Shape
//draw_list->AddPolyline(concave_shape, IM_COUNTOF(concave_shape), col, ImDrawFlags_Closed, th);
- draw_list->AddLine(ImVec2(x, y), ImVec2(x + sz, y), col, th); x += sz + spacing; // Horizontal line (note: drawing a filled rectangle will be faster!)
- draw_list->AddLine(ImVec2(x, y), ImVec2(x, y + sz), col, th); x += spacing; // Vertical line (note: drawing a filled rectangle will be faster!)
+ draw_list->AddLineH(x, x + sz, y, col, th); x += sz + spacing; // Horizontal line (note: drawing a filled rectangle will be faster!)
+ draw_list->AddLineV(x, y, y + sz, col, th); x += spacing; // Vertical line (note: drawing a filled rectangle will be faster!)
draw_list->AddLine(ImVec2(x, y), ImVec2(x + sz, y + sz), col, th); x += sz + spacing; // Diagonal line
// Path
draw_list->PathArcTo(ImVec2(x + sz*0.5f, y + sz*0.5f), sz*0.5f, 3.141592f, 3.141592f * -0.5f);
- draw_list->PathStroke(col, ImDrawFlags_None, th);
+ draw_list->PathStroke(col, th);
x += sz + spacing;
// Quadratic Bezier Curve (3 control points)
@@ -10304,6 +10503,7 @@ static void ShowExampleAppCustomRendering(bool* p_open)
x += sz + spacing;
ImGui::Dummy(ImVec2((sz + spacing) * 13.2f, (sz + spacing) * 3.0f));
+ ImGui::PopItemFlag();
ImGui::PopItemWidth();
ImGui::EndTabItem();
}
@@ -10395,9 +10595,9 @@ static void ShowExampleAppCustomRendering(bool* p_open)
{
const float GRID_STEP = 64.0f;
for (float x = fmodf(scrolling.x, GRID_STEP); x < canvas_sz.x; x += GRID_STEP)
- draw_list->AddLine(ImVec2(canvas_p0.x + x, canvas_p0.y), ImVec2(canvas_p0.x + x, canvas_p1.y), IM_COL32(200, 200, 200, 40));
+ draw_list->AddLineV(canvas_p0.x + x, canvas_p0.y, canvas_p1.y, IM_COL32(200, 200, 200, 40));
for (float y = fmodf(scrolling.y, GRID_STEP); y < canvas_sz.y; y += GRID_STEP)
- draw_list->AddLine(ImVec2(canvas_p0.x, canvas_p0.y + y), ImVec2(canvas_p1.x, canvas_p0.y + y), IM_COL32(200, 200, 200, 40));
+ draw_list->AddLineH(canvas_p0.x, canvas_p1.x, canvas_p0.y + y, IM_COL32(200, 200, 200, 40));
}
for (int n = 0; n < points.Size; n += 2)
draw_list->AddLine(ImVec2(origin.x + points[n].x, origin.y + points[n].y), ImVec2(origin.x + points[n + 1].x, origin.y + points[n + 1].y), IM_COL32(255, 255, 0, 255), 2.0f);
@@ -11067,10 +11267,11 @@ struct ExampleAssetsBrowser
bool AllowBoxSelect = true; // Will set ImGuiMultiSelectFlags_BoxSelect2d
bool AllowBoxSelectInsideSelection = false; // Will set ImGuiMultiSelectFlags_SelectOnClickAlways
bool AllowDragUnselected = false; // Will set ImGuiMultiSelectFlags_SelectOnClickRelease
- float IconSize = 32.0f;
+ float IconSize = 0;
int IconSpacing = 10;
- int IconHitSpacing = 4; // Increase hit-spacing if you want to make it possible to clear or box-select from gaps. Some spacing is required to able to amend with Shift+box-select. Value is small in Explorer.
+ int IconHitSpacing = 4; // Increase hit-spacing if you want to make it possible to clear or box-select from gaps. Some spacing is required to able to amend with Shift+box-select. Value is small in Explorer.
bool StretchSpacing = true;
+ bool UseScrollX = false; // Debug: submit twice the number of items per line (overflow horizontally to exercise ScrollX + box-select)
// State
ImVector Items; // Our items
@@ -11121,12 +11322,15 @@ struct ExampleAssetsBrowser
// Layout: calculate number of icon per line and number of lines
LayoutItemSize = ImVec2(floorf(IconSize), floorf(IconSize));
LayoutColumnCount = IM_MAX((int)(avail_width / (LayoutItemSize.x + LayoutItemSpacing)), 1);
- LayoutLineCount = (Items.Size + LayoutColumnCount - 1) / LayoutColumnCount;
// Layout: when stretching: allocate remaining space to more spacing. Round before division, so item_spacing may be non-integer.
if (StretchSpacing && LayoutColumnCount > 1)
LayoutItemSpacing = floorf(avail_width - LayoutItemSize.x * LayoutColumnCount) / LayoutColumnCount;
+ if (UseScrollX)
+ LayoutColumnCount *= 2;
+ LayoutLineCount = (Items.Size + LayoutColumnCount - 1) / LayoutColumnCount;
+
LayoutItemStep = ImVec2(LayoutItemSize.x + LayoutItemSpacing, LayoutItemSize.y + LayoutItemSpacing);
LayoutSelectableSpacing = IM_MAX(floorf(LayoutItemSpacing) - IconHitSpacing, 0.0f);
LayoutOuterPadding = floorf(LayoutItemSpacing * 0.5f);
@@ -11134,6 +11338,9 @@ struct ExampleAssetsBrowser
void Draw(const char* title, bool* p_open)
{
+ if (IconSize <= 0.0f)
+ IconSize = ImGui::CalcTextSize("99999").x;
+
ImGui::SetNextWindowSize(ImVec2(IconSize * 25, IconSize * 15), ImGuiCond_FirstUseEver);
if (!ImGui::Begin(title, p_open, ImGuiWindowFlags_MenuBar))
{
@@ -11183,6 +11390,7 @@ struct ExampleAssetsBrowser
ImGui::SliderInt("Icon Spacing", &IconSpacing, 0, 32);
ImGui::SliderInt("Icon Hit Spacing", &IconHitSpacing, 0, 32);
ImGui::Checkbox("Stretch Spacing", &StretchSpacing);
+ ImGui::Checkbox("Use ScrollX", &UseScrollX);
ImGui::PopItemWidth();
ImGui::EndMenu();
}
@@ -11212,7 +11420,7 @@ struct ExampleAssetsBrowser
ImGuiIO& io = ImGui::GetIO();
ImGui::SetNextWindowContentSize(ImVec2(0.0f, LayoutOuterPadding + LayoutLineCount * (LayoutItemSize.y + LayoutItemSpacing)));
- if (ImGui::BeginChild("Assets", ImVec2(0.0f, -ImGui::GetTextLineHeightWithSpacing()), ImGuiChildFlags_Borders, ImGuiWindowFlags_NoMove))
+ if (ImGui::BeginChild("Assets", ImVec2(0.0f, -ImGui::GetTextLineHeightWithSpacing()), ImGuiChildFlags_Borders, ImGuiWindowFlags_NoMove | ImGuiWindowFlags_HorizontalScrollbar))
{
ImDrawList* draw_list = ImGui::GetWindowDrawList();
@@ -11356,6 +11564,8 @@ struct ExampleAssetsBrowser
}
}
clipper.End();
+ if (Items.Size == 0)
+ ImGui::Dummy(ImVec2(0, 0));
ImGui::PopStyleVar(); // ImGuiStyleVar_ItemSpacing
// Context menu
diff --git a/include/imgui/imgui_draw.cpp b/include/imgui/imgui_draw.cpp
index 91af902..d72093f 100644
--- a/include/imgui/imgui_draw.cpp
+++ b/include/imgui/imgui_draw.cpp
@@ -1,4 +1,4 @@
-// dear imgui, v1.92.7
+// dear imgui, v1.92.9b
// (drawing and font code)
/*
@@ -208,6 +208,7 @@ void ImGui::StyleColorsDark(ImGuiStyle* dst)
colors[ImGuiCol_ScrollbarGrabHovered] = ImVec4(0.41f, 0.41f, 0.41f, 1.00f);
colors[ImGuiCol_ScrollbarGrabActive] = ImVec4(0.51f, 0.51f, 0.51f, 1.00f);
colors[ImGuiCol_CheckMark] = ImVec4(0.26f, 0.59f, 0.98f, 1.00f);
+ colors[ImGuiCol_CheckboxSelectedBg] = ImLerp(colors[ImGuiCol_FrameBg], colors[ImGuiCol_FrameBgHovered], 0.65f);
colors[ImGuiCol_SliderGrab] = ImVec4(0.24f, 0.52f, 0.88f, 1.00f);
colors[ImGuiCol_SliderGrabActive] = ImVec4(0.26f, 0.59f, 0.98f, 1.00f);
colors[ImGuiCol_Button] = ImVec4(0.26f, 0.59f, 0.98f, 0.40f);
@@ -277,6 +278,7 @@ void ImGui::StyleColorsClassic(ImGuiStyle* dst)
colors[ImGuiCol_ScrollbarGrabHovered] = ImVec4(0.40f, 0.40f, 0.80f, 0.40f);
colors[ImGuiCol_ScrollbarGrabActive] = ImVec4(0.41f, 0.39f, 0.80f, 0.60f);
colors[ImGuiCol_CheckMark] = ImVec4(0.90f, 0.90f, 0.90f, 0.50f);
+ colors[ImGuiCol_CheckboxSelectedBg] = ImLerp(colors[ImGuiCol_FrameBg], colors[ImGuiCol_FrameBgActive], 0.65f);
colors[ImGuiCol_SliderGrab] = ImVec4(1.00f, 1.00f, 1.00f, 0.30f);
colors[ImGuiCol_SliderGrabActive] = ImVec4(0.41f, 0.39f, 0.80f, 0.60f);
colors[ImGuiCol_Button] = ImVec4(0.35f, 0.40f, 0.61f, 0.62f);
@@ -347,6 +349,7 @@ void ImGui::StyleColorsLight(ImGuiStyle* dst)
colors[ImGuiCol_ScrollbarGrabHovered] = ImVec4(0.49f, 0.49f, 0.49f, 0.80f);
colors[ImGuiCol_ScrollbarGrabActive] = ImVec4(0.49f, 0.49f, 0.49f, 1.00f);
colors[ImGuiCol_CheckMark] = ImVec4(0.26f, 0.59f, 0.98f, 1.00f);
+ colors[ImGuiCol_CheckboxSelectedBg] = ImVec4(0.95f, 0.97f, 1.00f, 1.00f);
colors[ImGuiCol_SliderGrab] = ImVec4(0.26f, 0.59f, 0.98f, 0.78f);
colors[ImGuiCol_SliderGrabActive] = ImVec4(0.46f, 0.54f, 0.80f, 0.60f);
colors[ImGuiCol_Button] = ImVec4(0.26f, 0.59f, 0.98f, 0.40f);
@@ -405,7 +408,6 @@ ImDrawListSharedData::ImDrawListSharedData()
const float a = ((float)i * 2 * IM_PI) / (float)IM_COUNTOF(ArcFastVtx);
ArcFastVtx[i] = ImVec2(ImCos(a), ImSin(a));
}
- ArcFastRadiusCutoff = IM_DRAWLIST_CIRCLE_AUTO_SEGMENT_CALC_R(IM_DRAWLIST_ARCFAST_SAMPLE_MAX, CircleSegmentMaxError);
}
ImDrawListSharedData::~ImDrawListSharedData()
@@ -415,17 +417,17 @@ ImDrawListSharedData::~ImDrawListSharedData()
void ImDrawListSharedData::SetCircleTessellationMaxError(float max_error)
{
- if (CircleSegmentMaxError == max_error)
+ if (CircleTessellationMaxError == max_error)
return;
IM_ASSERT(max_error > 0.0f);
- CircleSegmentMaxError = max_error;
+ CircleTessellationMaxError = max_error;
for (int i = 0; i < IM_COUNTOF(CircleSegmentCounts); i++)
{
const float radius = (float)i;
- CircleSegmentCounts[i] = (ImU8)((i > 0) ? IM_DRAWLIST_CIRCLE_AUTO_SEGMENT_CALC(radius, CircleSegmentMaxError) : IM_DRAWLIST_ARCFAST_SAMPLE_MAX);
+ CircleSegmentCounts[i] = (ImU8)((i > 0) ? IM_DRAWLIST_CIRCLE_AUTO_SEGMENT_CALC(radius, CircleTessellationMaxError) : IM_DRAWLIST_ARCFAST_SAMPLE_MAX);
}
- ArcFastRadiusCutoff = IM_DRAWLIST_CIRCLE_AUTO_SEGMENT_CALC_R(IM_DRAWLIST_ARCFAST_SAMPLE_MAX, CircleSegmentMaxError);
+ ArcFastRadiusCutoff = IM_DRAWLIST_CIRCLE_AUTO_SEGMENT_CALC_R(IM_DRAWLIST_ARCFAST_SAMPLE_MAX, CircleTessellationMaxError);
}
ImDrawList::ImDrawList(ImDrawListSharedData* shared_data)
@@ -534,9 +536,14 @@ void ImDrawList::_PopUnusedDrawCmd()
void ImDrawList::AddCallback(ImDrawCallback callback, void* userdata, size_t userdata_size)
{
+ IM_ASSERT(callback != NULL);
+#ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS
+ if (callback == ImDrawCallback_ResetRenderState && _Data->Context != NULL && _Data->Context->PlatformIO.DrawCallback_ResetRenderState != NULL)
+ callback = _Data->Context->PlatformIO.DrawCallback_ResetRenderState; // == ImGui::GetPlatformIO().DrawCallback_ResetRenderState
+#endif
+
IM_ASSERT_PARANOID(CmdBuffer.Size > 0);
ImDrawCmd* curr_cmd = &CmdBuffer.Data[CmdBuffer.Size - 1];
- IM_ASSERT(callback != NULL);
IM_ASSERT(curr_cmd->UserCallback == NULL);
if (curr_cmd->ElemCount != 0)
{
@@ -654,11 +661,11 @@ void ImDrawList::_OnChangedVtxOffset()
int ImDrawList::_CalcCircleAutoSegmentCount(float radius) const
{
// Automatic segment count
- const int radius_idx = (int)(radius + 0.999999f); // ceil to never reduce accuracy
+ const int radius_idx = (int)(radius + 0.999f); // ceil to never reduce accuracy
if (radius_idx >= 0 && radius_idx < IM_COUNTOF(_Data->CircleSegmentCounts))
return _Data->CircleSegmentCounts[radius_idx]; // Use cached value
else
- return IM_DRAWLIST_CIRCLE_AUTO_SEGMENT_CALC(radius, _Data->CircleSegmentMaxError);
+ return IM_DRAWLIST_CIRCLE_AUTO_SEGMENT_CALC(radius, _Data->CircleTessellationMaxError);
}
// Render-level scissoring. This is passed down to your render function but not used for CPU-side coarse clipping. Prefer using higher-level ImGui::PushClipRect() to affect logic (hit-testing and widget culling)
@@ -668,7 +675,7 @@ void ImDrawList::PushClipRect(const ImVec2& cr_min, const ImVec2& cr_max, bool i
if (intersect_with_current_clip_rect)
{
ImVec4 current = _CmdHeader.ClipRect;
- if (cr.x < current.x) cr.x = current.x;
+ if (cr.x < current.x) cr.x = current.x; // = ClipWith(). Note that passing inverted range wouldn't be fixed here.
if (cr.y < current.y) cr.y = current.y;
if (cr.z > current.z) cr.z = current.z;
if (cr.w > current.w) cr.w = current.w;
@@ -812,7 +819,7 @@ void ImDrawList::PrimQuadUV(const ImVec2& a, const ImVec2& b, const ImVec2& c, c
// TODO: Thickness anti-aliased lines cap are missing their AA fringe.
// We avoid using the ImVec2 math operators here to reduce cost to a minimum for debug/non-inlined builds.
-void ImDrawList::AddPolyline(const ImVec2* points, const int points_count, ImU32 col, ImDrawFlags flags, float thickness)
+void ImDrawList::AddPolyline(const ImVec2* points, const int points_count, ImU32 col, float thickness, ImDrawFlags flags)
{
if (points_count < 2 || (col & IM_COL32_A_MASK) == 0)
return;
@@ -822,6 +829,12 @@ void ImDrawList::AddPolyline(const ImVec2* points, const int points_count, ImU32
const int count = closed ? points_count : points_count - 1; // The number of line segments we need to draw
const bool thick_line = (thickness > _FringeScale);
+ // If this assert triggers on legacy code:
+ // - 1.92.8 (2025/05): swapped two last parameters order: flags, thickness --> thickness, flags. This should normally be caught by compile-time type-checking.
+ // - 1.92.8 (2025/05): changed value of ImDrawList_Closed which was previously guaranteed to be == 1. Hardcoded use of 1 or true should be replaced.
+ // Read more details near AddRect() + see "API BREAKING CHANGES" section for 1.82, 1.90 and 1.92.8.
+ IM_ASSERT_USER_ERROR_RET((flags & ImDrawFlags_InvalidMask_) == 0, "Incorrect parameter. Did you swap 'thickness' and 'flags'?");
+
if (Flags & ImDrawListFlags_AntiAliasedLines)
{
// Anti-aliased stroke
@@ -1438,35 +1451,13 @@ void ImDrawList::PathBezierQuadraticCurveTo(const ImVec2& p2, const ImVec2& p3,
}
}
-static inline ImDrawFlags FixRectCornerFlags(ImDrawFlags flags)
-{
- /*
- IM_STATIC_ASSERT(ImDrawFlags_RoundCornersTopLeft == (1 << 4));
-#ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS
- // Obsoleted in 1.82 (from February 2021). This code was stripped/simplified and mostly commented in 1.90 (from September 2023)
- // - Legacy Support for hard coded ~0 (used to be a suggested equivalent to ImDrawCornerFlags_All)
- if (flags == ~0) { return ImDrawFlags_RoundCornersAll; }
- // - Legacy Support for hard coded 0x01 to 0x0F (matching 15 out of 16 old flags combinations). Read details in older version of this code.
- if (flags >= 0x01 && flags <= 0x0F) { return (flags << 4); }
- // We cannot support hard coded 0x00 with 'float rounding > 0.0f' --> replace with ImDrawFlags_RoundCornersNone or use 'float rounding = 0.0f'
-#endif
- */
- // If this assert triggers, please update your code replacing hardcoded values with new ImDrawFlags_RoundCorners* values.
- // Note that ImDrawFlags_Closed (== 0x01) is an invalid flag for AddRect(), AddRectFilled(), PathRect() etc. anyway.
- // See details in 1.82 Changelog as well as 2021/03/12 and 2023/09/08 entries in "API BREAKING CHANGES" section.
- IM_ASSERT((flags & 0x0F) == 0 && "Misuse of legacy hardcoded ImDrawCornerFlags values!");
-
- if ((flags & ImDrawFlags_RoundCornersMask_) == 0)
- flags |= ImDrawFlags_RoundCornersAll;
-
- return flags;
-}
-
void ImDrawList::PathRect(const ImVec2& a, const ImVec2& b, float rounding, ImDrawFlags flags)
{
if (rounding >= 0.5f)
{
- flags = FixRectCornerFlags(flags);
+ if ((flags & ImDrawFlags_RoundCornersMask_) == 0)
+ flags |= ImDrawFlags_RoundCornersAll;
+
rounding = ImMin(rounding, ImFabs(b.x - a.x) * (((flags & ImDrawFlags_RoundCornersTop) == ImDrawFlags_RoundCornersTop) || ((flags & ImDrawFlags_RoundCornersBottom) == ImDrawFlags_RoundCornersBottom) ? 0.5f : 1.0f) - 1.0f);
rounding = ImMin(rounding, ImFabs(b.y - a.y) * (((flags & ImDrawFlags_RoundCornersLeft) == ImDrawFlags_RoundCornersLeft) || ((flags & ImDrawFlags_RoundCornersRight) == ImDrawFlags_RoundCornersRight) ? 0.5f : 1.0f) - 1.0f);
}
@@ -1494,22 +1485,48 @@ void ImDrawList::AddLine(const ImVec2& p1, const ImVec2& p2, ImU32 col, float th
{
if ((col & IM_COL32_A_MASK) == 0)
return;
- PathLineTo(p1 + ImVec2(0.5f, 0.5f));
- PathLineTo(p2 + ImVec2(0.5f, 0.5f));
- PathStroke(col, 0, thickness);
+ const ImVec2 points[2] = { ImVec2(p1.x + 0.5f, p1.y + 0.5f), ImVec2(p2.x + 0.5f, p2.y + 0.5f) };
+ AddPolyline(points, 2, col, thickness);
+}
+
+void ImDrawList::AddLineH(float min_x, float max_x, float y, ImU32 col, float thickness)
+{
+ if ((col & IM_COL32_A_MASK) == 0)
+ return;
+ const ImVec2 points[2] = { ImVec2(min_x + 0.5f, y + 0.5f), ImVec2(max_x + 0.5f, y + 0.5f) }; // Same as AddLine() above.
+ AddPolyline(points, 2, col, thickness);
+}
+
+void ImDrawList::AddLineV(float x, float min_y, float max_y, ImU32 col, float thickness)
+{
+ if ((col & IM_COL32_A_MASK) == 0)
+ return;
+ const ImVec2 points[2] = { ImVec2(x + 0.5f, min_y + 0.5f), ImVec2(x + 0.5f, max_y + 0.5f) }; // Same as AddLine() above.
+ AddPolyline(points, 2, col, thickness);
}
// p_min = upper-left, p_max = lower-right
// Note we don't render 1 pixels sized rectangles properly.
-void ImDrawList::AddRect(const ImVec2& p_min, const ImVec2& p_max, ImU32 col, float rounding, ImDrawFlags flags, float thickness)
-{
+void ImDrawList::AddRect(const ImVec2& p_min, const ImVec2& p_max, ImU32 col, float rounding, float thickness, ImDrawFlags flags)
+{
+ // If this assert triggers on legacy code:
+ // - 1.92.8 (2025/05): swapped two last parameters order: flags, thickness --> thickness, flags. This should normally be caught by compile-time type-checking.
+ // - 1.92.8 (2025/05): changed value of ImDrawList_Closed which was previously guaranteed to be == 1. Hardcoded use of 1 or true should be replaced.
+ // - 1.82.0 (2021/03): changed ImDrawCornerFlags to ImDrawFlags_RoundCornersXXX values.
+ // If you used hard-coded 1 to 15 or ~0 in flags to configure corner rounding use the new flags!
+ // - Hard coded support for ~0 == ImDrawFlags_RoundCornersAll.
+ // - Hard coded support for values 0x01 to 0x0F (matching 15 out of 16 old flags combinations) --> see FixRectCornerFlags() in <1.90 code.
+ // - Hard coded 0x00 with 'float rounding > 0.0f' --> replace with ImDrawFlags_RoundCornersNone or use 'float rounding = 0.0f'.
+ // See "API BREAKING CHANGES" section for 1.82, 1.90 and 1.92.8.
+ IM_ASSERT_USER_ERROR_RET((flags & ImDrawFlags_InvalidMask_) == 0, "Incorrect parameter. Did you swap 'thickness' and 'flags'?"); // Or misuse of legacy hard-coded ImDrawCornerFlags values
+
if ((col & IM_COL32_A_MASK) == 0)
return;
if (Flags & ImDrawListFlags_AntiAliasedLines)
PathRect(p_min + ImVec2(0.50f, 0.50f), p_max - ImVec2(0.50f, 0.50f), rounding, flags);
else
PathRect(p_min + ImVec2(0.50f, 0.50f), p_max - ImVec2(0.49f, 0.49f), rounding, flags); // Better looking lower-right corner and rounded non-AA shapes.
- PathStroke(col, ImDrawFlags_Closed, thickness);
+ PathStroke(col, thickness, ImDrawFlags_Closed);
}
void ImDrawList::AddRectFilled(const ImVec2& p_min, const ImVec2& p_max, ImU32 col, float rounding, ImDrawFlags flags)
@@ -1553,7 +1570,7 @@ void ImDrawList::AddQuad(const ImVec2& p1, const ImVec2& p2, const ImVec2& p3, c
PathLineTo(p2);
PathLineTo(p3);
PathLineTo(p4);
- PathStroke(col, ImDrawFlags_Closed, thickness);
+ PathStroke(col, thickness, ImDrawFlags_Closed);
}
void ImDrawList::AddQuadFilled(const ImVec2& p1, const ImVec2& p2, const ImVec2& p3, const ImVec2& p4, ImU32 col)
@@ -1576,7 +1593,7 @@ void ImDrawList::AddTriangle(const ImVec2& p1, const ImVec2& p2, const ImVec2& p
PathLineTo(p1);
PathLineTo(p2);
PathLineTo(p3);
- PathStroke(col, ImDrawFlags_Closed, thickness);
+ PathStroke(col, thickness, ImDrawFlags_Closed);
}
void ImDrawList::AddTriangleFilled(const ImVec2& p1, const ImVec2& p2, const ImVec2& p3, ImU32 col)
@@ -1611,7 +1628,7 @@ void ImDrawList::AddCircle(const ImVec2& center, float radius, ImU32 col, int nu
PathArcTo(center, radius - 0.5f, 0.0f, a_max, num_segments - 1);
}
- PathStroke(col, ImDrawFlags_Closed, thickness);
+ PathStroke(col, thickness, ImDrawFlags_Closed);
}
void ImDrawList::AddCircleFilled(const ImVec2& center, float radius, ImU32 col, int num_segments)
@@ -1647,7 +1664,7 @@ void ImDrawList::AddNgon(const ImVec2& center, float radius, ImU32 col, int num_
// Because we are filling a closed shape we remove 1 from the count of segments/points
const float a_max = (IM_PI * 2.0f) * ((float)num_segments - 1.0f) / (float)num_segments;
PathArcTo(center, radius - 0.5f, 0.0f, a_max, num_segments - 1);
- PathStroke(col, ImDrawFlags_Closed, thickness);
+ PathStroke(col, thickness, ImDrawFlags_Closed);
}
// Guaranteed to honor 'num_segments'
@@ -1674,7 +1691,7 @@ void ImDrawList::AddEllipse(const ImVec2& center, const ImVec2& radius, ImU32 co
// Because we are filling a closed shape we remove 1 from the count of segments/points
const float a_max = IM_PI * 2.0f * ((float)num_segments - 1.0f) / (float)num_segments;
PathEllipticalArcTo(center, radius, rot, 0.0f, a_max, num_segments - 1);
- PathStroke(col, true, thickness);
+ PathStroke(col, thickness, ImDrawFlags_Closed);
}
void ImDrawList::AddEllipseFilled(const ImVec2& center, const ImVec2& radius, ImU32 col, float rot, int num_segments)
@@ -1699,7 +1716,7 @@ void ImDrawList::AddBezierCubic(const ImVec2& p1, const ImVec2& p2, const ImVec2
PathLineTo(p1);
PathBezierCubicCurveTo(p2, p3, p4, num_segments);
- PathStroke(col, 0, thickness);
+ PathStroke(col, thickness);
}
// Quadratic Bezier takes 3 controls points
@@ -1710,7 +1727,7 @@ void ImDrawList::AddBezierQuadratic(const ImVec2& p1, const ImVec2& p2, const Im
PathLineTo(p1);
PathBezierQuadraticCurveTo(p2, p3, num_segments);
- PathStroke(col, 0, thickness);
+ PathStroke(col, thickness);
}
void ImDrawList::AddText(ImFont* font, float font_size, const ImVec2& pos, ImU32 col, const char* text_begin, const char* text_end, float wrap_width, const ImVec4* cpu_fine_clip_rect)
@@ -1782,7 +1799,10 @@ void ImDrawList::AddImageRounded(ImTextureRef tex_ref, const ImVec2& p_min, cons
if ((col & IM_COL32_A_MASK) == 0)
return;
- flags = FixRectCornerFlags(flags);
+ IM_ASSERT((flags & 0x0F) == 0 && "Misuse of legacy hardcoded ImDrawCornerFlags values!"); // If this assert triggers on legacy code: see comments in ImDrawList::PathRect().
+ if ((flags & ImDrawFlags_RoundCornersMask_) == 0)
+ flags |= ImDrawFlags_RoundCornersAll;
+
if (rounding < 0.5f || (flags & ImDrawFlags_RoundCornersMask_) == ImDrawFlags_RoundCornersNone)
{
AddImage(tex_ref, p_min, p_max, uv_min, uv_max, col);
@@ -2266,11 +2286,14 @@ void ImDrawListSplitter::SetCurrentChannel(ImDrawList* draw_list, int idx)
void ImDrawData::Clear()
{
Valid = false;
- CmdListsCount = TotalIdxCount = TotalVtxCount = 0;
+ FrameCount = TotalIdxCount = TotalVtxCount = 0;
CmdLists.resize(0); // The ImDrawList are NOT owned by ImDrawData but e.g. by ImGuiContext, so we don't clear them.
DisplayPos = DisplaySize = FramebufferScale = ImVec2(0.0f, 0.0f);
OwnerViewport = NULL;
Textures = NULL;
+#ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS
+ CmdListsCount = 0;
+#endif
}
// Important: 'out_list' is generally going to be draw_data->CmdLists, but may be another temporary list
@@ -2315,14 +2338,12 @@ void ImGui::AddDrawListToDrawDataEx(ImDrawData* draw_data, ImVector
// Add to output list + records state in ImDrawData
out_list->push_back(draw_list);
- draw_data->CmdListsCount++;
draw_data->TotalVtxCount += draw_list->VtxBuffer.Size;
draw_data->TotalIdxCount += draw_list->IdxBuffer.Size;
}
void ImDrawData::AddDrawList(ImDrawList* draw_list)
{
- IM_ASSERT(CmdLists.Size == CmdListsCount);
draw_list->_PopUnusedDrawCmd();
ImGui::AddDrawListToDrawDataEx(this, &CmdLists, draw_list);
}
@@ -2507,10 +2528,11 @@ void ImTextureData::DestroyPixels()
// - Default texture data encoded in ASCII
// - ImFontAtlas()
// - ImFontAtlas::Clear()
-// - ImFontAtlas::CompactCache()
+// - ImFontAtlas::ClearFonts()
// - ImFontAtlas::ClearInputData()
// - ImFontAtlas::ClearTexData()
-// - ImFontAtlas::ClearFonts()
+// - ImFontAtlas::CompactCache()
+// - ImFontAtlas::SetFontLoader()
//-----------------------------------------------------------------------------
// - ImFontAtlasUpdateNewFrame()
// - ImFontAtlasTextureBlockConvert()
@@ -2547,8 +2569,6 @@ void ImTextureData::DestroyPixels()
// - ImFontAtlasBuildPreloadAllGlyphRanges()
// - ImFontAtlasBuildUpdatePointers()
// - ImFontAtlasBuildRenderBitmapFromString()
-// - ImFontAtlasBuildUpdateBasicTexData()
-// - ImFontAtlasBuildUpdateLinesTexData()
// - ImFontAtlasBuildAddFont()
// - ImFontAtlasBuildSetupFontBakedEllipsis()
// - ImFontAtlasBuildSetupFontBakedBlanks()
@@ -2565,13 +2585,14 @@ void ImTextureData::DestroyPixels()
// - ImFontAtlasUpdateDrawListsSharedData()
//-----------------------------------------------------------------------------
// - ImFontAtlasBuildSetTexture()
-// - ImFontAtlasBuildAddTexture()
-// - ImFontAtlasBuildMakeSpace()
-// - ImFontAtlasBuildRepackTexture()
-// - ImFontAtlasBuildGrowTexture()
-// - ImFontAtlasBuildRepackOrGrowTexture()
-// - ImFontAtlasBuildGetTextureSizeEstimate()
-// - ImFontAtlasBuildCompactTexture()
+// - ImFontAtlasBuildUpdateTexData()
+// - ImFontAtlasTextureAdd()
+// - ImFontAtlasTextureRepack()
+// - ImFontAtlasTextureGrow()
+// - ImFontAtlasTextureMakeSpace()
+// - ImFontAtlasTextureGetSizeEstimate()
+// - ImFontAtlasBuildClear()
+// - ImFontAtlasTextureCompact()
// - ImFontAtlasBuildInit()
// - ImFontAtlasBuildDestroy()
//-----------------------------------------------------------------------------
@@ -2671,9 +2692,12 @@ ImFontAtlas::~ImFontAtlas()
TexData = NULL;
}
-// If you call this mid-frame, you would need to add new font and bind them!
+// You probably should not call this directly. It is not well specified.
+// If you want to replace all your fonts mid-frame, most likely you should instead call ClearFonts() then load the new fonts.
+// Calling this mid-frame will discard the CPU-side copy of the texture data which is generally unreliable as you may have textures queued for creation or updates.
void ImFontAtlas::Clear()
{
+ IMGUI_DEBUG_LOG_FONT("[font] ImFontAtlas::Clear()\n");
bool backup_renderer_has_textures = RendererHasTextures;
RendererHasTextures = false; // Full Clear() is supported, but ClearTexData() only isn't.
ClearFonts();
@@ -2681,20 +2705,28 @@ void ImFontAtlas::Clear()
RendererHasTextures = backup_renderer_has_textures;
}
-void ImFontAtlas::CompactCache()
-{
- ImFontAtlasTextureCompact(this);
-}
-
-void ImFontAtlas::SetFontLoader(const ImFontLoader* font_loader)
+void ImFontAtlas::ClearFonts()
{
- ImFontAtlasBuildSetupFontLoader(this, font_loader);
+ // FIXME-NEWATLAS: Illegal to remove currently bound font.
+ IMGUI_DEBUG_LOG_FONT("[font] ImFontAtlas::ClearFonts()\n");
+ IM_ASSERT(!Locked && "Cannot modify a locked ImFontAtlas!");
+ for (ImFont* font : Fonts)
+ ImFontAtlasBuildNotifySetFont(this, font, NULL);
+ ImFontAtlasBuildDestroy(this);
+ ClearInputData();
+ Fonts.clear_delete();
+ TexIsBuilt = false;
+ for (ImDrawListSharedData* shared_data : DrawListSharedDatas)
+ if (shared_data->FontAtlas == this)
+ {
+ shared_data->Font = NULL;
+ shared_data->FontScale = shared_data->FontSize = 0.0f;
+ }
}
void ImFontAtlas::ClearInputData()
{
IM_ASSERT(!Locked && "Cannot modify a locked ImFontAtlas!");
-
for (ImFont* font : Fonts)
ImFontAtlasFontDestroyOutput(this, font);
for (ImFontConfig& font_cfg : Sources)
@@ -2718,22 +2750,14 @@ void ImFontAtlas::ClearTexData()
//Locked = true; // Hoped to be able to lock this down but some reload patterns may not be happy with it.
}
-void ImFontAtlas::ClearFonts()
+void ImFontAtlas::CompactCache()
{
- // FIXME-NEWATLAS: Illegal to remove currently bound font.
- IM_ASSERT(!Locked && "Cannot modify a locked ImFontAtlas!");
- for (ImFont* font : Fonts)
- ImFontAtlasBuildNotifySetFont(this, font, NULL);
- ImFontAtlasBuildDestroy(this);
- ClearInputData();
- Fonts.clear_delete();
- TexIsBuilt = false;
- for (ImDrawListSharedData* shared_data : DrawListSharedDatas)
- if (shared_data->FontAtlas == this)
- {
- shared_data->Font = NULL;
- shared_data->FontScale = shared_data->FontSize = 0.0f;
- }
+ ImFontAtlasTextureCompact(this);
+}
+
+void ImFontAtlas::SetFontLoader(const ImFontLoader* font_loader)
+{
+ ImFontAtlasBuildSetupFontLoader(this, font_loader);
}
static void ImFontAtlasBuildUpdateRendererHasTexturesFromContext(ImFontAtlas* atlas)
@@ -2760,6 +2784,28 @@ void ImFontAtlasUpdateNewFrame(ImFontAtlas* atlas, int frame_count, bool rendere
IM_ASSERT(atlas->Builder == NULL || atlas->Builder->FrameCount < frame_count); // Protection against being called twice.
atlas->RendererHasTextures = renderer_has_textures;
+ // Update texture status and discard old textures.
+ // (we do this first thing to handle an edge case: if user mistakenly calls ClearFonts()+SetStatus(OK) during
+ // rendering, it would ImFontAtlasBuildMain() rebuilding before tex->Updates[] gets a chance to be cleared)
+ // (if somehow we need to move this back lower in the function, we could manually call the code to clear Updates[]).
+ for (int tex_n = 0; tex_n < atlas->TexList.Size; tex_n++)
+ {
+ // Update and remove if requested
+ ImTextureData* tex = atlas->TexList[tex_n];
+ if (tex->Status == ImTextureStatus_WantCreate && atlas->RendererHasTextures)
+ IM_ASSERT(tex->TexID == ImTextureID_Invalid && tex->BackendUserData == NULL && "Backend set texture's TexID/BackendUserData but did not update Status to OK.");
+
+ bool remove_from_list = ImTextureDataUpdateNewFrame(tex);
+ if (remove_from_list)
+ {
+ IM_ASSERT(atlas->TexData != tex);
+ tex->DestroyPixels();
+ IM_DELETE(tex);
+ atlas->TexList.erase(atlas->TexList.begin() + tex_n);
+ tex_n--;
+ }
+ }
+
// Check that font atlas was built or backend support texture reload in which case we can build now
if (atlas->RendererHasTextures)
{
@@ -2799,61 +2845,50 @@ void ImFontAtlasUpdateNewFrame(ImFontAtlas* atlas, int frame_count, bool rendere
builder->BakedPool.Size -= builder->BakedDiscardedCount;
builder->BakedDiscardedCount = 0;
}
+}
- // Update texture status
- for (int tex_n = 0; tex_n < atlas->TexList.Size; tex_n++)
+bool ImTextureDataUpdateNewFrame(ImTextureData* tex)
+{
+ bool remove_from_list = false;
+ if (tex->Status == ImTextureStatus_OK)
{
- ImTextureData* tex = atlas->TexList[tex_n];
- bool remove_from_list = false;
- if (tex->Status == ImTextureStatus_OK)
- {
- tex->Updates.resize(0);
- tex->UpdateRect.x = tex->UpdateRect.y = (unsigned short)~0;
- tex->UpdateRect.w = tex->UpdateRect.h = 0;
- }
- if (tex->Status == ImTextureStatus_WantCreate && atlas->RendererHasTextures)
- IM_ASSERT(tex->TexID == ImTextureID_Invalid && tex->BackendUserData == NULL && "Backend set texture's TexID/BackendUserData but did not update Status to OK.");
+ tex->Updates.resize(0);
+ tex->UpdateRect.x = tex->UpdateRect.y = (unsigned short)~0;
+ tex->UpdateRect.w = tex->UpdateRect.h = 0;
+ }
- // Request destroy
- // - Keep bool to true in order to differentiate a planned destroy vs a destroy decided by the backend.
- // - We don't destroy pixels right away, as backend may have an in-flight copy from RAM.
- if (tex->WantDestroyNextFrame && tex->Status != ImTextureStatus_Destroyed && tex->Status != ImTextureStatus_WantDestroy)
- {
- IM_ASSERT(tex->Status == ImTextureStatus_OK || tex->Status == ImTextureStatus_WantCreate || tex->Status == ImTextureStatus_WantUpdates);
- tex->Status = ImTextureStatus_WantDestroy;
- }
+ // Request destroy
+ // - Keep bool to true in order to differentiate a planned destroy vs a destroy decided by the backend.
+ // - We don't destroy pixels right away, as backend may have an in-flight copy from RAM.
+ if (tex->WantDestroyNextFrame && tex->Status != ImTextureStatus_Destroyed && tex->Status != ImTextureStatus_WantDestroy)
+ {
+ IM_ASSERT(tex->Status == ImTextureStatus_OK || tex->Status == ImTextureStatus_WantCreate || tex->Status == ImTextureStatus_WantUpdates);
+ tex->Status = ImTextureStatus_WantDestroy;
+ }
- // If a texture has never reached the backend, they don't need to know about it.
- // (note: backends between 1.92.0 and 1.92.4 could set an already destroyed texture to ImTextureStatus_WantDestroy
- // when invalidating graphics objects twice, which would previously remove it from the list and crash.)
- if (tex->Status == ImTextureStatus_WantDestroy && tex->TexID == ImTextureID_Invalid && tex->BackendUserData == NULL)
- tex->Status = ImTextureStatus_Destroyed;
+ // If a texture has never reached the backend, they don't need to know about it.
+ // (note: backends between 1.92.0 and 1.92.4 could set an already destroyed texture to ImTextureStatus_WantDestroy
+ // when invalidating graphics objects twice, which would previously remove it from the list and crash.)
+ if (tex->Status == ImTextureStatus_WantDestroy && tex->TexID == ImTextureID_Invalid && tex->BackendUserData == NULL && tex->QueueUserData == NULL)
+ tex->Status = ImTextureStatus_Destroyed;
- // Process texture being destroyed
- if (tex->Status == ImTextureStatus_Destroyed)
- {
- IM_ASSERT(tex->TexID == ImTextureID_Invalid && tex->BackendUserData == NULL && "Backend set texture Status to Destroyed but did not clear TexID/BackendUserData!");
- if (tex->WantDestroyNextFrame)
- remove_from_list = true; // Destroy was scheduled by us
- else
- tex->Status = ImTextureStatus_WantCreate; // Destroy was done was backend: recreate it (e.g. freed resources mid-run)
- }
+ // Process texture being destroyed
+ if (tex->Status == ImTextureStatus_Destroyed)
+ {
+ IM_ASSERT(tex->TexID == ImTextureID_Invalid && tex->BackendUserData == NULL && "Backend set texture Status to Destroyed but did not clear TexID/BackendUserData!");
+ IM_ASSERT(tex->QueueUserData == NULL && "Texture queue set Status to Destroyed but did not clear QueueUserData!");
+ if (tex->WantDestroyNextFrame)
+ remove_from_list = true; // Destroy was scheduled by us
+ else
+ tex->Status = ImTextureStatus_WantCreate; // Destroy was done was backend: recreate it (e.g. freed resources mid-run)
+ }
- // The backend may need defer destroying by a few frames, to handle texture used by previous in-flight rendering.
- // We allow the texture staying in _WantDestroy state and increment a counter which the backend can use to take its decision.
- if (tex->Status == ImTextureStatus_WantDestroy)
- tex->UnusedFrames++;
+ // The backend may need defer destroying by a few frames, to handle texture used by previous in-flight rendering.
+ // We allow the texture staying in _WantDestroy state and increment a counter which the backend can use to take its decision.
+ if (tex->Status == ImTextureStatus_WantDestroy)
+ tex->UnusedFrames++;
- // Destroy and remove
- if (remove_from_list)
- {
- IM_ASSERT(atlas->TexData != tex);
- tex->DestroyPixels();
- IM_DELETE(tex);
- atlas->TexList.erase(atlas->TexList.begin() + tex_n);
- tex_n--;
- }
- }
+ return remove_from_list;
}
void ImFontAtlasTextureBlockConvert(const unsigned char* src_pixels, ImTextureFormat src_fmt, int src_pitch, unsigned char* dst_pixels, ImTextureFormat dst_fmt, int dst_pitch, int w, int h)
@@ -2967,12 +3002,17 @@ void ImFontAtlasTextureBlockCopy(ImTextureData* src_tex, int src_x, int src_y, I
memcpy(dst_tex->GetPixelsAt(dst_x, dst_y + y), src_tex->GetPixelsAt(src_x, src_y + y), w * dst_tex->BytesPerPixel);
}
-// Queue texture block update for renderer backend
void ImFontAtlasTextureBlockQueueUpload(ImFontAtlas* atlas, ImTextureData* tex, int x, int y, int w, int h)
+{
+ ImTextureDataQueueUpload(tex, x, y, w, h);
+ atlas->TexIsBuilt = false;
+}
+
+// Queue texture block update for renderer backend
+void ImTextureDataQueueUpload(ImTextureData* tex, int x, int y, int w, int h)
{
IM_ASSERT(tex->Status != ImTextureStatus_WantDestroy && tex->Status != ImTextureStatus_Destroyed);
IM_ASSERT(x >= 0 && x <= 0xFFFF && y >= 0 && y <= 0xFFFF && w >= 0 && x + w <= 0x10000 && h >= 0 && y + h <= 0x10000);
- IM_UNUSED(atlas);
ImTextureRect req = { (unsigned short)x, (unsigned short)y, (unsigned short)w, (unsigned short)h };
int new_x1 = ImMax(tex->UpdateRect.w == 0 ? 0 : tex->UpdateRect.x + tex->UpdateRect.w, req.x + req.w);
@@ -2985,7 +3025,6 @@ void ImFontAtlasTextureBlockQueueUpload(ImFontAtlas* atlas, ImTextureData* tex,
tex->UsedRect.y = ImMin(tex->UsedRect.y, req.y);
tex->UsedRect.w = (unsigned short)(ImMax(tex->UsedRect.x + tex->UsedRect.w, req.x + req.w) - tex->UsedRect.x);
tex->UsedRect.h = (unsigned short)(ImMax(tex->UsedRect.y + tex->UsedRect.h, req.y + req.h) - tex->UsedRect.y);
- atlas->TexIsBuilt = false;
// No need to queue if status is == ImTextureStatus_WantCreate
if (tex->Status == ImTextureStatus_OK || tex->Status == ImTextureStatus_WantUpdates)
@@ -3056,7 +3095,7 @@ ImFont* ImFontAtlas::AddFont(const ImFontConfig* font_cfg_in)
}
else
{
- IM_ASSERT(Fonts.Size > 0 && "Cannot use MergeMode for the first font"); // When using MergeMode make sure that a font has already been added before.
+ IM_ASSERT(Fonts.Size > 0 && "Cannot use MergeMode for the first font!"); // When using MergeMode make sure that a font has already been added before.
font = font_cfg_in->DstFont ? font_cfg_in->DstFont : Fonts.back();
ImFontAtlasFontDiscardBakes(this, font, 0); // Need to discard bakes if the font was already used, because baked->FontLoaderDatas[] will change size. (#9162)
}
@@ -3084,6 +3123,11 @@ ImFont* ImFontAtlas::AddFont(const ImFontConfig* font_cfg_in)
IM_ASSERT(font_cfg->FontLoader->FontBakedLoadGlyph != NULL);
IM_ASSERT(font_cfg->FontLoader->LoaderInit == NULL && font_cfg->FontLoader->LoaderShutdown == NULL); // FIXME-NEWATLAS: Unsupported yet.
}
+ // | Target w/ Implicit RefSize | Target w/ Explicit RefSize |
+ // Adding w/ Implicit RefSize: | OK (same scale) | OK (same scale) |
+ // Adding w/ Explicit RefSize: | KO | OK (custom scale) |
+ if (font_cfg_in->MergeMode && font_cfg_in->SizePixels > 0)
+ IM_ASSERT((font->Flags & ImFontFlags_ImplicitRefSize) == 0 && "Cannot use MergeMode with an explicit reference size when the destination font used an implicit reference size!");
IM_ASSERT(font_cfg->FontLoaderData == NULL);
if (!ImFontAtlasFontSourceInit(this, font_cfg))
@@ -3120,9 +3164,11 @@ static void Decode85(const unsigned char* src, unsigned char* dst)
dst += 4;
}
}
-#ifndef IMGUI_DISABLE_DEFAULT_FONT
-static const char* GetDefaultCompressedFontDataProggyClean(int* out_size);
-static const char* GetDefaultCompressedFontDataProggyForever(int* out_size);
+#if !defined(IMGUI_DISABLE_DEFAULT_FONT) && !defined(IMGUI_DISABLE_DEFAULT_FONT_BITMAP)
+const char* ImGui_GetDefaultCompressedFontDataProggyClean(int* out_size);
+#endif
+#if !defined(IMGUI_DISABLE_DEFAULT_FONT) && !defined(IMGUI_DISABLE_DEFAULT_FONT_VECTOR)
+const char* ImGui_GetDefaultCompressedFontDataProggyForever(int* out_size);
#endif
// This duplicates some of the logic in UpdateFontsNewFrame() which is a bit chicken-and-eggy/tricky to extract due to variety of codepaths and possible initialization ordering.
@@ -3146,50 +3192,56 @@ ImFont* ImFontAtlas::AddFontDefault(const ImFontConfig* font_cfg)
// If you want a similar font which may be better scaled, consider using AddFontDefaultVector().
ImFont* ImFontAtlas::AddFontDefaultBitmap(const ImFontConfig* font_cfg_template)
{
-#ifndef IMGUI_DISABLE_DEFAULT_FONT
+#if !defined(IMGUI_DISABLE_DEFAULT_FONT) && !defined(IMGUI_DISABLE_DEFAULT_FONT_BITMAP)
ImFontConfig font_cfg = font_cfg_template ? *font_cfg_template : ImFontConfig();
if (!font_cfg_template)
font_cfg.PixelSnapH = true; // Prevents sub-integer scaling factors at lower-level layers.
if (font_cfg.SizePixels <= 0.0f)
+ {
font_cfg.SizePixels = 13.0f; // This only serves (1) as a reference for GlyphOffset.y setting and (2) as a default for pre-1.92 backend.
+ font_cfg.Flags |= ImFontFlags_ImplicitRefSize;
+ }
if (font_cfg.Name[0] == '\0')
ImFormatString(font_cfg.Name, IM_COUNTOF(font_cfg.Name), "ProggyClean.ttf");
font_cfg.EllipsisChar = (ImWchar)0x0085;
font_cfg.GlyphOffset.y += 1.0f * (font_cfg.SizePixels / 13.0f); // Add +1 offset per 13 units
int ttf_compressed_size = 0;
- const char* ttf_compressed = GetDefaultCompressedFontDataProggyClean(&ttf_compressed_size);
+ const char* ttf_compressed = ImGui_GetDefaultCompressedFontDataProggyClean(&ttf_compressed_size);
return AddFontFromMemoryCompressedTTF(ttf_compressed, ttf_compressed_size, font_cfg.SizePixels, &font_cfg);
#else
IM_ASSERT(0 && "Function is disabled in this build.");
IM_UNUSED(font_cfg_template);
return NULL;
-#endif // #ifndef IMGUI_DISABLE_DEFAULT_FONT
+#endif
}
// Load a minimal version of ProggyForever, designed to match our good old ProggyClean, but nicely scalable.
// (See build script in https://github.com/ocornut/proggyforever for details)
ImFont* ImFontAtlas::AddFontDefaultVector(const ImFontConfig* font_cfg_template)
{
-#ifndef IMGUI_DISABLE_DEFAULT_FONT
+#if !defined(IMGUI_DISABLE_DEFAULT_FONT) && !defined(IMGUI_DISABLE_DEFAULT_FONT_VECTOR)
ImFontConfig font_cfg = font_cfg_template ? *font_cfg_template : ImFontConfig();
if (!font_cfg_template)
font_cfg.PixelSnapH = true; // Precisely match ProggyClean, but prevents sub-integer scaling factors at lower-level layers.
if (font_cfg.SizePixels <= 0.0f)
+ {
font_cfg.SizePixels = 13.0f;
+ font_cfg.Flags |= ImFontFlags_ImplicitRefSize;
+ }
if (font_cfg.Name[0] == '\0')
ImFormatString(font_cfg.Name, IM_COUNTOF(font_cfg.Name), "ProggyForever.ttf");
font_cfg.ExtraSizeScale *= 1.015f; // Match ProggyClean
font_cfg.GlyphOffset.y += 0.5f * (font_cfg.SizePixels / 16.0f); // Closer match ProggyClean + avoid descenders going too high (with current code).
int ttf_compressed_size = 0;
- const char* ttf_compressed = GetDefaultCompressedFontDataProggyForever(&ttf_compressed_size);
+ const char* ttf_compressed = ImGui_GetDefaultCompressedFontDataProggyForever(&ttf_compressed_size);
return AddFontFromMemoryCompressedTTF(ttf_compressed, ttf_compressed_size, font_cfg.SizePixels, &font_cfg);
#else
IM_ASSERT(0 && "Function is disabled in this build.");
IM_UNUSED(font_cfg_template);
return NULL;
-#endif // #ifndef IMGUI_DISABLE_DEFAULT_FONT
+#endif
}
ImFont* ImFontAtlas::AddFontFromFileTTF(const char* filename, float size_pixels, const ImFontConfig* font_cfg_template, const ImWchar* glyph_ranges)
@@ -3545,7 +3597,7 @@ void ImFontAtlasBuildRenderBitmapFromString(ImFontAtlas* atlas, int x, int y, in
}
}
-static void ImFontAtlasBuildUpdateBasicTexData(ImFontAtlas* atlas)
+static void ImFontAtlasBuildUpdateTexDataBasic(ImFontAtlas* atlas)
{
// Pack and store identifier so we can refresh UV coordinates on texture resize.
// FIXME-NEWATLAS: User/custom rects where user code wants to store UV coordinates will need to do the same thing.
@@ -3579,7 +3631,7 @@ static void ImFontAtlasBuildUpdateBasicTexData(ImFontAtlas* atlas)
atlas->TexUvWhitePixel = ImVec2((r.x + 0.5f) * atlas->TexUvScale.x, (r.y + 0.5f) * atlas->TexUvScale.y);
}
-static void ImFontAtlasBuildUpdateLinesTexData(ImFontAtlas* atlas)
+static void ImFontAtlasBuildUpdateTexDataLines(ImFontAtlas* atlas)
{
if (atlas->Flags & ImFontAtlasFlags_NoBakedLines)
return;
@@ -4028,6 +4080,12 @@ static void ImFontAtlasBuildSetTexture(ImFontAtlas* atlas, ImTextureData* tex)
ImFontAtlasUpdateDrawListsTextures(atlas, old_tex_ref, atlas->TexRef);
}
+static void ImFontAtlasBuildUpdateTexData(ImFontAtlas* atlas)
+{
+ ImFontAtlasBuildUpdateTexDataBasic(atlas);
+ ImFontAtlasBuildUpdateTexDataLines(atlas);
+}
+
// Create a new texture, discard previous one
ImTextureData* ImFontAtlasTextureAdd(ImFontAtlas* atlas, int w, int h)
{
@@ -4142,8 +4200,7 @@ void ImFontAtlasTextureRepack(ImFontAtlas* atlas, int w, int h)
}
// Update other cached UV
- ImFontAtlasBuildUpdateLinesTexData(atlas);
- ImFontAtlasBuildUpdateBasicTexData(atlas);
+ ImFontAtlasBuildUpdateTexData(atlas);
builder->LockDisableResize = false;
ImFontAtlasUpdateDrawListsSharedData(atlas);
@@ -4292,8 +4349,7 @@ void ImFontAtlasBuildInit(ImFontAtlas* atlas)
ImFontAtlasPackInit(atlas);
// Add required texture data
- ImFontAtlasBuildUpdateLinesTexData(atlas);
- ImFontAtlasBuildUpdateBasicTexData(atlas);
+ ImFontAtlasBuildUpdateTexData(atlas);
// Register fonts
ImFontAtlasBuildUpdatePointers(atlas);
@@ -4322,6 +4378,8 @@ void ImFontAtlasBuildDestroy(ImFontAtlas* atlas)
atlas->Builder = NULL;
}
+//-----------------------------------------------------------------------------
+
void ImFontAtlasPackInit(ImFontAtlas * atlas)
{
ImTextureData* tex = atlas->TexData;
@@ -5718,8 +5776,13 @@ void ImFont::RenderChar(ImDrawList* draw_list, float size, const ImVec2& pos, Im
if (glyph->Colored)
col |= ~IM_COL32_A_MASK;
float scale = (size >= 0.0f) ? (size / baked->Size) : 1.0f;
- float x = IM_TRUNC(pos.x);
- float y = IM_TRUNC(pos.y);
+ float x = pos.x;
+ float y = pos.y;
+ if ((draw_list->Flags & ImDrawListFlags_TextNoPixelSnap) == 0)
+ {
+ x = IM_TRUNC(x);
+ y = IM_TRUNC(y);
+ }
float x1 = x + glyph->X0 * scale;
float x2 = x + glyph->X1 * scale;
@@ -5751,12 +5814,17 @@ void ImFont::RenderChar(ImDrawList* draw_list, float size, const ImVec2& pos, Im
// DO NOT CALL DIRECTLY THIS WILL CHANGE WILDLY IN 2026. Use ImDrawList::AddText().
void ImFont::RenderText(ImDrawList* draw_list, float size, const ImVec2& pos, ImU32 col, const ImVec4& clip_rect, const char* text_begin, const char* text_end, float wrap_width, ImDrawTextFlags flags)
{
- // Align to be pixel perfect
begin:
- float x = IM_TRUNC(pos.x);
- float y = IM_TRUNC(pos.y);
+ // Align to be pixel perfect
+ float x = pos.x;
+ float y = pos.y;
if (y > clip_rect.w)
return;
+ if ((draw_list->Flags & ImDrawListFlags_TextNoPixelSnap) == 0)
+ {
+ x = IM_TRUNC(x);
+ y = IM_TRUNC(y);
+ }
if (!text_end)
text_end = text_begin + ImStrlen(text_begin); // ImGui:: functions generally already provides a valid text_end, so this is merely to handle direct calls.
@@ -6021,7 +6089,7 @@ void ImGui::RenderCheckMark(ImDrawList* draw_list, ImVec2 pos, ImU32 col, float
draw_list->PathLineTo(ImVec2(bx - third, by - third));
draw_list->PathLineTo(ImVec2(bx, by));
draw_list->PathLineTo(ImVec2(bx + third * 2.0f, by - third * 2.0f));
- draw_list->PathStroke(col, 0, thickness);
+ draw_list->PathStroke(col, thickness);
}
// Render an arrow. 'pos' is position of the arrow tip. half_sz.x is length from base to tip. half_sz.y is length on each side.
@@ -6151,8 +6219,8 @@ void ImGui::RenderColorRectWithAlphaCheckerboard(ImDrawList* draw_list, ImVec2 p
flags = ImDrawFlags_RoundCornersDefault_;
if (((col & IM_COL32_A_MASK) >> IM_COL32_A_SHIFT) < 0xFF)
{
- ImU32 col_bg1 = GetColorU32(ImAlphaBlendColors(IM_COL32(204, 204, 204, 255), col));
- ImU32 col_bg2 = GetColorU32(ImAlphaBlendColors(IM_COL32(128, 128, 128, 255), col));
+ ImU32 col_bg1 = GetColorU32(ImAlphaBlendColors(IM_COL32(128, 128, 128, 255), col));
+ ImU32 col_bg2 = GetColorU32(ImAlphaBlendColors(IM_COL32(204, 204, 204, 255), col));
draw_list->AddRectFilled(p_min, p_max, col_bg1, rounding, flags);
int yi = 0;
@@ -6161,12 +6229,12 @@ void ImGui::RenderColorRectWithAlphaCheckerboard(ImDrawList* draw_list, ImVec2 p
float y1 = ImClamp(y, p_min.y, p_max.y), y2 = ImMin(y + grid_step, p_max.y);
if (y2 <= y1)
continue;
- for (float x = p_min.x + grid_off.x + (yi & 1) * grid_step; x < p_max.x; x += grid_step * 2.0f)
+ for (float x = p_min.x + grid_off.x + ((yi ^ 1) & 1) * grid_step; x < p_max.x; x += grid_step * 2.0f)
{
float x1 = ImClamp(x, p_min.x, p_max.x), x2 = ImMin(x + grid_step, p_max.x);
if (x2 <= x1)
continue;
- ImDrawFlags cell_flags = ImDrawFlags_RoundCornersNone;
+ ImDrawFlags cell_flags = ImDrawFlags_RoundCornersNone; // FIXME: Could use CalcRoundingFlagsForRectInRect()
if (y1 <= p_min.y) { if (x1 <= p_min.x) cell_flags |= ImDrawFlags_RoundCornersTopLeft; if (x2 >= p_max.x) cell_flags |= ImDrawFlags_RoundCornersTopRight; }
if (y2 >= p_max.y) { if (x1 <= p_min.x) cell_flags |= ImDrawFlags_RoundCornersBottomLeft; if (x2 >= p_max.x) cell_flags |= ImDrawFlags_RoundCornersBottomRight; }
@@ -6308,7 +6376,7 @@ static unsigned int stb_decompress(unsigned char *output, const unsigned char *i
// Download and more information at https://github.com/bluescan/proggyfonts
//-----------------------------------------------------------------------------
-#ifndef IMGUI_DISABLE_DEFAULT_FONT
+#if !defined(IMGUI_DISABLE_DEFAULT_FONT) && !defined(IMGUI_DISABLE_DEFAULT_FONT_BITMAP)
// File: 'ProggyClean.ttf' (41208 bytes)
// Exported using binary_to_compressed_c.exe -u8 "ProggyClean.ttf" proggy_clean_ttf
@@ -6483,11 +6551,12 @@ static const unsigned char proggy_clean_ttf_compressed_data[9583] =
239,32,57,141,239,32,57,141,239,32,57,141,239,32,57,141,239,32,57,141,239,35,57,102,0,0,5,250,72,249,98,247,
};
-static const char* GetDefaultCompressedFontDataProggyClean(int* out_size)
+const char* ImGui_GetDefaultCompressedFontDataProggyClean(int* out_size)
{
*out_size = proggy_clean_ttf_compressed_size;
return (const char*)proggy_clean_ttf_compressed_data;
}
+#endif // #if !defined(IMGUI_DISABLE_DEFAULT_FONT) && !defined(IMGUI_DISABLE_DEFAULT_FONT_BITMAP)
//-----------------------------------------------------------------------------
// [SECTION] Default font data (ProggyForever-Regular-minimal.ttf)
@@ -6496,6 +6565,8 @@ static const char* GetDefaultCompressedFontDataProggyClean(int* out_size)
// MIT license / Copyright (c) 2026 Disco Hello, Copyright (c) 2019,2023 Tristan Grimmer
//-----------------------------------------------------------------------------
+#if !defined(IMGUI_DISABLE_DEFAULT_FONT) && !defined(IMGUI_DISABLE_DEFAULT_FONT_VECTOR)
+
// File: 'output/ProggyForever-Regular-minimal.ttf' (18556 bytes)
// Exported using binary_to_compressed_c.exe -u8 "output/ProggyForever-Regular-minimal.ttf" proggy_forever_minimal_ttf
static const unsigned int proggy_forever_minimal_ttf_compressed_size = 14562;
@@ -6745,12 +6816,11 @@ static const unsigned char proggy_forever_minimal_ttf_compressed_data[14562] =
3,36,0,229,13,183,147,132,7,42,175,187,66,0,0,0,0,229,178,59,232,5,250,48,120,202,241,
};
-static const char* GetDefaultCompressedFontDataProggyForever(int* out_size)
+const char* ImGui_GetDefaultCompressedFontDataProggyForever(int* out_size)
{
*out_size = proggy_forever_minimal_ttf_compressed_size;
return (const char*)proggy_forever_minimal_ttf_compressed_data;
}
-
-#endif // #ifndef IMGUI_DISABLE_DEFAULT_FONT
+#endif // #if !defined(IMGUI_DISABLE_DEFAULT_FONT) && !defined(IMGUI_DISABLE_DEFAULT_FONT_VECTOR)
#endif // #ifndef IMGUI_DISABLE
diff --git a/include/imgui/imgui_internal.h b/include/imgui/imgui_internal.h
index 9f532ab..633d9e6 100644
--- a/include/imgui/imgui_internal.h
+++ b/include/imgui/imgui_internal.h
@@ -1,4 +1,4 @@
-// dear imgui, v1.92.7
+// dear imgui, v1.92.9b
// (internal structures/api)
// You may use this file to debug, understand or extend Dear ImGui features but we don't provide any guarantee of forward compatibility.
@@ -35,7 +35,7 @@ Index of this file:
// [SECTION] ImGuiContext (main imgui context)
// [SECTION] ImGuiWindowTempData, ImGuiWindow
// [SECTION] Tab bar, Tab item support
-// [SECTION] Table support
+// [SECTION] Table support + internal API
// [SECTION] ImGui internal API
// [SECTION] ImFontLoader
// [SECTION] ImFontAtlas internal API
@@ -98,6 +98,7 @@ Index of this file:
#pragma clang diagnostic ignored "-Wimplicit-int-float-conversion" // warning: implicit conversion from 'xxx' to 'float' may lose precision
#pragma clang diagnostic ignored "-Wmissing-noreturn" // warning: function 'xxx' could be declared with attribute 'noreturn'
#pragma clang diagnostic ignored "-Wdeprecated-enum-enum-conversion"// warning: bitwise operation between different enumeration types ('XXXFlags_' and 'XXXFlagsPrivate_') is deprecated
+#pragma clang diagnostic ignored "-Wreserved-identifier" // warning: identifier '_Xxx' is reserved because it starts with '_' followed by a capital letter
#pragma clang diagnostic ignored "-Wunsafe-buffer-usage" // warning: 'xxx' is an unsafe pointer used for buffer access
#pragma clang diagnostic ignored "-Wnontrivial-memaccess" // warning: first argument in call to 'memset' is a pointer to non-trivially copyable type
#elif defined(__GNUC__)
@@ -138,6 +139,7 @@ Index of this file:
struct ImBitVector; // Store 1-bit per value
struct ImRect; // An axis-aligned rectangle (2 points)
struct ImGuiTextIndex; // Maintain a line index for a text buffer.
+struct ImGuiPackedDate; // A date in YYYYMMDD format packed into 16-bits
// ImDrawList/ImFontAtlas
struct ImDrawDataBuilder; // Helper to build a ImDrawData instance
@@ -196,7 +198,7 @@ struct ImGuiWindowSettings; // Storage for a window .ini settings (we ke
// Enumerations
// Use your programming IDE "Go to definition" facility on the names of the center columns to find the actual flags/enum lists.
enum ImGuiLocKey : int; // -> enum ImGuiLocKey // Enum: a localization entry for translation.
-typedef int ImGuiDataAuthority; // -> enum ImGuiDataAuthority_ // Enum: for storing the source authority (dock node vs window) of a field
+typedef unsigned int ImGuiDataAuthority;// -> enum ImGuiDataAuthority_ // Enum: for storing the source authority (dock node vs window) of a field
typedef int ImGuiLayoutType; // -> enum ImGuiLayoutType_ // Enum: Horizontal or vertical
// Flags
@@ -256,6 +258,7 @@ extern IMGUI_API ImGuiContext* GImGui; // Current implicit context pointer
#define IMGUI_DEBUG_LOG_POPUP(...) do { if (g.DebugLogFlags & ImGuiDebugLogFlags_EventPopup) IMGUI_DEBUG_LOG(__VA_ARGS__); } while (0)
#define IMGUI_DEBUG_LOG_NAV(...) do { if (g.DebugLogFlags & ImGuiDebugLogFlags_EventNav) IMGUI_DEBUG_LOG(__VA_ARGS__); } while (0)
#define IMGUI_DEBUG_LOG_SELECTION(...) do { if (g.DebugLogFlags & ImGuiDebugLogFlags_EventSelection) IMGUI_DEBUG_LOG(__VA_ARGS__); } while (0)
+#define IMGUI_DEBUG_LOG_TABLE(...) do { if (g.DebugLogFlags & ImGuiDebugLogFlags_EventTable) IMGUI_DEBUG_LOG(__VA_ARGS__); } while (0)
#define IMGUI_DEBUG_LOG_CLIPPER(...) do { if (g.DebugLogFlags & ImGuiDebugLogFlags_EventClipper) IMGUI_DEBUG_LOG(__VA_ARGS__); } while (0)
#define IMGUI_DEBUG_LOG_IO(...) do { if (g.DebugLogFlags & ImGuiDebugLogFlags_EventIO) IMGUI_DEBUG_LOG(__VA_ARGS__); } while (0)
#define IMGUI_DEBUG_LOG_FONT(...) do { ImGuiContext* g2 = GImGui; if (g2 && g2->DebugLogFlags & ImGuiDebugLogFlags_EventFont) IMGUI_DEBUG_LOG(__VA_ARGS__); } while (0) // Called from ImFontAtlas function which may operate without a context.
@@ -263,6 +266,9 @@ extern IMGUI_API ImGuiContext* GImGui; // Current implicit context pointer
#define IMGUI_DEBUG_LOG_DOCKING(...) do { if (g.DebugLogFlags & ImGuiDebugLogFlags_EventDocking) IMGUI_DEBUG_LOG(__VA_ARGS__); } while (0)
#define IMGUI_DEBUG_LOG_VIEWPORT(...) do { if (g.DebugLogFlags & ImGuiDebugLogFlags_EventViewport) IMGUI_DEBUG_LOG(__VA_ARGS__); } while (0)
+// Debug options (also see ones on top of imgui.cpp)
+//#define IMGUI_DEBUG_BOXSELECT
+
// Static Asserts
#define IM_STATIC_ASSERT(_COND) static_assert(_COND, "")
@@ -329,6 +335,8 @@ extern IMGUI_API ImGuiContext* GImGui; // Current implicit context pointer
#define IM_DEBUG_BREAK() __asm__ volatile(".inst 0xde01")
#elif defined(__GNUC__) && defined(__arm__) && !defined(__thumb__)
#define IM_DEBUG_BREAK() __asm__ volatile(".inst 0xe7f001f0")
+#elif defined(__GNUC__) && defined(__aarch64__)
+#define IM_DEBUG_BREAK() __asm__ volatile(".inst 0xd4200000") // GDB needs 'set $pc=($pc+4)' to skip this :(
#else
#define IM_DEBUG_BREAK() IM_ASSERT(0) // It is expected that you define IM_DEBUG_BREAK() into something that will break nicely in a debugger!
#endif
@@ -517,7 +525,8 @@ inline double ImRsqrt(double x) { return 1.0 / sqrt(x); }
template T ImMin(T lhs, T rhs) { return lhs < rhs ? lhs : rhs; }
template T ImMax(T lhs, T rhs) { return lhs >= rhs ? lhs : rhs; }
template T ImClamp(T v, T mn, T mx) { return (v < mn) ? mn : (v > mx) ? mx : v; }
-template T ImLerp(T a, T b, float t) { return (T)(a + (b - a) * t); }
+template T ImLerp(double a, double b, float t) { return (T)(a + (b - a) * (double)t); }
+template T ImLerp(T a, T b, float t) { return (T)((float)a + (float)(b - a) * t); }
template void ImSwap(T& a, T& b) { T tmp = a; a = b; b = tmp; }
template T ImAddClampOverflow(T a, T b, T mn, T mx) { if (b < 0 && (a < mn - b)) return mn; if (b > 0 && (a > mx - b)) return mx; return a + b; }
template T ImSubClampOverflow(T a, T b, T mn, T mx) { if (b > 0 && (a < mn + b)) return mn; if (b < 0 && (a > mx + b)) return mx; return a - b; }
@@ -538,6 +547,7 @@ inline float ImFloor(float f) { return
inline ImVec2 ImFloor(const ImVec2& v) { return ImVec2(ImFloor(v.x), ImFloor(v.y)); }
inline float ImTrunc64(float f) { return (float)(ImS64)(f); }
inline float ImRound64(float f) { return (float)(ImS64)(f + 0.5f); } // FIXME: Positive values only.
+inline float ImCeilFast(float f) { int i = (int)f; return (float)(i + (f > (float)i)); } // Consider using the the bit-hack version (search for "0x1p120f").
inline int ImModPositive(int a, int b) { return (a + b) % b; }
inline float ImDot(const ImVec2& a, const ImVec2& b) { return a.x * b.x + a.y * b.y; }
inline ImVec2 ImRotate(const ImVec2& v, float cos_a, float sin_a) { return ImVec2(v.x * cos_a - v.y * sin_a, v.x * sin_a + v.y * cos_a); }
@@ -614,6 +624,8 @@ struct IMGUI_API ImRect
bool Overlaps(const ImRect& r) const { return r.Min.y < Max.y && r.Max.y > Min.y && r.Min.x < Max.x && r.Max.x > Min.x; }
void Add(const ImVec2& p) { if (Min.x > p.x) Min.x = p.x; if (Min.y > p.y) Min.y = p.y; if (Max.x < p.x) Max.x = p.x; if (Max.y < p.y) Max.y = p.y; }
void Add(const ImRect& r) { if (Min.x > r.Min.x) Min.x = r.Min.x; if (Min.y > r.Min.y) Min.y = r.Min.y; if (Max.x < r.Max.x) Max.x = r.Max.x; if (Max.y < r.Max.y) Max.y = r.Max.y; }
+ void AddX(float x) { if (Min.x > x) Min.x = x; if (Max.x < x) Max.x = x; }
+ void AddY(float y) { if (Min.y > y) Min.y = y; if (Max.y < y) Max.y = y; }
void Expand(const float amount) { Min.x -= amount; Min.y -= amount; Max.x += amount; Max.y += amount; }
void Expand(const ImVec2& amount) { Min.x -= amount.x; Min.y -= amount.y; Max.x += amount.x; Max.y += amount.y; }
void Translate(const ImVec2& d) { Min.x += d.x; Min.y += d.y; Max.x += d.x; Max.y += d.y; }
@@ -693,6 +705,8 @@ struct ImSpan
inline void set(T* data, int size) { Data = data; DataEnd = data + size; }
inline void set(T* data, T* data_end) { Data = data; DataEnd = data_end; }
+ inline void clear() { Data = DataEnd = NULL; }
+ inline bool empty() const { return Data == DataEnd; }
inline int size() const { return (int)(ptrdiff_t)(DataEnd - Data); }
inline int size_in_bytes() const { return (int)(ptrdiff_t)(DataEnd - Data) * (int)sizeof(T); }
inline T& operator[](int i) { T* p = Data + i; IM_ASSERT(p >= Data && p < DataEnd); return *p; }
@@ -832,6 +846,22 @@ struct ImGuiTextIndex
void append(const char* base, int old_size, int new_size);
};
+// Helper: ImGuiPackedDate (sizeof() == 2)
+// Store a date in a way that is efficient to read/write in text form. If we stored e.g. number of days since Epoch we'd need costlier back and forth.
+// This is specifically designed to be able to prune old .ini data.
+struct ImGuiPackedDate
+{
+ ImU16 Year : 7; // Year since 2000 // We can change to another offset e.g. 1970 but this is easier to watch in debugger.
+ ImU16 Month : 4; // Month (1-12)
+ ImU16 Day : 5; // Day (1-31)
+
+ ImGuiPackedDate() { Year = Month = Day = 0; }
+ ImGuiPackedDate(int yyyymmdd) { Year = (ImU16)((yyyymmdd / 10000) - 2000); Month = (ImU16)((yyyymmdd / 100) % 100); Day = (ImU16)(yyyymmdd % 100); } // Pack
+ bool IsValid() { return (Year && Month && Day); }
+ int Unpack() const { return (Year && Month && Day) ? ((Year + 2000) * 10000) + (Month * 100) + Day : 0; } // Unpack
+ void SubtractMonths(int m) { while (m > 0) { Year -= Month == 1; Month = (Month == 1) ? 12 : Month - 1; m--; } } // FIXME-OPT: Stupid but enough for what we do with it.
+};
+
// Helper: ImGuiStorage
IMGUI_API ImGuiStoragePair* ImLowerBound(ImGuiStoragePair* in_begin, ImGuiStoragePair* in_end, ImGuiID key);
@@ -877,7 +907,7 @@ struct IMGUI_API ImDrawListSharedData
float FontSize; // Current font size (used for for simplified AddText overload)
float FontScale; // Current font scale (== FontSize / Font->FontSize)
float CurveTessellationTol; // Tessellation tolerance when using PathBezierCurveTo()
- float CircleSegmentMaxError; // Number of circle segments to use per pixel of radius for AddCircle() etc
+ float CircleTessellationMaxError; // Number of circle segments to use per pixel of radius for AddCircle() etc
float InitialFringeScale; // Initial scale to apply to AA fringe
ImDrawListFlags InitialFlags; // Initial flags at the beginning of the frame (it is possible to alter flags on a per-drawlist basis afterwards)
ImVec4 ClipRectFullscreen; // Value for PushClipRectFullscreen()
@@ -987,7 +1017,7 @@ enum ImGuiItemFlagsPrivate_
ImGuiItemFlags_HasSelectionUserData = 1 << 21, // false // Set by SetNextItemSelectionUserData()
ImGuiItemFlags_IsMultiSelect = 1 << 22, // false // Set by SetNextItemSelectionUserData()
- ImGuiItemFlags_Default_ = ImGuiItemFlags_AutoClosePopups, // Please don't change, use PushItemFlag() instead.
+ ImGuiItemFlags_Default_ = ImGuiItemFlags_AutoClosePopups | ImGuiItemFlags_LiveEditOnInputText, // Please don't change, use PushItemFlag() instead.
// Obsolete
//ImGuiItemFlags_SelectableDontClosePopup = !ImGuiItemFlags_AutoClosePopups, // Can't have a redirect as we inverted the behavior
@@ -1010,6 +1040,7 @@ enum ImGuiItemStatusFlags_
ImGuiItemStatusFlags_HasClipRect = 1 << 9, // g.LastItemData.ClipRect is valid.
ImGuiItemStatusFlags_HasShortcut = 1 << 10, // g.LastItemData.Shortcut valid. Set by SetNextItemShortcut() -> ItemAdd().
//ImGuiItemStatusFlags_FocusedByTabbing = 1 << 8, // Removed IN 1.90.1 (Dec 2023). The trigger is part of g.NavActivateId. See commit 54c1bdeceb.
+ ImGuiItemStatusFlags_EditedInternal = 1 << 11, // Similar to ImGuiItemStatusFlags_Edited but bypassing ImGuiItemFlags_NoMarkEdited.
// Additional status + semantic for ImGuiTestEngine
#ifdef IMGUI_ENABLE_TEST_ENGINE
@@ -1189,7 +1220,7 @@ struct IMGUI_API ImGuiGroupData
ImVec2 BackupCurrLineSize;
float BackupCurrLineTextBaseOffset;
ImGuiID BackupActiveIdIsAlive;
- bool BackupActiveIdHasBeenEditedThisFrame;
+ bool BackupAnyIdHasBeenEditedThisFrame;
bool BackupDeactivatedIdIsAlive;
bool BackupHoveredIdIsAlive;
bool BackupIsSameLine;
@@ -1215,13 +1246,15 @@ struct IMGUI_API ImGuiMenuColumns
};
// Internal temporary state for deactivating InputText() instances.
+// Store as part of ImGuiDeactivatedItemData?
struct IMGUI_API ImGuiInputTextDeactivatedState
{
ImGuiID ID; // widget id owning the text state (which just got deactivated)
+ int ElapseFrame;
ImVector TextA; // text buffer
ImGuiInputTextDeactivatedState() { memset((void*)this, 0, sizeof(*this)); }
- void ClearFreeMemory() { ID = 0; TextA.clear(); }
+ void ClearFreeMemory() { ID = 0; ElapseFrame = 0; TextA.clear(); }
};
// Forward declare imstb_textedit.h structure + make its main configuration define accessible
@@ -1243,6 +1276,7 @@ struct IMGUI_API ImGuiInputTextState
ImStbTexteditState* Stb; // State for stb_textedit.h
ImGuiInputTextFlags Flags; // copy of InputText() flags. may be used to check if e.g. ImGuiInputTextFlags_Password is set.
ImGuiID ID; // widget id owning the text state
+ //int LastFrameActive; // Last used frame-count (unused)
int TextLen; // UTF-8 length of the string in TextA (in bytes)
const char* TextSrc; // == TextA.Data unless read-only, in which case == buf passed to InputText(). For _ReadOnly fields, pointer will be null outside the InputText() call.
ImVector TextA; // main UTF8 buffer. TextA.Size is a buffer size! Should always be >= buf_size passed by user (and of course >= CurLenA + 1).
@@ -1374,7 +1408,7 @@ enum ImGuiNextItemDataFlags_
struct ImGuiNextItemData
{
ImGuiNextItemDataFlags HasFlags; // Called HasFlags instead of Flags to avoid mistaking this
- ImGuiItemFlags ItemFlags; // Currently only tested/used for ImGuiItemFlags_AllowOverlap and ImGuiItemFlags_HasSelectionUserData.
+ ImGuiItemFlags ItemFlagsSet; // Currently only tested/used for ImGuiItemFlags_AllowOverlap and ImGuiItemFlags_HasSelectionUserData.
// Members below are NOT cleared by ItemAdd() meaning they are still valid during e.g. NavProcessItem(). Always rely on HasFlags.
ImGuiID FocusScopeId; // Set by SetNextItemSelectionUserData()
@@ -1389,7 +1423,7 @@ struct ImGuiNextItemData
ImU32 ColorMarker; // Set by SetNextItemColorMarker(). Not exposed yet, supported by DragScalar,SliderScalar and for ImGuiSliderFlags_ColorMarkers.
ImGuiNextItemData() { memset((void*)this, 0, sizeof(*this)); SelectionUserData = -1; }
- inline void ClearFlags() { HasFlags = ImGuiNextItemDataFlags_None; ItemFlags = ImGuiItemFlags_None; } // Also cleared manually by ItemAdd()!
+ inline void ClearFlags() { HasFlags = ImGuiNextItemDataFlags_None; ItemFlagsSet = ImGuiItemFlags_None; } // Also cleared manually by ItemAdd()!
};
// Status storage for the last submitted item
@@ -1468,6 +1502,7 @@ struct ImGuiPtrOrIndex
};
// Data used by IsItemDeactivated()/IsItemDeactivatedAfterEdit() functions
+// Also see ImGuiInputTextDeactivatedState which is an extension for this for InputText()
struct ImGuiDeactivatedItemData
{
ImGuiID ID;
@@ -1715,6 +1750,7 @@ enum ImGuiActivateFlags_
};
// Early work-in-progress API for ScrollToItem()
+// FIXME: Missing flags to request making both edges visible when possible.
enum ImGuiScrollFlags_
{
ImGuiScrollFlags_None = 0,
@@ -1734,8 +1770,8 @@ enum ImGuiNavRenderCursorFlags_
ImGuiNavRenderCursorFlags_None = 0,
ImGuiNavRenderCursorFlags_Compact = 1 << 1, // Compact highlight, no padding/distance from focused item
ImGuiNavRenderCursorFlags_AlwaysDraw = 1 << 2, // Draw rectangular highlight if (g.NavId == id) even when g.NavCursorVisible == false, aka even when using the mouse.
- ImGuiNavRenderCursorFlags_NoRounding = 1 << 3,
#ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS
+ ImGuiNavRenderCursorFlags_NoRounding = 1 << 3,
ImGuiNavHighlightFlags_None = ImGuiNavRenderCursorFlags_None, // Renamed in 1.91.4
ImGuiNavHighlightFlags_Compact = ImGuiNavRenderCursorFlags_Compact, // Renamed in 1.91.4
ImGuiNavHighlightFlags_AlwaysDraw = ImGuiNavRenderCursorFlags_AlwaysDraw, // Renamed in 1.91.4
@@ -1912,6 +1948,7 @@ struct ImGuiBoxSelectState
// Temporary/Transient data
bool UnclipMode; // (Temp/Transient, here in hot area). Set/cleared by the BeginMultiSelect()/EndMultiSelect() owning active box-select.
ImRect UnclipRect; // Rectangle where ItemAdd() clipping may be temporarily disabled. Need support by multi-select supporting widgets.
+ ImRect UnclipRects[2]; // Per-axis versions.
ImRect BoxSelectRectPrev; // Selection rectangle in absolute coordinates (derived every frame from BoxSelectStartPosRel and MousePos)
ImRect BoxSelectRectCurr;
@@ -1934,7 +1971,8 @@ struct IMGUI_API ImGuiMultiSelectTempData
ImGuiMultiSelectFlags Flags;
ImVec2 ScopeRectMin;
ImVec2 BackupCursorMaxPos;
- ImGuiSelectionUserData LastSubmittedItem; // Copy of last submitted item data, used to merge output ranges.
+ //ImGuiSelectionUserData CurrSubmittedItem; // Copy of last submitted item data, used to merge output ranges.
+ //ImGuiSelectionUserData PrevSubmittedItem; // Copy of previous submitted item data, used to merge output ranges.
ImGuiID BoxSelectId;
ImGuiKeyChord KeyMods;
ImS8 LoopRequestSetAll; // -1: no operation, 0: clear all, 1: select all.
@@ -1944,6 +1982,7 @@ struct IMGUI_API ImGuiMultiSelectTempData
bool NavIdPassedBy;
bool RangeSrcPassedBy; // Set by the item that matches RangeSrcItem.
bool RangeDstPassedBy; // Set by the item that matches NavJustMovedToId when IsSetRange is set.
+ bool IsSoleOrUnknownSelectionSize;
ImGuiMultiSelectTempData() { Clear(); }
void Clear() { size_t io_sz = sizeof(IO); ClearIO(); memset((void*)(&IO + 1), 0, sizeof(*this) - io_sz); } // Zero-clear except IO as we preserve IO.Requests[] buffer allocation.
@@ -2022,7 +2061,7 @@ enum ImGuiDockNodeState
ImGuiDockNodeState_HostWindowVisible,
};
-// sizeof() 156~192
+// sizeof() 176~216
struct IMGUI_API ImGuiDockNode
{
ImGuiID ID;
@@ -2039,8 +2078,8 @@ struct IMGUI_API ImGuiDockNode
ImVec2 Size; // Current size
ImVec2 SizeRef; // [Split node only] Last explicitly written-to size (overridden when using a splitter affecting the node), used to calculate Size.
ImGuiAxis SplitAxis; // [Split node only] Split axis (X or Y)
- ImGuiWindowClass WindowClass; // [Root node only]
ImU32 LastBgColor;
+ ImGuiWindowClass WindowClass; // [Root node only]
ImGuiWindow* HostWindow;
ImGuiWindow* VisibleWindow; // Generally point to window which is ID is == SelectedTabID, but when CTRL+Tabbing this can be a different window.
@@ -2054,9 +2093,9 @@ struct IMGUI_API ImGuiDockNode
ImGuiID SelectedTabId; // [Leaf node only] Which of our tab/window is selected.
ImGuiID WantCloseTabId; // [Leaf node only] Set when closing a specific tab/window.
ImGuiID RefViewportId; // Reference viewport ID from visible window when HostWindow == NULL.
- ImGuiDataAuthority AuthorityForPos :3;
- ImGuiDataAuthority AuthorityForSize :3;
- ImGuiDataAuthority AuthorityForViewport :3;
+ ImU8 AuthorityForPos :3; // ImGuiDataAuthority
+ ImU8 AuthorityForSize :3;
+ ImU8 AuthorityForViewport :3;
bool IsVisible :1; // Set to false when the node is hidden (usually disabled as it has no active window)
bool IsFocused :1;
bool IsBgDrawnThisFrame :1;
@@ -2181,23 +2220,35 @@ struct ImGuiViewportP : public ImGuiViewport
// (this is designed to be stored in a ImChunkStream buffer, with the variable-length Name following our structure)
struct ImGuiWindowSettings
{
- ImGuiID ID;
- ImVec2ih Pos; // NB: Settings position are stored RELATIVE to the viewport! Whereas runtime ones are absolute positions.
- ImVec2ih Size;
- ImVec2ih ViewportPos;
- ImGuiID ViewportId;
- ImGuiID DockId; // ID of last known DockNode (even if the DockNode is invisible because it has only 1 active window), or 0 if none.
- ImGuiID ClassId; // ID of window class if specified
- short DockOrder; // Order of the last time the window was visible within its DockNode. This is used to reorder windows that are reappearing on the same frame. Same value between windows that were active and windows that were none are possible.
- bool Collapsed;
- bool IsChild;
- bool WantApply; // Set when loaded from .ini data (to enable merging/loading .ini data into an already running context)
- bool WantDelete; // Set to invalidate/delete the settings entry
+ ImGuiID ID;
+ ImVec2ih Pos; // NB: Settings position are stored RELATIVE to the viewport! Whereas runtime ones are absolute positions.
+ ImVec2ih Size;
+ ImVec2ih ViewportPos;
+ ImGuiID ViewportId;
+ ImGuiID DockId; // ID of last known DockNode (even if the DockNode is invisible because it has only 1 active window), or 0 if none.
+ ImGuiID ClassId; // ID of window class if specified
+ short DockOrder; // Order of the last time the window was visible within its DockNode. This is used to reorder windows that are reappearing on the same frame. Same value between windows that were active and windows that were none are possible.
+ ImGuiPackedDate LastUsedDate;
+ bool Collapsed : 1;
+ bool IsChild : 1;
+ bool WantApply : 1; // Set when loaded from .ini data (to enable merging/loading .ini data into an already running context)
+ bool WantDelete : 1; // Set to invalidate/delete the settings entry
ImGuiWindowSettings() { memset((void*)this, 0, sizeof(*this)); DockOrder = -1; }
char* GetName() { return (char*)(this + 1); }
};
+struct ImGuiSettingsCleanupArgs
+{
+ ImGuiID TypeHashFilter = 0; // Set to restrict cleanup to a given .ini type, e.g. == ImHashStr("Window"), ImHashStr("Table"). Otherwise every types supporting Cleanup will be affected.
+ int DiscardOlderThanMonths = 0; // Enable to discard entries older than XX months.
+ bool DiscardWhenMissingDate = false; // Enable to discard entries missing a date.
+ bool DiscardAll = false; // Enable to discard all entries = same as calling ClearIniSettings() except it may be filtered.
+ bool SetCurrentSessionDateToAll = false; // Enable to write current SessionDate to all supporting entries. // Let us know in #9460 if you use this.
+ bool SetCurrentSessionDateWhenMissingDate = false; // Enable to write current SessionDate to all supporting entries missing a date. // Let us know in #9460 if you use this.
+ int _DiscardOlderThanDate = 0; // [Internal]
+};
+
struct ImGuiSettingsHandler
{
const char* TypeName; // Short description stored in .ini file. Disallowed characters: '[' ']'
@@ -2208,6 +2259,7 @@ struct ImGuiSettingsHandler
void (*ReadLineFn)(ImGuiContext* ctx, ImGuiSettingsHandler* handler, void* entry, const char* line); // Read: Called for every line of text within an ini entry
void (*ApplyAllFn)(ImGuiContext* ctx, ImGuiSettingsHandler* handler); // Read: Called after reading (in registration order)
void (*WriteAllFn)(ImGuiContext* ctx, ImGuiSettingsHandler* handler, ImGuiTextBuffer* out_buf); // Write: Output every entries into 'out_buf'
+ void (*CleanupFn) (ImGuiContext* ctx, ImGuiSettingsHandler* handler, ImGuiSettingsCleanupArgs* args);// Cleanup/patch settings
void* UserData;
ImGuiSettingsHandler() { memset((void*)this, 0, sizeof(*this)); }
@@ -2224,7 +2276,10 @@ enum ImGuiLocKey : int
ImGuiLocKey_TableSizeOne,
ImGuiLocKey_TableSizeAllFit,
ImGuiLocKey_TableSizeAllDefault,
+ ImGuiLocKey_TableReset,
+ //ImGuiLocKey_TableResetAll,
ImGuiLocKey_TableResetOrder,
+ ImGuiLocKey_TableResetVisibility,
ImGuiLocKey_WindowingMainMenuBar,
ImGuiLocKey_WindowingPopup,
ImGuiLocKey_WindowingUntitled,
@@ -2281,8 +2336,9 @@ enum ImGuiDebugLogFlags_
ImGuiDebugLogFlags_EventInputRouting = 1 << 9,
ImGuiDebugLogFlags_EventDocking = 1 << 10,
ImGuiDebugLogFlags_EventViewport = 1 << 11,
+ ImGuiDebugLogFlags_EventTable = 1 << 12,
- ImGuiDebugLogFlags_EventMask_ = ImGuiDebugLogFlags_EventError | ImGuiDebugLogFlags_EventActiveId | ImGuiDebugLogFlags_EventFocus | ImGuiDebugLogFlags_EventPopup | ImGuiDebugLogFlags_EventNav | ImGuiDebugLogFlags_EventClipper | ImGuiDebugLogFlags_EventSelection | ImGuiDebugLogFlags_EventIO | ImGuiDebugLogFlags_EventFont | ImGuiDebugLogFlags_EventInputRouting | ImGuiDebugLogFlags_EventDocking | ImGuiDebugLogFlags_EventViewport,
+ ImGuiDebugLogFlags_EventMask_ = ImGuiDebugLogFlags_EventError | ImGuiDebugLogFlags_EventActiveId | ImGuiDebugLogFlags_EventFocus | ImGuiDebugLogFlags_EventPopup | ImGuiDebugLogFlags_EventNav | ImGuiDebugLogFlags_EventClipper | ImGuiDebugLogFlags_EventSelection | ImGuiDebugLogFlags_EventTable | ImGuiDebugLogFlags_EventIO | ImGuiDebugLogFlags_EventFont | ImGuiDebugLogFlags_EventInputRouting | ImGuiDebugLogFlags_EventDocking | ImGuiDebugLogFlags_EventViewport,
ImGuiDebugLogFlags_OutputToTTY = 1 << 20, // Also send output to TTY
ImGuiDebugLogFlags_OutputToDebugger = 1 << 21, // Also send output to Debugger Console [Windows only]
ImGuiDebugLogFlags_OutputToTestEngine = 1 << 22, // Also send output to Dear ImGui Test Engine
@@ -2321,6 +2377,8 @@ struct ImGuiMetricsConfig
int ShowTablesRectsType = -1;
int HighlightMonitorIdx = -1;
ImGuiID HighlightViewportID = 0;
+ int SettingsDiscardMonths = 6;
+ bool SettingsHighlightOldEntries = false;
bool ShowFontPreview = true;
};
@@ -2410,6 +2468,7 @@ struct ImGuiContext
float CurrentDpiScale; // Current window/viewport DpiScale == CurrentViewport->DpiScale
ImDrawListSharedData DrawListSharedData;
ImGuiID WithinEndChildID; // Set within EndChild()
+ ImGuiID WithinEndPopupID; // Set within EndPopup()
void* TestEngine; // Test engine user data
// Inputs
@@ -2451,10 +2510,13 @@ struct ImGuiContext
bool HoveredIdAllowOverlap;
bool HoveredIdIsDisabled; // At least one widget passed the rect test, but has been discarded by disabled flag or popup inhibit. May be true even if HoveredId == 0.
bool ItemUnclipByLog; // Disable ItemAdd() clipping, essentially a memory-locality friendly copy of LogEnabled
+ bool AnyIdHasBeenEditedThisFrame;
ImGuiID ActiveId; // Active widget
ImGuiID ActiveIdIsAlive; // Active widget has been seen this frame (we can't use a bool as the ActiveId may change within the frame)
float ActiveIdTimer;
bool ActiveIdIsJustActivated; // Set at the time of activation for one frame
+ bool ActiveIdWasSelected; // Active ID was selected at the time of activating
+ bool ActiveIdWasSoleSelected; // Active ID was sole selection at the time of activating
bool ActiveIdAllowOverlap; // Active widget allows another widget to steal active id (generally for overlapping widgets, but not always)
bool ActiveIdNoClearOnFocusLoss; // Disable losing active id if the active id window gets unfocused.
bool ActiveIdHasBeenPressedBefore; // Track whether the active id led to a press (this is to allow changing between PressOnClick and PressOnRelease without pressing twice). Used by range_select branch.
@@ -2471,6 +2533,8 @@ struct ImGuiContext
ImGuiDataTypeStorage ActiveIdValueOnActivation; // Backup of initial value at the time of activation. ONLY SET BY SPECIFIC WIDGETS: DragXXX and SliderXXX.
ImGuiID LastActiveId; // Store the last non-zero ActiveId, useful for animation.
float LastActiveIdTimer; // Store the last non-zero ActiveId timer since the beginning of activation, useful for animation.
+ bool LastActiveIdWasSelected;
+ bool LastActiveIdWasSoleSelected;
// Key/Input Ownership + Shortcut Routing system
// - The idea is that instead of "eating" a given key, we can link to an owner.
@@ -2676,7 +2740,6 @@ struct ImGuiContext
ImGuiDataTypeStorage DataTypeZeroValue; // 0 for all data types
int BeginMenuDepth;
int BeginComboDepth;
- ImGuiColorEditFlags ColorEditOptions; // Store user options for color edit widgets
ImGuiID ColorEditCurrentID; // Set temporarily while inside of the parent-most ColorEdit4/ColorPicker4 (because they call each others).
ImGuiID ColorEditSavedID; // ID we are saving/restoring HS for
float ColorEditSavedHue; // Backup of last Hue associated to LastColor, so we can restore Hue in lossy RGB<>HSV round trips
@@ -2713,6 +2776,7 @@ struct ImGuiContext
void (*DockNodeWindowMenuHandler)(ImGuiContext* ctx, ImGuiDockNode* node, ImGuiTabBar* tab_bar);
// Settings
+ ImGuiPackedDate SessionDate; // Packed copy of platform_io.Platform_SessionDate, when valid.
bool SettingsLoaded;
float SettingsDirtyTimer; // Save .ini Settings to memory when time reaches zero
ImGuiTextBuffer SettingsIniData; // In memory .ini settings
@@ -3098,13 +3162,13 @@ struct IMGUI_API ImGuiTabBar
};
//-----------------------------------------------------------------------------
-// [SECTION] Table support
+// [SECTION] Table support + internal API
//-----------------------------------------------------------------------------
#define IM_COL32_DISABLE IM_COL32(0,0,0,1) // Special sentinel code which cannot be used as a regular color.
#define IMGUI_TABLE_MAX_COLUMNS 512 // Arbitrary "safety" maximum, may be lifted in the future if needed. Must fit in ImGuiTableColumnIdx/ImGuiTableDrawChannelIdx.
-// [Internal] sizeof() ~ 112
+// [Internal] sizeof() ~ 120
// We use the terminology "Enabled" to refer to a column that is not Hidden by user/api.
// We use the terminology "Clipped" to refer to a column that is out of sight because of scrolling/clipping.
// This is in contrast with some user-facing api such as IsItemVisible() / IsRectVisible() which use "Visible" to mean "not clipped".
@@ -3120,7 +3184,8 @@ struct ImGuiTableColumn
float StretchWeight; // Master width weight when (Flags & _WidthStretch). Often around ~1.0f initially.
float InitStretchWeightOrWidth; // Value passed to TableSetupColumn(). For Width it is a content width (_without padding_).
ImRect ClipRect; // Clipping rectangle for the column
- ImGuiID UserID; // Optional, value passed to TableSetupColumn()
+ ImGuiID ID; // Hash of column name (ignoring top of ID stack), used for .ini persistence when available.
+ ImGuiID UserData; // (Optional) User data value passed to TableSetupColumn()
float WorkMinX; // Contents region min ~(MinX + CellPaddingX + CellSpacingX1) == cursor start position when entering column
float WorkMaxX; // Contents region max ~(MaxX - CellPaddingX - CellSpacingX2)
float ItemWidth; // Current item width for the column, preserved across rows
@@ -3144,10 +3209,14 @@ struct ImGuiTableColumn
bool IsVisibleY;
bool IsRequestOutput; // Return value for TableSetColumnIndex() / TableNextColumn(): whether we request user to output contents or not.
bool IsSkipItems; // Do we want item submissions to this column to be completely ignored (no layout will happen).
- bool IsPreserveWidthAuto;
+ bool IsPreserveWidthAuto : 1;
+ bool IsJustCreated : 1;
+ bool IsLoadedSettings : 1;
+ bool IsNeedReconcileSrc : 1;
+ bool IsNeedReconcileDst : 1;
ImS8 NavLayerCurrent; // ImGuiNavLayer in 1 byte
- ImU8 AutoFitQueue; // Queue of 8 values for the next 8 frames to request auto-fit
- ImU8 CannotSkipItemsQueue; // Queue of 8 values for the next 8 frames to disable Clipped/SkipItem
+ ImU8 AutoFitQueue : 4; // Queue of 4 values for the next 4 frames to request auto-fit
+ ImU8 CannotSkipItemsQueue : 4; // Queue of 4 values for the next 4 frames to disable Clipped/SkipItem
ImU8 SortDirection : 2; // ImGuiSortDirection_Ascending or ImGuiSortDirection_Descending
ImU8 SortDirectionsAvailCount : 2; // Number of available sort directions (0 to 3)
ImU8 SortDirectionsAvailMask : 4; // Mask of available sort directions (1-bit each)
@@ -3162,10 +3231,28 @@ struct ImGuiTableColumn
PrevEnabledColumn = NextEnabledColumn = -1;
SortOrder = -1;
SortDirection = ImGuiSortDirection_None;
+ IsJustCreated = true;
DrawChannelCurrent = DrawChannelFrozen = DrawChannelUnfrozen = (ImU8)-1;
}
};
+// Passed to TableSetupColumn()
+// sizeof() ~ 24+120 bytes
+struct ImGuiTableReconcileColumnData
+{
+ // Setup data
+ ImGuiID ID;
+ ImS16 NameOffset;
+ ImGuiTableColumnFlags Flags;
+ float InitWidthOrWeight;
+ ImGuiID UserData;
+
+ // Reconcile data
+ ImGuiTableColumnIdx ColumnNewIdx; // Index in the current table.
+ ImGuiTableColumnIdx ColumnOldIdx; // Index in the previous frame table.
+ ImGuiTableColumn ColumnOldData; // Full backup of the column. Could be avoided by storing 1 of them and applying reconcile in the right order. Not worth bothering.
+};
+
// Transient cell data stored per row.
// sizeof() ~ 6 bytes
struct ImGuiTableCellData
@@ -3299,6 +3386,7 @@ struct IMGUI_API ImGuiTable
bool IsLayoutLocked; // Set by TableUpdateLayout() which is called when beginning the first row.
bool IsInsideRow; // Set when inside TableBeginRow()/TableEndRow().
bool IsInitializing;
+ bool IsReconcileMode;
bool IsSortSpecsDirty;
bool IsUsingHeaders; // Set when the first row had the ImGuiTableRowFlags_Headers flag.
bool IsContextPopupOpen; // Set when default context menu is open (also see: ContextPopupColumn, InstanceInteracted).
@@ -3306,8 +3394,10 @@ struct IMGUI_API ImGuiTable
bool IsSettingsRequestLoad;
bool IsSettingsDirty; // Set when table settings have changed and needs to be reported into ImGuiTableSettings data.
bool IsDefaultDisplayOrder; // Set when display order is unchanged from default (DisplayOrder contains 0...Count-1)
- bool IsResetAllRequest;
+ bool IsDefaultVisibility; // Set when enabled/visibility is unchanged from default
+ bool IsResetAllRequest; // Set to queue a call to TableResetSettings() in BeginTable()
bool IsResetDisplayOrderRequest;
+ bool IsResetVisibilityRequest;
bool IsUnfrozenRows; // Set when we got past the frozen row.
bool IsDefaultSizingPolicy; // Set if user didn't explicitly set a sizing policy in BeginTable()
bool IsActiveIdAliveBeforeTable;
@@ -3325,14 +3415,19 @@ struct IMGUI_API ImGuiTable
// - Accessing those requires chasing an extra pointer so for very frequently used data we leave them in the main table structure.
// - We also leave out of this structure data that tend to be particularly useful for debugging/metrics.
// FIXME-TABLE: more transient data could be stored in a stacked ImGuiTableTempData: e.g. SortSpecs.
-// sizeof() ~ 136 bytes.
+// sizeof() ~ 176 bytes.
struct IMGUI_API ImGuiTableTempData
{
ImGuiID WindowID; // Shortcut to g.Tables[TableIndex]->OuterWindow->ID.
int TableIndex; // Index in g.Tables.Buf[] pool
float LastTimeActive; // Last timestamp this structure was used
float AngledHeadersExtraWidth; // Used in EndTable()
- ImVector AngledHeadersRequests; // Used in TableAngledHeadersRow()
+ ImVector AngledHeadersRequests; // Used in TableAngledHeadersRow() // FIXME: Single instance is enough?
+
+ // Topology change
+ ImVector ReconcileColumnsRequests; // Used in TableSetupColumn(), TableUpdateLayout(). Cleared every frame.
+ void* OldColumnsRawData; // Used in BeginTable() -> TableUpdateLayout() when resizing.
+ ImSpan OldColumnsData;
ImVec2 UserOuterSize; // outer_size.x passed to BeginTable()
ImDrawListSplitter DrawSplitter;
@@ -3353,23 +3448,25 @@ struct IMGUI_API ImGuiTableTempData
struct ImGuiTableColumnSettings
{
float WidthOrWeight;
- ImGuiID UserID;
+ ImGuiID ID;
ImGuiTableColumnIdx Index;
ImGuiTableColumnIdx DisplayOrder;
ImGuiTableColumnIdx SortOrder;
ImU8 SortDirection : 2;
- ImS8 IsEnabled : 2; // "Visible" in ini file
+ ImS8 IsEnabled : 2; // "Visible" in .ini file
ImU8 IsStretch : 1;
+ bool IsLoaded : 1; // Using during loading to mark finding a matching column.
ImGuiTableColumnSettings()
{
WidthOrWeight = 0.0f;
- UserID = 0;
+ ID = 0;
Index = -1;
DisplayOrder = SortOrder = -1;
SortDirection = ImGuiSortDirection_None;
IsEnabled = -1;
IsStretch = 0;
+ IsLoaded = false;
}
};
@@ -3381,12 +3478,94 @@ struct ImGuiTableSettings
float RefScale; // Reference scale to be able to rescale columns on font/dpi changes.
ImGuiTableColumnIdx ColumnsCount;
ImGuiTableColumnIdx ColumnsCountMax; // Maximum number of columns this settings instance can store, we can recycle a settings instance with lower number of columns but not higher
- bool WantApply; // Set when loaded from .ini data (to enable merging/loading .ini data into an already running context)
+ ImGuiPackedDate LastUsedDate;
+ bool WantApply : 1; // Set when loaded from .ini data (to enable merging/loading .ini data into an already running context)
ImGuiTableSettings() { memset((void*)this, 0, sizeof(*this)); }
ImGuiTableColumnSettings* GetColumnSettings() { return (ImGuiTableColumnSettings*)(this + 1); }
};
+namespace ImGui
+{
+ // Tables: Candidates for public API
+ IMGUI_API void TableOpenContextMenu(int column_n = -1);
+ IMGUI_API void TableSetColumnWidth(int column_n, float width);
+ IMGUI_API void TableSetColumnSortDirection(int column_n, ImGuiSortDirection sort_direction, bool append_to_sort_specs);
+ IMGUI_API int TableGetHoveredRow(); // Retrieve *PREVIOUS FRAME* hovered row. This difference with TableGetHoveredColumn() is the reason why this is not public yet.
+ IMGUI_API float TableGetHeaderRowHeight();
+ IMGUI_API float TableGetHeaderAngledMaxLabelWidth();
+ IMGUI_API void TablePushBackgroundChannel();
+ IMGUI_API void TablePopBackgroundChannel();
+ IMGUI_API void TablePushColumnChannel(int column_n);
+ IMGUI_API void TablePopColumnChannel();
+ IMGUI_API void TableAngledHeadersRowEx(ImGuiID row_id, float angle, float max_label_width, const ImGuiTableHeaderData* data, int data_count);
+
+ // Tables: Internals
+ inline ImGuiTable* GetCurrentTable() { ImGuiContext& g = *GImGui; return g.CurrentTable; }
+ IMGUI_API ImGuiTable* TableFindByID(ImGuiID id);
+ IMGUI_API bool BeginTableEx(const char* name, ImGuiID id, int columns_count, ImGuiTableFlags flags = 0, const ImVec2& outer_size = ImVec2(0, 0), float inner_width = 0.0f);
+ IMGUI_API void TableBeginInitMemory(ImGuiTable* table, int columns_count);
+ IMGUI_API void TableApplyQueuedRequests(ImGuiTable* table);
+ IMGUI_API void TableSetupDrawChannels(ImGuiTable* table);
+ IMGUI_API void TableReconcileColumns(ImGuiTable* table);
+ IMGUI_API void TableUpdateLayout(ImGuiTable* table);
+ IMGUI_API void TableUpdateBorders(ImGuiTable* table);
+ IMGUI_API void TableUpdateColumnsWeightFromWidth(ImGuiTable* table);
+ IMGUI_API void TableApplyExternalUnclipRect(ImGuiTable* table, ImRect& rect);
+ IMGUI_API void TableDrawBorders(ImGuiTable* table);
+ IMGUI_API void TableDrawDefaultContextMenu(ImGuiTable* table, ImGuiTableFlags flags_for_section_to_display);
+ IMGUI_API bool TableBeginContextMenuPopup(ImGuiTable* table);
+ IMGUI_API void TableMergeDrawChannels(ImGuiTable* table);
+ inline ImGuiTableInstanceData* TableGetInstanceData(ImGuiTable* table, int instance_no) { if (instance_no == 0) return &table->InstanceDataFirst; return &table->InstanceDataExtra[instance_no - 1]; }
+ inline ImGuiID TableGetInstanceID(ImGuiTable* table, int instance_no) { return TableGetInstanceData(table, instance_no)->TableInstanceID; }
+ IMGUI_API void TableFixDisplayOrder(ImGuiTable* table);
+ IMGUI_API void TableSortSpecsSanitize(ImGuiTable* table);
+ IMGUI_API void TableSortSpecsBuild(ImGuiTable* table);
+ IMGUI_API void TableInitColumnDefaults(ImGuiTable* table, ImGuiTableColumn* column, ImGuiTableColumnFlags init_mask);
+ IMGUI_API ImGuiSortDirection TableGetColumnNextSortDirection(ImGuiTableColumn* column);
+ IMGUI_API void TableFixColumnSortDirection(ImGuiTable* table, ImGuiTableColumn* column);
+ IMGUI_API float TableGetColumnWidthAuto(ImGuiTable* table, ImGuiTableColumn* column);
+ IMGUI_API void TableBeginRow(ImGuiTable* table);
+ IMGUI_API void TableEndRow(ImGuiTable* table);
+ IMGUI_API void TableBeginCell(ImGuiTable* table, int column_n);
+ IMGUI_API void TableEndCell(ImGuiTable* table);
+ IMGUI_API ImRect TableGetCellBgRect(const ImGuiTable* table, int column_n);
+ IMGUI_API const char* TableGetColumnName(const ImGuiTable* table, int column_n);
+ IMGUI_API ImGuiID TableGetColumnResizeID(ImGuiTable* table, int column_n, int instance_no = 0);
+ IMGUI_API float TableCalcMaxColumnWidth(const ImGuiTable* table, int column_n);
+ IMGUI_API void TableSetColumnWidthAutoSingle(ImGuiTable* table, int column_n);
+ IMGUI_API void TableSetColumnWidthAutoAll(ImGuiTable* table);
+ IMGUI_API void TableSetColumnDisplayOrder(ImGuiTable* table, int column_n, int dst_order);
+ IMGUI_API void TableQueueSetColumnDisplayOrder(ImGuiTable* table, int column_n, int dst_order);
+ IMGUI_API void TableRemove(ImGuiTable* table);
+ IMGUI_API void TableGcCompactTransientBuffers(ImGuiTable* table);
+ IMGUI_API void TableGcCompactTransientBuffers(ImGuiTableTempData* table);
+ IMGUI_API void TableGcCompactSettings();
+
+ // Tables: Settings
+ IMGUI_API void TableLoadSettings(ImGuiTable* table);
+ IMGUI_API void TableLoadSettingsForColumns(ImGuiTable* table);
+ IMGUI_API void TableLoadSettingsForColumn(ImGuiTableColumn* column, ImGuiTableColumnSettings* column_settings, ImGuiTableFlags load_flags);
+ IMGUI_API void TableSaveSettings(ImGuiTable* table);
+ IMGUI_API void TableResetSettings(ImGuiTable* table);
+ IMGUI_API ImGuiTableSettings* TableGetBoundSettings(ImGuiTable* table);
+ IMGUI_API void TableSettingsAddSettingsHandler();
+ IMGUI_API ImGuiTableSettings* TableSettingsCreate(ImGuiID id, int columns_count);
+ IMGUI_API ImGuiTableSettings* TableSettingsFindByID(ImGuiID id);
+
+ // Legacy Columns API (this is not exposed because we will encourage transitioning to the Tables API)
+ IMGUI_API void SetWindowClipRectBeforeSetChannel(ImGuiWindow* window, const ImRect& clip_rect);
+ IMGUI_API void BeginColumns(const char* str_id, int count, ImGuiOldColumnFlags flags = 0); // setup number of columns. use an identifier to distinguish multiple column sets. close with EndColumns().
+ IMGUI_API void EndColumns(); // close columns
+ IMGUI_API void PushColumnClipRect(int column_index);
+ IMGUI_API void PushColumnsBackground();
+ IMGUI_API void PopColumnsBackground();
+ IMGUI_API ImGuiID GetColumnsID(const char* str_id, int count);
+ IMGUI_API ImGuiOldColumns* FindOrCreateColumns(ImGuiWindow* window, ImGuiID id);
+ IMGUI_API float GetColumnOffsetFromNorm(const ImGuiOldColumns* columns, float offset_norm);
+ IMGUI_API float GetColumnNormFromOffset(const ImGuiOldColumns* columns, float offset);
+}
+
//-----------------------------------------------------------------------------
// [SECTION] ImGui internal API
// No guarantee of forward compatibility here!
@@ -3439,7 +3618,7 @@ namespace ImGui
IMGUI_API void SetNextWindowRefreshPolicy(ImGuiWindowRefreshFlags flags);
// Fonts, drawing
- IMGUI_API void RegisterUserTexture(ImTextureData* tex); // Register external texture. EXPERIMENTAL: DO NOT USE YET.
+ IMGUI_API void RegisterUserTexture(ImTextureData* tex); // Register external texture. EXPERIMENTAL.
IMGUI_API void UnregisterUserTexture(ImTextureData* tex);
IMGUI_API void RegisterFontAtlas(ImFontAtlas* atlas);
IMGUI_API void UnregisterFontAtlas(ImFontAtlas* atlas);
@@ -3487,6 +3666,7 @@ namespace ImGui
IMGUI_API void MarkIniSettingsDirty();
IMGUI_API void MarkIniSettingsDirty(ImGuiWindow* window);
IMGUI_API void ClearIniSettings();
+ IMGUI_API void CleanupIniSettings(ImGuiSettingsCleanupArgs* args); // [BETA] Expected to turn into a public API. Please report if you are using this!
IMGUI_API void AddSettingsHandler(const ImGuiSettingsHandler* handler);
IMGUI_API void RemoveSettingsHandler(const char* type_name);
IMGUI_API ImGuiSettingsHandler* FindSettingsHandler(const char* type_name);
@@ -3557,11 +3737,12 @@ namespace ImGui
// Childs
IMGUI_API bool BeginChildEx(const char* name, ImGuiID id, const ImVec2& size_arg, ImGuiChildFlags child_flags, ImGuiWindowFlags window_flags);
+ IMGUI_API ImGuiWindow* FindFrontMostVisibleChildWindow(ImGuiWindow* window);
// Popups, Modals
IMGUI_API bool BeginPopupEx(ImGuiID id, ImGuiWindowFlags extra_window_flags);
IMGUI_API bool BeginPopupMenuEx(ImGuiID id, const char* label, ImGuiWindowFlags extra_window_flags);
- IMGUI_API void OpenPopupEx(ImGuiID id, ImGuiPopupFlags popup_flags = ImGuiPopupFlags_None);
+ IMGUI_API bool OpenPopupEx(ImGuiID id, ImGuiPopupFlags popup_flags = ImGuiPopupFlags_None);
IMGUI_API void ClosePopupToLevel(int remaining, bool restore_focus_to_window_under_popup);
IMGUI_API void ClosePopupsOverWindow(ImGuiWindow* ref_window, bool restore_focus_to_window_under_popup);
IMGUI_API void ClosePopupsExceptModals();
@@ -3662,7 +3843,7 @@ namespace ImGui
IMGUI_API ImGuiID GetKeyOwner(ImGuiKey key);
IMGUI_API void SetKeyOwner(ImGuiKey key, ImGuiID owner_id, ImGuiInputFlags flags = 0);
IMGUI_API void SetKeyOwnersForKeyChord(ImGuiKeyChord key, ImGuiID owner_id, ImGuiInputFlags flags = 0);
- IMGUI_API void SetItemKeyOwner(ImGuiKey key, ImGuiInputFlags flags); // Set key owner to last item if it is hovered or active. Equivalent to 'if (IsItemHovered() || IsItemActive()) { SetKeyOwner(key, GetItemID());'.
+ IMGUI_API bool SetItemKeyOwner(ImGuiKey key, ImGuiInputFlags flags);
IMGUI_API bool TestKeyOwner(ImGuiKey key, ImGuiID owner_id); // Test that key is either not owned, either owned by 'owner_id'
inline ImGuiKeyOwnerData* GetKeyOwnerData(ImGuiContext* ctx, ImGuiKey key) { if (key & ImGuiMod_Mask_) key = ConvertSingleModFlagToKey(key); IM_ASSERT(IsNamedKey(key)); return &ctx->KeysOwnerData[key - ImGuiKey_NamedKey_BEGIN]; }
@@ -3765,6 +3946,7 @@ namespace ImGui
// We don't use the ID Stack for this as it is common to want them separate.
IMGUI_API void PushFocusScope(ImGuiID id);
IMGUI_API void PopFocusScope();
+ IMGUI_API bool IsInNavFocusRoute(ImGuiID focus_scope_id);
inline ImGuiID GetCurrentFocusScope() { ImGuiContext& g = *GImGui; return g.CurrentFocusScopeId; } // Focus scope we are outputting into, set by PushFocusScope()
// Drag and Drop
@@ -3774,7 +3956,7 @@ namespace ImGui
IMGUI_API void ClearDragDrop();
IMGUI_API bool IsDragDropPayloadBeingAccepted();
IMGUI_API void RenderDragDropTargetRectForItem(const ImRect& bb);
- IMGUI_API void RenderDragDropTargetRectEx(ImDrawList* draw_list, const ImRect& bb);
+ IMGUI_API void RenderDragDropTargetRectEx(ImDrawList* draw_list, const ImRect& bb, float rounding);
// Typing-Select API
// (provide Windows Explorer style "select items by typing partial name" + "cycle through items by typing same letter" feature)
@@ -3790,85 +3972,12 @@ namespace ImGui
// Multi-Select API
IMGUI_API void MultiSelectItemHeader(ImGuiID id, bool* p_selected, ImGuiButtonFlags* p_button_flags);
- IMGUI_API void MultiSelectItemFooter(ImGuiID id, bool* p_selected, bool* p_pressed);
+ IMGUI_API void MultiSelectItemFooter(ImGuiID id, bool* p_selected, bool* p_pressed, ImGuiMultiSelectFlags extra_flags = 0);
IMGUI_API void MultiSelectAddSetAll(ImGuiMultiSelectTempData* ms, bool selected);
IMGUI_API void MultiSelectAddSetRange(ImGuiMultiSelectTempData* ms, bool selected, int range_dir, ImGuiSelectionUserData first_item, ImGuiSelectionUserData last_item);
inline ImGuiBoxSelectState* GetBoxSelectState(ImGuiID id) { ImGuiContext& g = *GImGui; return (id != 0 && g.BoxSelectState.ID == id && g.BoxSelectState.IsActive) ? &g.BoxSelectState : NULL; }
inline ImGuiMultiSelectState* GetMultiSelectState(ImGuiID id) { ImGuiContext& g = *GImGui; return g.MultiSelectStorage.GetByKey(id); }
- // Internal Columns API (this is not exposed because we will encourage transitioning to the Tables API)
- IMGUI_API void SetWindowClipRectBeforeSetChannel(ImGuiWindow* window, const ImRect& clip_rect);
- IMGUI_API void BeginColumns(const char* str_id, int count, ImGuiOldColumnFlags flags = 0); // setup number of columns. use an identifier to distinguish multiple column sets. close with EndColumns().
- IMGUI_API void EndColumns(); // close columns
- IMGUI_API void PushColumnClipRect(int column_index);
- IMGUI_API void PushColumnsBackground();
- IMGUI_API void PopColumnsBackground();
- IMGUI_API ImGuiID GetColumnsID(const char* str_id, int count);
- IMGUI_API ImGuiOldColumns* FindOrCreateColumns(ImGuiWindow* window, ImGuiID id);
- IMGUI_API float GetColumnOffsetFromNorm(const ImGuiOldColumns* columns, float offset_norm);
- IMGUI_API float GetColumnNormFromOffset(const ImGuiOldColumns* columns, float offset);
-
- // Tables: Candidates for public API
- IMGUI_API void TableOpenContextMenu(int column_n = -1);
- IMGUI_API void TableSetColumnWidth(int column_n, float width);
- IMGUI_API void TableSetColumnSortDirection(int column_n, ImGuiSortDirection sort_direction, bool append_to_sort_specs);
- IMGUI_API int TableGetHoveredRow(); // Retrieve *PREVIOUS FRAME* hovered row. This difference with TableGetHoveredColumn() is the reason why this is not public yet.
- IMGUI_API float TableGetHeaderRowHeight();
- IMGUI_API float TableGetHeaderAngledMaxLabelWidth();
- IMGUI_API void TablePushBackgroundChannel();
- IMGUI_API void TablePopBackgroundChannel();
- IMGUI_API void TablePushColumnChannel(int column_n);
- IMGUI_API void TablePopColumnChannel();
- IMGUI_API void TableAngledHeadersRowEx(ImGuiID row_id, float angle, float max_label_width, const ImGuiTableHeaderData* data, int data_count);
-
- // Tables: Internals
- inline ImGuiTable* GetCurrentTable() { ImGuiContext& g = *GImGui; return g.CurrentTable; }
- IMGUI_API ImGuiTable* TableFindByID(ImGuiID id);
- IMGUI_API bool BeginTableEx(const char* name, ImGuiID id, int columns_count, ImGuiTableFlags flags = 0, const ImVec2& outer_size = ImVec2(0, 0), float inner_width = 0.0f);
- IMGUI_API void TableBeginInitMemory(ImGuiTable* table, int columns_count);
- IMGUI_API void TableBeginApplyRequests(ImGuiTable* table);
- IMGUI_API void TableSetupDrawChannels(ImGuiTable* table);
- IMGUI_API void TableUpdateLayout(ImGuiTable* table);
- IMGUI_API void TableUpdateBorders(ImGuiTable* table);
- IMGUI_API void TableUpdateColumnsWeightFromWidth(ImGuiTable* table);
- IMGUI_API void TableDrawBorders(ImGuiTable* table);
- IMGUI_API void TableDrawDefaultContextMenu(ImGuiTable* table, ImGuiTableFlags flags_for_section_to_display);
- IMGUI_API bool TableBeginContextMenuPopup(ImGuiTable* table);
- IMGUI_API void TableMergeDrawChannels(ImGuiTable* table);
- inline ImGuiTableInstanceData* TableGetInstanceData(ImGuiTable* table, int instance_no) { if (instance_no == 0) return &table->InstanceDataFirst; return &table->InstanceDataExtra[instance_no - 1]; }
- inline ImGuiID TableGetInstanceID(ImGuiTable* table, int instance_no) { return TableGetInstanceData(table, instance_no)->TableInstanceID; }
- IMGUI_API void TableFixDisplayOrder(ImGuiTable* table);
- IMGUI_API void TableSortSpecsSanitize(ImGuiTable* table);
- IMGUI_API void TableSortSpecsBuild(ImGuiTable* table);
- IMGUI_API ImGuiSortDirection TableGetColumnNextSortDirection(ImGuiTableColumn* column);
- IMGUI_API void TableFixColumnSortDirection(ImGuiTable* table, ImGuiTableColumn* column);
- IMGUI_API float TableGetColumnWidthAuto(ImGuiTable* table, ImGuiTableColumn* column);
- IMGUI_API void TableBeginRow(ImGuiTable* table);
- IMGUI_API void TableEndRow(ImGuiTable* table);
- IMGUI_API void TableBeginCell(ImGuiTable* table, int column_n);
- IMGUI_API void TableEndCell(ImGuiTable* table);
- IMGUI_API ImRect TableGetCellBgRect(const ImGuiTable* table, int column_n);
- IMGUI_API const char* TableGetColumnName(const ImGuiTable* table, int column_n);
- IMGUI_API ImGuiID TableGetColumnResizeID(ImGuiTable* table, int column_n, int instance_no = 0);
- IMGUI_API float TableCalcMaxColumnWidth(const ImGuiTable* table, int column_n);
- IMGUI_API void TableSetColumnWidthAutoSingle(ImGuiTable* table, int column_n);
- IMGUI_API void TableSetColumnWidthAutoAll(ImGuiTable* table);
- IMGUI_API void TableSetColumnDisplayOrder(ImGuiTable* table, int column_n, int dst_order);
- IMGUI_API void TableQueueSetColumnDisplayOrder(ImGuiTable* table, int column_n, int dst_order);
- IMGUI_API void TableRemove(ImGuiTable* table);
- IMGUI_API void TableGcCompactTransientBuffers(ImGuiTable* table);
- IMGUI_API void TableGcCompactTransientBuffers(ImGuiTableTempData* table);
- IMGUI_API void TableGcCompactSettings();
-
- // Tables: Settings
- IMGUI_API void TableLoadSettings(ImGuiTable* table);
- IMGUI_API void TableSaveSettings(ImGuiTable* table);
- IMGUI_API void TableResetSettings(ImGuiTable* table);
- IMGUI_API ImGuiTableSettings* TableGetBoundSettings(ImGuiTable* table);
- IMGUI_API void TableSettingsAddSettingsHandler();
- IMGUI_API ImGuiTableSettings* TableSettingsCreate(ImGuiID id, int columns_count);
- IMGUI_API ImGuiTableSettings* TableSettingsFindByID(ImGuiID id);
-
// Tab Bars
inline ImGuiTabBar* GetCurrentTabBar() { ImGuiContext& g = *GImGui; return g.CurrentTabBar; }
IMGUI_API ImGuiTabBar* TabBarFindByID(ImGuiID id);
@@ -3907,7 +4016,7 @@ namespace ImGui
IMGUI_API void RenderFrameBorder(ImVec2 p_min, ImVec2 p_max, float rounding = 0.0f);
IMGUI_API void RenderColorComponentMarker(const ImRect& bb, ImU32 col, float rounding);
IMGUI_API void RenderColorRectWithAlphaCheckerboard(ImDrawList* draw_list, ImVec2 p_min, ImVec2 p_max, ImU32 fill_col, float grid_step, ImVec2 grid_off, float rounding = 0.0f, ImDrawFlags flags = 0);
- IMGUI_API void RenderNavCursor(const ImRect& bb, ImGuiID id, ImGuiNavRenderCursorFlags flags = ImGuiNavRenderCursorFlags_None); // Navigation highlight
+ IMGUI_API void RenderNavCursor(const ImRect& bb, ImGuiID id, ImGuiNavRenderCursorFlags flags = ImGuiNavRenderCursorFlags_None, float rounding = -1.0f); // Navigation highlight
#ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS
inline void RenderNavHighlight(const ImRect& bb, ImGuiID id, ImGuiNavRenderCursorFlags flags = ImGuiNavRenderCursorFlags_None) { RenderNavCursor(bb, id, flags); } // Renamed in 1.91.4
#endif
@@ -3987,7 +4096,7 @@ namespace ImGui
IMGUI_API void InputTextDeactivateHook(ImGuiID id);
IMGUI_API bool TempInputText(const ImRect& bb, ImGuiID id, const char* label, char* buf, size_t buf_size, ImGuiInputTextFlags flags = 0, ImGuiInputTextCallback callback = NULL, void* user_data = NULL);
IMGUI_API bool TempInputScalar(const ImRect& bb, ImGuiID id, const char* label, ImGuiDataType data_type, void* p_data, const char* format, const void* p_clamp_min = NULL, const void* p_clamp_max = NULL);
- inline bool TempInputIsActive(ImGuiID id) { ImGuiContext& g = *GImGui; return g.ActiveId == id && g.TempInputId == id; }
+ inline bool TempInputIsActive(ImGuiID id) { ImGuiContext& g = *GImGui; return (g.TempInputId == id && g.ActiveId == id) || (g.InputTextDeactivatedState.ID == id); }
inline ImGuiInputTextState* GetInputTextState(ImGuiID id) { ImGuiContext& g = *GImGui; return (id != 0 && g.InputTextState.ID == id) ? &g.InputTextState : NULL; } // Get input text state if active
IMGUI_API void SetNextItemRefVal(ImGuiDataType data_type, void* p_data);
inline bool IsItemActiveAsInputText() { ImGuiContext& g = *GImGui; return g.ActiveId != 0 && g.ActiveId == g.LastItemData.ID && g.InputTextState.ID == g.LastItemData.ID; } // This may be useful to apply workaround that a based on distinguish whenever an item is active as a text input field.
@@ -4050,7 +4159,7 @@ namespace ImGui
IMGUI_API void DebugNodeStorage(ImGuiStorage* storage, const char* label);
IMGUI_API void DebugNodeTabBar(ImGuiTabBar* tab_bar, const char* label);
IMGUI_API void DebugNodeTable(ImGuiTable* table);
- IMGUI_API void DebugNodeTableSettings(ImGuiTableSettings* settings);
+ IMGUI_API void DebugNodeTableSettings(ImGuiTableSettings* settings, ImGuiTable* table);
IMGUI_API void DebugNodeInputTextState(ImGuiInputTextState* state);
IMGUI_API void DebugNodeTypingSelectState(ImGuiTypingSelectState* state);
IMGUI_API void DebugNodeMultiSelectState(ImGuiMultiSelectState* state);
@@ -4261,6 +4370,8 @@ IMGUI_API void ImFontAtlasTextureBlockFill(ImTextureData* dst_tex,
IMGUI_API void ImFontAtlasTextureBlockCopy(ImTextureData* src_tex, int src_x, int src_y, ImTextureData* dst_tex, int dst_x, int dst_y, int w, int h);
IMGUI_API void ImFontAtlasTextureBlockQueueUpload(ImFontAtlas* atlas, ImTextureData* tex, int x, int y, int w, int h);
+IMGUI_API bool ImTextureDataUpdateNewFrame(ImTextureData* tex);
+IMGUI_API void ImTextureDataQueueUpload(ImTextureData* tex, int x, int y, int w, int h);
IMGUI_API int ImTextureDataGetFormatBytesPerPixel(ImTextureFormat format);
IMGUI_API const char* ImTextureDataGetStatusName(ImTextureStatus status);
IMGUI_API const char* ImTextureDataGetFormatName(ImTextureFormat format);
diff --git a/include/imgui/imgui_tables.cpp b/include/imgui/imgui_tables.cpp
index 9b523bf..f8fab37 100644
--- a/include/imgui/imgui_tables.cpp
+++ b/include/imgui/imgui_tables.cpp
@@ -1,4 +1,4 @@
-// dear imgui, v1.92.7
+// dear imgui, v1.92.9b
// (tables and columns code)
/*
@@ -40,13 +40,15 @@ Index of this file:
// | TableBeginInitMemory() - first time table is used
// | TableResetSettings() - on settings reset
// | TableLoadSettings() - on settings load
-// | TableBeginApplyRequests() - apply queued resizing/reordering/hiding requests
-// | - TableSetColumnWidth() - apply resizing width (for mouse resize, often requested by previous frame)
-// | - TableUpdateColumnsWeightFromWidth()- recompute columns weights (of stretch columns) from their respective width
+//-----------------------------------------------------------------------------
// - TableSetupColumn() user submit columns details (optional)
// - TableSetupScrollFreeze() user submit scroll freeze information (optional)
//-----------------------------------------------------------------------------
// - TableUpdateLayout() [Internal] followup to BeginTable(): setup everything: widths, columns positions, clipping rectangles. Automatically called by the FIRST call to TableNextRow() or TableHeadersRow().
+// | TableApplyQueuedRequests() - apply queued resizing/reordering/hiding requests
+// | - TableSetColumnWidth() - apply resizing width (for mouse resize, often requested by previous frame)
+// | - TableUpdateColumnsWeightFromWidth()- recompute columns weights (of stretch columns) from their respective width
+// | - TableSetColumnDisplayOrder() - apply reordering a column
// | TableSetupDrawChannels() - setup ImDrawList channels
// | TableUpdateBorders() - detect hovering columns for resize, ahead of contents submission
// | TableBeginContextMenuPopup()
@@ -240,6 +242,7 @@ Index of this file:
#pragma GCC diagnostic ignored "-Wformat" // warning: format '%p' expects argument of type 'int'/'void*', but argument X has type 'unsigned int'/'ImGuiWindow*'
#pragma GCC diagnostic ignored "-Wstrict-overflow"
#pragma GCC diagnostic ignored "-Wclass-memaccess" // [__GNUC__ >= 8] warning: 'memset/memcpy' clearing/writing an object of type 'xxxx' with no trivial copy-assignment; use assignment or value-initialization instead
+#pragma GCC diagnostic ignored "-Wconversion" // warning: conversion to 'xxxx' from 'xxxx' may change value
#pragma GCC diagnostic ignored "-Wsign-conversion" // warning: conversion to 'xxxx' from 'xxxx' may change the sign of the result
#endif
@@ -251,7 +254,7 @@ Index of this file:
// - BeginTable()
// - BeginTableEx() [Internal]
// - TableBeginInitMemory() [Internal]
-// - TableBeginApplyRequests() [Internal]
+// - TableApplyQueuedRequests() [Internal]
// - TableSetupColumnFlags() [Internal]
// - TableUpdateLayout() [Internal]
// - TableUpdateBorders() [Internal]
@@ -360,6 +363,7 @@ bool ImGui::BeginTableEx(const char* name, ImGuiID id, int columns_count, ImG
g.TablesTempData.resize(g.TablesTempDataStacked, ImGuiTableTempData());
ImGuiTableTempData* temp_data = table->TempData = &g.TablesTempData[g.TablesTempDataStacked - 1];
temp_data->TableIndex = table_idx;
+ temp_data->ReconcileColumnsRequests.resize(0); // FIXME: Use shrink(0) everywhere?
table->DrawSplitter = &table->TempData->DrawSplitter;
table->DrawSplitter->Clear();
@@ -371,6 +375,7 @@ bool ImGui::BeginTableEx(const char* name, ImGuiID id, int columns_count, ImG
const int previous_frame_active = table->LastFrameActive;
const int instance_no = (previous_frame_active != g.FrameCount) ? 0 : table->InstanceCurrent + 1;
const ImGuiTableFlags previous_flags = table->Flags;
+ const bool is_new_table = (previous_frame_active == -1);
table->ID = id;
table->Flags = flags;
table->LastFrameActive = g.FrameCount;
@@ -485,17 +490,18 @@ bool ImGui::BeginTableEx(const char* name, ImGuiID id, int columns_count, ImG
// FIXME: Because inner_window's Scrollbar doesn't know about border size, since it's not encoded in window->WindowBorderSize,
// it already overlaps it and doesn't need an extra offset. Ideally we should be able to pass custom border size with
// different x/y values to BeginChild().
+ const float border_size = TABLE_BORDER_SIZE;
if (flags & ImGuiTableFlags_BordersOuterV)
{
- table->HostClipRect.Min.x = ImMin(table->HostClipRect.Min.x + TABLE_BORDER_SIZE, table->HostClipRect.Max.x);
+ table->HostClipRect.Min.x = ImMin(table->HostClipRect.Min.x + border_size, table->HostClipRect.Max.x);
if (inner_window->DecoOuterSizeX2 == 0.0f)
- table->HostClipRect.Max.x = ImMax(table->HostClipRect.Max.x - TABLE_BORDER_SIZE, table->HostClipRect.Min.x);
+ table->HostClipRect.Max.x = ImMax(table->HostClipRect.Max.x - border_size, table->HostClipRect.Min.x);
}
if (flags & ImGuiTableFlags_BordersOuterH)
{
- table->HostClipRect.Min.y = ImMin(table->HostClipRect.Min.y + TABLE_BORDER_SIZE, table->HostClipRect.Max.y);
+ table->HostClipRect.Min.y = ImMin(table->HostClipRect.Min.y + border_size, table->HostClipRect.Max.y);
if (inner_window->DecoOuterSizeY2 == 0.0f)
- table->HostClipRect.Max.y = ImMax(table->HostClipRect.Max.y - TABLE_BORDER_SIZE, table->HostClipRect.Min.y);
+ table->HostClipRect.Max.y = ImMax(table->HostClipRect.Max.y - border_size, table->HostClipRect.Min.y);
}
}
@@ -560,29 +566,36 @@ bool ImGui::BeginTableEx(const char* name, ImGuiID id, int columns_count, ImG
table->MemoryCompacted = false;
// Setup memory buffer (clear data if columns count changed)
- ImGuiTableColumn* old_columns_to_preserve = NULL;
- void* old_columns_raw_data = NULL;
const int old_columns_count = table->Columns.size();
if (old_columns_count != 0 && old_columns_count != columns_count)
{
- // Attempt to preserve width and other settings on column count/specs change (#4046)
- old_columns_to_preserve = table->Columns.Data;
- old_columns_raw_data = table->RawData; // Free at end of function
+ // Attempt to preserve width and other settings on column count/specs change (#4046, #9108)
+ IMGUI_DEBUG_LOG_TABLE("[table] Table 0x%08X column count %d -> %d, recreating storage.\n", table->ID, old_columns_count, columns_count);
+ IM_ASSERT(temp_data->OldColumnsRawData == NULL);
+ temp_data->OldColumnsRawData = table->RawData; // Freed during layout
+ temp_data->OldColumnsData = table->Columns;
+ for (ImGuiTableColumn& src_column : table->TempData->OldColumnsData)
+ src_column.IsNeedReconcileSrc = true;
table->RawData = NULL;
}
if (table->RawData == NULL)
{
TableBeginInitMemory(table, columns_count);
- table->IsInitializing = table->IsSettingsRequestLoad = true;
+ table->IsInitializing = true;
}
if (table->IsResetAllRequest)
TableResetSettings(table);
if (table->IsInitializing)
{
// Initialize
- table->SettingsOffset = -1;
+ if (is_new_table)
+ {
+ table->SettingsOffset = -1;
+ table->IsSettingsRequestLoad = true;
+ }
table->IsSortSpecsDirty = true;
table->IsSettingsDirty = true; // Records itself into .ini file even when in default state (#7934)
+ table->IsReconcileMode = false;
table->InstanceInteracted = -1;
table->ContextPopupColumn = -1;
table->ReorderColumn = table->ReorderColumnDstOrder = table->ResizedColumn = table->LastResizedColumn = -1;
@@ -591,9 +604,9 @@ bool ImGui::BeginTableEx(const char* name, ImGuiID id, int columns_count, ImG
for (int n = 0; n < columns_count; n++)
{
ImGuiTableColumn* column = &table->Columns[n];
- if (old_columns_to_preserve && n < old_columns_count)
+ if (temp_data->OldColumnsData.Data && n < temp_data->OldColumnsData.size())
{
- *column = old_columns_to_preserve[n];
+ *column = temp_data->OldColumnsData[n];
}
else
{
@@ -607,28 +620,11 @@ bool ImGui::BeginTableEx(const char* name, ImGuiID id, int columns_count, ImG
table->DisplayOrderToIndex[n] = column->DisplayOrder;
}
}
- if (old_columns_raw_data)
- IM_FREE(old_columns_raw_data);
// Load settings
if (table->IsSettingsRequestLoad)
TableLoadSettings(table);
- // Handle DPI/font resize
- // This is designed to facilitate DPI changes with the assumption that e.g. style.CellPadding has been scaled as well.
- // It will also react to changing fonts with mixed results. It doesn't need to be perfect but merely provide a decent transition.
- // FIXME-DPI: Provide consistent standards for reference size. Perhaps using g.CurrentDpiScale would be more self explanatory.
- // This is will lead us to non-rounded WidthRequest in columns, which should work but is a poorly tested path.
- const float new_ref_scale_unit = g.FontSize; // g.Font->GetCharAdvance('A') ?
- if (table->RefScale != 0.0f && table->RefScale != new_ref_scale_unit)
- {
- const float scale_factor = new_ref_scale_unit / table->RefScale;
- //IMGUI_DEBUG_PRINT("[table] %08X RefScaleUnit %.3f -> %.3f, scaling width by %.3f\n", table->ID, table->RefScaleUnit, new_ref_scale_unit, scale_factor);
- for (int n = 0; n < columns_count; n++)
- table->Columns[n].WidthRequest = table->Columns[n].WidthRequest * scale_factor;
- }
- table->RefScale = new_ref_scale_unit;
-
// Disable output until user calls TableNextRow() or TableNextColumn() leading to the TableUpdateLayout() call..
// This is not strictly necessary but will reduce cases were "out of table" output will be misleading to the user.
// Because we cannot safely assert in EndTable() when no rows have been created, this seems like our best option.
@@ -638,10 +634,7 @@ bool ImGui::BeginTableEx(const char* name, ImGuiID id, int columns_count, ImG
// At this point the ->NameOffset field of each column will be invalid until TableUpdateLayout() or the first call to TableSetupColumn()
if (table->ColumnsNames.Buf.Size > 0)
table->ColumnsNames.Buf.resize(0);
-
- // Apply queued resizing/reordering/hiding requests
- TableBeginApplyRequests(table);
-
+
return true;
}
@@ -676,7 +669,7 @@ void ImGui::TableBeginInitMemory(ImGuiTable* table, int columns_count)
}
// Apply queued resizing/reordering/hiding requests
-void ImGui::TableBeginApplyRequests(ImGuiTable* table)
+void ImGui::TableApplyQueuedRequests(ImGuiTable* table)
{
// Handle resizing request
// (We process this in the TableBegin() of the first instance of each table)
@@ -718,7 +711,7 @@ void ImGui::TableBeginApplyRequests(ImGuiTable* table)
// table->ReorderColumn = -1;
}
- // Handle display order reset request
+ // Handle display order / visibility reset requests
if (table->IsResetDisplayOrderRequest)
{
for (int n = 0; n < table->ColumnsCount; n++)
@@ -726,6 +719,13 @@ void ImGui::TableBeginApplyRequests(ImGuiTable* table)
table->IsResetDisplayOrderRequest = false;
table->IsSettingsDirty = true;
}
+ if (table->IsResetVisibilityRequest)
+ {
+ for (ImGuiTableColumn& column : table->Columns)
+ column.IsUserEnabled = column.IsUserEnabledNextFrame = (column.Flags & ImGuiTableColumnFlags_DefaultHide) ? 0 : 1;
+ table->IsResetVisibilityRequest = false;
+ table->IsSettingsDirty = true;
+ }
}
// Apply immediately. See TableQueueSetColumnDisplayOrder() for additional checks/constraints.
@@ -781,8 +781,9 @@ void ImGui::TableQueueSetColumnDisplayOrder(ImGuiTable* table, int column_n, int
table->ReorderColumn = (ImGuiTableColumnIdx)column_n;
table->ReorderColumnDstOrder = (ImGuiTableColumnIdx)-1;
dst_order = TableGetMaxDisplayOrderAllowed(table, src_order, dst_order);
- if (dst_order != src_order)
- table->ReorderColumnDstOrder = (ImGuiTableColumnIdx)dst_order;
+ if (table->IsLayoutLocked && dst_order == src_order) // We allow calling the function before layout w/ reconcile so don't early out.
+ return;
+ table->ReorderColumnDstOrder = (ImGuiTableColumnIdx)dst_order;
}
// Adjust flags: default width mode + stretch columns are not allowed when auto extending
@@ -848,13 +849,61 @@ static void TableSetupColumnFlags(ImGuiTable* table, ImGuiTableColumn* column, I
void ImGui::TableUpdateLayout(ImGuiTable* table)
{
ImGuiContext& g = *GImGui;
+ ImGuiTableTempData* temp_data = table->TempData;
IM_ASSERT(table->IsLayoutLocked == false);
+ const int columns_count = table->ColumnsCount;
+
+ // Reconcile moved columns
+ if (temp_data->ReconcileColumnsRequests.Size > 0)
+ TableReconcileColumns(table);
+ if (temp_data->OldColumnsRawData)
+ {
+ IM_FREE(temp_data->OldColumnsRawData);
+ temp_data->OldColumnsRawData = NULL;
+ temp_data->OldColumnsData.clear();
+ }
+
+ // Apply columns settings
+ if (table->IsSettingsRequestLoad)
+ TableLoadSettingsForColumns(table);
+ if (table->IsInitializing || table->IsSettingsRequestLoad)
+ {
+ for (ImGuiTableColumn& column : table->Columns)
+ {
+ ImGuiTableFlags init_flags;
+ if (table->IsSettingsRequestLoad)
+ init_flags = column.IsLoadedSettings ? ~table->SettingsLoadedFlags : ~0;
+ else
+ init_flags = column.IsJustCreated ? ~0 : 0;
+ TableInitColumnDefaults(table, &column, init_flags);
+ }
+ TableFixDisplayOrder(table); // Call even for non _Reorderable table as we loaded .ini data.
+ table->IsSettingsRequestLoad = false;
+ }
+
+ // Apply queued resizing/reordering/hiding requests
+ TableApplyQueuedRequests(table);
+
+ // Handle DPI/font resize
+ // This is designed to facilitate DPI changes with the assumption that e.g. style.CellPadding has been scaled as well.
+ // It will also react to changing fonts with mixed results. It doesn't need to be perfect but merely provide a decent transition.
+ // FIXME-DPI: Provide consistent standards for reference size. Perhaps using g.CurrentDpiScale would be more self explanatory.
+ // This is will lead us to non-rounded WidthRequest in columns, which should work but is a poorly tested path.
+ const float new_ref_scale_unit = g.FontSize; // g.Font->GetCharAdvance('A') ?
+ if (table->RefScale != 0.0f && table->RefScale != new_ref_scale_unit)
+ {
+ const float scale_factor = new_ref_scale_unit / table->RefScale;
+ IMGUI_DEBUG_LOG_TABLE("[table] 0x%08X RefScale %.3f -> %.3f, scaling width by %.3f\n", table->ID, table->RefScale, new_ref_scale_unit, scale_factor);
+ for (int n = 0; n < columns_count; n++)
+ table->Columns[n].WidthRequest = table->Columns[n].WidthRequest * scale_factor;
+ }
+ table->RefScale = new_ref_scale_unit;
const ImGuiTableFlags table_sizing_policy = (table->Flags & ImGuiTableFlags_SizingMask_);
- table->IsDefaultDisplayOrder = true;
+ table->IsDefaultDisplayOrder = table->IsDefaultVisibility = true;
table->ColumnsEnabledCount = 0;
- ImBitArrayClearAllBits(table->EnabledMaskByIndex, table->ColumnsCount);
- ImBitArrayClearAllBits(table->EnabledMaskByDisplayOrder, table->ColumnsCount);
+ ImBitArrayClearAllBits(table->EnabledMaskByIndex, columns_count);
+ ImBitArrayClearAllBits(table->EnabledMaskByDisplayOrder, columns_count);
table->LeftMostEnabledColumn = -1;
table->MinColumnWidth = ImMax(1.0f, g.Style.FramePadding.x * 1.0f); // g.Style.ColumnsMinSpacing; // FIXME-TABLE
@@ -867,11 +916,9 @@ void ImGui::TableUpdateLayout(ImGuiTable* table)
bool has_resizable = false;
float stretch_sum_width_auto = 0.0f;
float fixed_max_width_auto = 0.0f;
- for (int order_n = 0; order_n < table->ColumnsCount; order_n++)
+ for (int order_n = 0; order_n < columns_count; order_n++)
{
const int column_n = table->DisplayOrderToIndex[order_n];
- if (column_n != order_n)
- table->IsDefaultDisplayOrder = false;
ImGuiTableColumn* column = &table->Columns[column_n];
// Clear column setup if not submitted by user. Currently we make it mandatory to call TableSetupColumn() every frame.
@@ -881,7 +928,7 @@ void ImGui::TableUpdateLayout(ImGuiTable* table)
{
TableSetupColumnFlags(table, column, ImGuiTableColumnFlags_None);
column->NameOffset = -1;
- column->UserID = 0;
+ column->ID = column->UserData = 0;
column->InitStretchWeightOrWidth = -1.0f;
}
@@ -894,6 +941,12 @@ void ImGui::TableUpdateLayout(ImGuiTable* table)
table->IsSettingsDirty = true;
}
column->IsEnabled = column->IsUserEnabled && (column->Flags & ImGuiTableColumnFlags_Disabled) == 0;
+ column->IsJustCreated = false;
+
+ if (column->IsEnabled != ((column->Flags & ImGuiTableColumnFlags_DefaultHide) ? 0 : 1))
+ table->IsDefaultVisibility = false;
+ if (column_n != order_n)
+ table->IsDefaultDisplayOrder = false;
if (column->SortOrder != -1 && !column->IsEnabled)
table->IsSortSpecsDirty = true;
@@ -966,7 +1019,7 @@ void ImGui::TableUpdateLayout(ImGuiTable* table)
float sum_width_requests = 0.0f; // Sum of all width for fixed and auto-resize columns, excluding width contributed by Stretch columns but including spacing/padding.
float stretch_sum_weights = 0.0f; // Sum of all weights for stretch columns.
table->LeftMostStretchedColumn = table->RightMostStretchedColumn = -1;
- for (int column_n = 0; column_n < table->ColumnsCount; column_n++)
+ for (int column_n = 0; column_n < columns_count; column_n++)
{
if (!IM_BITARRAY_TESTBIT(table->EnabledMaskByIndex, column_n))
continue;
@@ -1030,7 +1083,7 @@ void ImGui::TableUpdateLayout(ImGuiTable* table)
const float width_avail_for_stretched_columns = width_avail - width_spacings - sum_width_requests;
float width_remaining_for_stretched_columns = width_avail_for_stretched_columns;
table->ColumnsGivenWidth = width_spacings + (table->CellPaddingX * 2.0f) * table->ColumnsEnabledCount;
- for (int column_n = 0; column_n < table->ColumnsCount; column_n++)
+ for (int column_n = 0; column_n < columns_count; column_n++)
{
if (!IM_BITARRAY_TESTBIT(table->EnabledMaskByIndex, column_n))
continue;
@@ -1057,7 +1110,7 @@ void ImGui::TableUpdateLayout(ImGuiTable* table)
// [Part 5] Redistribute stretch remainder width due to rounding (remainder width is < 1.0f * number of Stretch column).
// Using right-to-left distribution (more likely to match resizing cursor).
if (width_remaining_for_stretched_columns >= 1.0f && !(table->Flags & ImGuiTableFlags_PreciseWidths))
- for (int order_n = table->ColumnsCount - 1; stretch_sum_weights > 0.0f && width_remaining_for_stretched_columns >= 1.0f && order_n >= 0; order_n--)
+ for (int order_n = columns_count - 1; stretch_sum_weights > 0.0f && width_remaining_for_stretched_columns >= 1.0f && order_n >= 0; order_n--)
{
if (!IM_BITARRAY_TESTBIT(table->EnabledMaskByDisplayOrder, order_n))
continue;
@@ -1097,8 +1150,8 @@ void ImGui::TableUpdateLayout(ImGuiTable* table)
float offset_x = ((table->FreezeColumnsCount > 0) ? table->OuterRect.Min.x : work_rect.Min.x) + table->OuterPaddingX - table->CellSpacingX1;
ImRect host_clip_rect = table->InnerClipRect;
//host_clip_rect.Max.x += table->CellPaddingX + table->CellSpacingX2;
- ImBitArrayClearAllBits(table->VisibleMaskByIndex, table->ColumnsCount);
- for (int order_n = 0; order_n < table->ColumnsCount; order_n++)
+ ImBitArrayClearAllBits(table->VisibleMaskByIndex, columns_count);
+ for (int order_n = 0; order_n < columns_count; order_n++)
{
const int column_n = table->DisplayOrderToIndex[order_n];
ImGuiTableColumn* column = &table->Columns[column_n];
@@ -1246,7 +1299,7 @@ void ImGui::TableUpdateLayout(ImGuiTable* table)
const float unused_x1 = ImMax(table->WorkRect.Min.x, table->Columns[table->RightMostEnabledColumn].ClipRect.Max.x);
if (is_hovering_table && table->HoveredColumnBody == -1)
if (mouse_skewed_x >= unused_x1)
- table->HoveredColumnBody = (ImGuiTableColumnIdx)table->ColumnsCount;
+ table->HoveredColumnBody = (ImGuiTableColumnIdx)columns_count;
if (has_resizable == false && (table->Flags & ImGuiTableFlags_Resizable))
table->Flags &= ~ImGuiTableFlags_Resizable;
@@ -1288,7 +1341,7 @@ void ImGui::TableUpdateLayout(ImGuiTable* table)
table->HighlightColumnHeader = -1;
if (table->IsContextPopupOpen && table->ContextPopupColumn != -1 && table->InstanceInteracted == table->InstanceCurrent)
table->HighlightColumnHeader = table->ContextPopupColumn;
- else if ((table->Flags & ImGuiTableFlags_HighlightHoveredColumn) && table->HoveredColumnBody != -1 && table->HoveredColumnBody != table->ColumnsCount && table->HoveredColumnBorder == -1)
+ else if ((table->Flags & ImGuiTableFlags_HighlightHoveredColumn) && table->HoveredColumnBody != -1 && table->HoveredColumnBody != columns_count && table->HoveredColumnBorder == -1)
if (g.ActiveId == 0 || (table->IsActiveIdInTable || g.DragDropActive))
table->HighlightColumnHeader = table->HoveredColumnBody;
@@ -1315,14 +1368,32 @@ void ImGui::TableUpdateLayout(ImGuiTable* table)
table->InnerWindow->DecoInnerSizeY1 = table_instance->LastFrozenHeight;
table_instance->LastFrozenHeight = 0.0f;
- // Initial state
ImGuiWindow* inner_window = table->InnerWindow;
+ ImGuiBoxSelectState* bs = &g.BoxSelectState;
+ if (bs->Window == inner_window && bs->UnclipMode)
+ TableApplyExternalUnclipRect(table, bs->UnclipRect);
+
+ // Initial state
if (table->Flags & ImGuiTableFlags_NoClip)
table->DrawSplitter->SetCurrentChannel(inner_window->DrawList, TABLE_DRAW_CHANNEL_NOCLIP);
else
inner_window->DrawList->PushClipRect(inner_window->InnerClipRect.Min, inner_window->InnerClipRect.Max, false); // FIXME: use table->InnerClipRect?
}
+// When starting a BeginMultiSelect() after table has been layout we update IsRequestOutput fields.
+void ImGui::TableApplyExternalUnclipRect(ImGuiTable* table, ImRect& rect)
+{
+ if (rect.IsInverted())
+ return;
+ for (int column_n = 0; column_n < table->ColumnsCount; column_n++)
+ {
+ ImGuiTableColumn* column = &table->Columns[column_n];
+ if (!column->IsRequestOutput)
+ if (rect.Overlaps(ImRect(column->MinX, table->WorkRect.Min.y, column->MaxX, FLT_MAX)))
+ column->IsRequestOutput = true;
+ }
+}
+
// Process hit-testing on resizing borders. Actual size change will be applied in EndTable()
// - Set table->HoveredColumnBorder with a short delay/timer to reduce visual feedback noise.
void ImGui::TableUpdateBorders(ImGuiTable* table)
@@ -1436,12 +1507,12 @@ void ImGui::EndTable()
if (table->Flags & ImGuiTableFlags_ScrollX)
{
const float outer_padding_for_border = (table->Flags & ImGuiTableFlags_BordersOuterV) ? TABLE_BORDER_SIZE : 0.0f;
- float max_pos_x = table->InnerWindow->DC.CursorMaxPos.x;
+ float max_pos_x = inner_window->DC.CursorMaxPos.x;
if (table->RightMostEnabledColumn != -1)
max_pos_x = ImMax(max_pos_x, table->Columns[table->RightMostEnabledColumn].WorkMaxX + table->CellPaddingX + table->OuterPaddingX - outer_padding_for_border);
if (table->ResizedColumn != -1)
max_pos_x = ImMax(max_pos_x, table->ResizeLockMinContentsX2);
- table->InnerWindow->DC.CursorMaxPos.x = max_pos_x + table->TempData->AngledHeadersExtraWidth;
+ inner_window->DC.CursorMaxPos.x = max_pos_x + table->TempData->AngledHeadersExtraWidth;
}
// Pop clipping rect
@@ -1550,7 +1621,7 @@ void ImGui::EndTable()
}
else
{
- table->InnerWindow->DC.TreeDepth--;
+ inner_window->DC.TreeDepth--;
ItemSize(table->OuterRect.GetSize());
ItemAdd(table->OuterRect, 0);
}
@@ -1565,13 +1636,12 @@ void ImGui::EndTable()
}
else if (temp_data->UserOuterSize.x <= 0.0f)
{
- // Some references for this: #7651 + tests "table_reported_size", "table_reported_size_outer" equivalent Y block
- // - Checking for ImGuiTableFlags_ScrollX/ScrollY flag makes us a frame ahead when disabling those flags.
- // - FIXME-TABLE: Would make sense to pre-compute expected scrollbar visibility/sizes to generally save a frame of feedback.
- const float inner_content_max_x = table->OuterRect.Min.x + table->ColumnsAutoFitWidth; // Slightly misleading name but used for code symmetry with inner_content_max_y
- const float decoration_size = table->TempData->AngledHeadersExtraWidth + ((table->Flags & ImGuiTableFlags_ScrollY) ? inner_window->ScrollbarSizes.x : 0.0f);
- outer_window->DC.IdealMaxPos.x = ImMax(outer_window->DC.IdealMaxPos.x, inner_content_max_x + decoration_size - temp_data->UserOuterSize.x);
- outer_window->DC.CursorMaxPos.x = ImMax(backup_outer_max_pos.x, ImMin(table->OuterRect.Max.x, inner_content_max_x + decoration_size));
+ // Some references for this: #7651 + tests "table_reported_size", "table_reported_size_outer" equivalent Y block, #9352
+ // - FIXME-TABLE: Would make sense to pre-compute expected scrollbar visibility/sizes to generally save a frame of feedback? See broken test in 'table_reported_size_outer'
+ const float outer_content_max_x = table->OuterRect.Min.x + table->ColumnsAutoFitWidth;
+ const float decoration_size = table->TempData->AngledHeadersExtraWidth + ((inner_window != outer_window) ? inner_window->ScrollbarSizes.x : 0.0f);
+ outer_window->DC.IdealMaxPos.x = ImMax(outer_window->DC.IdealMaxPos.x, outer_content_max_x + decoration_size - temp_data->UserOuterSize.x);
+ outer_window->DC.CursorMaxPos.x = ImMax(backup_outer_max_pos.x, ImMin(table->OuterRect.Max.x, outer_content_max_x + decoration_size));
}
else
{
@@ -1579,9 +1649,12 @@ void ImGui::EndTable()
}
if (temp_data->UserOuterSize.y <= 0.0f)
{
- const float decoration_size = (table->Flags & ImGuiTableFlags_ScrollX) ? inner_window->ScrollbarSizes.y : 0.0f;
- outer_window->DC.IdealMaxPos.y = ImMax(outer_window->DC.IdealMaxPos.y, inner_content_max_y + decoration_size - temp_data->UserOuterSize.y);
- outer_window->DC.CursorMaxPos.y = ImMax(backup_outer_max_pos.y, ImMin(table->OuterRect.Max.y, inner_content_max_y + decoration_size));
+ // (same comment as above)
+ const float outer_content_size_y = (inner_window == outer_window) ? (inner_content_max_y - table->InnerRect.Min.y) : (inner_content_max_y - inner_window->DC.CursorStartPos.y);
+ const float outer_content_max_y = table->OuterRect.Min.y + outer_content_size_y;
+ const float decoration_size = (inner_window != outer_window ? inner_window->ScrollbarSizes.y : 0.0f);
+ outer_window->DC.IdealMaxPos.y = ImMax(outer_window->DC.IdealMaxPos.y, outer_content_max_y + decoration_size - temp_data->UserOuterSize.y);
+ outer_window->DC.CursorMaxPos.y = ImMax(backup_outer_max_pos.y, ImMin(table->OuterRect.Max.y, outer_content_max_y + decoration_size));
}
else
{
@@ -1608,9 +1681,9 @@ void ImGui::EndTable()
NavUpdateCurrentWindowIsScrollPushableX();
}
-// Called in TableSetupColumn() when initializing and in TableLoadSettings() for defaults before applying stored settings.
+// Called in TableUpdateLayout() when initializing/after loading settings.
// 'init_mask' specify which fields to initialize.
-static void TableInitColumnDefaults(ImGuiTable* table, ImGuiTableColumn* column, ImGuiTableColumnFlags init_mask)
+void ImGui::TableInitColumnDefaults(ImGuiTable* table, ImGuiTableColumn* column, ImGuiTableColumnFlags init_mask)
{
ImGuiTableColumnFlags flags = column->Flags;
if (init_mask & ImGuiTableFlags_Resizable)
@@ -1622,7 +1695,7 @@ static void TableInitColumnDefaults(ImGuiTable* table, ImGuiTableColumn* column,
column->AutoFitQueue = 0x00;
}
if (init_mask & ImGuiTableFlags_Reorderable)
- column->DisplayOrder = (ImGuiTableColumnIdx)table->Columns.index_from_ptr(column);
+ column->DisplayOrder = (ImGuiTableColumnIdx)((table->Flags & ImGuiTableFlags_Reorderable) ? -1 : table->Columns.index_from_ptr(column));
if (init_mask & ImGuiTableFlags_Hideable)
column->IsUserEnabled = column->IsUserEnabledNextFrame = (flags & ImGuiTableColumnFlags_DefaultHide) ? 0 : 1;
if (init_mask & ImGuiTableFlags_Sortable)
@@ -1635,17 +1708,9 @@ static void TableInitColumnDefaults(ImGuiTable* table, ImGuiTableColumn* column,
// See "COLUMNS SIZING POLICIES" comments at the top of this file
// If (init_width_or_weight <= 0.0f) it is ignored
-void ImGui::TableSetupColumn(const char* label, ImGuiTableColumnFlags flags, float init_width_or_weight, ImGuiID user_id)
+static void TableSetupColumnApply(ImGuiTable* table, int idx, ImGuiID id, ImS16 name_offset, ImGuiTableColumnFlags flags, float init_width_or_weight, ImGuiID user_data)
{
- ImGuiContext& g = *GImGui;
- ImGuiTable* table = g.CurrentTable;
- IM_ASSERT_USER_ERROR_RET(table != NULL, "Call should only be done while in BeginTable() scope!");
- IM_ASSERT_USER_ERROR_RET(table->DeclColumnsCount < table->ColumnsCount, "TableSetupColumn(): called too many times!");
- IM_ASSERT_USER_ERROR_RET(table->IsLayoutLocked == false, "TableSetupColumn(): need to call before first row!");
- IM_ASSERT((flags & ImGuiTableColumnFlags_StatusMask_) == 0 && "Illegal to pass StatusMask values to TableSetupColumn()");
-
- ImGuiTableColumn* column = &table->Columns[table->DeclColumnsCount];
- table->DeclColumnsCount++;
+ ImGuiTableColumn* column = &table->Columns[idx];
// Assert when passing a width or weight if policy is entirely left to default, to avoid storing width into weight and vice-versa.
// Give a grace to users of ImGuiTableFlags_ScrollX.
@@ -1664,27 +1729,127 @@ void ImGui::TableSetupColumn(const char* label, ImGuiTableColumnFlags flags, flo
}
TableSetupColumnFlags(table, column, flags);
- column->UserID = user_id;
- flags = column->Flags;
-
- // Initialize defaults
+ column->ID = id;
+ column->UserData = user_data;
+ column->NameOffset = name_offset;
column->InitStretchWeightOrWidth = init_width_or_weight;
- if (table->IsInitializing)
- {
- ImGuiTableFlags init_flags = ~table->SettingsLoadedFlags;
- if (column->WidthRequest < 0.0f && column->StretchWeight < 0.0f)
- init_flags |= ImGuiTableFlags_Resizable;
- TableInitColumnDefaults(table, column, init_flags);
- }
+}
+
+void ImGui::TableSetupColumn(const char* label, ImGuiTableColumnFlags flags, float init_width_or_weight, ImGuiID user_data)
+{
+ ImGuiContext& g = *GImGui;
+ ImGuiTable* table = g.CurrentTable;
+ IM_ASSERT_USER_ERROR_RET(table != NULL, "Call should only be done while in BeginTable() scope!");
+ IM_ASSERT_USER_ERROR_RET(table->DeclColumnsCount < table->ColumnsCount, "TableSetupColumn(): called too many times!");
+ IM_ASSERT_USER_ERROR_RET(table->IsLayoutLocked == false, "TableSetupColumn(): need to call before first row!"); // Table layout is locked when submitting a row or when calling BeginMultiSelect() with box-select.
+ IM_ASSERT((flags & ImGuiTableColumnFlags_StatusMask_) == 0 && "Illegal to pass StatusMask values to TableSetupColumn()");
// Store name (append with zero-terminator in contiguous buffer)
// FIXME: If we recorded the number of \n in names we could compute header row height
- column->NameOffset = -1;
+ ImS16 name_offset = -1;
if (label != NULL && label[0] != 0)
{
- column->NameOffset = (ImS16)table->ColumnsNames.size();
+ name_offset = (ImS16)table->ColumnsNames.size();
table->ColumnsNames.append(label, label + ImStrlen(label) + 1);
}
+ const ImGuiID column_id = (label != NULL && label[0] != 0) ? ImHashStr(label) : 0;
+
+ // When ID changed or a column moved: defer the request until layout where we will process full reconcile.
+ const int column_idx = table->DeclColumnsCount++;
+ ImGuiTableColumn* column = &table->Columns[column_idx];
+
+ // If topology change goes into reconcile mode
+ if (table->IsReconcileMode == false && column->ID != column_id)
+ {
+ table->IsReconcileMode = true;
+ table->TempData->ReconcileColumnsRequests.reserve(table->ColumnsCount - column_idx);
+ }
+
+ // Fast/common path
+ if (table->IsReconcileMode == false)
+ {
+ TableSetupColumnApply(table, column_idx, column_id, name_offset, flags, init_width_or_weight, user_data);
+ column->IsNeedReconcileSrc = column->IsNeedReconcileDst = false;
+ if (column_idx < table->TempData->OldColumnsData.size())
+ table->TempData->OldColumnsData[column_idx].IsNeedReconcileSrc = false;
+ return;
+ }
+
+ // Reconcile path: defer applying data to TableUpdateLayout() -> TableReconcileMovedColumns() -> TableSetupColumnApply().
+ // On column count change: search the previous columns:
+ // - the live Columns[] array is truncated on shrink, so a moved column may only exist in old data.
+ // - the live Columns[] array may already be partially reset.
+ table->TempData->ReconcileColumnsRequests.push_back(ImGuiTableReconcileColumnData());
+ ImGuiTableReconcileColumnData& reconcile_data = table->TempData->ReconcileColumnsRequests.back();
+ reconcile_data.ID = column_id;
+ reconcile_data.NameOffset = name_offset;
+ reconcile_data.Flags = flags;
+ reconcile_data.InitWidthOrWeight = init_width_or_weight;
+ reconcile_data.UserData = user_data;
+ reconcile_data.ColumnNewIdx = (ImGuiTableColumnIdx)column_idx;
+ reconcile_data.ColumnOldIdx = (ImGuiTableColumnIdx)-1;
+ column->NameOffset = name_offset; // Allow TableGetColumnName() to work before layout
+ column->IsNeedReconcileSrc = column->IsNeedReconcileDst = true;
+}
+
+// NB: This was written to be similar to the logic in TableLoadSettingsForColumns().
+void ImGui::TableReconcileColumns(ImGuiTable* table)
+{
+ ImGuiContext& g = *GImGui;
+ ImGuiTableTempData* temp_data = table->TempData;
+ IM_UNUSED(g);
+ IMGUI_DEBUG_LOG_TABLE("[table] Reconcile columns for table 0x%08X\n", table->ID);
+
+ ImSpan& dst_columns = table->Columns;
+ ImSpan