From 812e6094f47bb8d1da5a6b421aa4c724cf2035c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miodrag=20Milanovi=C4=87?= Date: Thu, 5 Jan 2023 15:32:40 +0100 Subject: Update BGFX, BX and BIMG (#10789) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Update to bgfx a93a714632b79b5ddbf5c86ac323fa9b76ed3433 Co-authored-by: Бранимир Караџић --- 3rdparty/bgfx/.appveyor.yml | 25 - 3rdparty/bgfx/.editorconfig | 4 + 3rdparty/bgfx/.gitattributes | 9 +- 3rdparty/bgfx/.github/ISSUE_TEMPLATE/bug_report.md | 54 + 3rdparty/bgfx/.github/workflows/main.yml | 250 + 3rdparty/bgfx/.gitignore | 10 +- 3rdparty/bgfx/3rdparty/cgltf/cgltf.h | 681 +- 3rdparty/bgfx/3rdparty/cgltf/cgltf_write.h | 205 +- 3rdparty/bgfx/3rdparty/dear-imgui/LICENSE.txt | 21 + 3rdparty/bgfx/3rdparty/dear-imgui/imconfig.h | 2 + 3rdparty/bgfx/3rdparty/dear-imgui/imgui.cpp | 5046 +++- 3rdparty/bgfx/3rdparty/dear-imgui/imgui.h | 928 +- 3rdparty/bgfx/3rdparty/dear-imgui/imgui_demo.cpp | 1156 +- 3rdparty/bgfx/3rdparty/dear-imgui/imgui_draw.cpp | 298 +- 3rdparty/bgfx/3rdparty/dear-imgui/imgui_internal.h | 1028 +- 3rdparty/bgfx/3rdparty/dear-imgui/imgui_tables.cpp | 146 +- .../bgfx/3rdparty/dear-imgui/imgui_widgets.cpp | 1507 +- 3rdparty/bgfx/3rdparty/dear-imgui/widgets/gizmo.h | 301 +- .../bgfx/3rdparty/dear-imgui/widgets/gizmo.inl | 2192 +- .../3rdparty/dear-imgui/widgets/memory_editor.inl | 4 +- .../3rdparty/dear-imgui/widgets/range_slider.inl | 2 +- 3rdparty/bgfx/3rdparty/directx-headers/LICENSE | 21 + .../include/directx/PIXEventsCommon.h | 483 + .../include/directx/PIXEventsGenerated.h | 10748 +++++++ .../directx-headers/include/directx/d3d10.h | 1 + .../directx-headers/include/directx/d3d10_1.h | 1 + .../include/directx/d3d10_1shader.h | 1 + .../directx-headers/include/directx/d3d10effect.h | 1 + .../directx-headers/include/directx/d3d10misc.h | 1 + .../include/directx/d3d10sdklayers.h | 1 + .../directx-headers/include/directx/d3d10shader.h | 1 + .../directx-headers/include/directx/d3d11.h | 14600 ++++++++++ .../directx-headers/include/directx/d3d11_1.h | 5220 ++++ .../directx-headers/include/directx/d3d11_2.h | 2721 ++ .../directx-headers/include/directx/d3d11_3.h | 6826 +++++ .../directx-headers/include/directx/d3d11_4.h | 4759 +++ .../include/directx/d3d11sdklayers.h | 2606 ++ .../directx-headers/include/directx/d3d11shader.h | 601 + .../include/directx/d3d11shadertracing.h | 570 + .../directx-headers/include/directx/d3d12.h | 28706 +++++++++++++++++++ .../include/directx/d3d12compatibility.h | 739 + .../include/directx/d3d12sdklayers.h | 4110 +++ .../directx-headers/include/directx/d3d12shader.h | 490 + .../directx-headers/include/directx/d3d12video.h | 8584 ++++++ .../directx-headers/include/directx/d3d9.h | 2794 ++ .../directx-headers/include/directx/d3d9caps.h | 571 + .../directx-headers/include/directx/d3d9types.h | 2444 ++ .../directx-headers/include/directx/d3dcommon.h | 1116 + .../directx-headers/include/directx/d3dcompiler.h | 586 + .../directx-headers/include/directx/dxcore.h | 41 + .../include/directx/dxcore_interface.h | 316 + .../directx-headers/include/directx/dxgi.h | 2953 ++ .../directx-headers/include/directx/dxgi1_2.h | 2466 ++ .../directx-headers/include/directx/dxgi1_3.h | 2108 ++ .../directx-headers/include/directx/dxgi1_4.h | 1489 + .../directx-headers/include/directx/dxgi1_5.h | 1540 + .../directx-headers/include/directx/dxgi1_6.h | 1511 + .../directx-headers/include/directx/dxgicommon.h | 57 + .../directx-headers/include/directx/dxgidebug.h | 986 + .../directx-headers/include/directx/dxgiformat.h | 142 + .../directx-headers/include/directx/dxgitype.h | 111 + .../directx-headers/include/directx/dxva2api.h | 1945 ++ .../directx-headers/include/directx/pix3.h | 116 + .../directx-headers/include/directx/pix3_win.h | 53 + .../directx-headers/include/directx/winapifamily.h | 30 + .../directx-headers/include/wsl/stubs/basetsd.h | 347 + .../directx-headers/include/wsl/stubs/oaidl.h | 5 + .../directx-headers/include/wsl/stubs/objbase.h | 1 + .../directx-headers/include/wsl/stubs/ocidl.h | 5 + .../directx-headers/include/wsl/stubs/rpc.h | 5 + .../directx-headers/include/wsl/stubs/rpcndr.h | 82 + .../directx-headers/include/wsl/stubs/unknwn.h | 3 + .../directx-headers/include/wsl/stubs/unknwnbase.h | 124 + .../include/wsl/stubs/winapifamily.h | 6 + .../directx-headers/include/wsl/stubs/windows.h | 18 + .../directx-headers/include/wsl/stubs/wrl/client.h | 6 + .../include/wsl/stubs/wrl/implements.h | 6 + .../directx-headers/include/wsl/winadapter.h | 6 + .../directx-headers/include/wsl/wrladapter.h | 803 + 3rdparty/bgfx/3rdparty/dxsdk/directx-sdk-eula.txt | 77 - .../bgfx/3rdparty/dxsdk/include/PIXEventsCommon.h | 483 - .../3rdparty/dxsdk/include/PIXEventsGenerated.h | 10748 ------- 3rdparty/bgfx/3rdparty/dxsdk/include/d3d11.h | 14600 ---------- 3rdparty/bgfx/3rdparty/dxsdk/include/d3d11_1.h | 5220 ---- 3rdparty/bgfx/3rdparty/dxsdk/include/d3d11_2.h | 2721 -- 3rdparty/bgfx/3rdparty/dxsdk/include/d3d11_3.h | 6826 ----- 3rdparty/bgfx/3rdparty/dxsdk/include/d3d11_4.h | 4759 --- .../bgfx/3rdparty/dxsdk/include/d3d11sdklayers.h | 2606 -- 3rdparty/bgfx/3rdparty/dxsdk/include/d3d11shader.h | 601 - .../3rdparty/dxsdk/include/d3d11shadertracing.h | 570 - 3rdparty/bgfx/3rdparty/dxsdk/include/d3d12.h | 17253 ----------- 3rdparty/bgfx/3rdparty/dxsdk/include/d3d12_1.h | 2539 -- .../bgfx/3rdparty/dxsdk/include/d3d12sdklayers.h | 3225 --- 3rdparty/bgfx/3rdparty/dxsdk/include/d3d12shader.h | 459 - 3rdparty/bgfx/3rdparty/dxsdk/include/d3d12video.h | 3352 --- 3rdparty/bgfx/3rdparty/dxsdk/include/d3d9.h | 2794 -- 3rdparty/bgfx/3rdparty/dxsdk/include/d3d9caps.h | 571 - 3rdparty/bgfx/3rdparty/dxsdk/include/d3d9types.h | 2444 -- 3rdparty/bgfx/3rdparty/dxsdk/include/d3dcommon.h | 1056 - 3rdparty/bgfx/3rdparty/dxsdk/include/d3dcompiler.h | 586 - 3rdparty/bgfx/3rdparty/dxsdk/include/d3dx12.h | 1522 - 3rdparty/bgfx/3rdparty/dxsdk/include/dxgi.h | 2953 -- 3rdparty/bgfx/3rdparty/dxsdk/include/dxgi1_2.h | 2466 -- 3rdparty/bgfx/3rdparty/dxsdk/include/dxgi1_3.h | 2108 -- 3rdparty/bgfx/3rdparty/dxsdk/include/dxgi1_4.h | 1489 - 3rdparty/bgfx/3rdparty/dxsdk/include/dxgi1_5.h | 1540 - 3rdparty/bgfx/3rdparty/dxsdk/include/dxgi1_6.h | 1511 - 3rdparty/bgfx/3rdparty/dxsdk/include/dxgicommon.h | 56 - 3rdparty/bgfx/3rdparty/dxsdk/include/dxgidebug.h | 986 - 3rdparty/bgfx/3rdparty/dxsdk/include/dxgiformat.h | 137 - 3rdparty/bgfx/3rdparty/dxsdk/include/dxgitype.h | 111 - 3rdparty/bgfx/3rdparty/dxsdk/include/dxva2api.h | 1945 -- 3rdparty/bgfx/3rdparty/dxsdk/include/pix3.h | 116 - 3rdparty/bgfx/3rdparty/dxsdk/include/pix3_win.h | 53 - .../bgfx/3rdparty/dxsdk/include/winapifamily.h | 24 - .../bgfx/3rdparty/glsl-optimizer/.gitattributes | 4 - 3rdparty/bgfx/3rdparty/glsl-optimizer/.gitignore | 78 - 3rdparty/bgfx/3rdparty/glsl-optimizer/.npmignore | 2 - .../bgfx/3rdparty/glsl-optimizer/CMakeLists.txt | 51 - 3rdparty/bgfx/3rdparty/glsl-optimizer/Changelog.md | 238 - 3rdparty/bgfx/3rdparty/glsl-optimizer/README.md | 102 - 3rdparty/bgfx/3rdparty/glsl-optimizer/autogen.sh | 14 - 3rdparty/bgfx/3rdparty/glsl-optimizer/binding.gyp | 28 - .../glsl-optimizer/contrib/glslopt/Main.cpp | 159 - .../glsl-optimizer/contrib/glslopt/Makefile | 16 - .../3rdparty/glsl-optimizer/contrib/glslopt/Readme | 13 - .../glsl-optimizer/contrib/glslopt/SourceFiles | 105 - .../glsl-optimizer/contrib/glslopt/glslopt.bdgcfg | 10 - .../glsl-optimizer/contrib/glslopt/glslopt.sln | 26 - .../glsl-optimizer/contrib/glslopt/glslopt.vcproj | 897 - .../contrib/staticlib/Build/Tool/SourceFiles | 90 - .../contrib/staticlib/Build/Tool/glsloptlib.bdgcfg | 9 - .../contrib/staticlib/Build/Tool/glsloptlib.vcproj | 829 - 3rdparty/bgfx/3rdparty/glsl-optimizer/package.json | 38 - .../projects/vs2010/glsl_optimizer.sln | 36 - .../projects/vs2010/glsl_optimizer_lib.vcxproj | 372 - .../vs2010/glsl_optimizer_lib.vcxproj.filters | 518 - .../projects/vs2010/glsl_optimizer_tests.vcxproj | 186 - .../glsl_optimizer_lib.xcodeproj/project.pbxproj | 882 - .../glsl_optimizer_tests.xcodeproj/project.pbxproj | 272 - .../3rdparty/glsl-optimizer/removeDeletedByUs.sh | 15 - .../3rdparty/glsl-optimizer/src/getopt/SConscript | 15 - .../3rdparty/glsl-optimizer/src/glsl/.gitignore | 8 - .../3rdparty/glsl-optimizer/src/glsl/.npmignore | 0 .../bgfx/3rdparty/glsl-optimizer/src/glsl/README | 228 - .../3rdparty/glsl-optimizer/src/glsl/SConscript | 112 - .../bgfx/3rdparty/glsl-optimizer/src/glsl/TODO | 12 - .../glsl-optimizer/src/glsl/glcpp/.gitignore | 10 - .../glsl-optimizer/src/glsl/glcpp/.npmignore | 0 .../3rdparty/glsl-optimizer/src/glsl/glcpp/README | 30 - .../glsl-optimizer/src/glsl/glcpp/glcpp-lex.c | 911 +- .../glsl-optimizer/src/glsl/glcpp/glcpp-parse.c | 1141 +- .../glsl-optimizer/src/glsl/glcpp/glcpp-parse.h | 8 +- .../glsl-optimizer/src/glsl/glsl_lexer.cpp | 1360 +- .../glsl-optimizer/src/glsl/glsl_parser.cpp | 2436 +- .../3rdparty/glsl-optimizer/src/glsl/glsl_parser.h | 15 +- .../src/glsl/ir_print_glsl_visitor.cpp | 16 +- .../glsl-optimizer/src/mesa/main/.gitignore | 11 - .../glsl-optimizer/src/mesa/program/.gitignore | 4 - .../3rdparty/glsl-optimizer/src/util/.gitignore | 1 - .../3rdparty/glsl-optimizer/src/util/SConscript | 38 - .../3rdparty/glsl-optimizer/target_defaults.gypi | 28 - .../tests/fragment/array-const-in.txt | 24 - .../tests/fragment/array-const-inES.txt | 24 - .../tests/fragment/array-const-inES3.txt | 24 - .../tests/fragment/array-const-out.txt | 10 - .../tests/fragment/array-const-outES.txt | 10 - .../tests/fragment/array-const-outES3.txt | 12 - .../tests/fragment/array-const-outES3Metal.txt | 22 - .../tests/fragment/array-constconst-in.txt | 24 - .../tests/fragment/array-constconst-inES.txt | 24 - .../tests/fragment/array-constconst-inES3.txt | 26 - .../tests/fragment/array-constconst-out.txt | 10 - .../tests/fragment/array-constconst-outES.txt | 10 - .../tests/fragment/array-constconst-outES3.txt | 12 - .../fragment/array-constconst-outES3Metal.txt | 22 - .../glsl-optimizer/tests/fragment/ast-in.txt | 23 - .../glsl-optimizer/tests/fragment/ast-inES3.txt | 26 - .../glsl-optimizer/tests/fragment/ast-out.txt | 26 - .../glsl-optimizer/tests/fragment/ast-outES3.txt | 28 - .../tests/fragment/ast-outES3Metal.txt | 39 - .../glsl-optimizer/tests/fragment/basic-in.txt | 8 - .../glsl-optimizer/tests/fragment/basic-inES.txt | 9 - .../glsl-optimizer/tests/fragment/basic-out.txt | 8 - .../glsl-optimizer/tests/fragment/basic-outES.txt | 7 - ...ad-framebufferfetch-metal-translation-inES3.txt | 14 - ...d-framebufferfetch-metal-translation-outES3.txt | 15 - ...mebufferfetch-metal-translation-outES3Metal.txt | 25 - .../tests/fragment/bug-const-variable-in.txt | 19 - .../tests/fragment/bug-const-variable-out.txt | 29 - .../tests/fragment/bug-global-init-in.txt | 6 - .../tests/fragment/bug-global-init-out.txt | 10 - .../tests/fragment/bug-inline-names-in.txt | 19 - .../tests/fragment/bug-inline-names-out.txt | 10 - .../tests/fragment/bug-loop-null-from-in.txt | 9 - .../tests/fragment/bug-loop-null-from-out.txt | 7 - .../tests/fragment/bug-loop-share-index-in.txt | 21 - .../tests/fragment/bug-loop-share-index-out.txt | 33 - .../fragment/bug-loop-undeclaredinductor-inES3.txt | 78 - .../bug-loop-undeclaredinductor-outES3.txt | 88 - .../bug-loop-undeclaredinductor-outES3Metal.txt | 98 - .../tests/fragment/bug-op-parens-in.txt | 8 - .../tests/fragment/bug-op-parens-out.txt | 12 - .../tests/fragment/bug-sampler-highp-inES3.txt | 15 - .../tests/fragment/bug-sampler-highp-outES3.txt | 17 - .../fragment/bug-sampler-highp-outES3Metal.txt | 27 - .../tests/fragment/bug-sampler-highpfull-inES3.txt | 118 - .../fragment/bug-sampler-highpfull-outES3.txt | 161 - .../fragment/bug-sampler-highpfull-outES3Metal.txt | 172 - .../tests/fragment/bug-vectorize-tex-in.txt | 17 - .../tests/fragment/bug-vectorize-tex-out.txt | 22 - .../tests/fragment/builtin-vars-inES3.txt | 14 - .../tests/fragment/builtin-vars-outES3.txt | 25 - .../tests/fragment/builtin-vars-outES3Metal.txt | 38 - .../tests/fragment/const-precision-inES3.txt | 41 - .../tests/fragment/const-precision-outES3.txt | 34 - .../tests/fragment/const-precision-outES3Metal.txt | 46 - .../tests/fragment/derivatives-in.txt | 59 - .../tests/fragment/derivatives-inES.txt | 61 - .../tests/fragment/derivatives-out.txt | 15 - .../tests/fragment/derivatives-outES.txt | 24 - .../glsl-optimizer/tests/fragment/estest1-in.txt | 26 - .../glsl-optimizer/tests/fragment/estest1-out.txt | 23 - .../tests/fragment/float-literals-in.txt | 21 - .../tests/fragment/float-literals-out.txt | 23 - .../glsl-optimizer/tests/fragment/fragdepth-in.txt | 11 - .../tests/fragment/fragdepth-inES.txt | 12 - .../tests/fragment/fragdepth-inES3.txt | 13 - .../tests/fragment/fragdepth-out.txt | 8 - .../tests/fragment/fragdepth-outES.txt | 9 - .../tests/fragment/fragdepth-outES3.txt | 10 - .../tests/fragment/fragdepth-outES3Metal.txt | 21 - .../tests/fragment/framebuffer_fetch-inES.txt | 20 - .../tests/fragment/framebuffer_fetch-inES3.txt | 24 - .../tests/fragment/framebuffer_fetch-outES.txt | 21 - .../tests/fragment/framebuffer_fetch-outES3.txt | 22 - .../fragment/framebuffer_fetch-outES3Metal.txt | 30 - .../global-struct-constant-init-metal-inES3.txt | 685 - .../global-struct-constant-init-metal-outES3.txt | 187 - ...obal-struct-constant-init-metal-outES3Metal.txt | 199 - .../tests/fragment/glsl120-basic-in.txt | 25 - .../tests/fragment/glsl120-basic-inES3.txt | 23 - .../tests/fragment/glsl120-basic-out.txt | 20 - .../tests/fragment/glsl120-basic-outES3.txt | 17 - .../tests/fragment/glsl120-basic-outES3Metal.txt | 27 - .../tests/fragment/glsl140-basic-in.txt | 10 - .../tests/fragment/glsl140-basic-out.txt | 12 - .../tests/fragment/in-struct-ret-vals-in.txt | 21 - .../tests/fragment/in-struct-ret-vals-inES.txt | 23 - .../tests/fragment/in-struct-ret-vals-out.txt | 13 - .../tests/fragment/in-struct-ret-vals-outES.txt | 15 - .../tests/fragment/in-vals-ret-vals-inES.txt | 14 - .../tests/fragment/in-vals-ret-vals-outES.txt | 15 - .../tests/fragment/intrinsics-in.txt | 77 - .../tests/fragment/intrinsics-inES.txt | 77 - .../tests/fragment/intrinsics-inES3.txt | 97 - .../tests/fragment/intrinsics-out.txt | 116 - .../tests/fragment/intrinsics-outES.txt | 132 - .../tests/fragment/intrinsics-outES3.txt | 154 - .../tests/fragment/intrinsics-outES3Metal.txt | 164 - .../tests/fragment/loop-for-inES.txt | 23 - .../tests/fragment/loop-for-inES3.txt | 25 - .../tests/fragment/loop-for-outES.txt | 29 - .../tests/fragment/loop-for-outES3.txt | 31 - .../tests/fragment/loop-for-outES3Metal.txt | 41 - .../tests/fragment/loop-forafterdiscard-inES.txt | 24 - .../tests/fragment/loop-forafterdiscard-inES3.txt | 26 - .../tests/fragment/loop-forafterdiscard-outES.txt | 32 - .../tests/fragment/loop-forafterdiscard-outES3.txt | 34 - .../fragment/loop-forafterdiscard-outES3Metal.txt | 44 - .../tests/fragment/loop-foraliasinductor-inES.txt | 29 - .../tests/fragment/loop-foraliasinductor-outES.txt | 36 - .../tests/fragment/loop-forarounddiscard-inES.txt | 25 - .../tests/fragment/loop-forarounddiscard-outES.txt | 32 - .../tests/fragment/loop-fornounroll-inES.txt | 7 - .../tests/fragment/loop-fornounroll-outES.txt | 16 - .../tests/fragment/loop-forunbounded-inES.txt | 24 - .../tests/fragment/loop-forunbounded-outES.txt | 38 - .../tests/fragment/loop-forvariants-in.txt | 21 - .../tests/fragment/loop-forvariants-out.txt | 51 - .../tests/fragment/loop-forwronginductor-inES.txt | 24 - .../tests/fragment/loop-forwronginductor-outES.txt | 31 - .../tests/fragment/matrix-cast-types-inES3.txt | 94 - .../tests/fragment/matrix-cast-types-outES3.txt | 78 - .../fragment/matrix-cast-types-outES3Metal.txt | 94 - .../tests/fragment/matrix-ops-inES3.txt | 30 - .../tests/fragment/matrix-ops-outES3.txt | 49 - .../tests/fragment/matrix-ops-outES3Metal.txt | 71 - .../glsl-optimizer/tests/fragment/mrt-in.txt | 7 - .../glsl-optimizer/tests/fragment/mrt-inES.txt | 9 - .../glsl-optimizer/tests/fragment/mrt-inES3.txt | 9 - .../tests/fragment/mrt-mixed-array-inES3.txt | 13 - .../tests/fragment/mrt-mixed-array-outES3.txt | 11 - .../tests/fragment/mrt-mixed-array-outES3Metal.txt | 21 - .../glsl-optimizer/tests/fragment/mrt-out.txt | 10 - .../glsl-optimizer/tests/fragment/mrt-outES.txt | 11 - .../glsl-optimizer/tests/fragment/mrt-outES3.txt | 12 - .../tests/fragment/mrt-outES3Metal.txt | 25 - .../tests/fragment/mrt-unused-inES3.txt | 15 - .../tests/fragment/mrt-unused-outES3.txt | 19 - .../tests/fragment/mrt-unused-outES3Metal.txt | 29 - .../tests/fragment/nested-inlining-in.txt | 20 - .../tests/fragment/nested-inlining-out.txt | 24 - .../tests/fragment/opt-copyprop-struct-in.txt | 10 - .../tests/fragment/opt-copyprop-struct-out.txt | 10 - .../fragment/opt-copypropelems-swizzle-in.txt | 8 - .../fragment/opt-copypropelems-swizzle-out.txt | 19 - .../tests/fragment/opt-dead-texloads-in.txt | 20 - .../tests/fragment/opt-dead-texloads-out.txt | 14 - .../fragment/opt-dead-texloadstreeshadow-inES3.txt | 85 - .../opt-dead-texloadstreeshadow-outES3.txt | 9 - .../opt-dead-texloadstreeshadow-outES3Metal.txt | 19 - .../tests/fragment/opt-deadcode-in.txt | 24 - .../tests/fragment/opt-deadcode-out.txt | 9 - .../tests/fragment/opt-deadcodestruct-in.txt | 11 - .../tests/fragment/opt-deadcodestruct-out.txt | 7 - .../tests/fragment/opt-grafting-precision-inES.txt | 13 - .../fragment/opt-grafting-precision-inES3.txt | 15 - .../fragment/opt-grafting-precision-outES.txt | 21 - .../fragment/opt-grafting-precision-outES3.txt | 23 - .../opt-grafting-precision-outES3Metal.txt | 33 - .../glsl-optimizer/tests/fragment/opt-ifs-in.txt | 11 - .../glsl-optimizer/tests/fragment/opt-ifs-out.txt | 14 - .../tests/fragment/opt-inline-inoutstruct-in.txt | 11 - .../tests/fragment/opt-inline-inoutstruct-out.txt | 7 - .../fragment/opt-movevars-sideeffect-inES.txt | 22 - .../fragment/opt-movevars-sideeffect-outES.txt | 21 - .../fragment/opt-movevars-sideeffect2-inES.txt | 16 - .../fragment/opt-movevars-sideeffect2-outES.txt | 26 - .../tests/fragment/opt-movevars-simple-inES.txt | 14 - .../tests/fragment/opt-movevars-simple-outES.txt | 19 - .../tests/fragment/opt-vec-var-index-in.txt | 7 - .../tests/fragment/opt-vec-var-index-out.txt | 10 - .../tests/fragment/opt-vectorize-ifs-in.txt | 14 - .../tests/fragment/opt-vectorize-ifs-out.txt | 31 - .../tests/fragment/opt-vectorize-retval-in.txt | 22 - .../tests/fragment/opt-vectorize-retval-out.txt | 35 - .../tests/fragment/opt-vectorize-types-in.txt | 14 - .../tests/fragment/opt-vectorize-types-out.txt | 21 - .../glsl-optimizer/tests/fragment/pp-basic-in.txt | 17 - .../glsl-optimizer/tests/fragment/pp-basic-out.txt | 7 - .../tests/fragment/prec-default-inES.txt | 25 - .../tests/fragment/prec-default-outES.txt | 49 - .../tests/fragment/prec-expressions-inES3.txt | 17 - .../tests/fragment/prec-expressions-outES3.txt | 24 - .../fragment/prec-expressions-outES3Metal.txt | 34 - .../tests/fragment/prec-inlineexpr1-inES.txt | 21 - .../tests/fragment/prec-inlineexpr1-outES.txt | 27 - .../tests/fragment/prec-inlineexpr2-inES.txt | 21 - .../tests/fragment/prec-inlineexpr2-outES.txt | 27 - .../tests/fragment/prec-matrix-constr-inES3.txt | 28 - .../tests/fragment/prec-matrix-constr-outES3.txt | 25 - .../fragment/prec-matrix-constr-outES3Metal.txt | 35 - .../tests/fragment/prec-temps-inES.txt | 42 - .../tests/fragment/prec-temps-outES.txt | 37 - .../tests/fragment/prec-tempssimple-inES.txt | 21 - .../tests/fragment/prec-tempssimple-outES.txt | 31 - .../tests/fragment/prec-treegrafting-inES.txt | 13 - .../tests/fragment/prec-treegrafting-outES.txt | 20 - .../tests/fragment/qualifiers-layout-inES3.txt | 13 - .../tests/fragment/qualifiers-layout-outES3.txt | 14 - .../fragment/qualifiers-layout-outES3Metal.txt | 24 - .../tests/fragment/sampler-precision-inES.txt | 23 - .../tests/fragment/sampler-precision-inES3.txt | 25 - .../tests/fragment/sampler-precision-outES.txt | 38 - .../tests/fragment/sampler-precision-outES3.txt | 40 - .../fragment/sampler-precision-outES3Metal.txt | 50 - .../tests/fragment/small-float-in.txt | 6 - .../tests/fragment/small-float-out.txt | 10 - .../tests/fragment/struct-array-var-index-in.txt | 9 - .../tests/fragment/struct-array-var-index-out.txt | 7 - .../tests/fragment/struct-initializer-in.txt | 78 - .../tests/fragment/struct-initializer-out.txt | 49 - .../tests/fragment/struct-unused-in.txt | 7 - .../tests/fragment/struct-unused-out.txt | 7 - .../tests/fragment/swizzle-writemask-in.txt | 6 - .../tests/fragment/swizzle-writemask-out.txt | 12 - .../glsl-optimizer/tests/fragment/syntax-inES.txt | 15 - .../glsl-optimizer/tests/fragment/syntax-outES.txt | 7 - .../glsl-optimizer/tests/fragment/ternary-in.txt | 17 - .../glsl-optimizer/tests/fragment/ternary-inES.txt | 17 - .../tests/fragment/ternary-inES3.txt | 18 - .../glsl-optimizer/tests/fragment/ternary-out.txt | 49 - .../tests/fragment/ternary-outES.txt | 49 - .../tests/fragment/ternary-outES3.txt | 51 - .../tests/fragment/ternary-outES3Metal.txt | 61 - .../tests/fragment/ternary-vec4-in.txt | 26 - .../tests/fragment/ternary-vec4-inES.txt | 26 - .../tests/fragment/ternary-vec4-inES3.txt | 28 - .../tests/fragment/ternary-vec4-out.txt | 172 - .../tests/fragment/ternary-vec4-outES.txt | 174 - .../tests/fragment/ternary-vec4-outES3.txt | 176 - .../tests/fragment/ternary-vec4-outES3Metal.txt | 186 - .../tests/fragment/tex2DArray-in.txt | 20 - .../tests/fragment/tex2DArray-inES3.txt | 19 - .../tests/fragment/tex2DArray-out.txt | 14 - .../tests/fragment/tex2DArray-outES3.txt | 33 - .../tests/fragment/tex2DArray-outES3Metal.txt | 43 - .../glsl-optimizer/tests/fragment/tex2dgrad-in.txt | 7 - .../tests/fragment/tex2dgrad-inES.txt | 8 - .../tests/fragment/tex2dgrad-inES3.txt | 13 - .../tests/fragment/tex2dgrad-out.txt | 16 - .../tests/fragment/tex2dgrad-outES.txt | 21 - .../tests/fragment/tex2dgrad-outES3.txt | 26 - .../tests/fragment/tex2dgrad-outES3Metal.txt | 36 - .../glsl-optimizer/tests/fragment/tex2dlod-in.txt | 15 - .../tests/fragment/tex2dlod-inES.txt | 15 - .../tests/fragment/tex2dlod-inES3.txt | 19 - .../glsl-optimizer/tests/fragment/tex2dlod-out.txt | 14 - .../tests/fragment/tex2dlod-outES.txt | 27 - .../tests/fragment/tex2dlod-outES3.txt | 24 - .../tests/fragment/tex2dlod-outES3Metal.txt | 34 - .../tests/fragment/tex2dshadow-in.txt | 19 - .../tests/fragment/tex2dshadow-inES.txt | 20 - .../tests/fragment/tex2dshadow-inES3.txt | 23 - .../tests/fragment/tex2dshadow-out.txt | 13 - .../tests/fragment/tex2dshadow-outES.txt | 16 - .../tests/fragment/tex2dshadow-outES3.txt | 23 - .../tests/fragment/tex2dshadow-outES3Metal.txt | 34 - .../glsl-optimizer/tests/fragment/tex3D-in.txt | 5 - .../glsl-optimizer/tests/fragment/tex3D-inES3.txt | 8 - .../glsl-optimizer/tests/fragment/tex3D-inES__.txt | 7 - .../glsl-optimizer/tests/fragment/tex3D-out.txt | 13 - .../glsl-optimizer/tests/fragment/tex3D-outES3.txt | 16 - .../tests/fragment/tex3D-outES3Metal.txt | 26 - .../tests/fragment/texCubeShadow-inES3.txt | 13 - .../tests/fragment/texCubeShadow-outES3.txt | 18 - .../tests/fragment/texCubeShadow-outES3Metal.txt | 29 - .../tests/fragment/texOffset-inES3.txt | 23 - .../tests/fragment/texOffset-outES3.txt | 25 - .../tests/fragment/texOffset-outES3Metal.txt | 35 - .../glsl-optimizer/tests/fragment/texProj-inES.txt | 20 - .../tests/fragment/texProj-inES3.txt | 20 - .../tests/fragment/texProj-outES.txt | 41 - .../tests/fragment/texProj-outES3.txt | 23 - .../tests/fragment/texProj-outES3Metal.txt | 34 - .../tests/fragment/texSize-inES3.txt | 7 - .../tests/fragment/texSize-outES3.txt | 15 - .../tests/fragment/texSize-outES3Metal.txt | 25 - .../tests/fragment/texelFetchMSAA-in.txt | 7 - .../tests/fragment/texelFetchMSAA-out.txt | 15 - .../tests/fragment/types-writemask-in.txt | 6 - .../tests/fragment/types-writemask-out.txt | 12 - .../fragment/variables-initialization-inES3.txt | 44 - .../fragment/variables-initialization-outES3.txt | 32 - .../variables-initialization-outES3Metal.txt | 42 - .../glsl-optimizer/tests/fragment/varyings-in.txt | 13 - .../tests/fragment/varyings-inES.txt | 13 - .../glsl-optimizer/tests/fragment/varyings-out.txt | 7 - .../tests/fragment/varyings-outES.txt | 7 - .../glsl-optimizer/tests/fragment/vface-in.txt | 10 - .../glsl-optimizer/tests/fragment/vface-inES.txt | 10 - .../glsl-optimizer/tests/fragment/vface-out.txt | 10 - .../glsl-optimizer/tests/fragment/vface-outES.txt | 14 - .../glsl-optimizer/tests/fragment/vpos-in.txt | 10 - .../glsl-optimizer/tests/fragment/vpos-inES.txt | 10 - .../glsl-optimizer/tests/fragment/vpos-out.txt | 13 - .../glsl-optimizer/tests/fragment/vpos-outES.txt | 15 - .../tests/fragment/z-DirLMBasis-inES3.txt | 136 - .../tests/fragment/z-DirLMBasis-outES3.txt | 55 - .../tests/fragment/z-DirLMBasis-outES3Metal.txt | 65 - .../tests/fragment/z-LightShaftsCoord-inES3.txt | 98 - .../tests/fragment/z-LightShaftsCoord-outES3.txt | 128 - .../fragment/z-LightShaftsCoord-outES3Metal.txt | 139 - .../tests/fragment/z-alphabumpspec-in.txt | 111 - .../tests/fragment/z-alphabumpspec-inES3.txt | 118 - .../tests/fragment/z-alphabumpspec-out.txt | 54 - .../tests/fragment/z-alphabumpspec-outES3.txt | 67 - .../tests/fragment/z-alphabumpspec-outES3Metal.txt | 79 - .../tests/fragment/z-collectshadows-in.txt | 77 - .../tests/fragment/z-collectshadows-inES.txt | 79 - .../tests/fragment/z-collectshadows-inES3.txt | 81 - .../tests/fragment/z-collectshadows-out.txt | 65 - .../tests/fragment/z-collectshadows-outES.txt | 89 - .../tests/fragment/z-collectshadows-outES3.txt | 91 - .../fragment/z-collectshadows-outES3Metal.txt | 101 - .../glsl-optimizer/tests/fragment/z-flare-in.txt | 23 - .../glsl-optimizer/tests/fragment/z-flare-inES.txt | 11 - .../glsl-optimizer/tests/fragment/z-flare-out.txt | 13 - .../tests/fragment/z-flare-outES.txt | 17 - .../tests/fragment/z-fxaa-preset1-in.txt | 188 - .../tests/fragment/z-fxaa-preset1-out.txt | 294 - .../tests/fragment/z-fxaa-preset3-in.txt | 138 - .../tests/fragment/z-fxaa-preset3-inES3.txt | 139 - .../tests/fragment/z-fxaa-preset3-out.txt | 292 - .../tests/fragment/z-fxaa-preset3-outES3.txt | 293 - .../tests/fragment/z-fxaa-preset3-outES3Metal.txt | 303 - .../tests/fragment/z-fxaa3-11-consolepc-in.txt | 107 - .../tests/fragment/z-fxaa3-11-consolepc-inES.txt | 106 - .../tests/fragment/z-fxaa3-11-consolepc-out.txt | 79 - .../tests/fragment/z-fxaa3-11-consolepc-outES.txt | 100 - .../tests/fragment/z-fxaa3-11-pc39-in.txt | 567 - .../tests/fragment/z-fxaa3-11-pc39-inES.txt | 567 - .../tests/fragment/z-fxaa3-11-pc39-out.txt | 541 - .../tests/fragment/z-fxaa3-11-pc39-outES.txt | 654 - .../tests/fragment/z-particle-in.txt | 21 - .../tests/fragment/z-particle-inES.txt | 20 - .../tests/fragment/z-particle-out.txt | 15 - .../tests/fragment/z-particle-outES.txt | 17 - .../tests/fragment/z-prepasslight-in.txt | 145 - .../tests/fragment/z-prepasslight-inES.txt | 145 - .../tests/fragment/z-prepasslight-inES3.txt | 147 - .../tests/fragment/z-prepasslight-out.txt | 124 - .../tests/fragment/z-prepasslight-outES.txt | 176 - .../tests/fragment/z-prepasslight-outES3.txt | 178 - .../tests/fragment/z-prepasslight-outES3Metal.txt | 188 - .../tests/fragment/z-tonemap-usercurve-inES3.txt | 49 - .../tests/fragment/z-tonemap-usercurve-outES3.txt | 46 - .../fragment/z-tonemap-usercurve-outES3Metal.txt | 56 - .../tests/fragment/z-treeleaf-in.txt | 137 - .../tests/fragment/z-treeleaf-inES.txt | 137 - .../tests/fragment/z-treeleaf-out.txt | 79 - .../tests/fragment/z-treeleaf-outES.txt | 97 - .../tests/fragment/z-treeleafloop-inES.txt | 81 - .../tests/fragment/z-treeleafloop-inES3.txt | 81 - .../tests/fragment/z-treeleafloop-outES.txt | 87 - .../tests/fragment/z-treeleafloop-outES3.txt | 89 - .../tests/fragment/z-treeleafloop-outES3Metal.txt | 99 - .../tests/fragment/z-unishader-dirlm-in.txt | 258 - .../tests/fragment/z-unishader-dirlm-inES3.txt | 259 - .../tests/fragment/z-unishader-dirlm-out.txt | 204 - .../tests/fragment/z-unishader-dirlm-outES3.txt | 207 - .../fragment/z-unishader-dirlm-outES3Metal.txt | 217 - .../tests/fragment/z-unity-spot-inES3.txt | 101 - .../tests/fragment/z-unity-spot-outES3.txt | 71 - .../tests/fragment/z-unity-spot-outES3Metal.txt | 81 - .../tests/fragment/zun-Bumped_Diffuse-in.txt | 90 - .../tests/fragment/zun-Bumped_Diffuse-out.txt | 24 - .../tests/fragment/zun-Bumped_Diffuse1-in.txt | 96 - .../tests/fragment/zun-Bumped_Diffuse1-out.txt | 27 - .../tests/fragment/zun-Bumped_Specular-in.txt | 120 - .../tests/fragment/zun-Bumped_Specular-out.txt | 56 - .../tests/fragment/zun-Bumped_Specular1-in.txt | 112 - .../tests/fragment/zun-Bumped_Specular1-out.txt | 54 - .../tests/fragment/zun-Bumped_Specular2-in.txt | 136 - .../tests/fragment/zun-Bumped_Specular2-out.txt | 35 - .../glsl-optimizer/tests/fragment/zun-Decal-in.txt | 96 - .../tests/fragment/zun-Decal-out.txt | 37 - .../tests/fragment/zun-Decal1-in.txt | 99 - .../tests/fragment/zun-Decal1-out.txt | 39 - .../tests/fragment/zun-Decal2-in.txt | 93 - .../tests/fragment/zun-Decal2-out.txt | 37 - .../tests/fragment/zun-Diffuse-in.txt | 93 - .../tests/fragment/zun-Diffuse-out.txt | 33 - .../tests/fragment/zun-Diffuse1-in.txt | 69 - .../tests/fragment/zun-Diffuse1-out.txt | 12 - .../tests/fragment/zun-Diffuse2-in.txt | 120 - .../tests/fragment/zun-Diffuse2-out.txt | 31 - .../zun-Diffuse_Alpha_Shadowed_ZWrite-in.txt | 90 - .../zun-Diffuse_Alpha_Shadowed_ZWrite-out.txt | 31 - .../tests/fragment/zun-Diffuse_Detail-in.txt | 106 - .../tests/fragment/zun-Diffuse_Detail-out.txt | 40 - .../tests/fragment/zun-Diffuse_Detail1-in.txt | 72 - .../tests/fragment/zun-Diffuse_Detail1-out.txt | 12 - .../zun-FX_Glass_Stained_BumpDistort-in.txt | 58 - .../zun-FX_Glass_Stained_BumpDistort-out.txt | 31 - .../tests/fragment/zun-FX_Water_(simple)-in.txt | 62 - .../tests/fragment/zun-FX_Water_(simple)-out.txt | 32 - .../tests/fragment/zun-Grab_Invert-in.txt | 30 - .../tests/fragment/zun-Grab_Invert-out.txt | 12 - .../zun-Hidden_Camera-DepthNormalTexture-in.txt | 71 - .../zun-Hidden_Camera-DepthNormalTexture-out.txt | 35 - .../zun-Hidden_Camera-DepthNormalTexture1-in.txt | 72 - .../zun-Hidden_Camera-DepthNormalTexture1-out.txt | 35 - .../fragment/zun-Hidden_Camera-DepthTexture-in.txt | 42 - .../zun-Hidden_Camera-DepthTexture-out.txt | 17 - .../zun-Hidden_Color_Correction_Effect-in.txt | 37 - .../zun-Hidden_Color_Correction_Effect-out.txt | 21 - .../tests/fragment/zun-Hidden_Edge_Detect_X-in.txt | 48 - .../fragment/zun-Hidden_Edge_Detect_X-out.txt | 26 - .../tests/fragment/zun-Hidden_GlowConeTap-in.txt | 38 - .../tests/fragment/zun-Hidden_GlowConeTap-out.txt | 24 - .../fragment/zun-Hidden_Glow_Downsample-in.txt | 43 - .../fragment/zun-Hidden_Glow_Downsample-out.txt | 23 - .../fragment/zun-Hidden_Grayscale_Effect-in.txt | 41 - .../fragment/zun-Hidden_Grayscale_Effect-out.txt | 25 - .../zun-Hidden_Internal-CombineDepthNormals-in.txt | 73 - ...zun-Hidden_Internal-CombineDepthNormals-out.txt | 46 - .../zun-Hidden_Internal-GUITextureBlit-in.txt | 43 - .../zun-Hidden_Internal-GUITextureBlit-out.txt | 18 - .../zun-Hidden_Internal-GUITextureClip-in.txt | 43 - .../zun-Hidden_Internal-GUITextureClip-out.txt | 18 - .../tests/fragment/zun-Hidden_Internal-Halo-in.txt | 39 - .../fragment/zun-Hidden_Internal-Halo-out.txt | 18 - ...un-Hidden_Internal-PrePassCollectShadows-in.txt | 95 - ...n-Hidden_Internal-PrePassCollectShadows-out.txt | 65 - .../zun-Hidden_Internal-PrePassLighting-in.txt | 146 - .../zun-Hidden_Internal-PrePassLighting-out.txt | 97 - .../fragment/zun-Hidden_Noise_Shader_RGB-in.txt | 45 - .../fragment/zun-Hidden_Noise_Shader_RGB-out.txt | 29 - .../fragment/zun-Hidden_Noise_Shader_YUV-in.txt | 52 - .../fragment/zun-Hidden_Noise_Shader_YUV-out.txt | 36 - .../fragment/zun-Hidden_Sepiatone_Effect-in.txt | 34 - .../fragment/zun-Hidden_Sepiatone_Effect-out.txt | 17 - .../fragment/zun-Hidden_Shadow-ScreenBlur-in.txt | 73 - .../fragment/zun-Hidden_Shadow-ScreenBlur-out.txt | 79 - .../fragment/zun-Hidden_ShowDepthNTexture-in.txt | 61 - .../fragment/zun-Hidden_ShowDepthNTexture-out.txt | 30 - .../fragment/zun-Hidden_ShowDepthTexture-in.txt | 41 - .../fragment/zun-Hidden_ShowDepthTexture-out.txt | 24 - .../zun-Hidden_TerrainEngine_BillboardTree-in.txt | 48 - .../zun-Hidden_TerrainEngine_BillboardTree-out.txt | 21 - ...Engine_Details_BillboardWavingDoublePass-in.txt | 98 - ...ngine_Details_BillboardWavingDoublePass-out.txt | 37 - ...ngine_Details_BillboardWavingDoublePass1-in.txt | 102 - ...gine_Details_BillboardWavingDoublePass1-out.txt | 43 - ...ngine_Details_BillboardWavingDoublePass2-in.txt | 74 - ...gine_Details_BillboardWavingDoublePass2-out.txt | 21 - ...n-Hidden_TerrainEngine_Details_Vertexlit-in.txt | 96 - ...-Hidden_TerrainEngine_Details_Vertexlit-out.txt | 32 - ...-Hidden_TerrainEngine_Details_Vertexlit1-in.txt | 123 - ...Hidden_TerrainEngine_Details_Vertexlit1-out.txt | 29 - ...n_TerrainEngine_Details_WavingDoublePass-in.txt | 108 - ..._TerrainEngine_Details_WavingDoublePass-out.txt | 39 - ..._TerrainEngine_Details_WavingDoublePass1-in.txt | 110 - ...TerrainEngine_Details_WavingDoublePass1-out.txt | 43 - ..._TerrainEngine_Details_WavingDoublePass2-in.txt | 94 - ...TerrainEngine_Details_WavingDoublePass2-out.txt | 33 - ...ngine_My_Soft_Occlusion_Leaves_rendertex-in.txt | 37 - ...gine_My_Soft_Occlusion_Leaves_rendertex-out.txt | 12 - ...rainEngine_Soft_Occlusion_Bark_rendertex-in.txt | 45 - ...ainEngine_Soft_Occlusion_Bark_rendertex-out.txt | 16 - ...inEngine_Soft_Occlusion_Leaves_rendertex-in.txt | 51 - ...nEngine_Soft_Occlusion_Leaves_rendertex-out.txt | 26 - ..._TerrainEngine_Splatmap_Lightmap-AddPass-in.txt | 119 - ...TerrainEngine_Splatmap_Lightmap-AddPass-out.txt | 46 - ...TerrainEngine_Splatmap_Lightmap-AddPass1-in.txt | 106 - ...errainEngine_Splatmap_Lightmap-AddPass1-out.txt | 42 - ...errainEngine_Splatmap_Lightmap-FirstPass-in.txt | 106 - ...rrainEngine_Splatmap_Lightmap-FirstPass-out.txt | 42 - ...rrainEngine_Splatmap_Lightmap-FirstPass1-in.txt | 140 - ...rainEngine_Splatmap_Lightmap-FirstPass1-out.txt | 45 - .../zun-Hidden_Tree_Bark_Shader_Rendertex-in.txt | 44 - .../zun-Hidden_Tree_Bark_Shader_Rendertex-out.txt | 15 - .../zun-Hidden_Tree_Leaf_Shader_Rendertex-in.txt | 66 - .../zun-Hidden_Tree_Leaf_Shader_Rendertex-out.txt | 25 - .../zun-Hidden_Tree_Optimized_Bark_Shader-in.txt | 127 - .../zun-Hidden_Tree_Optimized_Bark_Shader-out.txt | 53 - .../zun-Hidden_Tree_Optimized_Bark_Shader1-in.txt | 88 - .../zun-Hidden_Tree_Optimized_Bark_Shader1-out.txt | 7 - .../zun-Hidden_Tree_Optimized_Leaf_Shader-in.txt | 156 - .../zun-Hidden_Tree_Optimized_Leaf_Shader-out.txt | 67 - .../zun-Hidden_Tree_Optimized_Leaf_Shader1-in.txt | 161 - .../zun-Hidden_Tree_Optimized_Leaf_Shader1-out.txt | 75 - .../fragment/zun-Hidden_Twirt_Effect_Shader-in.txt | 49 - .../zun-Hidden_Twirt_Effect_Shader-out.txt | 26 - .../tests/fragment/zun-Hidden_Twist_Effect-in.txt | 75 - .../tests/fragment/zun-Hidden_Twist_Effect-out.txt | 34 - ...egacy_Shaders_Lightmapped_Bumped_Diffuse-in.txt | 103 - ...gacy_Shaders_Lightmapped_Bumped_Diffuse-out.txt | 39 - ...gacy_Shaders_Lightmapped_Bumped_Diffuse2-in.txt | 101 - ...acy_Shaders_Lightmapped_Bumped_Diffuse2-out.txt | 36 - .../zun-Legacy_Shaders_Lightmapped_Diffuse-in.txt | 105 - .../zun-Legacy_Shaders_Lightmapped_Diffuse-out.txt | 36 - .../tests/fragment/zun-MobileBumpSpec-inES.txt | 83 - .../tests/fragment/zun-MobileBumpSpec-inES3.txt | 86 - .../tests/fragment/zun-MobileBumpSpec-outES.txt | 46 - .../tests/fragment/zun-MobileBumpSpec-outES3.txt | 48 - .../fragment/zun-MobileBumpSpec-outES3Metal.txt | 58 - .../zun-Nature_My_Soft_Occlusion_Leaves-in.txt | 37 - .../zun-Nature_My_Soft_Occlusion_Leaves-out.txt | 12 - .../fragment/zun-Nature_Soft_Occlusion_Bark-in.txt | 102 - .../zun-Nature_Soft_Occlusion_Bark-out.txt | 35 - .../zun-Nature_Soft_Occlusion_Bark1-in.txt | 92 - .../zun-Nature_Soft_Occlusion_Bark1-out.txt | 29 - .../zun-Nature_Soft_Occlusion_Bark2-in.txt | 76 - .../zun-Nature_Soft_Occlusion_Bark2-out.txt | 21 - .../zun-Nature_Soft_Occlusion_Bark3-in.txt | 127 - .../zun-Nature_Soft_Occlusion_Bark3-out.txt | 50 - .../zun-Nature_Soft_Occlusion_Leaves-in.txt | 105 - .../zun-Nature_Soft_Occlusion_Leaves-out.txt | 40 - .../zun-Nature_Soft_Occlusion_Leaves1-in.txt | 91 - .../zun-Nature_Soft_Occlusion_Leaves1-out.txt | 34 - .../zun-Nature_Soft_Occlusion_Leaves2-in.txt | 125 - .../zun-Nature_Soft_Occlusion_Leaves2-out.txt | 38 - .../zun-Nature_Soft_Occlusion_Leaves3-in.txt | 84 - .../zun-Nature_Soft_Occlusion_Leaves3-out.txt | 33 - .../zun-Nature_Vegetation_Two_Pass_unlit-in.txt | 45 - .../zun-Nature_Vegetation_Two_Pass_unlit-out.txt | 24 - .../tests/fragment/zun-Parallax_Diffuse-in.txt | 128 - .../tests/fragment/zun-Parallax_Diffuse-out.txt | 49 - .../tests/fragment/zun-Parallax_Diffuse1-in.txt | 117 - .../tests/fragment/zun-Parallax_Diffuse1-out.txt | 42 - .../tests/fragment/zun-Parallax_Diffuse2-in.txt | 151 - .../tests/fragment/zun-Parallax_Diffuse2-out.txt | 46 - .../tests/fragment/zun-Parallax_Specular-in.txt | 140 - .../tests/fragment/zun-Parallax_Specular-out.txt | 75 - .../tests/fragment/zun-Particles_Additive-in.txt | 38 - .../tests/fragment/zun-Particles_Additive-out.txt | 16 - .../fragment/zun-Particles_Additive_(Soft)-in.txt | 40 - .../fragment/zun-Particles_Additive_(Soft)-out.txt | 16 - .../zun-Particles_Alpha_Blended_Premultiply-in.txt | 37 - ...zun-Particles_Alpha_Blended_Premultiply-out.txt | 13 - .../tests/fragment/zun-Particles_Multiply-in.txt | 39 - .../tests/fragment/zun-Particles_Multiply-out.txt | 15 - .../zun-Particles_Multiply_(Double)-in.txt | 42 - .../zun-Particles_Multiply_(Double)-out.txt | 18 - .../zun-Particles__Additive-Multiply-in.txt | 43 - .../zun-Particles__Additive-Multiply-out.txt | 21 - .../fragment/zun-Reflective_Bumped_Diffuse-in.txt | 111 - .../fragment/zun-Reflective_Bumped_Diffuse-out.txt | 43 - .../fragment/zun-Reflective_Bumped_Diffuse1-in.txt | 156 - .../zun-Reflective_Bumped_Diffuse1-out.txt | 65 - .../fragment/zun-Reflective_Bumped_Specular-in.txt | 124 - .../zun-Reflective_Bumped_Specular-out.txt | 61 - .../zun-Reflective_Bumped_Specular1-in.txt | 104 - .../zun-Reflective_Bumped_Specular1-out.txt | 27 - .../zun-Reflective_Bumped_Specular2-in.txt | 128 - .../zun-Reflective_Bumped_Specular2-out.txt | 65 - .../fragment/zun-Reflective_Bumped_Unlit-in.txt | 75 - .../fragment/zun-Reflective_Bumped_Unlit-out.txt | 38 - .../tests/fragment/zun-Reflective_Diffuse-in.txt | 111 - .../tests/fragment/zun-Reflective_Diffuse-out.txt | 40 - .../tests/fragment/zun-Reflective_Diffuse1-in.txt | 99 - .../tests/fragment/zun-Reflective_Diffuse1-out.txt | 36 - .../zun-Reflective_Parallax_Diffuse-in.txt | 141 - .../zun-Reflective_Parallax_Diffuse-out.txt | 60 - .../zun-Reflective_Parallax_Diffuse1-in.txt | 142 - .../zun-Reflective_Parallax_Diffuse1-out.txt | 72 - .../zun-Reflective_Parallax_Specular-in.txt | 140 - .../zun-Reflective_Parallax_Specular-out.txt | 74 - .../zun-Reflective_Parallax_Specular1-in.txt | 139 - .../zun-Reflective_Parallax_Specular1-out.txt | 72 - .../tests/fragment/zun-Reflective_Specular-in.txt | 123 - .../tests/fragment/zun-Reflective_Specular-out.txt | 60 - .../tests/fragment/zun-Reflective_Specular1-in.txt | 81 - .../fragment/zun-Reflective_Specular1-out.txt | 15 - .../tests/fragment/zun-Reflective_Specular2-in.txt | 105 - .../fragment/zun-Reflective_Specular2-out.txt | 40 - .../tests/fragment/zun-RenderFX_Skybox-in.txt | 44 - .../tests/fragment/zun-RenderFX_Skybox-out.txt | 20 - .../fragment/zun-RenderFX_Skybox_Cubed-in.txt | 40 - .../fragment/zun-RenderFX_Skybox_Cubed-out.txt | 20 - .../tests/fragment/zun-SSAO24-in.txt | 100 - .../tests/fragment/zun-SSAO24-inES3.txt | 79 - .../tests/fragment/zun-SSAO24-out.txt | 100 - .../tests/fragment/zun-SSAO24-outES3.txt | 79 - .../tests/fragment/zun-SSAO24-outES3Metal.txt | 90 - .../tests/fragment/zun-SSAO8-inES.txt | 131 - .../tests/fragment/zun-SSAO8-outES.txt | 96 - .../zun-Self-Illumin_Bumped_Diffuse-in.txt | 115 - .../zun-Self-Illumin_Bumped_Diffuse-out.txt | 44 - .../zun-Self-Illumin_Bumped_Diffuse1-in.txt | 95 - .../zun-Self-Illumin_Bumped_Diffuse1-out.txt | 24 - .../zun-Self-Illumin_Bumped_Diffuse2-in.txt | 103 - .../zun-Self-Illumin_Bumped_Diffuse2-out.txt | 34 - .../zun-Self-Illumin_Bumped_Specular-in.txt | 98 - .../zun-Self-Illumin_Bumped_Specular-out.txt | 27 - .../zun-Self-Illumin_Bumped_Specular1-in.txt | 109 - .../zun-Self-Illumin_Bumped_Specular1-out.txt | 40 - .../tests/fragment/zun-Self-Illumin_Diffuse-in.txt | 97 - .../fragment/zun-Self-Illumin_Diffuse-out.txt | 29 - .../fragment/zun-Self-Illumin_Diffuse1-in.txt | 127 - .../fragment/zun-Self-Illumin_Diffuse1-out.txt | 38 - .../zun-Self-Illumin_Parallax_Diffuse-in.txt | 134 - .../zun-Self-Illumin_Parallax_Diffuse-out.txt | 55 - .../zun-Self-Illumin_Parallax_Diffuse1-in.txt | 124 - .../zun-Self-Illumin_Parallax_Diffuse1-out.txt | 49 - .../zun-Self-Illumin_Parallax_Diffuse2-in.txt | 125 - .../zun-Self-Illumin_Parallax_Diffuse2-out.txt | 45 - .../zun-Self-Illumin_Parallax_Specular-in.txt | 137 - .../zun-Self-Illumin_Parallax_Specular-out.txt | 71 - .../zun-Self-Illumin_Parallax_Specular1-in.txt | 138 - .../zun-Self-Illumin_Parallax_Specular1-out.txt | 73 - .../fragment/zun-Self-Illumin_Specular-in.txt | 119 - .../fragment/zun-Self-Illumin_Specular-out.txt | 57 - .../fragment/zun-Self-Illumin_Specular1-in.txt | 77 - .../fragment/zun-Self-Illumin_Specular1-out.txt | 15 - .../fragment/zun-Self-Illumin_Specular2-in.txt | 133 - .../fragment/zun-Self-Illumin_Specular2-out.txt | 44 - .../tests/fragment/zun-Specular-in.txt | 114 - .../tests/fragment/zun-Specular-out.txt | 55 - .../tests/fragment/zun-Specular1-in.txt | 72 - .../tests/fragment/zun-Specular1-out.txt | 15 - .../tests/fragment/zun-Specular2-in.txt | 126 - .../tests/fragment/zun-Specular2-out.txt | 35 - .../tests/fragment/zun-Surface_2UV-in.txt | 101 - .../tests/fragment/zun-Surface_2UV-out.txt | 35 - .../tests/fragment/zun-Surface_2UV1-in.txt | 85 - .../tests/fragment/zun-Surface_2UV1-out.txt | 27 - .../fragment/zun-Surface_Colored_Specular-in.txt | 122 - .../fragment/zun-Surface_Colored_Specular-out.txt | 47 - .../fragment/zun-Surface_Colored_Specular1-in.txt | 78 - .../fragment/zun-Surface_Colored_Specular1-out.txt | 12 - .../tests/fragment/zun-Surface_Custom_Data-in.txt | 89 - .../tests/fragment/zun-Surface_Custom_Data-out.txt | 29 - .../tests/fragment/zun-Surface_Custom_Data1-in.txt | 87 - .../fragment/zun-Surface_Custom_Data1-out.txt | 23 - .../tests/fragment/zun-Surface_Custom_Data2-in.txt | 115 - .../fragment/zun-Surface_Custom_Data2-out.txt | 24 - .../tests/fragment/zun-Surface_DecalAdd-in.txt | 88 - .../tests/fragment/zun-Surface_DecalAdd-out.txt | 25 - .../fragment/zun-Surface_DecalAddBump3-in.txt | 104 - .../fragment/zun-Surface_DecalAddBump3-out.txt | 36 - .../fragment/zun-Surface_DecalAddBump5-in.txt | 97 - .../fragment/zun-Surface_DecalAddBump5-out.txt | 38 - .../fragment/zun-Surface_Diffuse_Wrapped-in.txt | 90 - .../fragment/zun-Surface_Diffuse_Wrapped-out.txt | 25 - .../tests/fragment/zun-Surface_Rim-in.txt | 112 - .../tests/fragment/zun-Surface_Rim-out.txt | 23 - .../tests/fragment/zun-Surface_Rim1-in.txt | 116 - .../tests/fragment/zun-Surface_Rim1-out.txt | 32 - .../tests/fragment/zun-Surface_Rim2-in.txt | 129 - .../tests/fragment/zun-Surface_Rim2-out.txt | 36 - .../tests/fragment/zun-Surface_Rim_Bump-in.txt | 131 - .../tests/fragment/zun-Surface_Rim_Bump-out.txt | 40 - .../tests/fragment/zun-Surface_Rim_Bump1-in.txt | 123 - .../tests/fragment/zun-Surface_Rim_Bump1-out.txt | 40 - .../tests/fragment/zun-Surface_ScreenPos-in.txt | 99 - .../tests/fragment/zun-Surface_ScreenPos-out.txt | 29 - .../tests/fragment/zun-Surface_ScreenPos1-in.txt | 91 - .../tests/fragment/zun-Surface_ScreenPos1-out.txt | 29 - .../tests/fragment/zun-Surface_ScreenPos2-in.txt | 69 - .../tests/fragment/zun-Surface_ScreenPos2-out.txt | 12 - .../fragment/zun-Surface_ScreenPosAlbedo-in.txt | 68 - .../fragment/zun-Surface_ScreenPosAlbedo-out.txt | 12 - .../fragment/zun-Surface_ScreenPosAlbedo1-in.txt | 85 - .../fragment/zun-Surface_ScreenPosAlbedo1-out.txt | 28 - .../tests/fragment/zun-Surface_Slices-in.txt | 106 - .../tests/fragment/zun-Surface_Slices-out.txt | 40 - .../tests/fragment/zun-Surface_Slices1-in.txt | 90 - .../tests/fragment/zun-Surface_Slices1-out.txt | 32 - .../tests/fragment/zun-Surface_Slices2-in.txt | 124 - .../tests/fragment/zun-Surface_Slices2-out.txt | 35 - .../tests/fragment/zun-Surface_Slices3-in.txt | 131 - .../tests/fragment/zun-Surface_Slices3-out.txt | 59 - .../tests/fragment/zun-Surface_WorldRefl-in.txt | 85 - .../tests/fragment/zun-Surface_WorldRefl-out.txt | 23 - .../tests/fragment/zun-Surface_WorldRefl1-in.txt | 65 - .../tests/fragment/zun-Surface_WorldRefl1-out.txt | 12 - .../tests/fragment/zun-Test_CgNormals-in.txt | 34 - .../tests/fragment/zun-Test_CgNormals-out.txt | 9 - .../tests/fragment/zun-Test_FontShaderCull-in.txt | 35 - .../tests/fragment/zun-Test_FontShaderCull-out.txt | 15 - .../zun-Test_VertexShaderDepthTexture-in.txt | 40 - .../zun-Test_VertexShaderDepthTexture-out.txt | 17 - .../fragment/zun-Test_VertexShaderTexture-in.txt | 35 - .../fragment/zun-Test_VertexShaderTexture-out.txt | 12 - .../fragment/zun-Tests_Blend_Many_Textures-in.txt | 67 - .../fragment/zun-Tests_Blend_Many_Textures-out.txt | 60 - .../tests/fragment/zun-Tests_Fwd-Def-Vert-in.txt | 85 - .../tests/fragment/zun-Tests_Fwd-Def-Vert-out.txt | 10 - .../tests/fragment/zun-Tests_Fwd-Def-Vert1-in.txt | 64 - .../tests/fragment/zun-Tests_Fwd-Def-Vert1-out.txt | 12 - .../tests/fragment/zun-TexGen_Cube_Refl-in.txt | 37 - .../tests/fragment/zun-TexGen_Cube_Refl-out.txt | 12 - .../tests/fragment/zun-Toon_Basic-in.txt | 43 - .../tests/fragment/zun-Toon_Basic-out.txt | 22 - .../tests/fragment/zun-Toon_Lighted-in.txt | 95 - .../tests/fragment/zun-Toon_Lighted-out.txt | 31 - .../zun-Transparent_Bumped_Specular-in.txt | 114 - .../zun-Transparent_Bumped_Specular-out.txt | 60 - .../zun-Transparent_Cutout_Bumped_Diffuse-in.txt | 102 - .../zun-Transparent_Cutout_Bumped_Diffuse-out.txt | 45 - .../zun-Transparent_Cutout_Bumped_Diffuse1-in.txt | 101 - .../zun-Transparent_Cutout_Bumped_Diffuse1-out.txt | 34 - .../zun-Transparent_Cutout_Bumped_Specular-in.txt | 99 - .../zun-Transparent_Cutout_Bumped_Specular-out.txt | 40 - .../zun-Transparent_Cutout_Bumped_Specular1-in.txt | 107 - ...zun-Transparent_Cutout_Bumped_Specular1-out.txt | 40 - .../fragment/zun-Transparent_Cutout_Diffuse-in.txt | 107 - .../zun-Transparent_Cutout_Diffuse-out.txt | 44 - .../zun-Transparent_Cutout_Specular-in.txt | 106 - .../zun-Transparent_Cutout_Specular-out.txt | 52 - .../zun-Transparent_Cutout_Specular1-in.txt | 111 - .../zun-Transparent_Cutout_Specular1-out.txt | 60 - .../zun-Transparent_Cutout_Specular2-in.txt | 131 - .../zun-Transparent_Cutout_Specular2-out.txt | 44 - .../tests/fragment/zun-Transparent_Diffuse-in.txt | 94 - .../tests/fragment/zun-Transparent_Diffuse-out.txt | 37 - .../tests/fragment/zun-Transparent_Specular-in.txt | 104 - .../fragment/zun-Transparent_Specular-out.txt | 49 - .../tests/fragment/zun-TreeCreatorLeavesRT-in.txt | 66 - .../tests/fragment/zun-TreeCreatorLeavesRT-out.txt | 67 - .../fragment/zun-Tree_Editor_Bark_Shader-in.txt | 120 - .../fragment/zun-Tree_Editor_Bark_Shader-out.txt | 47 - .../fragment/zun-Tree_Editor_Bark_Shader1-in.txt | 125 - .../fragment/zun-Tree_Editor_Bark_Shader1-out.txt | 55 - .../fragment/zun-Tree_Editor_Leaf_Shader-in.txt | 160 - .../fragment/zun-Tree_Editor_Leaf_Shader-out.txt | 79 - .../fragment/zun-Tree_Editor_Leaf_Shader1-in.txt | 162 - .../fragment/zun-Tree_Editor_Leaf_Shader1-out.txt | 60 - .../tests/fragment/zun-Vertex_Colored-in.txt | 43 - .../tests/fragment/zun-Vertex_Colored-out.txt | 13 - .../tests/fragment/zun-currently_adapted-in.txt | 42 - .../tests/fragment/zun-currently_adapted-out.txt | 30 - .../fragment/zunity-MotionBlur-TileMax-in.txt | 46 - .../fragment/zunity-MotionBlur-TileMax-out.txt | 105 - .../glsl-optimizer/tests/global-mutable-inES.txt | 31 - .../glsl-optimizer/tests/global-mutable-inES3.txt | 68 - .../glsl-optimizer/tests/global-mutable-outES.txt | 35 - .../glsl-optimizer/tests/global-mutable-outES3.txt | 54 - .../tests/global-mutable-outES3Metal.txt | 63 - .../glsl-optimizer/tests/glsl_optimizer_tests.cpp | 706 - .../bgfx/3rdparty/glsl-optimizer/tests/tests.gyp | 0 .../bgfx/3rdparty/glsl-optimizer/tests/tests.js | 40 - .../tests/vertex/MF-GodRays-inES.txt | 154 - .../tests/vertex/MF-GodRays-inES3.txt | 161 - .../tests/vertex/MF-GodRays-outES.txt | 167 - .../tests/vertex/MF-GodRays-outES3.txt | 168 - .../tests/vertex/MF-GodRays-outES3Metal.txt | 179 - .../tests/vertex/bug-chained-assign-in.txt | 13 - .../tests/vertex/bug-chained-assign-out.txt | 30 - .../tests/vertex/bug-loops-for-while-in.txt | 21 - .../tests/vertex/bug-loops-for-while-out.txt | 30 - .../tests/vertex/bug-struct-uniform-in.txt | 14 - .../tests/vertex/bug-struct-uniform-out.txt | 19 - .../tests/vertex/bug-swizzle-lhs-cast-inES3.txt | 53 - .../tests/vertex/bug-swizzle-lhs-cast-outES3.txt | 50 - .../vertex/bug-swizzle-lhs-cast-outES3Metal.txt | 61 - .../tests/vertex/bug-varying-const-in.txt | 10 - .../tests/vertex/bug-varying-const-out.txt | 14 - .../tests/vertex/builtin-vars-in.txt | 16 - .../tests/vertex/builtin-vars-inES.txt | 14 - .../tests/vertex/builtin-vars-inES3.txt | 15 - .../tests/vertex/builtin-vars-out.txt | 23 - .../tests/vertex/builtin-vars-outES.txt | 21 - .../tests/vertex/builtin-vars-outES3.txt | 22 - .../tests/vertex/builtin-vars-outES3Metal.txt | 36 - .../glsl-optimizer/tests/vertex/estest1-in.txt | 19 - .../glsl-optimizer/tests/vertex/estest1-out.txt | 23 - .../tests/vertex/glsl140-basic-in.txt | 14 - .../tests/vertex/glsl140-basic-out.txt | 21 - .../tests/vertex/glsl140-integers-in.txt | 26 - .../tests/vertex/glsl140-integers-out.txt | 31 - .../glsl-optimizer/tests/vertex/inputs-inES3.txt | 36 - .../glsl-optimizer/tests/vertex/inputs-outES3.txt | 29 - .../tests/vertex/inputs-outES3Metal.txt | 42 - .../glsl-optimizer/tests/vertex/loops-for-in.txt | 55 - .../glsl-optimizer/tests/vertex/loops-for-out.txt | 50 - .../tests/vertex/loops-for-withvec4-in.txt | 188 - .../tests/vertex/loops-for-withvec4-inES3.txt | 188 - .../tests/vertex/loops-for-withvec4-out.txt | 123 - .../tests/vertex/loops-for-withvec4-outES3.txt | 123 - .../vertex/loops-for-withvec4-outES3Metal.txt | 134 - .../vertex/loops-for-withvec4inductorW-inES3.txt | 86 - .../vertex/loops-for-withvec4inductorW-outES3.txt | 91 - .../loops-for-withvec4inductorW-outES3Metal.txt | 102 - .../tests/vertex/loops-forlimitbreak-inES.txt | 63 - .../tests/vertex/loops-forlimitbreak-inES3.txt | 66 - .../tests/vertex/loops-forlimitbreak-outES.txt | 65 - .../tests/vertex/loops-forlimitbreak-outES3.txt | 77 - .../vertex/loops-forlimitbreak-outES3Metal.txt | 86 - .../tests/vertex/loops-forsimple-in.txt | 9 - .../tests/vertex/loops-forsimple-out.txt | 19 - .../tests/vertex/loops-forvarious-inES.txt | 71 - .../tests/vertex/loops-forvarious-inES3.txt | 74 - .../tests/vertex/loops-forvarious-outES.txt | 44 - .../tests/vertex/loops-forvarious-outES3.txt | 45 - .../tests/vertex/loops-forvarious-outES3Metal.txt | 56 - .../tests/vertex/loops-forwithcalls-in.txt | 9 - .../tests/vertex/loops-forwithcalls-out.txt | 19 - .../tests/vertex/matrix-casts-inES3.txt | 32 - .../tests/vertex/matrix-casts-outES3.txt | 37 - .../tests/vertex/matrix-casts-outES3Metal.txt | 54 - .../tests/vertex/opt-inline-varnames-in.txt | 16 - .../tests/vertex/opt-inline-varnames-out.txt | 11 - .../tests/vertex/opt-matrix-constr-in.txt | 6 - .../tests/vertex/opt-matrix-constr-out.txt | 16 - .../tests/vertex/opt-matrix-transpose-mul-inES.txt | 81 - .../vertex/opt-matrix-transpose-mul-inES3.txt | 83 - .../vertex/opt-matrix-transpose-mul-outES.txt | 70 - .../vertex/opt-matrix-transpose-mul-outES3.txt | 73 - .../opt-matrix-transpose-mul-outES3Metal.txt | 84 - .../glsl-optimizer/tests/vertex/opt-negsub-in.txt | 17 - .../glsl-optimizer/tests/vertex/opt-negsub-out.txt | 32 - .../tests/vertex/opt-normalize-in.txt | 6 - .../tests/vertex/opt-normalize-out.txt | 11 - .../glsl-optimizer/tests/vertex/opt-unroll-in.txt | 42 - .../glsl-optimizer/tests/vertex/opt-unroll-out.txt | 57 - .../tests/vertex/opt-unusedvars-in.txt | 10 - .../tests/vertex/opt-unusedvars-out.txt | 15 - .../tests/vertex/swizzle-casts-inES3.txt | 40 - .../tests/vertex/swizzle-casts-outES3.txt | 24 - .../tests/vertex/swizzle-casts-outES3Metal.txt | 37 - .../glsl-optimizer/tests/vertex/swizzlemask-in.txt | 9 - .../tests/vertex/swizzlemask-out.txt | 14 - .../glsl-optimizer/tests/vertex/types-in.txt | 41 - .../glsl-optimizer/tests/vertex/types-inES.txt | 41 - .../glsl-optimizer/tests/vertex/types-inES3.txt | 47 - .../glsl-optimizer/tests/vertex/types-out.txt | 22 - .../glsl-optimizer/tests/vertex/types-outES.txt | 30 - .../glsl-optimizer/tests/vertex/types-outES3.txt | 29 - .../tests/vertex/types-outES3Metal.txt | 40 - .../tests/vertex/uniforms-arrays-inES3.txt | 54 - .../tests/vertex/uniforms-arrays-outES3.txt | 88 - .../tests/vertex/uniforms-arrays-outES3Metal.txt | 99 - .../tests/vertex/z-NichsHybridLight-in.txt | 187 - .../tests/vertex/z-NichsHybridLight-out.txt | 227 - .../z-NichsHybridLightVectorInsertBug-in.txt | 121 - .../z-NichsHybridLightVectorInsertBug-inES.txt | 139 - .../z-NichsHybridLightVectorInsertBug-inES3.txt | 134 - .../z-NichsHybridLightVectorInsertBug-out.txt | 109 - .../z-NichsHybridLightVectorInsertBug-outES.txt | 163 - .../z-NichsHybridLightVectorInsertBug-outES3.txt | 164 - ...NichsHybridLightVectorInsertBug-outES3Metal.txt | 175 - .../tests/vertex/z-alphabumpspec-in.txt | 132 - .../tests/vertex/z-alphabumpspec-out.txt | 106 - .../glsl-optimizer/tests/vertex/z-particle-in.txt | 33 - .../tests/vertex/z-particle-inES.txt | 33 - .../glsl-optimizer/tests/vertex/z-particle-out.txt | 20 - .../tests/vertex/z-particle-outES.txt | 25 - .../tests/vertex/z-prepasslight-in.txt | 41 - .../tests/vertex/z-prepasslight-inES.txt | 41 - .../tests/vertex/z-prepasslight-inES3.txt | 45 - .../tests/vertex/z-prepasslight-out.txt | 35 - .../tests/vertex/z-prepasslight-outES.txt | 39 - .../tests/vertex/z-prepasslight-outES3.txt | 38 - .../tests/vertex/z-prepasslight-outES3Metal.txt | 49 - .../glsl-optimizer/tests/vertex/z-treeleaf-in.txt | 148 - .../tests/vertex/z-treeleaf-inES.txt | 148 - .../tests/vertex/z-treeleaf-inES3.txt | 155 - .../glsl-optimizer/tests/vertex/z-treeleaf-out.txt | 139 - .../tests/vertex/z-treeleaf-outES.txt | 148 - .../tests/vertex/z-treeleaf-outES3.txt | 157 - .../tests/vertex/z-treeleaf-outES3Metal.txt | 168 - .../tests/vertex/z-unishader-dirlm-in.txt | 109 - .../tests/vertex/z-unishader-dirlm-out.txt | 71 - .../tests/vertex/zun-Bumped_Diffuse-in.txt | 77 - .../tests/vertex/zun-Bumped_Diffuse-out.txt | 46 - .../tests/vertex/zun-Bumped_Diffuse1-in.txt | 80 - .../tests/vertex/zun-Bumped_Diffuse1-out.txt | 35 - .../tests/vertex/zun-Bumped_Specular-in.txt | 188 - .../tests/vertex/zun-Bumped_Specular-out.txt | 158 - .../tests/vertex/zun-Bumped_Specular2-in.txt | 87 - .../tests/vertex/zun-Bumped_Specular2-out.txt | 50 - .../glsl-optimizer/tests/vertex/zun-Decal-in.txt | 88 - .../glsl-optimizer/tests/vertex/zun-Decal-out.txt | 46 - .../glsl-optimizer/tests/vertex/zun-Diffuse-in.txt | 89 - .../tests/vertex/zun-Diffuse-out.txt | 52 - .../tests/vertex/zun-Diffuse2-in.txt | 86 - .../tests/vertex/zun-Diffuse2-out.txt | 50 - .../zun-Diffuse_Alpha_Shadowed_ZWrite-in.txt | 107 - .../zun-Diffuse_Alpha_Shadowed_ZWrite-out.txt | 75 - .../vertex/zun-FX_Glass_Stained_BumpDistort-in.txt | 55 - .../zun-FX_Glass_Stained_BumpDistort-out.txt | 35 - .../tests/vertex/zun-FX_Water_(simple)-in.txt | 64 - .../tests/vertex/zun-FX_Water_(simple)-out.txt | 47 - .../tests/vertex/zun-Grab_Invert-in.txt | 33 - .../tests/vertex/zun-Grab_Invert-out.txt | 17 - .../zun-Hidden_Camera-DepthNormalTexture-in.txt | 77 - .../zun-Hidden_Camera-DepthNormalTexture-out.txt | 54 - .../zun-Hidden_Camera-DepthNormalTexture1-in.txt | 111 - .../zun-Hidden_Camera-DepthNormalTexture1-out.txt | 56 - .../vertex/zun-Hidden_Camera-DepthTexture-in.txt | 71 - .../vertex/zun-Hidden_Camera-DepthTexture-out.txt | 51 - .../tests/vertex/zun-Hidden_Glow_Downsample-in.txt | 56 - .../vertex/zun-Hidden_Glow_Downsample-out.txt | 49 - .../zun-Hidden_Internal-GUITextureClip-in.txt | 51 - .../zun-Hidden_Internal-GUITextureClip-out.txt | 27 - .../zun-Hidden_Internal-PrePassLighting-in.txt | 52 - .../zun-Hidden_Internal-PrePassLighting-out.txt | 34 - .../vertex/zun-Hidden_Noise_Shader_RGB-in.txt | 50 - .../vertex/zun-Hidden_Noise_Shader_RGB-out.txt | 32 - .../zun-Hidden_TerrainEngine_BillboardTree-in.txt | 78 - .../zun-Hidden_TerrainEngine_BillboardTree-out.txt | 60 - ...Engine_Details_BillboardWavingDoublePass-in.txt | 233 - ...ngine_Details_BillboardWavingDoublePass-out.txt | 179 - ...ngine_Details_BillboardWavingDoublePass1-in.txt | 171 - ...gine_Details_BillboardWavingDoublePass1-out.txt | 112 - ...ngine_Details_BillboardWavingDoublePass2-in.txt | 146 - ...gine_Details_BillboardWavingDoublePass2-out.txt | 90 - ..._TerrainEngine_Details_WavingDoublePass1-in.txt | 157 - ...TerrainEngine_Details_WavingDoublePass1-out.txt | 88 - ...rainEngine_Soft_Occlusion_Bark_rendertex-in.txt | 101 - ...ainEngine_Soft_Occlusion_Bark_rendertex-out.txt | 80 - ...inEngine_Soft_Occlusion_Leaves_rendertex-in.txt | 101 - ...nEngine_Soft_Occlusion_Leaves_rendertex-out.txt | 80 - ..._TerrainEngine_Splatmap_Lightmap-AddPass-in.txt | 179 - ...TerrainEngine_Splatmap_Lightmap-AddPass-out.txt | 143 - ...rrainEngine_Splatmap_Lightmap-FirstPass1-in.txt | 102 - ...rainEngine_Splatmap_Lightmap-FirstPass1-out.txt | 66 - .../zun-Hidden_Tree_Bark_Shader_Rendertex-in.txt | 63 - .../zun-Hidden_Tree_Bark_Shader_Rendertex-out.txt | 41 - .../zun-Hidden_Tree_Leaf_Shader_Rendertex-in.txt | 94 - .../zun-Hidden_Tree_Leaf_Shader_Rendertex-out.txt | 53 - .../zun-Hidden_Tree_Optimized_Bark_Shader-in.txt | 175 - .../zun-Hidden_Tree_Optimized_Bark_Shader-out.txt | 137 - .../zun-Hidden_Tree_Optimized_Bark_Shader1-in.txt | 135 - .../zun-Hidden_Tree_Optimized_Bark_Shader1-out.txt | 75 - .../zun-Hidden_Tree_Optimized_Leaf_Shader-in.txt | 185 - .../zun-Hidden_Tree_Optimized_Leaf_Shader-out.txt | 148 - .../zun-Hidden_Tree_Optimized_Leaf_Shader1-in.txt | 189 - .../zun-Hidden_Tree_Optimized_Leaf_Shader1-out.txt | 156 - .../tests/vertex/zun-Hidden_Twist_Effect-in.txt | 48 - .../tests/vertex/zun-Hidden_Twist_Effect-out.txt | 28 - ...egacy_Shaders_Lightmapped_Bumped_Diffuse-in.txt | 91 - ...gacy_Shaders_Lightmapped_Bumped_Diffuse-out.txt | 58 - .../vertex/zun-Nature_Soft_Occlusion_Bark-in.txt | 118 - .../vertex/zun-Nature_Soft_Occlusion_Bark-out.txt | 72 - .../vertex/zun-Nature_Soft_Occlusion_Bark2-in.txt | 89 - .../vertex/zun-Nature_Soft_Occlusion_Bark2-out.txt | 44 - .../vertex/zun-Nature_Soft_Occlusion_Bark3-in.txt | 111 - .../vertex/zun-Nature_Soft_Occlusion_Bark3-out.txt | 76 - .../zun-Nature_Soft_Occlusion_Leaves1-in.txt | 108 - .../zun-Nature_Soft_Occlusion_Leaves1-out.txt | 60 - .../zun-Nature_Soft_Occlusion_Leaves3-in.txt | 93 - .../zun-Nature_Soft_Occlusion_Leaves3-out.txt | 51 - .../tests/vertex/zun-Parallax_Diffuse-in.txt | 189 - .../tests/vertex/zun-Parallax_Diffuse-out.txt | 158 - .../tests/vertex/zun-Parallax_Diffuse1-in.txt | 99 - .../tests/vertex/zun-Parallax_Diffuse1-out.txt | 67 - .../tests/vertex/zun-Parallax_Diffuse2-in.txt | 106 - .../tests/vertex/zun-Parallax_Diffuse2-out.txt | 82 - .../tests/vertex/zun-Particles_Blend-in.txt | 44 - .../tests/vertex/zun-Particles_Blend-out.txt | 20 - .../vertex/zun-Reflective_Bumped_Diffuse-in.txt | 91 - .../vertex/zun-Reflective_Bumped_Diffuse-out.txt | 58 - .../vertex/zun-Reflective_Bumped_Diffuse1-in.txt | 123 - .../vertex/zun-Reflective_Bumped_Diffuse1-out.txt | 98 - .../vertex/zun-Reflective_Bumped_Specular-in.txt | 102 - .../vertex/zun-Reflective_Bumped_Specular-out.txt | 73 - .../vertex/zun-Reflective_Bumped_Specular1-in.txt | 78 - .../vertex/zun-Reflective_Bumped_Specular1-out.txt | 46 - .../vertex/zun-Reflective_Bumped_Specular2-in.txt | 116 - .../vertex/zun-Reflective_Bumped_Specular2-out.txt | 83 - .../vertex/zun-Reflective_Bumped_Unlit-in.txt | 79 - .../vertex/zun-Reflective_Bumped_Unlit-out.txt | 68 - .../tests/vertex/zun-Reflective_Diffuse-in.txt | 90 - .../tests/vertex/zun-Reflective_Diffuse-out.txt | 49 - .../tests/vertex/zun-Reflective_Diffuse1-in.txt | 100 - .../tests/vertex/zun-Reflective_Diffuse1-out.txt | 59 - .../vertex/zun-Reflective_Parallax_Diffuse-in.txt | 103 - .../vertex/zun-Reflective_Parallax_Diffuse-out.txt | 70 - .../vertex/zun-Reflective_Parallax_Diffuse1-in.txt | 120 - .../zun-Reflective_Parallax_Diffuse1-out.txt | 92 - .../vertex/zun-Reflective_Parallax_Specular-in.txt | 103 - .../zun-Reflective_Parallax_Specular-out.txt | 73 - .../zun-Reflective_Parallax_Specular1-in.txt | 103 - .../zun-Reflective_Parallax_Specular1-out.txt | 71 - .../tests/vertex/zun-Reflective_Specular-in.txt | 98 - .../tests/vertex/zun-Reflective_Specular-out.txt | 55 - .../tests/vertex/zun-Reflective_Specular1-in.txt | 63 - .../tests/vertex/zun-Reflective_Specular1-out.txt | 21 - .../tests/vertex/zun-Reflective_Specular2-in.txt | 100 - .../tests/vertex/zun-Reflective_Specular2-out.txt | 59 - .../tests/vertex/zun-RenderFX_Skybox_Cubed-in.txt | 38 - .../tests/vertex/zun-RenderFX_Skybox_Cubed-out.txt | 16 - .../vertex/zun-Self-Illumin_Bumped_Diffuse-in.txt | 92 - .../vertex/zun-Self-Illumin_Bumped_Diffuse-out.txt | 59 - .../zun-Self-Illumin_Bumped_Specular1-in.txt | 83 - .../zun-Self-Illumin_Bumped_Specular1-out.txt | 37 - .../tests/vertex/zun-Self-Illumin_Diffuse1-in.txt | 89 - .../tests/vertex/zun-Self-Illumin_Diffuse1-out.txt | 52 - .../zun-Self-Illumin_Parallax_Diffuse-in.txt | 103 - .../zun-Self-Illumin_Parallax_Diffuse-out.txt | 70 - .../zun-Self-Illumin_Parallax_Specular1-in.txt | 103 - .../zun-Self-Illumin_Parallax_Specular1-out.txt | 73 - .../tests/vertex/zun-Self-Illumin_Specular1-in.txt | 63 - .../vertex/zun-Self-Illumin_Specular1-out.txt | 21 - .../tests/vertex/zun-ShowDestAlpha-in.txt | 33 - .../tests/vertex/zun-ShowDestAlpha-out.txt | 11 - .../tests/vertex/zun-Specular-in.txt | 97 - .../tests/vertex/zun-Specular-out.txt | 55 - .../tests/vertex/zun-Specular1-in.txt | 62 - .../tests/vertex/zun-Specular1-out.txt | 21 - .../tests/vertex/zun-Specular2-in.txt | 86 - .../tests/vertex/zun-Specular2-out.txt | 50 - .../tests/vertex/zun-Surface_2UV-in.txt | 92 - .../tests/vertex/zun-Surface_2UV-out.txt | 52 - .../tests/vertex/zun-Surface_2UV1-in.txt | 82 - .../tests/vertex/zun-Surface_2UV1-out.txt | 38 - .../vertex/zun-Surface_Colored_Specular-in.txt | 108 - .../vertex/zun-Surface_Colored_Specular-out.txt | 57 - .../vertex/zun-Surface_Colored_Specular1-in.txt | 71 - .../vertex/zun-Surface_Colored_Specular1-out.txt | 21 - .../tests/vertex/zun-Surface_Custom_Data-in.txt | 94 - .../tests/vertex/zun-Surface_Custom_Data-out.txt | 49 - .../tests/vertex/zun-Surface_Custom_Data1-in.txt | 94 - .../tests/vertex/zun-Surface_Custom_Data1-out.txt | 47 - .../tests/vertex/zun-Surface_Custom_Data2-in.txt | 91 - .../tests/vertex/zun-Surface_Custom_Data2-out.txt | 48 - .../tests/vertex/zun-Surface_DecalAddBump-in.txt | 85 - .../tests/vertex/zun-Surface_DecalAddBump-out.txt | 44 - .../tests/vertex/zun-Surface_DecalAddBump1-in.txt | 79 - .../tests/vertex/zun-Surface_DecalAddBump1-out.txt | 35 - .../tests/vertex/zun-Surface_DecalAddBump2-in.txt | 85 - .../tests/vertex/zun-Surface_DecalAddBump2-out.txt | 34 - .../tests/vertex/zun-Surface_DecalAddBump3-in.txt | 134 - .../tests/vertex/zun-Surface_DecalAddBump3-out.txt | 105 - .../vertex/zun-Surface_Diffuse_Wrapped-in.txt | 89 - .../vertex/zun-Surface_Diffuse_Wrapped-out.txt | 50 - .../tests/vertex/zun-Surface_Rim-in.txt | 86 - .../tests/vertex/zun-Surface_Rim-out.txt | 44 - .../tests/vertex/zun-Surface_Rim1-in.txt | 99 - .../tests/vertex/zun-Surface_Rim1-out.txt | 69 - .../tests/vertex/zun-Surface_Rim2-in.txt | 106 - .../tests/vertex/zun-Surface_Rim2-out.txt | 84 - .../tests/vertex/zun-Surface_Rim_Bump-in.txt | 89 - .../tests/vertex/zun-Surface_Rim_Bump-out.txt | 57 - .../tests/vertex/zun-Surface_Rim_Bump1-in.txt | 89 - .../tests/vertex/zun-Surface_Rim_Bump1-out.txt | 60 - .../tests/vertex/zun-Surface_ScreenPos-in.txt | 85 - .../tests/vertex/zun-Surface_ScreenPos-out.txt | 42 - .../tests/vertex/zun-Surface_ScreenPos1-in.txt | 85 - .../tests/vertex/zun-Surface_ScreenPos1-out.txt | 45 - .../tests/vertex/zun-Surface_ScreenPos2-in.txt | 62 - .../tests/vertex/zun-Surface_ScreenPos2-out.txt | 21 - .../vertex/zun-Surface_ScreenPosAlbedo-in.txt | 62 - .../vertex/zun-Surface_ScreenPosAlbedo-out.txt | 21 - .../vertex/zun-Surface_ScreenPosAlbedo1-in.txt | 78 - .../vertex/zun-Surface_ScreenPosAlbedo1-out.txt | 36 - .../tests/vertex/zun-Surface_Slices-in.txt | 93 - .../tests/vertex/zun-Surface_Slices-out.txt | 53 - .../tests/vertex/zun-Surface_Slices1-in.txt | 84 - .../tests/vertex/zun-Surface_Slices1-out.txt | 41 - .../tests/vertex/zun-Surface_Slices2-in.txt | 91 - .../tests/vertex/zun-Surface_Slices2-out.txt | 56 - .../tests/vertex/zun-Surface_Slices3-in.txt | 86 - .../tests/vertex/zun-Surface_Slices3-out.txt | 55 - .../tests/vertex/zun-Surface_WorldRefl-in.txt | 96 - .../tests/vertex/zun-Surface_WorldRefl-out.txt | 56 - .../tests/vertex/zun-Surface_WorldRefl1-in.txt | 62 - .../tests/vertex/zun-Surface_WorldRefl1-out.txt | 21 - .../tests/vertex/zun-Test_CgNormals-in.txt | 46 - .../tests/vertex/zun-Test_CgNormals-out.txt | 21 - .../zun-Test_VertexShaderDepthTexture-in.txt | 47 - .../zun-Test_VertexShaderDepthTexture-out.txt | 22 - .../vertex/zun-Test_VertexShaderTexture-in.txt | 47 - .../vertex/zun-Test_VertexShaderTexture-out.txt | 22 - .../tests/vertex/zun-TexGen_Cube_Refl-in.txt | 56 - .../tests/vertex/zun-TexGen_Cube_Refl-out.txt | 37 - .../tests/vertex/zun-Toon_Basic-in.txt | 45 - .../tests/vertex/zun-Toon_Basic-out.txt | 27 - .../vertex/zun-Transparent_Bumped_Specular-in.txt | 101 - .../vertex/zun-Transparent_Bumped_Specular-out.txt | 73 - .../zun-Transparent_Cutout_Bumped_Diffuse-in.txt | 85 - .../zun-Transparent_Cutout_Bumped_Diffuse-out.txt | 50 - .../zun-Transparent_Cutout_Bumped_Diffuse1-in.txt | 80 - .../zun-Transparent_Cutout_Bumped_Diffuse1-out.txt | 35 - .../zun-Transparent_Cutout_Bumped_Specular-in.txt | 79 - .../zun-Transparent_Cutout_Bumped_Specular-out.txt | 48 - .../zun-Transparent_Cutout_Bumped_Specular1-in.txt | 80 - ...zun-Transparent_Cutout_Bumped_Specular1-out.txt | 35 - .../vertex/zun-Transparent_Cutout_Diffuse-in.txt | 89 - .../vertex/zun-Transparent_Cutout_Diffuse-out.txt | 49 - .../vertex/zun-Transparent_Cutout_Specular-in.txt | 93 - .../vertex/zun-Transparent_Cutout_Specular-out.txt | 50 - .../tests/vertex/zun-Transparent_Specular-in.txt | 97 - .../tests/vertex/zun-Transparent_Specular-out.txt | 58 - .../tests/vertex/zun-TreeCreatorLeavesRT-in.txt | 91 - .../tests/vertex/zun-TreeCreatorLeavesRT-out.txt | 127 - .../vertex/zun-Tree_Editor_Bark_Shader-in.txt | 171 - .../vertex/zun-Tree_Editor_Bark_Shader-out.txt | 129 - .../vertex/zun-Tree_Editor_Bark_Shader1-in.txt | 175 - .../vertex/zun-Tree_Editor_Bark_Shader1-out.txt | 137 - .../vertex/zun-Tree_Editor_Leaf_Shader-in.txt | 189 - .../vertex/zun-Tree_Editor_Leaf_Shader-out.txt | 156 - .../vertex/zun-Tree_Editor_Leaf_Shader1-in.txt | 177 - .../vertex/zun-Tree_Editor_Leaf_Shader1-out.txt | 130 - .../tests/vertex/zun-Vertex_Colored-in.txt | 57 - .../tests/vertex/zun-Vertex_Colored-out.txt | 32 - 3rdparty/bgfx/3rdparty/glslang/CHANGES.md | 84 - 3rdparty/bgfx/3rdparty/glslang/LICENSE.txt | 692 +- .../glslang/SPIRV/CInterface/spirv_c_interface.cpp | 40 +- .../bgfx/3rdparty/glslang/SPIRV/GLSL.ext.EXT.h | 1 + .../bgfx/3rdparty/glslang/SPIRV/GLSL.ext.KHR.h | 4 +- .../bgfx/3rdparty/glslang/SPIRV/GlslangToSpv.cpp | 566 +- .../glslang/SPIRV/NonSemanticShaderDebugInfo100.h | 171 + .../bgfx/3rdparty/glslang/SPIRV/SPVRemapper.cpp | 53 +- 3rdparty/bgfx/3rdparty/glslang/SPIRV/SPVRemapper.h | 8 + .../bgfx/3rdparty/glslang/SPIRV/SpvBuilder.cpp | 777 +- 3rdparty/bgfx/3rdparty/glslang/SPIRV/SpvBuilder.h | 111 +- .../bgfx/3rdparty/glslang/SPIRV/SpvPostProcess.cpp | 39 +- 3rdparty/bgfx/3rdparty/glslang/SPIRV/SpvTools.cpp | 4 + 3rdparty/bgfx/3rdparty/glslang/SPIRV/SpvTools.h | 16 +- .../bgfx/3rdparty/glslang/SPIRV/disassemble.cpp | 47 +- 3rdparty/bgfx/3rdparty/glslang/SPIRV/doc.cpp | 83 +- 3rdparty/bgfx/3rdparty/glslang/SPIRV/spirv.hpp | 249 +- 3rdparty/bgfx/3rdparty/glslang/SPIRV/spvIR.h | 40 +- .../3rdparty/glslang/StandAlone/ResourceLimits.cpp | 50 +- .../3rdparty/glslang/StandAlone/ResourceLimits.h | 57 - .../3rdparty/glslang/StandAlone/StandAlone.cpp | 188 +- .../glslang/StandAlone/resource_limits_c.cpp | 15 +- .../glslang/StandAlone/resource_limits_c.h | 54 - .../3rdparty/glslang/StandAlone/spirv-remap.cpp | 46 +- 3rdparty/bgfx/3rdparty/glslang/build_info.h | 26 +- 3rdparty/bgfx/3rdparty/glslang/build_info.h.tmpl | 62 - 3rdparty/bgfx/3rdparty/glslang/build_info.py | 226 - .../glslang/CInterface/glslang_c_interface.cpp | 68 +- .../GL_EXT_shader_realtime_clock.glsl | 38 + .../3rdparty/glslang/glslang/HLSL/hlslGrammar.cpp | 2 +- .../glslang/glslang/HLSL/hlslParseHelper.cpp | 130 +- .../glslang/glslang/HLSL/hlslParseHelper.h | 3 + .../3rdparty/glslang/glslang/Include/BaseTypes.h | 24 +- .../bgfx/3rdparty/glslang/glslang/Include/Common.h | 37 +- .../3rdparty/glslang/glslang/Include/PoolAlloc.h | 2 + .../glslang/glslang/Include/ResourceLimits.h | 9 + .../glslang/glslang/Include/SpirvIntrinsics.h | 18 +- .../bgfx/3rdparty/glslang/glslang/Include/Types.h | 573 +- .../glslang/glslang/Include/glslang_c_interface.h | 30 + .../glslang/Include/glslang_c_shader_types.h | 79 +- .../glslang/glslang/Include/intermediate.h | 7 +- .../glslang/MachineIndependent/Constant.cpp | 33 +- .../glslang/MachineIndependent/Initialize.cpp | 552 +- .../glslang/MachineIndependent/Intermediate.cpp | 14 +- .../MachineIndependent/ParseContextBase.cpp | 3 + .../glslang/MachineIndependent/ParseHelper.cpp | 439 +- .../glslang/MachineIndependent/ParseHelper.h | 1 - .../glslang/glslang/MachineIndependent/Scan.cpp | 19 +- .../glslang/MachineIndependent/ShaderLang.cpp | 85 +- .../glslang/MachineIndependent/SpirvIntrinsics.cpp | 33 +- .../glslang/MachineIndependent/SymbolTable.cpp | 17 +- .../glslang/MachineIndependent/SymbolTable.h | 17 +- .../glslang/MachineIndependent/Versions.cpp | 43 +- .../glslang/glslang/MachineIndependent/Versions.h | 16 +- .../glslang/glslang/MachineIndependent/glslang.m4 | 46 +- .../glslang/glslang/MachineIndependent/glslang.y | 48 +- .../glslang/MachineIndependent/glslang_tab.cpp | 7492 ++--- .../glslang/MachineIndependent/glslang_tab.cpp.h | 15 +- .../glslang/MachineIndependent/intermOut.cpp | 46 +- .../glslang/MachineIndependent/iomapper.cpp | 89 +- .../glslang/glslang/MachineIndependent/iomapper.h | 19 +- .../glslang/MachineIndependent/linkValidate.cpp | 385 +- .../glslang/MachineIndependent/localintermediate.h | 75 +- .../glslang/MachineIndependent/parseVersions.h | 7 +- .../glslang/MachineIndependent/reflection.cpp | 4 +- .../glslang/MachineIndependent/reflection.h | 4 +- .../glslang/glslang/OSDependent/Unix/ossource.cpp | 54 +- .../glslang/OSDependent/Web/glslang.after.js | 26 - .../glslang/glslang/OSDependent/Web/glslang.js.cpp | 287 - .../glslang/glslang/OSDependent/Web/glslang.pre.js | 56 - .../glslang/glslang/OSDependent/Windows/main.cpp | 74 - .../glslang/glslang/OSDependent/osinclude.h | 2 - .../glslang/glslang/Public/ResourceLimits.h | 57 + .../3rdparty/glslang/glslang/Public/ShaderLang.h | 47 +- .../glslang/glslang/Public/resource_limits_c.h | 57 + 3rdparty/bgfx/3rdparty/iconfontheaders/.gitignore | 58 - 3rdparty/bgfx/3rdparty/iconfontheaders/README.md | 53 - .../bgfx/3rdparty/khronos/vulkan-local/vk_icd.h | 9 +- .../3rdparty/khronos/vulkan-local/vk_platform.h | 4 +- .../khronos/vulkan-local/vk_sdk_platform.h | 2 + .../bgfx/3rdparty/khronos/vulkan-local/vulkan.h | 3 +- .../3rdparty/khronos/vulkan-local/vulkan_android.h | 17 +- .../3rdparty/khronos/vulkan-local/vulkan_beta.h | 823 +- .../3rdparty/khronos/vulkan-local/vulkan_core.h | 14085 +++++---- .../khronos/vulkan-local/vulkan_directfb.h | 2 +- .../3rdparty/khronos/vulkan-local/vulkan_fuchsia.h | 139 +- .../3rdparty/khronos/vulkan-local/vulkan_ggp.h | 2 +- .../3rdparty/khronos/vulkan-local/vulkan_ios.h | 2 +- .../3rdparty/khronos/vulkan-local/vulkan_macos.h | 2 +- .../3rdparty/khronos/vulkan-local/vulkan_metal.h | 143 +- .../3rdparty/khronos/vulkan-local/vulkan_screen.h | 2 +- .../bgfx/3rdparty/khronos/vulkan-local/vulkan_vi.h | 2 +- .../3rdparty/khronos/vulkan-local/vulkan_wayland.h | 2 +- .../3rdparty/khronos/vulkan-local/vulkan_win32.h | 2 +- .../3rdparty/khronos/vulkan-local/vulkan_xcb.h | 2 +- .../3rdparty/khronos/vulkan-local/vulkan_xlib.h | 2 +- .../khronos/vulkan-local/vulkan_xlib_xrandr.h | 2 +- 3rdparty/bgfx/3rdparty/meshoptimizer/LICENSE.md | 2 +- .../bgfx/3rdparty/meshoptimizer/src/allocator.cpp | 2 +- .../3rdparty/meshoptimizer/src/clusterizer.cpp | 152 +- .../3rdparty/meshoptimizer/src/indexgenerator.cpp | 6 +- .../3rdparty/meshoptimizer/src/meshoptimizer.h | 121 +- .../meshoptimizer/src/overdrawanalyzer.cpp | 2 +- .../meshoptimizer/src/overdrawoptimizer.cpp | 2 +- .../bgfx/3rdparty/meshoptimizer/src/simplifier.cpp | 30 +- .../3rdparty/meshoptimizer/src/spatialorder.cpp | 4 +- .../3rdparty/meshoptimizer/src/vcacheoptimizer.cpp | 28 +- .../3rdparty/meshoptimizer/src/vertexcodec.cpp | 92 +- .../3rdparty/meshoptimizer/src/vertexfilter.cpp | 3 +- 3rdparty/bgfx/3rdparty/native_app_glue/LICENSE | 13 + .../native_app_glue/android_native_app_glue.c | 457 + .../native_app_glue/android_native_app_glue.h | 350 + 3rdparty/bgfx/3rdparty/renderdoc/renderdoc_app.h | 66 +- 3rdparty/bgfx/3rdparty/spirv-cross/main.cpp | 271 +- 3rdparty/bgfx/3rdparty/spirv-cross/spirv.h | 392 +- 3rdparty/bgfx/3rdparty/spirv-cross/spirv.hpp | 392 +- 3rdparty/bgfx/3rdparty/spirv-cross/spirv_cfg.cpp | 44 +- 3rdparty/bgfx/3rdparty/spirv-cross/spirv_cfg.hpp | 5 + .../bgfx/3rdparty/spirv-cross/spirv_common.hpp | 96 +- 3rdparty/bgfx/3rdparty/spirv-cross/spirv_cpp.cpp | 7 +- 3rdparty/bgfx/3rdparty/spirv-cross/spirv_cross.cpp | 544 +- 3rdparty/bgfx/3rdparty/spirv-cross/spirv_cross.hpp | 49 +- .../bgfx/3rdparty/spirv-cross/spirv_cross_c.cpp | 175 +- 3rdparty/bgfx/3rdparty/spirv-cross/spirv_cross_c.h | 85 +- .../spirv-cross/spirv_cross_containers.hpp | 23 +- .../3rdparty/spirv-cross/spirv_cross_parsed_ir.cpp | 52 +- .../3rdparty/spirv-cross/spirv_cross_parsed_ir.hpp | 11 +- 3rdparty/bgfx/3rdparty/spirv-cross/spirv_glsl.cpp | 2190 +- 3rdparty/bgfx/3rdparty/spirv-cross/spirv_glsl.hpp | 84 +- 3rdparty/bgfx/3rdparty/spirv-cross/spirv_hlsl.cpp | 992 +- 3rdparty/bgfx/3rdparty/spirv-cross/spirv_hlsl.hpp | 33 +- 3rdparty/bgfx/3rdparty/spirv-cross/spirv_msl.cpp | 2827 +- 3rdparty/bgfx/3rdparty/spirv-cross/spirv_msl.hpp | 190 +- .../bgfx/3rdparty/spirv-cross/spirv_parser.cpp | 153 +- .../bgfx/3rdparty/spirv-cross/spirv_parser.hpp | 2 + .../bgfx/3rdparty/spirv-cross/spirv_reflect.cpp | 24 +- .../3rdparty/spirv-headers/SPIRV-Headers.pc.in | 9 - .../spirv-headers/include/spirv/1.0/spirv.cs | 993 - .../spirv-headers/include/spirv/1.0/spirv.hpp | 1002 - .../spirv-headers/include/spirv/1.0/spirv.hpp11 | 1002 - .../spirv-headers/include/spirv/1.0/spirv.lua | 949 - .../spirv-headers/include/spirv/1.0/spirv.py | 949 - .../spirv-headers/include/spirv/1.1/spirv.cs | 1015 - .../spirv-headers/include/spirv/1.1/spirv.hpp | 1024 - .../spirv-headers/include/spirv/1.1/spirv.hpp11 | 1024 - .../spirv-headers/include/spirv/1.1/spirv.lua | 971 - .../spirv-headers/include/spirv/1.1/spirv.py | 971 - .../spirv-headers/include/spirv/1.2/spirv.cs | 1021 - .../spirv-headers/include/spirv/1.2/spirv.hpp | 1030 - .../spirv-headers/include/spirv/1.2/spirv.hpp11 | 1030 - .../spirv-headers/include/spirv/1.2/spirv.lua | 977 - .../spirv-headers/include/spirv/1.2/spirv.py | 977 - .../spirv-headers/include/spirv/spir-v.xml | 44 +- .../spirv/unified1/NonSemanticClspvReflection.h | 13 +- ...xtinst.nonsemantic.clspvreflection.grammar.json | 117 +- .../include/spirv/unified1/spirv.core.grammar.json | 863 +- .../spirv-headers/include/spirv/unified1/spirv.cs | 1812 -- .../spirv-headers/include/spirv/unified1/spirv.h | 149 +- .../spirv-headers/include/spirv/unified1/spirv.hpp | 2467 -- .../include/spirv/unified1/spirv.hpp11 | 2467 -- .../include/spirv/unified1/spirv.json | 118 +- .../spirv-headers/include/spirv/unified1/spirv.lua | 1757 -- .../spirv-headers/include/spirv/unified1/spirv.py | 1757 -- .../spirv-headers/include/spirv/unified1/spv.d | 1814 -- .../include/generated/build-version.inc | 2 +- .../include/generated/core.insts-unified1.inc | 62 +- .../include/generated/enum_string_mapping.inc | 70 +- .../include/generated/extension_enum.inc | 11 + .../spirv-tools/include/generated/generators.inc | 7 +- .../nonsemantic.clspvreflection.insts.inc | 13 +- .../include/generated/operand.kinds-unified1.inc | 166 +- .../spirv-tools/include/spirv-tools/libspirv.h | 16 +- .../spirv-tools/include/spirv-tools/libspirv.hpp | 9 +- .../spirv-tools/include/spirv-tools/optimizer.hpp | 79 +- .../spirv-tools/source/assembly_grammar.cpp | 6 +- .../bgfx/3rdparty/spirv-tools/source/binary.cpp | 39 +- 3rdparty/bgfx/3rdparty/spirv-tools/source/binary.h | 7 + 3rdparty/bgfx/3rdparty/spirv-tools/source/cfa.h | 75 +- .../bgfx/3rdparty/spirv-tools/source/diff/diff.cpp | 2869 ++ .../bgfx/3rdparty/spirv-tools/source/diff/diff.h | 48 + .../bgfx/3rdparty/spirv-tools/source/diff/lcs.h | 224 + .../3rdparty/spirv-tools/source/disassemble.cpp | 488 +- .../bgfx/3rdparty/spirv-tools/source/disassemble.h | 66 +- .../bgfx/3rdparty/spirv-tools/source/ext_inst.cpp | 2 + .../bgfx/3rdparty/spirv-tools/source/ext_inst.h | 4 +- .../3rdparty/spirv-tools/source/extensions.cpp | 4 +- .../bgfx/3rdparty/spirv-tools/source/libspirv.cpp | 4 +- .../3rdparty/spirv-tools/source/link/linker.cpp | 222 +- .../3rdparty/spirv-tools/source/name_mapper.cpp | 11 +- .../bgfx/3rdparty/spirv-tools/source/opcode.cpp | 14 +- 3rdparty/bgfx/3rdparty/spirv-tools/source/opcode.h | 10 +- .../bgfx/3rdparty/spirv-tools/source/operand.cpp | 14 +- .../source/opt/aggressive_dead_code_elim_pass.cpp | 597 +- .../source/opt/aggressive_dead_code_elim_pass.h | 84 +- .../spirv-tools/source/opt/amd_ext_to_khr.cpp | 24 +- .../spirv-tools/source/opt/amd_ext_to_khr.h | 2 +- .../3rdparty/spirv-tools/source/opt/basic_block.h | 2 +- .../spirv-tools/source/opt/block_merge_pass.cpp | 2 +- .../spirv-tools/source/opt/block_merge_util.cpp | 37 +- .../3rdparty/spirv-tools/source/opt/ccp_pass.cpp | 48 +- .../3rdparty/spirv-tools/source/opt/ccp_pass.h | 16 + .../bgfx/3rdparty/spirv-tools/source/opt/cfg.cpp | 22 +- .../bgfx/3rdparty/spirv-tools/source/opt/cfg.h | 10 +- .../source/opt/combine_access_chains.cpp | 4 + .../spirv-tools/source/opt/compact_ids_pass.cpp | 8 +- .../spirv-tools/source/opt/const_folding_rules.cpp | 328 +- .../3rdparty/spirv-tools/source/opt/constants.cpp | 23 +- .../3rdparty/spirv-tools/source/opt/constants.h | 43 +- .../source/opt/convert_to_half_pass.cpp | 36 +- .../spirv-tools/source/opt/convert_to_half_pass.h | 2 +- .../spirv-tools/source/opt/copy_prop_arrays.cpp | 174 +- .../spirv-tools/source/opt/copy_prop_arrays.h | 38 +- .../source/opt/dead_branch_elim_pass.cpp | 20 +- .../spirv-tools/source/opt/dead_branch_elim_pass.h | 4 +- .../source/opt/dead_insert_elim_pass.cpp | 2 +- .../spirv-tools/source/opt/debug_info_manager.cpp | 65 +- .../spirv-tools/source/opt/debug_info_manager.h | 22 +- .../spirv-tools/source/opt/decoration_manager.cpp | 8 + .../spirv-tools/source/opt/decoration_manager.h | 4 + .../spirv-tools/source/opt/def_use_manager.cpp | 47 +- .../spirv-tools/source/opt/def_use_manager.h | 50 +- .../3rdparty/spirv-tools/source/opt/desc_sroa.cpp | 231 +- .../3rdparty/spirv-tools/source/opt/desc_sroa.h | 50 +- .../spirv-tools/source/opt/desc_sroa_util.cpp | 117 + .../spirv-tools/source/opt/desc_sroa_util.h | 54 + .../spirv-tools/source/opt/dominator_tree.cpp | 34 +- .../spirv-tools/source/opt/dominator_tree.h | 2 +- .../opt/eliminate_dead_input_components_pass.cpp | 189 + .../opt/eliminate_dead_input_components_pass.h | 65 + .../source/opt/eliminate_dead_members_pass.cpp | 35 +- .../spirv-tools/source/opt/feature_manager.cpp | 3 +- .../source/opt/fix_func_call_arguments.cpp | 90 + .../source/opt/fix_func_call_arguments.h | 47 + .../bgfx/3rdparty/spirv-tools/source/opt/fold.cpp | 5 +- .../fold_spec_constant_op_and_composite_pass.cpp | 125 +- .../opt/fold_spec_constant_op_and_composite_pass.h | 11 - .../spirv-tools/source/opt/folding_rules.cpp | 392 +- .../3rdparty/spirv-tools/source/opt/function.cpp | 8 + .../3rdparty/spirv-tools/source/opt/function.h | 44 + .../source/opt/graphics_robust_access_pass.cpp | 16 +- .../source/opt/graphics_robust_access_pass.h | 2 +- .../spirv-tools/source/opt/if_conversion.cpp | 7 + .../source/opt/inline_exhaustive_pass.cpp | 2 +- .../spirv-tools/source/opt/inline_opaque_pass.cpp | 2 +- .../spirv-tools/source/opt/inline_pass.cpp | 58 +- .../3rdparty/spirv-tools/source/opt/inline_pass.h | 12 +- .../source/opt/inst_bindless_check_pass.cpp | 7 - .../source/opt/inst_bindless_check_pass.h | 4 +- .../source/opt/inst_buff_addr_check_pass.cpp | 2 + .../source/opt/inst_buff_addr_check_pass.h | 2 +- .../source/opt/inst_debug_printf_pass.cpp | 12 +- .../spirv-tools/source/opt/instruction.cpp | 54 +- .../3rdparty/spirv-tools/source/opt/instruction.h | 36 +- .../spirv-tools/source/opt/instrument_pass.cpp | 70 +- .../spirv-tools/source/opt/instrument_pass.h | 19 +- .../spirv-tools/source/opt/interface_var_sroa.cpp | 968 + .../spirv-tools/source/opt/interface_var_sroa.h | 401 + .../spirv-tools/source/opt/interp_fixup_pass.cpp | 7 - .../3rdparty/spirv-tools/source/opt/ir_builder.h | 31 +- .../3rdparty/spirv-tools/source/opt/ir_context.cpp | 30 +- .../3rdparty/spirv-tools/source/opt/ir_context.h | 41 +- .../3rdparty/spirv-tools/source/opt/ir_loader.cpp | 5 +- .../3rdparty/spirv-tools/source/opt/iterator.h | 2 +- .../source/opt/local_access_chain_convert_pass.cpp | 91 +- .../source/opt/local_access_chain_convert_pass.h | 18 +- .../source/opt/local_single_block_elim_pass.cpp | 16 +- .../source/opt/local_single_store_elim_pass.cpp | 40 +- .../spirv-tools/source/opt/loop_descriptor.cpp | 13 +- .../spirv-tools/source/opt/loop_descriptor.h | 5 +- .../spirv-tools/source/opt/loop_fission.cpp | 4 +- .../3rdparty/spirv-tools/source/opt/loop_fission.h | 2 +- .../spirv-tools/source/opt/loop_fusion.cpp | 4 +- .../3rdparty/spirv-tools/source/opt/loop_fusion.h | 2 +- .../spirv-tools/source/opt/loop_fusion_pass.h | 2 +- .../3rdparty/spirv-tools/source/opt/loop_peeling.h | 2 +- .../spirv-tools/source/opt/loop_unroller.cpp | 29 +- .../spirv-tools/source/opt/loop_unswitch_pass.cpp | 2 +- .../spirv-tools/source/opt/loop_unswitch_pass.h | 2 +- .../3rdparty/spirv-tools/source/opt/loop_utils.h | 4 +- .../3rdparty/spirv-tools/source/opt/mem_pass.cpp | 2 +- .../spirv-tools/source/opt/merge_return_pass.cpp | 22 +- .../spirv-tools/source/opt/merge_return_pass.h | 10 +- .../3rdparty/spirv-tools/source/opt/module.cpp | 11 +- .../bgfx/3rdparty/spirv-tools/source/opt/module.h | 25 +- .../3rdparty/spirv-tools/source/opt/optimizer.cpp | 66 +- .../bgfx/3rdparty/spirv-tools/source/opt/pass.h | 9 +- .../spirv-tools/source/opt/pass_manager.cpp | 14 +- .../3rdparty/spirv-tools/source/opt/pass_manager.h | 4 +- .../bgfx/3rdparty/spirv-tools/source/opt/passes.h | 8 +- .../source/opt/private_to_local_pass.cpp | 2 +- .../spirv-tools/source/opt/private_to_local_pass.h | 2 +- .../spirv-tools/source/opt/reduce_load_size.cpp | 11 +- .../source/opt/redundancy_elimination.cpp | 4 + .../source/opt/redundancy_elimination.h | 2 +- .../bgfx/3rdparty/spirv-tools/source/opt/reflect.h | 3 +- .../spirv-tools/source/opt/register_pressure.cpp | 2 +- .../source/opt/relax_float_ops_pass.cpp | 2 +- .../source/opt/remove_dontinline_pass.cpp | 49 + .../source/opt/remove_dontinline_pass.h | 42 + .../source/opt/remove_duplicates_pass.cpp | 5 +- .../replace_desc_array_access_using_var_index.cpp | 429 + .../replace_desc_array_access_using_var_index.h | 205 + .../spirv-tools/source/opt/replace_invalid_opc.cpp | 5 +- .../spirv-tools/source/opt/scalar_analysis.cpp | 2 +- .../spirv-tools/source/opt/scalar_analysis_nodes.h | 2 +- .../source/opt/scalar_analysis_simplification.cpp | 4 +- .../source/opt/scalar_replacement_pass.cpp | 29 +- .../source/opt/scalar_replacement_pass.h | 33 +- .../opt/set_spec_constant_default_value_pass.cpp | 33 +- .../spirv-tools/source/opt/simplification_pass.cpp | 4 + .../source/opt/spread_volatile_semantics.cpp | 298 + .../source/opt/spread_volatile_semantics.h | 116 + .../spirv-tools/source/opt/ssa_rewrite_pass.cpp | 74 +- .../spirv-tools/source/opt/ssa_rewrite_pass.h | 9 - .../source/opt/strength_reduction_pass.h | 2 +- .../source/opt/strip_debug_info_pass.cpp | 13 +- .../source/opt/strip_nonsemantic_info_pass.cpp | 115 + .../source/opt/strip_nonsemantic_info_pass.h | 44 + .../source/opt/strip_reflect_info_pass.cpp | 128 - .../source/opt/strip_reflect_info_pass.h | 44 - .../spirv-tools/source/opt/type_manager.cpp | 11 +- .../3rdparty/spirv-tools/source/opt/type_manager.h | 7 + .../bgfx/3rdparty/spirv-tools/source/opt/types.cpp | 193 +- .../bgfx/3rdparty/spirv-tools/source/opt/types.h | 111 +- .../spirv-tools/source/opt/unify_const_pass.cpp | 2 +- .../source/opt/upgrade_memory_model.cpp | 8 +- .../3rdparty/spirv-tools/source/opt/vector_dce.h | 2 +- .../3rdparty/spirv-tools/source/parsed_operand.cpp | 4 +- .../bgfx/3rdparty/spirv-tools/source/print.cpp | 3 +- .../remove_struct_member_reduction_opportunity.cpp | 2 +- ..._struct_member_reduction_opportunity_finder.cpp | 4 +- ...truct_to_block_reduction_opportunity_finder.cpp | 4 +- .../3rdparty/spirv-tools/source/spirv_constant.h | 1 + .../3rdparty/spirv-tools/source/spirv_definition.h | 2 +- .../3rdparty/spirv-tools/source/spirv_endian.h | 2 +- .../spirv-tools/source/spirv_target_env.cpp | 93 +- .../3rdparty/spirv-tools/source/spirv_target_env.h | 5 +- .../spirv-tools/source/spirv_validator_options.cpp | 5 + .../spirv-tools/source/spirv_validator_options.h | 4 +- .../bgfx/3rdparty/spirv-tools/source/table.cpp | 2 + 3rdparty/bgfx/3rdparty/spirv-tools/source/text.cpp | 25 +- .../3rdparty/spirv-tools/source/text_handler.cpp | 57 +- .../3rdparty/spirv-tools/source/util/bit_vector.h | 2 +- .../spirv-tools/source/util/hash_combine.h | 53 + .../3rdparty/spirv-tools/source/util/hex_float.h | 92 +- .../bgfx/3rdparty/spirv-tools/source/util/ilist.h | 3 +- .../spirv-tools/source/util/parse_number.h | 2 +- .../spirv-tools/source/util/small_vector.h | 21 +- .../spirv-tools/source/util/string_utils.h | 63 +- .../bgfx/3rdparty/spirv-tools/source/util/timer.h | 6 +- .../spirv-tools/source/val/basic_block.cpp | 83 +- .../3rdparty/spirv-tools/source/val/basic_block.h | 109 +- .../3rdparty/spirv-tools/source/val/construct.cpp | 86 +- .../3rdparty/spirv-tools/source/val/decoration.h | 9 + .../3rdparty/spirv-tools/source/val/function.cpp | 41 +- .../3rdparty/spirv-tools/source/val/function.h | 18 +- .../spirv-tools/source/val/instruction.cpp | 10 + .../3rdparty/spirv-tools/source/val/instruction.h | 3 + .../3rdparty/spirv-tools/source/val/validate.cpp | 34 +- .../3rdparty/spirv-tools/source/val/validate.h | 11 +- .../spirv-tools/source/val/validate_annotation.cpp | 368 +- .../source/val/validate_arithmetics.cpp | 2 +- .../spirv-tools/source/val/validate_atomics.cpp | 10 +- .../spirv-tools/source/val/validate_barriers.cpp | 3 +- .../spirv-tools/source/val/validate_bitwise.cpp | 83 +- .../spirv-tools/source/val/validate_builtins.cpp | 230 +- .../spirv-tools/source/val/validate_cfg.cpp | 252 +- .../spirv-tools/source/val/validate_composites.cpp | 4 +- .../spirv-tools/source/val/validate_constants.cpp | 102 +- .../spirv-tools/source/val/validate_conversion.cpp | 18 + .../spirv-tools/source/val/validate_debug.cpp | 14 +- .../source/val/validate_decorations.cpp | 425 +- .../source/val/validate_derivatives.cpp | 12 +- .../source/val/validate_execution_limitations.cpp | 9 +- .../spirv-tools/source/val/validate_extensions.cpp | 137 +- .../spirv-tools/source/val/validate_function.cpp | 68 +- .../spirv-tools/source/val/validate_image.cpp | 337 +- .../source/val/validate_instruction.cpp | 27 +- .../spirv-tools/source/val/validate_interfaces.cpp | 75 +- .../spirv-tools/source/val/validate_layout.cpp | 1 + .../spirv-tools/source/val/validate_logicals.cpp | 13 +- .../spirv-tools/source/val/validate_memory.cpp | 484 +- .../source/val/validate_mesh_shading.cpp | 123 + .../spirv-tools/source/val/validate_misc.cpp | 5 +- .../source/val/validate_mode_setting.cpp | 147 +- .../source/val/validate_non_uniform.cpp | 55 + .../spirv-tools/source/val/validate_ray_query.cpp | 273 + .../source/val/validate_ray_tracing.cpp | 209 + .../spirv-tools/source/val/validate_scopes.cpp | 69 +- .../spirv-tools/source/val/validate_type.cpp | 131 +- .../spirv-tools/source/val/validation_state.cpp | 339 +- .../spirv-tools/source/val/validation_state.h | 114 +- 3rdparty/bgfx/3rdparty/stb/LICENSE | 37 + 3rdparty/bgfx/3rdparty/stb/stb_rect_pack.h | 41 +- 3rdparty/bgfx/LICENSE | 2 +- 3rdparty/bgfx/README.md | 64 +- 3rdparty/bgfx/bindings/bf/bgfx.bf | 193 +- 3rdparty/bgfx/bindings/cs/bgfx.cs | 193 +- 3rdparty/bgfx/bindings/cs/bgfx_dllname.cs | 2 +- 3rdparty/bgfx/bindings/d/funcs.d | 450 +- 3rdparty/bgfx/bindings/d/types.d | 139 +- 3rdparty/bgfx/bindings/zig/bgfx.zig | 3705 +++ 3rdparty/bgfx/docs/bgfx.rst | 605 + 3rdparty/bgfx/docs/build.rst | 215 + 3rdparty/bgfx/docs/examples.rst | 706 + 3rdparty/bgfx/docs/index.rst | 22 + 3rdparty/bgfx/docs/internals.rst | 50 + 3rdparty/bgfx/docs/license.rst | 132 + 3rdparty/bgfx/docs/overview.rst | 300 + 3rdparty/bgfx/docs/tools.rst | 243 + .../bgfx/examples/00-helloworld/helloworld.cpp | 6 +- 3rdparty/bgfx/examples/01-cubes/cubes.cpp | 8 +- 3rdparty/bgfx/examples/01-cubes/fs_cubes.sc | 4 +- 3rdparty/bgfx/examples/01-cubes/makefile | 4 +- 3rdparty/bgfx/examples/01-cubes/vs_cubes.sc | 4 +- .../bgfx/examples/02-metaballs/fs_metaballs.sc | 4 +- 3rdparty/bgfx/examples/02-metaballs/makefile | 4 +- 3rdparty/bgfx/examples/02-metaballs/metaballs.cpp | 6 +- .../bgfx/examples/02-metaballs/vs_metaballs.sc | 4 +- .../bgfx/examples/03-raymarch/fs_raymarching.sc | 4 +- 3rdparty/bgfx/examples/03-raymarch/makefile | 4 +- 3rdparty/bgfx/examples/03-raymarch/raymarch.cpp | 6 +- .../bgfx/examples/03-raymarch/vs_raymarching.sc | 4 +- 3rdparty/bgfx/examples/04-mesh/fs_mesh.sc | 4 +- 3rdparty/bgfx/examples/04-mesh/makefile | 4 +- 3rdparty/bgfx/examples/04-mesh/mesh.cpp | 6 +- 3rdparty/bgfx/examples/04-mesh/vs_mesh.sc | 4 +- .../bgfx/examples/05-instancing/fs_instancing.sc | 4 +- .../bgfx/examples/05-instancing/instancing.cpp | 8 +- 3rdparty/bgfx/examples/05-instancing/makefile | 4 +- .../bgfx/examples/05-instancing/vs_instancing.sc | 4 +- 3rdparty/bgfx/examples/06-bump/bump.cpp | 6 +- 3rdparty/bgfx/examples/06-bump/fs_bump.sc | 4 +- 3rdparty/bgfx/examples/06-bump/makefile | 4 +- 3rdparty/bgfx/examples/06-bump/vs_bump.sc | 4 +- .../bgfx/examples/06-bump/vs_bump_instanced.sc | 4 +- 3rdparty/bgfx/examples/07-callback/callback.cpp | 9 +- 3rdparty/bgfx/examples/07-callback/fs_callback.sc | 4 +- 3rdparty/bgfx/examples/07-callback/makefile | 4 +- 3rdparty/bgfx/examples/07-callback/vs_callback.sc | 4 +- 3rdparty/bgfx/examples/08-update/cs_update.sc | 2 +- 3rdparty/bgfx/examples/08-update/fs_update.sc | 4 +- 3rdparty/bgfx/examples/08-update/fs_update_3d.sc | 4 +- 3rdparty/bgfx/examples/08-update/fs_update_cmp.sc | 4 +- 3rdparty/bgfx/examples/08-update/makefile | 4 +- 3rdparty/bgfx/examples/08-update/update.cpp | 64 +- 3rdparty/bgfx/examples/08-update/vs_update.sc | 4 +- 3rdparty/bgfx/examples/09-hdr/common.sh | 4 +- 3rdparty/bgfx/examples/09-hdr/fs_hdr_blur.sc | 4 +- 3rdparty/bgfx/examples/09-hdr/fs_hdr_bright.sc | 8 +- 3rdparty/bgfx/examples/09-hdr/fs_hdr_lum.sc | 4 +- 3rdparty/bgfx/examples/09-hdr/fs_hdr_lumavg.sc | 4 +- 3rdparty/bgfx/examples/09-hdr/fs_hdr_mesh.sc | 4 +- 3rdparty/bgfx/examples/09-hdr/fs_hdr_skybox.sc | 4 +- 3rdparty/bgfx/examples/09-hdr/fs_hdr_tonemap.sc | 6 +- 3rdparty/bgfx/examples/09-hdr/hdr.cpp | 8 +- 3rdparty/bgfx/examples/09-hdr/makefile | 4 +- 3rdparty/bgfx/examples/09-hdr/vs_hdr_blur.sc | 4 +- 3rdparty/bgfx/examples/09-hdr/vs_hdr_bright.sc | 4 +- 3rdparty/bgfx/examples/09-hdr/vs_hdr_lum.sc | 4 +- 3rdparty/bgfx/examples/09-hdr/vs_hdr_lumavg.sc | 4 +- 3rdparty/bgfx/examples/09-hdr/vs_hdr_mesh.sc | 4 +- 3rdparty/bgfx/examples/09-hdr/vs_hdr_skybox.sc | 4 +- 3rdparty/bgfx/examples/09-hdr/vs_hdr_tonemap.sc | 4 +- 3rdparty/bgfx/examples/10-font/font.cpp | 9 +- 3rdparty/bgfx/examples/11-fontsdf/fontsdf.cpp | 9 +- 3rdparty/bgfx/examples/12-lod/fs_tree.sc | 2 +- 3rdparty/bgfx/examples/12-lod/lod.cpp | 4 +- 3rdparty/bgfx/examples/12-lod/makefile | 4 +- 3rdparty/bgfx/examples/12-lod/vs_tree.sc | 2 +- .../examples/13-stencil/fs_stencil_color_black.sc | 2 +- .../13-stencil/fs_stencil_color_lighting.sc | 2 +- .../13-stencil/fs_stencil_color_texture.sc | 2 +- .../bgfx/examples/13-stencil/fs_stencil_texture.sc | 2 +- .../13-stencil/fs_stencil_texture_lighting.sc | 2 +- 3rdparty/bgfx/examples/13-stencil/makefile | 4 +- 3rdparty/bgfx/examples/13-stencil/stencil.cpp | 55 +- .../bgfx/examples/13-stencil/vs_stencil_color.sc | 2 +- .../13-stencil/vs_stencil_color_lighting.sc | 2 +- .../13-stencil/vs_stencil_color_texture.sc | 2 +- .../bgfx/examples/13-stencil/vs_stencil_texture.sc | 2 +- .../13-stencil/vs_stencil_texture_lighting.sc | 2 +- .../fs_shadowvolume_color_lighting.sc | 2 +- .../fs_shadowvolume_color_texture.sc | 2 +- .../fs_shadowvolume_svbackblank.sc | 2 +- .../fs_shadowvolume_svbackcolor.sc | 2 +- .../14-shadowvolumes/fs_shadowvolume_svbacktex1.sc | 2 +- .../14-shadowvolumes/fs_shadowvolume_svbacktex2.sc | 2 +- .../fs_shadowvolume_svfrontblank.sc | 2 +- .../fs_shadowvolume_svfrontcolor.sc | 2 +- .../fs_shadowvolume_svfronttex1.sc | 2 +- .../fs_shadowvolume_svfronttex2.sc | 2 +- .../14-shadowvolumes/fs_shadowvolume_svside.sc | 2 +- .../fs_shadowvolume_svsideblank.sc | 2 +- .../fs_shadowvolume_svsidecolor.sc | 2 +- .../14-shadowvolumes/fs_shadowvolume_svsidetex.sc | 2 +- .../14-shadowvolumes/fs_shadowvolume_texture.sc | 2 +- .../fs_shadowvolume_texture_lighting.sc | 2 +- 3rdparty/bgfx/examples/14-shadowvolumes/makefile | 4 +- .../examples/14-shadowvolumes/shadowvolumes.cpp | 25 +- .../vs_shadowvolume_color_lighting.sc | 2 +- .../vs_shadowvolume_color_texture.sc | 2 +- .../14-shadowvolumes/vs_shadowvolume_svback.sc | 2 +- .../14-shadowvolumes/vs_shadowvolume_svfront.sc | 2 +- .../14-shadowvolumes/vs_shadowvolume_svside.sc | 2 +- .../14-shadowvolumes/vs_shadowvolume_texture.sc | 2 +- .../vs_shadowvolume_texture_lighting.sc | 2 +- .../examples/15-shadowmaps-simple/fs_sms_mesh.sc | 2 +- .../15-shadowmaps-simple/fs_sms_mesh_pd.sc | 2 +- .../examples/15-shadowmaps-simple/fs_sms_shadow.sc | 2 +- .../examples/15-shadowmaps-simple/fs_sms_shadow.sh | 2 +- .../15-shadowmaps-simple/fs_sms_shadow_pd.sc | 2 +- .../bgfx/examples/15-shadowmaps-simple/makefile | 4 +- .../15-shadowmaps-simple/shadowmaps_simple.cpp | 32 +- .../examples/15-shadowmaps-simple/vs_sms_mesh.sc | 2 +- .../examples/15-shadowmaps-simple/vs_sms_shadow.sc | 2 +- .../15-shadowmaps-simple/vs_sms_shadow_pd.sc | 2 +- 3rdparty/bgfx/examples/16-shadowmaps/common.sh | 2 +- .../16-shadowmaps/fs_shadowmaps_color_black.sc | 2 +- .../16-shadowmaps/fs_shadowmaps_color_lighting.sh | 2 +- .../fs_shadowmaps_color_lighting_esm.sc | 2 +- .../fs_shadowmaps_color_lighting_esm_csm.sc | 2 +- .../fs_shadowmaps_color_lighting_esm_linear.sc | 2 +- .../fs_shadowmaps_color_lighting_esm_linear_csm.sc | 2 +- ...fs_shadowmaps_color_lighting_esm_linear_omni.sc | 2 +- .../fs_shadowmaps_color_lighting_esm_omni.sc | 2 +- .../fs_shadowmaps_color_lighting_hard.sc | 2 +- .../fs_shadowmaps_color_lighting_hard_csm.sc | 2 +- .../fs_shadowmaps_color_lighting_hard_linear.sc | 2 +- ...fs_shadowmaps_color_lighting_hard_linear_csm.sc | 2 +- ...s_shadowmaps_color_lighting_hard_linear_omni.sc | 2 +- .../fs_shadowmaps_color_lighting_hard_omni.sc | 2 +- .../fs_shadowmaps_color_lighting_pcf.sc | 2 +- .../fs_shadowmaps_color_lighting_pcf_csm.sc | 2 +- .../fs_shadowmaps_color_lighting_pcf_linear.sc | 2 +- .../fs_shadowmaps_color_lighting_pcf_linear_csm.sc | 2 +- ...fs_shadowmaps_color_lighting_pcf_linear_omni.sc | 2 +- .../fs_shadowmaps_color_lighting_pcf_omni.sc | 2 +- .../fs_shadowmaps_color_lighting_vsm.sc | 2 +- .../fs_shadowmaps_color_lighting_vsm_csm.sc | 2 +- .../fs_shadowmaps_color_lighting_vsm_linear.sc | 2 +- .../fs_shadowmaps_color_lighting_vsm_linear_csm.sc | 2 +- ...fs_shadowmaps_color_lighting_vsm_linear_omni.sc | 2 +- .../fs_shadowmaps_color_lighting_vsm_omni.sc | 2 +- .../16-shadowmaps/fs_shadowmaps_color_texture.sc | 2 +- .../examples/16-shadowmaps/fs_shadowmaps_hblur.sc | 2 +- .../16-shadowmaps/fs_shadowmaps_hblur_vsm.sc | 2 +- .../16-shadowmaps/fs_shadowmaps_packdepth.sc | 2 +- .../fs_shadowmaps_packdepth_linear.sc | 2 +- .../16-shadowmaps/fs_shadowmaps_packdepth_vsm.sc | 2 +- .../fs_shadowmaps_packdepth_vsm_linear.sc | 2 +- .../16-shadowmaps/fs_shadowmaps_texture.sc | 2 +- .../16-shadowmaps/fs_shadowmaps_unpackdepth.sc | 2 +- .../16-shadowmaps/fs_shadowmaps_unpackdepth_vsm.sc | 2 +- .../examples/16-shadowmaps/fs_shadowmaps_vblur.sc | 2 +- .../16-shadowmaps/fs_shadowmaps_vblur_vsm.sc | 2 +- 3rdparty/bgfx/examples/16-shadowmaps/makefile | 4 +- .../bgfx/examples/16-shadowmaps/shadowmaps.cpp | 6 +- .../examples/16-shadowmaps/vs_shadowmaps_color.sc | 2 +- .../16-shadowmaps/vs_shadowmaps_color_lighting.sc | 2 +- .../vs_shadowmaps_color_lighting_csm.sc | 2 +- .../vs_shadowmaps_color_lighting_linear.sc | 2 +- .../vs_shadowmaps_color_lighting_linear_csm.sc | 2 +- .../vs_shadowmaps_color_lighting_linear_omni.sc | 2 +- .../vs_shadowmaps_color_lighting_omni.sc | 2 +- .../16-shadowmaps/vs_shadowmaps_color_texture.sc | 2 +- .../examples/16-shadowmaps/vs_shadowmaps_depth.sc | 2 +- .../examples/16-shadowmaps/vs_shadowmaps_hblur.sc | 4 +- .../16-shadowmaps/vs_shadowmaps_packdepth.sc | 2 +- .../vs_shadowmaps_packdepth_linear.sc | 2 +- .../16-shadowmaps/vs_shadowmaps_texture.sc | 2 +- .../vs_shadowmaps_texture_lighting.sc | 2 +- .../16-shadowmaps/vs_shadowmaps_unpackdepth.sc | 2 +- .../examples/16-shadowmaps/vs_shadowmaps_vblur.sc | 2 +- .../bgfx/examples/17-drawstress/drawstress.cpp | 6 +- .../bgfx/examples/17-drawstress/fs_drawstress.sc | 4 +- 3rdparty/bgfx/examples/17-drawstress/makefile | 4 +- .../bgfx/examples/17-drawstress/vs_drawstress.sc | 4 +- 3rdparty/bgfx/examples/18-ibl/fs_ibl_mesh.sc | 2 +- 3rdparty/bgfx/examples/18-ibl/fs_ibl_skybox.sc | 2 +- 3rdparty/bgfx/examples/18-ibl/ibl.cpp | 10 +- 3rdparty/bgfx/examples/18-ibl/makefile | 4 +- 3rdparty/bgfx/examples/18-ibl/uniforms.sh | 2 +- 3rdparty/bgfx/examples/18-ibl/vs_ibl_mesh.sc | 2 +- 3rdparty/bgfx/examples/18-ibl/vs_ibl_skybox.sc | 2 +- 3rdparty/bgfx/examples/19-oit/fs_oit.sc | 4 +- 3rdparty/bgfx/examples/19-oit/fs_oit_wb.sc | 4 +- 3rdparty/bgfx/examples/19-oit/fs_oit_wb_blit.sc | 4 +- .../bgfx/examples/19-oit/fs_oit_wb_separate.sc | 4 +- .../examples/19-oit/fs_oit_wb_separate_blit.sc | 4 +- 3rdparty/bgfx/examples/19-oit/makefile | 4 +- 3rdparty/bgfx/examples/19-oit/oit.cpp | 6 +- 3rdparty/bgfx/examples/19-oit/vs_oit.sc | 4 +- 3rdparty/bgfx/examples/19-oit/vs_oit_blit.sc | 4 +- 3rdparty/bgfx/examples/20-nanovg/blendish.h | 8 +- 3rdparty/bgfx/examples/20-nanovg/nanovg.cpp | 18 +- 3rdparty/bgfx/examples/21-deferred/common.sh | 4 +- 3rdparty/bgfx/examples/21-deferred/deferred.cpp | 68 +- .../examples/21-deferred/fs_deferred_clear_uav.sc | 6 +- .../examples/21-deferred/fs_deferred_combine.sc | 4 +- .../examples/21-deferred/fs_deferred_combine_ta.sc | 18 + .../bgfx/examples/21-deferred/fs_deferred_debug.sc | 4 +- .../examples/21-deferred/fs_deferred_debug_line.sc | 4 +- .../examples/21-deferred/fs_deferred_debug_ta.sc | 17 + .../bgfx/examples/21-deferred/fs_deferred_geom.sc | 4 +- .../bgfx/examples/21-deferred/fs_deferred_light.sc | 4 +- .../examples/21-deferred/fs_deferred_light_ta.sc | 4 +- .../examples/21-deferred/fs_deferred_light_uav.sc | 4 +- 3rdparty/bgfx/examples/21-deferred/makefile | 4 +- .../examples/21-deferred/vs_deferred_combine.sc | 4 +- .../bgfx/examples/21-deferred/vs_deferred_debug.sc | 4 +- .../examples/21-deferred/vs_deferred_debug_line.sc | 4 +- .../bgfx/examples/21-deferred/vs_deferred_geom.sc | 4 +- .../bgfx/examples/21-deferred/vs_deferred_light.sc | 4 +- 3rdparty/bgfx/examples/22-windows/windows.cpp | 6 +- 3rdparty/bgfx/examples/23-vectordisplay/main.cpp | 4 +- 3rdparty/bgfx/examples/23-vectordisplay/makefile | 4 +- .../examples/23-vectordisplay/vectordisplay.cpp | 2 +- .../bgfx/examples/23-vectordisplay/vectordisplay.h | 6 +- 3rdparty/bgfx/examples/24-nbody/cs_indirect.sc | 2 +- .../bgfx/examples/24-nbody/cs_init_instances.sc | 2 +- .../bgfx/examples/24-nbody/cs_update_instances.sc | 2 +- 3rdparty/bgfx/examples/24-nbody/fs_particle.sc | 2 +- 3rdparty/bgfx/examples/24-nbody/makefile | 4 +- 3rdparty/bgfx/examples/24-nbody/nbody.cpp | 4 +- 3rdparty/bgfx/examples/24-nbody/uniforms.sh | 2 +- 3rdparty/bgfx/examples/24-nbody/vs_particle.sc | 2 +- 3rdparty/bgfx/examples/25-c99/helloworld.c | 5 + 3rdparty/bgfx/examples/26-occlusion/occlusion.cpp | 6 +- 3rdparty/bgfx/examples/27-terrain/fs_terrain.sc | 2 +- 3rdparty/bgfx/examples/27-terrain/makefile | 4 +- 3rdparty/bgfx/examples/27-terrain/terrain.cpp | 11 +- 3rdparty/bgfx/examples/27-terrain/vs_terrain.sc | 2 +- .../27-terrain/vs_terrain_height_texture.sc | 2 +- 3rdparty/bgfx/examples/28-wireframe/fs_wf_mesh.sc | 2 +- .../bgfx/examples/28-wireframe/fs_wf_wireframe.sc | 2 +- 3rdparty/bgfx/examples/28-wireframe/makefile | 4 +- 3rdparty/bgfx/examples/28-wireframe/uniforms.sh | 2 +- 3rdparty/bgfx/examples/28-wireframe/vs_wf_mesh.sc | 2 +- .../bgfx/examples/28-wireframe/vs_wf_wireframe.sc | 2 +- 3rdparty/bgfx/examples/28-wireframe/wireframe.cpp | 10 +- 3rdparty/bgfx/examples/29-debugdraw/debugdraw.cpp | 150 +- 3rdparty/bgfx/examples/30-picking/fs_picking_id.sc | 4 +- .../bgfx/examples/30-picking/fs_picking_shaded.sc | 4 +- 3rdparty/bgfx/examples/30-picking/makefile | 4 +- 3rdparty/bgfx/examples/30-picking/picking.cpp | 6 +- .../bgfx/examples/30-picking/vs_picking_shaded.sc | 4 +- 3rdparty/bgfx/examples/31-rsm/fs_rsm_combine.sc | 2 +- 3rdparty/bgfx/examples/31-rsm/fs_rsm_gbuffer.sc | 2 +- 3rdparty/bgfx/examples/31-rsm/fs_rsm_lbuffer.sc | 2 +- 3rdparty/bgfx/examples/31-rsm/fs_rsm_shadow.sc | 2 +- 3rdparty/bgfx/examples/31-rsm/makefile | 4 +- .../bgfx/examples/31-rsm/reflectiveshadowmap.cpp | 8 +- 3rdparty/bgfx/examples/31-rsm/vs_rsm_combine.sc | 2 +- 3rdparty/bgfx/examples/31-rsm/vs_rsm_gbuffer.sc | 2 +- 3rdparty/bgfx/examples/31-rsm/vs_rsm_lbuffer.sc | 2 +- 3rdparty/bgfx/examples/31-rsm/vs_rsm_shadow.sc | 2 +- 3rdparty/bgfx/examples/32-particles/particles.cpp | 8 +- 3rdparty/bgfx/examples/33-pom/makefile | 4 +- 3rdparty/bgfx/examples/33-pom/pom.cpp | 6 +- 3rdparty/bgfx/examples/34-mvs/mvs.cpp | 6 +- 3rdparty/bgfx/examples/35-dynamic/dynamic.cpp | 6 +- 3rdparty/bgfx/examples/36-sky/fs_sky.sc | 2 +- .../examples/36-sky/fs_sky_color_banding_fix.sc | 2 +- 3rdparty/bgfx/examples/36-sky/fs_sky_landscape.sc | 2 +- 3rdparty/bgfx/examples/36-sky/makefile | 4 +- 3rdparty/bgfx/examples/36-sky/sky.cpp | 971 +- 3rdparty/bgfx/examples/36-sky/vs_sky.sc | 2 +- 3rdparty/bgfx/examples/36-sky/vs_sky_landscape.sc | 4 +- .../37-gpudrivenrendering/cs_gdr_copy_z.sc | 2 +- .../37-gpudrivenrendering/cs_gdr_downscale_hi_z.sc | 2 +- .../37-gpudrivenrendering/cs_gdr_occlude_props.sc | 2 +- .../cs_gdr_stream_compaction.sc | 2 +- .../fs_gdr_instanced_indirect_rendering.sc | 2 +- .../37-gpudrivenrendering/gpudrivenrendering.cpp | 10 +- .../bgfx/examples/37-gpudrivenrendering/makefile | 4 +- .../vs_gdr_instanced_indirect_rendering.sc | 2 +- .../vs_gdr_render_occlusion.sc | 2 +- 3rdparty/bgfx/examples/38-bloom/bloom.cpp | 45 +- .../bgfx/examples/38-bloom/fs_albedo_output.sc | 2 +- .../bgfx/examples/38-bloom/fs_bloom_combine.sc | 4 +- 3rdparty/bgfx/examples/38-bloom/fs_downsample.sc | 2 +- 3rdparty/bgfx/examples/38-bloom/fs_upsample.sc | 2 +- 3rdparty/bgfx/examples/38-bloom/makefile | 4 +- .../bgfx/examples/38-bloom/vs_albedo_output.sc | 2 +- .../bgfx/examples/38-bloom/vs_deferred_combine.sc | 4 +- 3rdparty/bgfx/examples/38-bloom/vs_fullscreen.sc | 2 +- 3rdparty/bgfx/examples/39-assao/assao.cpp | 11 +- 3rdparty/bgfx/examples/39-assao/cs_assao_apply.sc | 2 +- .../39-assao/cs_assao_generate_importance_map.sc | 2 +- .../bgfx/examples/39-assao/cs_assao_generate_q.sh | 2 +- .../bgfx/examples/39-assao/cs_assao_generate_q0.sc | 2 +- .../bgfx/examples/39-assao/cs_assao_generate_q1.sc | 2 +- .../bgfx/examples/39-assao/cs_assao_generate_q2.sc | 2 +- .../bgfx/examples/39-assao/cs_assao_generate_q3.sc | 2 +- .../examples/39-assao/cs_assao_generate_q3base.sc | 2 +- .../39-assao/cs_assao_load_counter_clear.sc | 2 +- .../examples/39-assao/cs_assao_non_smart_apply.sc | 2 +- .../examples/39-assao/cs_assao_non_smart_blur.sc | 2 +- .../39-assao/cs_assao_non_smart_half_apply.sc | 2 +- .../cs_assao_postprocess_importance_map_a.sc | 2 +- .../cs_assao_postprocess_importance_map_b.sc | 2 +- .../39-assao/cs_assao_prepare_depth_mip.sc | 2 +- .../examples/39-assao/cs_assao_prepare_depths.sc | 2 +- .../cs_assao_prepare_depths_and_normals.sc | 2 +- .../cs_assao_prepare_depths_and_normals_half.sc | 2 +- .../39-assao/cs_assao_prepare_depths_half.sc | 2 +- .../bgfx/examples/39-assao/cs_assao_smart_blur.sc | 2 +- .../examples/39-assao/cs_assao_smart_blur_wide.sc | 2 +- .../examples/39-assao/fs_assao_deferred_combine.sc | 2 +- .../bgfx/examples/39-assao/fs_assao_gbuffer.sc | 2 +- 3rdparty/bgfx/examples/39-assao/makefile | 4 +- 3rdparty/bgfx/examples/39-assao/vs_assao.sc | 2 +- .../bgfx/examples/39-assao/vs_assao_gbuffer.sc | 2 +- 3rdparty/bgfx/examples/40-svt/fs_vt_mip.sc | 4 +- 3rdparty/bgfx/examples/40-svt/fs_vt_unlit.sc | 4 +- 3rdparty/bgfx/examples/40-svt/makefile | 4 +- 3rdparty/bgfx/examples/40-svt/svt.cpp | 12 +- 3rdparty/bgfx/examples/40-svt/virtualtexture.sh | 4 +- 3rdparty/bgfx/examples/40-svt/vs_vt_generic.sc | 4 +- 3rdparty/bgfx/examples/40-svt/vt.cpp | 6 +- 3rdparty/bgfx/examples/40-svt/vt.h | 2 +- 3rdparty/bgfx/examples/41-tess/makefile | 4 +- 3rdparty/bgfx/examples/41-tess/tess.cpp | 1518 +- 3rdparty/bgfx/examples/42-bunnylod/bunnylod.cpp | 56 +- 3rdparty/bgfx/examples/42-bunnylod/fs_bunnylod.sc | 4 +- 3rdparty/bgfx/examples/42-bunnylod/makefile | 4 +- 3rdparty/bgfx/examples/42-bunnylod/progmesh.c | 5 +- 3rdparty/bgfx/examples/42-bunnylod/vs_bunnylod.sc | 4 +- 3rdparty/bgfx/examples/43-denoise/denoise.cpp | 13 +- .../43-denoise/fs_denoise_apply_lighting.sc | 2 +- .../bgfx/examples/43-denoise/fs_denoise_copy.sc | 2 +- .../43-denoise/fs_denoise_deferred_combine.sc | 2 +- .../examples/43-denoise/fs_denoise_spatial_3x3.sc | 2 +- .../examples/43-denoise/fs_denoise_spatial_5x5.sc | 2 +- .../fs_denoise_spatial_implementation.sh | 2 +- .../examples/43-denoise/fs_denoise_temporal.sc | 2 +- .../bgfx/examples/43-denoise/fs_denoise_txaa.sc | 2 +- 3rdparty/bgfx/examples/43-denoise/makefile | 2 +- .../bgfx/examples/43-denoise/normal_encoding.sh | 2 +- 3rdparty/bgfx/examples/43-denoise/parameters.sh | 2 +- .../bgfx/examples/43-denoise/shared_functions.sh | 2 +- .../bgfx/examples/43-denoise/vs_denoise_gbuffer.sc | 2 +- .../examples/44-sss/fs_screen_space_shadows.sc | 2 +- .../examples/44-sss/fs_sss_deferred_combine.sc | 2 +- .../bgfx/examples/44-sss/fs_sss_linear_depth.sc | 2 +- 3rdparty/bgfx/examples/44-sss/makefile | 2 +- 3rdparty/bgfx/examples/44-sss/normal_encoding.sh | 2 +- 3rdparty/bgfx/examples/44-sss/parameters.sh | 2 +- .../bgfx/examples/44-sss/screen_space_shadows.cpp | 24 +- 3rdparty/bgfx/examples/44-sss/vs_sss_gbuffer.sc | 2 +- 3rdparty/bgfx/examples/45-bokeh/bokeh.cpp | 28 +- 3rdparty/bgfx/examples/45-bokeh/bokeh_dof.sh | 2 +- 3rdparty/bgfx/examples/45-bokeh/fs_bokeh_copy.sc | 2 +- .../45-bokeh/fs_bokeh_copy_linear_to_gamma.sc | 2 +- .../bgfx/examples/45-bokeh/fs_bokeh_dof_combine.sc | 2 +- .../bgfx/examples/45-bokeh/fs_bokeh_dof_debug.sc | 2 +- .../examples/45-bokeh/fs_bokeh_dof_downsample.sc | 2 +- .../examples/45-bokeh/fs_bokeh_dof_second_pass.sc | 2 +- .../examples/45-bokeh/fs_bokeh_dof_single_pass.sc | 2 +- .../bgfx/examples/45-bokeh/fs_bokeh_forward.sc | 2 +- .../examples/45-bokeh/fs_bokeh_forward_grid.sc | 2 +- .../examples/45-bokeh/fs_bokeh_linear_depth.sc | 2 +- 3rdparty/bgfx/examples/45-bokeh/makefile | 2 +- 3rdparty/bgfx/examples/45-bokeh/parameters.sh | 2 +- .../bgfx/examples/45-bokeh/vs_bokeh_forward.sc | 2 +- 3rdparty/bgfx/examples/46-fsr/app.cpp | 858 + 3rdparty/bgfx/examples/46-fsr/cs_fsr.h | 127 + .../bgfx/examples/46-fsr/cs_fsr_bilinear_16.sc | 3 + .../bgfx/examples/46-fsr/cs_fsr_bilinear_32.sc | 4 + 3rdparty/bgfx/examples/46-fsr/cs_fsr_easu_16.sc | 3 + 3rdparty/bgfx/examples/46-fsr/cs_fsr_easu_32.sc | 4 + 3rdparty/bgfx/examples/46-fsr/cs_fsr_rcas_16.sc | 3 + 3rdparty/bgfx/examples/46-fsr/cs_fsr_rcas_32.sc | 4 + 3rdparty/bgfx/examples/46-fsr/ffx_a.h | 2637 ++ 3rdparty/bgfx/examples/46-fsr/ffx_fsr1.h | 1199 + .../examples/46-fsr/fs_fsr_copy_linear_to_gamma.sc | 21 + 3rdparty/bgfx/examples/46-fsr/fs_fsr_forward.sc | 79 + .../bgfx/examples/46-fsr/fs_fsr_forward_grid.sc | 58 + 3rdparty/bgfx/examples/46-fsr/fsr.cpp | 346 + 3rdparty/bgfx/examples/46-fsr/fsr.h | 46 + 3rdparty/bgfx/examples/46-fsr/makefile | 10 + 3rdparty/bgfx/examples/46-fsr/screenshot.png | Bin 0 -> 194145 bytes 3rdparty/bgfx/examples/46-fsr/varying.def.sc | 9 + 3rdparty/bgfx/examples/46-fsr/vs_fsr_forward.sc | 34 + 3rdparty/bgfx/examples/46-fsr/vs_fsr_screenquad.sc | 10 + 3rdparty/bgfx/examples/47-pixelformats/makefile | 10 + .../bgfx/examples/47-pixelformats/pixelformats.cpp | 827 + .../bgfx/examples/47-pixelformats/screenshot.png | Bin 0 -> 154208 bytes .../examples/48-drawindirect/cs_drawindirect.sc | 93 + .../48-drawindirect/cs_drawindirect_count.sc | 2 + .../bgfx/examples/48-drawindirect/drawindirect.cpp | 468 + 3rdparty/bgfx/examples/48-drawindirect/makefile | 10 + .../bgfx/examples/48-drawindirect/screenshot.png | Bin 0 -> 211827 bytes 3rdparty/bgfx/examples/49-hextile/fs_hextile.bin | Bin 0 -> 8741 bytes 3rdparty/bgfx/examples/49-hextile/fs_hextile.sc | 226 + 3rdparty/bgfx/examples/49-hextile/hextile.cpp | 327 + 3rdparty/bgfx/examples/49-hextile/makefile | 10 + 3rdparty/bgfx/examples/49-hextile/screenshot.png | Bin 0 -> 2552337 bytes 3rdparty/bgfx/examples/49-hextile/varying.def.sc | 13 + 3rdparty/bgfx/examples/49-hextile/vs_hextile.sc | 18 + .../assets/textures/aerial_rocks_04_diff_2k.jpg | Bin 0 -> 3001368 bytes .../bgfx/examples/assets/textures/textures.ninja | 32 +- 3rdparty/bgfx/examples/common/aviwriter.h | 161 +- 3rdparty/bgfx/examples/common/bgfx_utils.cpp | 117 +- 3rdparty/bgfx/examples/common/bgfx_utils.h | 18 +- 3rdparty/bgfx/examples/common/bounds.cpp | 2104 -- 3rdparty/bgfx/examples/common/bounds.h | 450 - 3rdparty/bgfx/examples/common/bounds.inl | 188 - 3rdparty/bgfx/examples/common/camera.cpp | 3 +- 3rdparty/bgfx/examples/common/camera.h | 2 +- 3rdparty/bgfx/examples/common/common.h | 4 +- 3rdparty/bgfx/examples/common/common.sh | 4 +- 3rdparty/bgfx/examples/common/cube_atlas.cpp | 38 +- 3rdparty/bgfx/examples/common/cube_atlas.h | 5 +- .../bgfx/examples/common/debugdraw/debugdraw.cpp | 72 +- .../bgfx/examples/common/debugdraw/debugdraw.h | 22 +- .../examples/common/debugdraw/fs_debugdraw_fill.sc | 4 +- .../common/debugdraw/fs_debugdraw_fill_lit.sc | 4 +- .../common/debugdraw/fs_debugdraw_fill_texture.sc | 4 +- .../common/debugdraw/fs_debugdraw_lines.sc | 4 +- .../common/debugdraw/fs_debugdraw_lines_stipple.sc | 4 +- 3rdparty/bgfx/examples/common/debugdraw/makefile | 4 +- .../examples/common/debugdraw/vs_debugdraw_fill.sc | 4 +- .../common/debugdraw/vs_debugdraw_fill_lit.sc | 4 +- .../common/debugdraw/vs_debugdraw_fill_lit_mesh.sc | 4 +- .../common/debugdraw/vs_debugdraw_fill_mesh.sc | 4 +- .../common/debugdraw/vs_debugdraw_fill_texture.sc | 4 +- .../common/debugdraw/vs_debugdraw_lines.sc | 4 +- .../common/debugdraw/vs_debugdraw_lines_stipple.sc | 4 +- 3rdparty/bgfx/examples/common/entry/cmd.cpp | 23 +- 3rdparty/bgfx/examples/common/entry/cmd.h | 7 +- 3rdparty/bgfx/examples/common/entry/dbg.h | 4 +- 3rdparty/bgfx/examples/common/entry/dialog.cpp | 27 +- 3rdparty/bgfx/examples/common/entry/dialog.h | 4 +- .../bgfx/examples/common/entry/dialog_darwin.mm | 2 +- 3rdparty/bgfx/examples/common/entry/entry.cpp | 71 +- 3rdparty/bgfx/examples/common/entry/entry.h | 63 +- .../bgfx/examples/common/entry/entry_android.cpp | 34 +- 3rdparty/bgfx/examples/common/entry/entry_glfw.cpp | 88 +- .../bgfx/examples/common/entry/entry_html5.cpp | 48 +- 3rdparty/bgfx/examples/common/entry/entry_ios.mm | 43 +- 3rdparty/bgfx/examples/common/entry/entry_noop.cpp | 15 +- 3rdparty/bgfx/examples/common/entry/entry_osx.mm | 28 +- 3rdparty/bgfx/examples/common/entry/entry_p.h | 4 +- 3rdparty/bgfx/examples/common/entry/entry_sdl.cpp | 61 +- .../bgfx/examples/common/entry/entry_windows.cpp | 26 +- 3rdparty/bgfx/examples/common/entry/entry_winrt.cx | 237 - 3rdparty/bgfx/examples/common/entry/entry_x11.cpp | 126 +- 3rdparty/bgfx/examples/common/entry/input.cpp | 8 +- 3rdparty/bgfx/examples/common/entry/input.h | 4 +- 3rdparty/bgfx/examples/common/example-glue.cpp | 14 +- .../bgfx/examples/common/font/font_manager.cpp | 31 +- 3rdparty/bgfx/examples/common/font/font_manager.h | 4 +- 3rdparty/bgfx/examples/common/font/makefile | 4 +- .../examples/common/font/text_buffer_manager.cpp | 49 +- .../examples/common/font/text_buffer_manager.h | 2 +- .../bgfx/examples/common/font/text_metrics.cpp | 2 +- 3rdparty/bgfx/examples/common/font/text_metrics.h | 2 +- .../bgfx/examples/common/imgui/fs_imgui_image.sc | 2 +- 3rdparty/bgfx/examples/common/imgui/imgui.cpp | 175 +- 3rdparty/bgfx/examples/common/imgui/imgui.h | 10 +- 3rdparty/bgfx/examples/common/imgui/makefile | 4 +- 3rdparty/bgfx/examples/common/imgui/varying.def.sc | 2 - .../bgfx/examples/common/imgui/vs_imgui_image.sc | 2 +- 3rdparty/bgfx/examples/common/nanovg/makefile | 4 +- 3rdparty/bgfx/examples/common/nanovg/nanovg.h | 2 +- .../bgfx/examples/common/nanovg/nanovg_bgfx.cpp | 17 +- 3rdparty/bgfx/examples/common/nanovg/nanovg_bgfx.h | 4 +- 3rdparty/bgfx/examples/common/packrect.h | 4 +- 3rdparty/bgfx/examples/common/ps/fs_particle.sc | 4 +- 3rdparty/bgfx/examples/common/ps/makefile | 4 +- .../bgfx/examples/common/ps/particle_system.cpp | 20 +- 3rdparty/bgfx/examples/common/ps/particle_system.h | 9 +- 3rdparty/bgfx/examples/common/ps/vs_particle.sc | 4 +- 3rdparty/bgfx/examples/common/shaderlib.sh | 4 +- 3rdparty/bgfx/examples/makefile | 12 +- .../runtime/shaders/dx11/cs_drawindirect.bin | Bin 0 -> 2589 bytes .../runtime/shaders/dx11/cs_drawindirect_count.bin | Bin 0 -> 2637 bytes .../runtime/shaders/dx11/cs_fsr_bilinear_16.bin | Bin 0 -> 1304 bytes .../runtime/shaders/dx11/cs_fsr_bilinear_32.bin | Bin 0 -> 1304 bytes .../runtime/shaders/dx11/cs_fsr_easu_16.bin | Bin 0 -> 33504 bytes .../runtime/shaders/dx11/cs_fsr_easu_32.bin | Bin 0 -> 38344 bytes .../runtime/shaders/dx11/cs_fsr_rcas_16.bin | Bin 0 -> 7729 bytes .../runtime/shaders/dx11/cs_fsr_rcas_32.bin | Bin 0 -> 6129 bytes .../runtime/shaders/dx11/cs_gdr_copy_z.bin | Bin 422 -> 456 bytes .../runtime/shaders/dx11/cs_gdr_downscale_hi_z.bin | Bin 910 -> 914 bytes .../runtime/shaders/dx11/cs_gdr_occlude_props.bin | Bin 4971 -> 5017 bytes .../shaders/dx11/cs_gdr_stream_compaction.bin | Bin 3252 -> 3256 bytes .../runtime/shaders/dx11/fs_deferred_clear_uav.bin | Bin 294 -> 294 bytes .../runtime/shaders/dx11/fs_deferred_combine.bin | Bin 768 -> 776 bytes .../shaders/dx11/fs_deferred_combine_ta.bin | Bin 0 -> 816 bytes .../runtime/shaders/dx11/fs_deferred_debug.bin | Bin 364 -> 368 bytes .../shaders/dx11/fs_deferred_debug_line.bin | Bin 270 -> 270 bytes .../runtime/shaders/dx11/fs_deferred_debug_ta.bin | Bin 0 -> 454 bytes .../runtime/shaders/dx11/fs_deferred_geom.bin | Bin 1530 -> 1540 bytes .../runtime/shaders/dx11/fs_deferred_light.bin | Bin 1448 -> 1462 bytes .../runtime/shaders/dx11/fs_deferred_light_ta.bin | Bin 1488 -> 1502 bytes .../runtime/shaders/dx11/fs_deferred_light_uav.bin | Bin 1564 -> 1578 bytes .../shaders/dx11/fs_fsr_copy_linear_to_gamma.bin | Bin 0 -> 474 bytes .../runtime/shaders/dx11/fs_fsr_forward.bin | Bin 0 -> 2158 bytes .../runtime/shaders/dx11/fs_fsr_forward_grid.bin | Bin 0 -> 1318 bytes .../dx11/fs_gdr_instanced_indirect_rendering.bin | Bin 664 -> 672 bytes .../examples/runtime/shaders/dx11/fs_hextile.bin | Bin 0 -> 8741 bytes .../runtime/shaders/dx11/vs_deferred_combine.bin | Bin 530 -> 532 bytes .../runtime/shaders/dx11/vs_deferred_debug.bin | Bin 530 -> 532 bytes .../shaders/dx11/vs_deferred_debug_line.bin | Bin 522 -> 524 bytes .../runtime/shaders/dx11/vs_deferred_geom.bin | Bin 2104 -> 2110 bytes .../runtime/shaders/dx11/vs_deferred_light.bin | Bin 530 -> 532 bytes .../runtime/shaders/dx11/vs_fsr_forward.bin | Bin 0 -> 1262 bytes .../runtime/shaders/dx11/vs_fsr_screenquad.bin | Bin 0 -> 532 bytes .../dx11/vs_gdr_instanced_indirect_rendering.bin | Bin 1093 -> 1101 bytes .../shaders/dx11/vs_gdr_render_occlusion.bin | Bin 701 -> 709 bytes .../examples/runtime/shaders/dx11/vs_hextile.bin | Bin 0 -> 1181 bytes .../runtime/shaders/essl/cs_drawindirect.bin | Bin 0 -> 3029 bytes .../examples/runtime/shaders/essl/fs_hextile.bin | Bin 0 -> 8061 bytes .../examples/runtime/shaders/essl/vs_hextile.bin | Bin 0 -> 664 bytes .../runtime/shaders/glsl/cs_drawindirect.bin | Bin 0 -> 3197 bytes .../runtime/shaders/glsl/cs_drawindirect_count.bin | Bin 0 -> 3352 bytes .../runtime/shaders/glsl/cs_fsr_bilinear_16.bin | Bin 0 -> 58590 bytes .../runtime/shaders/glsl/cs_fsr_bilinear_32.bin | Bin 0 -> 32439 bytes .../runtime/shaders/glsl/cs_fsr_easu_16.bin | Bin 0 -> 64067 bytes .../runtime/shaders/glsl/cs_fsr_easu_32.bin | Bin 0 -> 37251 bytes .../runtime/shaders/glsl/cs_fsr_rcas_16.bin | Bin 0 -> 61163 bytes .../runtime/shaders/glsl/cs_fsr_rcas_32.bin | Bin 0 -> 34671 bytes .../runtime/shaders/glsl/cs_gdr_copy_z.bin | Bin 1746 -> 1910 bytes .../runtime/shaders/glsl/cs_gdr_downscale_hi_z.bin | Bin 2180 -> 2350 bytes .../runtime/shaders/glsl/cs_gdr_occlude_props.bin | Bin 3735 -> 3885 bytes .../shaders/glsl/cs_gdr_stream_compaction.bin | Bin 3800 -> 4057 bytes .../runtime/shaders/glsl/cs_terrain_init.bin | Bin 2726 -> 2726 bytes .../runtime/shaders/glsl/cs_terrain_lod.bin | Bin 8013 -> 8011 bytes .../shaders/glsl/cs_terrain_update_draw.bin | Bin 1982 -> 1982 bytes .../shaders/glsl/cs_terrain_update_indirect.bin | Bin 2032 -> 2032 bytes .../runtime/shaders/glsl/fs_deferred_clear_uav.bin | Bin 1934 -> 2027 bytes .../runtime/shaders/glsl/fs_deferred_combine.bin | Bin 695 -> 699 bytes .../shaders/glsl/fs_deferred_combine_ta.bin | Bin 0 -> 772 bytes .../runtime/shaders/glsl/fs_deferred_debug.bin | Bin 166 -> 168 bytes .../shaders/glsl/fs_deferred_debug_line.bin | Bin 87 -> 87 bytes .../runtime/shaders/glsl/fs_deferred_debug_ta.bin | Bin 0 -> 287 bytes .../runtime/shaders/glsl/fs_deferred_geom.bin | Bin 914 -> 920 bytes .../runtime/shaders/glsl/fs_deferred_light.bin | Bin 1766 -> 1778 bytes .../runtime/shaders/glsl/fs_deferred_light_ta.bin | Bin 1844 -> 1856 bytes .../runtime/shaders/glsl/fs_deferred_light_uav.bin | Bin 11904 -> 11996 bytes .../shaders/glsl/fs_fsr_copy_linear_to_gamma.bin | Bin 0 -> 324 bytes .../runtime/shaders/glsl/fs_fsr_forward.bin | Bin 0 -> 1888 bytes .../runtime/shaders/glsl/fs_fsr_forward_grid.bin | Bin 0 -> 1039 bytes .../glsl/fs_gdr_instanced_indirect_rendering.bin | Bin 389 -> 407 bytes .../examples/runtime/shaders/glsl/fs_hextile.bin | Bin 0 -> 7628 bytes .../runtime/shaders/glsl/fs_terrain_render.bin | Bin 6032 -> 6144 bytes .../shaders/glsl/fs_terrain_render_normal.bin | Bin 5971 -> 6083 bytes .../runtime/shaders/glsl/vs_deferred_combine.bin | Bin 313 -> 315 bytes .../runtime/shaders/glsl/vs_deferred_debug.bin | Bin 313 -> 315 bytes .../shaders/glsl/vs_deferred_debug_line.bin | Bin 301 -> 303 bytes .../runtime/shaders/glsl/vs_deferred_geom.bin | Bin 1603 -> 1609 bytes .../runtime/shaders/glsl/vs_deferred_light.bin | Bin 313 -> 315 bytes .../runtime/shaders/glsl/vs_fsr_forward.bin | Bin 0 -> 1034 bytes .../runtime/shaders/glsl/vs_fsr_screenquad.bin | Bin 0 -> 319 bytes .../glsl/vs_gdr_instanced_indirect_rendering.bin | Bin 506 -> 527 bytes .../shaders/glsl/vs_gdr_render_occlusion.bin | Bin 398 -> 402 bytes .../examples/runtime/shaders/glsl/vs_hextile.bin | Bin 0 -> 610 bytes .../runtime/shaders/glsl/vs_terrain_render.bin | Bin 6655 -> 6706 bytes .../runtime/shaders/metal/cs_drawindirect.bin | Bin 0 -> 2579 bytes .../shaders/metal/cs_drawindirect_count.bin | Bin 0 -> 2798 bytes .../runtime/shaders/metal/cs_fsr_bilinear_16.bin | Bin 0 -> 2536 bytes .../runtime/shaders/metal/cs_fsr_bilinear_32.bin | Bin 0 -> 2536 bytes .../runtime/shaders/metal/cs_fsr_easu_16.bin | Bin 0 -> 38078 bytes .../runtime/shaders/metal/cs_fsr_easu_32.bin | Bin 0 -> 48593 bytes .../runtime/shaders/metal/cs_fsr_rcas_16.bin | Bin 0 -> 9686 bytes .../runtime/shaders/metal/cs_fsr_rcas_32.bin | Bin 0 -> 8968 bytes .../runtime/shaders/metal/cs_gdr_copy_z.bin | Bin 689 -> 816 bytes .../shaders/metal/cs_gdr_downscale_hi_z.bin | Bin 1148 -> 1235 bytes .../runtime/shaders/metal/cs_gdr_occlude_props.bin | Bin 4104 -> 4852 bytes .../shaders/metal/cs_gdr_stream_compaction.bin | Bin 4171 -> 4092 bytes .../examples/runtime/shaders/metal/cs_indirect.bin | Bin 589 -> 562 bytes .../runtime/shaders/metal/cs_init_instances.bin | Bin 8343 -> 7775 bytes .../runtime/shaders/metal/cs_terrain_init.bin | Bin 1890 -> 1737 bytes .../runtime/shaders/metal/cs_terrain_lod.bin | Bin 11328 -> 11143 bytes .../shaders/metal/cs_terrain_update_draw.bin | Bin 743 -> 682 bytes .../shaders/metal/cs_terrain_update_indirect.bin | Bin 935 -> 872 bytes .../examples/runtime/shaders/metal/cs_update.bin | Bin 1810 -> 1807 bytes .../runtime/shaders/metal/cs_update_instances.bin | Bin 2339 -> 2209 bytes .../runtime/shaders/metal/fs_albedo_output.bin | Bin 470 -> 472 bytes .../runtime/shaders/metal/fs_bloom_combine.bin | Bin 865 -> 877 bytes .../runtime/shaders/metal/fs_bokeh_copy.bin | Bin 566 -> 572 bytes .../metal/fs_bokeh_copy_linear_to_gamma.bin | Bin 649 -> 663 bytes .../runtime/shaders/metal/fs_bokeh_dof_combine.bin | Bin 1012 -> 1196 bytes .../runtime/shaders/metal/fs_bokeh_dof_debug.bin | Bin 1331 -> 1428 bytes .../shaders/metal/fs_bokeh_dof_downsample.bin | Bin 984 -> 998 bytes .../shaders/metal/fs_bokeh_dof_second_pass.bin | Bin 2468 -> 2502 bytes .../shaders/metal/fs_bokeh_dof_single_pass.bin | Bin 2883 -> 2931 bytes .../runtime/shaders/metal/fs_bokeh_forward.bin | Bin 2045 -> 2281 bytes .../shaders/metal/fs_bokeh_forward_grid.bin | Bin 1165 -> 1218 bytes .../shaders/metal/fs_bokeh_linear_depth.bin | Bin 727 -> 735 bytes .../examples/runtime/shaders/metal/fs_bump.bin | Bin 2706 -> 2843 bytes .../examples/runtime/shaders/metal/fs_bunnylod.bin | Bin 628 -> 634 bytes .../examples/runtime/shaders/metal/fs_callback.bin | Bin 628 -> 634 bytes .../examples/runtime/shaders/metal/fs_cubes.bin | Bin 386 -> 386 bytes .../shaders/metal/fs_deferred_clear_uav.bin | Bin 464 -> 295 bytes .../runtime/shaders/metal/fs_deferred_combine.bin | Bin 1031 -> 1043 bytes .../shaders/metal/fs_deferred_combine_ta.bin | Bin 0 -> 1110 bytes .../runtime/shaders/metal/fs_deferred_debug.bin | Bin 587 -> 593 bytes .../shaders/metal/fs_deferred_debug_line.bin | Bin 386 -> 386 bytes .../runtime/shaders/metal/fs_deferred_debug_ta.bin | Bin 0 -> 772 bytes .../runtime/shaders/metal/fs_deferred_geom.bin | Bin 1445 -> 1524 bytes .../runtime/shaders/metal/fs_deferred_light.bin | Bin 1607 -> 1518 bytes .../runtime/shaders/metal/fs_deferred_light_ta.bin | Bin 1674 -> 1585 bytes .../shaders/metal/fs_deferred_light_uav.bin | Bin 1722 -> 1579 bytes .../shaders/metal/fs_denoise_apply_lighting.bin | Bin 862 -> 888 bytes .../runtime/shaders/metal/fs_denoise_copy.bin | Bin 566 -> 572 bytes .../shaders/metal/fs_denoise_deferred_combine.bin | Bin 1694 -> 1754 bytes .../runtime/shaders/metal/fs_denoise_gbuffer.bin | Bin 2299 -> 2510 bytes .../shaders/metal/fs_denoise_spatial_3x3.bin | Bin 3630 -> 3635 bytes .../shaders/metal/fs_denoise_spatial_5x5.bin | Bin 3676 -> 3681 bytes .../runtime/shaders/metal/fs_denoise_temporal.bin | Bin 3812 -> 3882 bytes .../runtime/shaders/metal/fs_denoise_txaa.bin | Bin 8341 -> 8394 bytes .../runtime/shaders/metal/fs_downsample.bin | Bin 1799 -> 1829 bytes .../shaders/metal/fs_fsr_copy_linear_to_gamma.bin | Bin 0 -> 663 bytes .../runtime/shaders/metal/fs_fsr_forward.bin | Bin 0 -> 2281 bytes .../runtime/shaders/metal/fs_fsr_forward_grid.bin | Bin 0 -> 1218 bytes .../metal/fs_gdr_instanced_indirect_rendering.bin | Bin 763 -> 767 bytes .../examples/runtime/shaders/metal/fs_hdr_blur.bin | Bin 1523 -> 1529 bytes .../runtime/shaders/metal/fs_hdr_bright.bin | Bin 2654 -> 2714 bytes .../examples/runtime/shaders/metal/fs_hdr_lum.bin | Bin 3020 -> 3046 bytes .../runtime/shaders/metal/fs_hdr_lumavg.bin | Bin 3093 -> 3139 bytes .../examples/runtime/shaders/metal/fs_hdr_mesh.bin | Bin 2076 -> 1985 bytes .../runtime/shaders/metal/fs_hdr_skybox.bin | Bin 1048 -> 947 bytes .../runtime/shaders/metal/fs_hdr_tonemap.bin | Bin 3776 -> 3433 bytes .../examples/runtime/shaders/metal/fs_hextile.bin | Bin 0 -> 6819 bytes .../examples/runtime/shaders/metal/fs_ibl_mesh.bin | Bin 3970 -> 3658 bytes .../runtime/shaders/metal/fs_ibl_skybox.bin | Bin 2575 -> 2507 bytes .../examples/runtime/shaders/metal/fs_mesh.bin | Bin 1854 -> 1757 bytes .../bgfx/examples/runtime/shaders/metal/fs_oit.bin | Bin 389 -> 391 bytes .../examples/runtime/shaders/metal/fs_oit_wb.bin | Bin 884 -> 923 bytes .../runtime/shaders/metal/fs_oit_wb_blit.bin | Bin 928 -> 940 bytes .../runtime/shaders/metal/fs_oit_wb_separate.bin | Bin 807 -> 809 bytes .../shaders/metal/fs_oit_wb_separate_blit.bin | Bin 928 -> 940 bytes .../examples/runtime/shaders/metal/fs_particle.bin | Bin 795 -> 797 bytes .../runtime/shaders/metal/fs_picking_id.bin | Bin 498 -> 399 bytes .../runtime/shaders/metal/fs_picking_shaded.bin | Bin 1086 -> 984 bytes .../bgfx/examples/runtime/shaders/metal/fs_pom.bin | Bin 4067 -> 4228 bytes .../runtime/shaders/metal/fs_raymarching.bin | Bin 6901 -> 6915 bytes .../runtime/shaders/metal/fs_rsm_combine.bin | Bin 6707 -> 6769 bytes .../runtime/shaders/metal/fs_rsm_gbuffer.bin | Bin 679 -> 576 bytes .../runtime/shaders/metal/fs_rsm_lbuffer.bin | Bin 1683 -> 1590 bytes .../runtime/shaders/metal/fs_rsm_shadow.bin | Bin 660 -> 559 bytes .../shaders/metal/fs_screen_space_shadows.bin | Bin 3120 -> 3223 bytes .../shaders/metal/fs_shadowmaps_color_black.bin | Bin 291 -> 291 bytes .../metal/fs_shadowmaps_color_lighting_esm.bin | Bin 4539 -> 4432 bytes .../metal/fs_shadowmaps_color_lighting_esm_csm.bin | Bin 9057 -> 8952 bytes .../fs_shadowmaps_color_lighting_esm_linear.bin | Bin 4556 -> 4445 bytes ...fs_shadowmaps_color_lighting_esm_linear_csm.bin | Bin 9109 -> 9004 bytes ...s_shadowmaps_color_lighting_esm_linear_omni.bin | Bin 6795 -> 6696 bytes .../fs_shadowmaps_color_lighting_esm_omni.bin | Bin 6779 -> 6679 bytes .../metal/fs_shadowmaps_color_lighting_hard.bin | Bin 4468 -> 4357 bytes .../fs_shadowmaps_color_lighting_hard_csm.bin | Bin 8773 -> 8668 bytes .../fs_shadowmaps_color_lighting_hard_linear.bin | Bin 4481 -> 4374 bytes ...s_shadowmaps_color_lighting_hard_linear_csm.bin | Bin 8825 -> 8720 bytes ..._shadowmaps_color_lighting_hard_linear_omni.bin | Bin 6721 -> 6621 bytes .../fs_shadowmaps_color_lighting_hard_omni.bin | Bin 6708 -> 6605 bytes .../metal/fs_shadowmaps_color_lighting_pcf.bin | Bin 12489 -> 12404 bytes .../metal/fs_shadowmaps_color_lighting_pcf_csm.bin | Bin 48070 -> 47989 bytes .../fs_shadowmaps_color_lighting_pcf_linear.bin | Bin 12400 -> 12315 bytes ...fs_shadowmaps_color_lighting_pcf_linear_csm.bin | Bin 47891 -> 47781 bytes ...s_shadowmaps_color_lighting_pcf_linear_omni.bin | Bin 14657 -> 14580 bytes .../fs_shadowmaps_color_lighting_pcf_omni.bin | Bin 14592 -> 14515 bytes .../metal/fs_shadowmaps_color_lighting_vsm.bin | Bin 4844 -> 4759 bytes .../metal/fs_shadowmaps_color_lighting_vsm_csm.bin | Bin 10621 -> 10620 bytes .../fs_shadowmaps_color_lighting_vsm_linear.bin | Bin 4857 -> 4772 bytes ...fs_shadowmaps_color_lighting_vsm_linear_csm.bin | Bin 10673 -> 10672 bytes ...s_shadowmaps_color_lighting_vsm_linear_omni.bin | Bin 7106 -> 7032 bytes .../fs_shadowmaps_color_lighting_vsm_omni.bin | Bin 7087 -> 7016 bytes .../shaders/metal/fs_shadowmaps_color_texture.bin | Bin 1024 -> 1032 bytes .../runtime/shaders/metal/fs_shadowmaps_hblur.bin | Bin 2347 -> 2355 bytes .../shaders/metal/fs_shadowmaps_hblur_vsm.bin | Bin 2709 -> 2719 bytes .../shaders/metal/fs_shadowmaps_packdepth.bin | Bin 565 -> 564 bytes .../metal/fs_shadowmaps_packdepth_linear.bin | Bin 520 -> 522 bytes .../shaders/metal/fs_shadowmaps_packdepth_vsm.bin | Bin 652 -> 655 bytes .../metal/fs_shadowmaps_packdepth_vsm_linear.bin | Bin 598 -> 602 bytes .../shaders/metal/fs_shadowmaps_texture.bin | Bin 587 -> 593 bytes .../shaders/metal/fs_shadowmaps_unpackdepth.bin | Bin 829 -> 837 bytes .../metal/fs_shadowmaps_unpackdepth_vsm.bin | Bin 789 -> 797 bytes .../runtime/shaders/metal/fs_shadowmaps_vblur.bin | Bin 2347 -> 2355 bytes .../shaders/metal/fs_shadowmaps_vblur_vsm.bin | Bin 2709 -> 2719 bytes .../metal/fs_shadowvolume_color_lighting.bin | Bin 2507 -> 2454 bytes .../metal/fs_shadowvolume_color_texture.bin | Bin 1024 -> 1032 bytes .../shaders/metal/fs_shadowvolume_svbackblank.bin | Bin 291 -> 291 bytes .../shaders/metal/fs_shadowvolume_svbackcolor.bin | Bin 528 -> 428 bytes .../shaders/metal/fs_shadowvolume_svbacktex1.bin | Bin 897 -> 837 bytes .../shaders/metal/fs_shadowvolume_svbacktex2.bin | Bin 897 -> 837 bytes .../shaders/metal/fs_shadowvolume_svfrontblank.bin | Bin 406 -> 306 bytes .../shaders/metal/fs_shadowvolume_svfrontcolor.bin | Bin 528 -> 428 bytes .../shaders/metal/fs_shadowvolume_svfronttex1.bin | Bin 894 -> 836 bytes .../shaders/metal/fs_shadowvolume_svfronttex2.bin | Bin 894 -> 836 bytes .../shaders/metal/fs_shadowvolume_svside.bin | Bin 934 -> 934 bytes .../shaders/metal/fs_shadowvolume_svsideblank.bin | Bin 291 -> 291 bytes .../shaders/metal/fs_shadowvolume_svsidecolor.bin | Bin 528 -> 428 bytes .../shaders/metal/fs_shadowvolume_svsidetex.bin | Bin 1165 -> 1167 bytes .../shaders/metal/fs_shadowvolume_texture.bin | Bin 587 -> 593 bytes .../metal/fs_shadowvolume_texture_lighting.bin | Bin 2804 -> 2756 bytes .../bgfx/examples/runtime/shaders/metal/fs_sky.bin | Bin 935 -> 951 bytes .../shaders/metal/fs_sky_color_banding_fix.bin | Bin 1522 -> 1538 bytes .../runtime/shaders/metal/fs_sky_landscape.bin | Bin 2025 -> 2009 bytes .../examples/runtime/shaders/metal/fs_sms_mesh.bin | Bin 6434 -> 6479 bytes .../runtime/shaders/metal/fs_sms_mesh_pd.bin | Bin 6448 -> 6496 bytes .../runtime/shaders/metal/fs_sms_shadow.bin | Bin 291 -> 291 bytes .../runtime/shaders/metal/fs_sms_shadow_pd.bin | Bin 732 -> 733 bytes .../shaders/metal/fs_sss_deferred_combine.bin | Bin 3103 -> 3136 bytes .../runtime/shaders/metal/fs_sss_gbuffer.bin | Bin 2329 -> 2577 bytes .../runtime/shaders/metal/fs_sss_linear_depth.bin | Bin 727 -> 735 bytes .../runtime/shaders/metal/fs_sss_unlit.bin | Bin 1046 -> 1075 bytes .../shaders/metal/fs_stencil_color_black.bin | Bin 291 -> 291 bytes .../shaders/metal/fs_stencil_color_lighting.bin | Bin 2195 -> 2114 bytes .../shaders/metal/fs_stencil_color_texture.bin | Bin 1024 -> 1032 bytes .../runtime/shaders/metal/fs_stencil_texture.bin | Bin 587 -> 593 bytes .../shaders/metal/fs_stencil_texture_lighting.bin | Bin 2528 -> 2454 bytes .../examples/runtime/shaders/metal/fs_terrain.bin | Bin 494 -> 494 bytes .../runtime/shaders/metal/fs_terrain_render.bin | Bin 916 -> 940 bytes .../shaders/metal/fs_terrain_render_normal.bin | Bin 839 -> 857 bytes .../examples/runtime/shaders/metal/fs_tree.bin | Bin 1638 -> 1796 bytes .../examples/runtime/shaders/metal/fs_update.bin | Bin 582 -> 588 bytes .../runtime/shaders/metal/fs_update_3d.bin | Bin 761 -> 770 bytes .../runtime/shaders/metal/fs_update_cmp.bin | Bin 614 -> 620 bytes .../examples/runtime/shaders/metal/fs_upsample.bin | Bin 1550 -> 1560 bytes .../shaders/metal/fs_vectordisplay_blit.bin | Bin 791 -> 799 bytes .../shaders/metal/fs_vectordisplay_blur.bin | Bin 2185 -> 2233 bytes .../runtime/shaders/metal/fs_vectordisplay_fb.bin | Bin 782 -> 790 bytes .../examples/runtime/shaders/metal/fs_vt_mip.bin | Bin 1131 -> 1143 bytes .../examples/runtime/shaders/metal/fs_vt_unlit.bin | Bin 1656 -> 1673 bytes .../examples/runtime/shaders/metal/fs_wf_mesh.bin | Bin 2665 -> 2524 bytes .../runtime/shaders/metal/fs_wf_wireframe.bin | Bin 872 -> 876 bytes .../runtime/shaders/metal/vs_albedo_output.bin | Bin 1320 -> 1324 bytes .../runtime/shaders/metal/vs_bokeh_forward.bin | Bin 1377 -> 1395 bytes .../runtime/shaders/metal/vs_bokeh_screenquad.bin | Bin 699 -> 701 bytes .../examples/runtime/shaders/metal/vs_bump.bin | Bin 1787 -> 1816 bytes .../runtime/shaders/metal/vs_bump_instanced.bin | Bin 2146 -> 1990 bytes .../examples/runtime/shaders/metal/vs_bunnylod.bin | Bin 882 -> 886 bytes .../examples/runtime/shaders/metal/vs_callback.bin | Bin 869 -> 873 bytes .../examples/runtime/shaders/metal/vs_cubes.bin | Bin 683 -> 685 bytes .../runtime/shaders/metal/vs_deferred_combine.bin | Bin 695 -> 697 bytes .../runtime/shaders/metal/vs_deferred_debug.bin | Bin 695 -> 697 bytes .../shaders/metal/vs_deferred_debug_line.bin | Bin 683 -> 685 bytes .../runtime/shaders/metal/vs_deferred_geom.bin | Bin 1819 -> 1837 bytes .../runtime/shaders/metal/vs_deferred_light.bin | Bin 695 -> 697 bytes .../runtime/shaders/metal/vs_denoise_gbuffer.bin | Bin 1720 -> 1734 bytes .../shaders/metal/vs_denoise_screenquad.bin | Bin 699 -> 701 bytes .../runtime/shaders/metal/vs_fsr_forward.bin | Bin 0 -> 1368 bytes .../runtime/shaders/metal/vs_fsr_screenquad.bin | Bin 0 -> 701 bytes .../runtime/shaders/metal/vs_fullscreen.bin | Bin 695 -> 697 bytes .../metal/vs_gdr_instanced_indirect_rendering.bin | Bin 1054 -> 1058 bytes .../shaders/metal/vs_gdr_render_occlusion.bin | Bin 924 -> 928 bytes .../examples/runtime/shaders/metal/vs_hdr_blur.bin | Bin 1683 -> 1696 bytes .../runtime/shaders/metal/vs_hdr_bright.bin | Bin 695 -> 697 bytes .../examples/runtime/shaders/metal/vs_hdr_lum.bin | Bin 695 -> 697 bytes .../runtime/shaders/metal/vs_hdr_lumavg.bin | Bin 695 -> 697 bytes .../examples/runtime/shaders/metal/vs_hdr_mesh.bin | Bin 1054 -> 1058 bytes .../runtime/shaders/metal/vs_hdr_skybox.bin | Bin 695 -> 697 bytes .../runtime/shaders/metal/vs_hdr_tonemap.bin | Bin 1702 -> 1721 bytes .../examples/runtime/shaders/metal/vs_hextile.bin | Bin 0 -> 936 bytes .../examples/runtime/shaders/metal/vs_ibl_mesh.bin | Bin 995 -> 1001 bytes .../runtime/shaders/metal/vs_ibl_skybox.bin | Bin 1205 -> 1025 bytes .../examples/runtime/shaders/metal/vs_mesh.bin | Bin 1627 -> 1633 bytes .../bgfx/examples/runtime/shaders/metal/vs_oit.bin | Bin 858 -> 864 bytes .../examples/runtime/shaders/metal/vs_oit_blit.bin | Bin 695 -> 697 bytes .../examples/runtime/shaders/metal/vs_particle.bin | Bin 1086 -> 1033 bytes .../runtime/shaders/metal/vs_picking_shaded.bin | Bin 1293 -> 1299 bytes .../bgfx/examples/runtime/shaders/metal/vs_pom.bin | Bin 1652 -> 1678 bytes .../runtime/shaders/metal/vs_raymarching.bin | Bin 840 -> 842 bytes .../runtime/shaders/metal/vs_rsm_combine.bin | Bin 695 -> 697 bytes .../runtime/shaders/metal/vs_rsm_gbuffer.bin | Bin 820 -> 830 bytes .../runtime/shaders/metal/vs_rsm_lbuffer.bin | Bin 1760 -> 1800 bytes .../runtime/shaders/metal/vs_rsm_shadow.bin | Bin 803 -> 813 bytes .../runtime/shaders/metal/vs_shadowmaps_color.bin | Bin 538 -> 540 bytes .../shaders/metal/vs_shadowmaps_color_lighting.bin | Bin 1241 -> 1255 bytes .../metal/vs_shadowmaps_color_lighting_csm.bin | Bin 2053 -> 2075 bytes .../metal/vs_shadowmaps_color_lighting_linear.bin | Bin 1316 -> 1306 bytes .../vs_shadowmaps_color_lighting_linear_csm.bin | Bin 2353 -> 2279 bytes .../vs_shadowmaps_color_lighting_linear_omni.bin | Bin 2291 -> 2217 bytes .../metal/vs_shadowmaps_color_lighting_omni.bin | Bin 1991 -> 2013 bytes .../shaders/metal/vs_shadowmaps_color_texture.bin | Bin 695 -> 697 bytes .../runtime/shaders/metal/vs_shadowmaps_depth.bin | Bin 538 -> 540 bytes .../runtime/shaders/metal/vs_shadowmaps_hblur.bin | Bin 1682 -> 1796 bytes .../shaders/metal/vs_shadowmaps_packdepth.bin | Bin 661 -> 663 bytes .../metal/vs_shadowmaps_packdepth_linear.bin | Bin 670 -> 673 bytes .../shaders/metal/vs_shadowmaps_texture.bin | Bin 695 -> 697 bytes .../metal/vs_shadowmaps_texture_lighting.bin | Bin 1097 -> 1101 bytes .../shaders/metal/vs_shadowmaps_unpackdepth.bin | Bin 695 -> 697 bytes .../runtime/shaders/metal/vs_shadowmaps_vblur.bin | Bin 1682 -> 1796 bytes .../metal/vs_shadowvolume_color_lighting.bin | Bin 944 -> 948 bytes .../metal/vs_shadowvolume_color_texture.bin | Bin 695 -> 697 bytes .../shaders/metal/vs_shadowvolume_svback.bin | Bin 739 -> 749 bytes .../shaders/metal/vs_shadowvolume_svfront.bin | Bin 538 -> 540 bytes .../shaders/metal/vs_shadowvolume_svside.bin | Bin 1015 -> 1025 bytes .../shaders/metal/vs_shadowvolume_texture.bin | Bin 695 -> 697 bytes .../metal/vs_shadowvolume_texture_lighting.bin | Bin 1097 -> 1101 bytes .../bgfx/examples/runtime/shaders/metal/vs_sky.bin | Bin 2928 -> 2809 bytes .../runtime/shaders/metal/vs_sky_landscape.bin | Bin 947 -> 951 bytes .../examples/runtime/shaders/metal/vs_sms_mesh.bin | Bin 1218 -> 1230 bytes .../runtime/shaders/metal/vs_sms_shadow.bin | Bin 538 -> 540 bytes .../runtime/shaders/metal/vs_sms_shadow_pd.bin | Bin 661 -> 663 bytes .../runtime/shaders/metal/vs_sss_gbuffer.bin | Bin 1127 -> 1137 bytes .../runtime/shaders/metal/vs_sss_screenquad.bin | Bin 699 -> 701 bytes .../runtime/shaders/metal/vs_stencil_color.bin | Bin 538 -> 540 bytes .../shaders/metal/vs_stencil_color_lighting.bin | Bin 942 -> 946 bytes .../shaders/metal/vs_stencil_color_texture.bin | Bin 695 -> 697 bytes .../runtime/shaders/metal/vs_stencil_texture.bin | Bin 695 -> 697 bytes .../shaders/metal/vs_stencil_texture_lighting.bin | Bin 1097 -> 1101 bytes .../examples/runtime/shaders/metal/vs_terrain.bin | Bin 806 -> 808 bytes .../shaders/metal/vs_terrain_height_texture.bin | Bin 1159 -> 1173 bytes .../runtime/shaders/metal/vs_terrain_render.bin | Bin 2530 -> 2431 bytes .../examples/runtime/shaders/metal/vs_tree.bin | Bin 1228 -> 1232 bytes .../examples/runtime/shaders/metal/vs_update.bin | Bin 695 -> 697 bytes .../runtime/shaders/metal/vs_vectordisplay_fb.bin | Bin 840 -> 842 bytes .../runtime/shaders/metal/vs_vt_generic.bin | Bin 761 -> 765 bytes .../examples/runtime/shaders/metal/vs_wf_mesh.bin | Bin 1131 -> 1137 bytes .../runtime/shaders/metal/vs_wf_wireframe.bin | Bin 925 -> 931 bytes .../runtime/shaders/spirv/cs_assao_apply.bin | Bin 4751 -> 4803 bytes .../spirv/cs_assao_generate_importance_map.bin | Bin 2950 -> 3002 bytes .../runtime/shaders/spirv/cs_assao_generate_q0.bin | Bin 10535 -> 10617 bytes .../runtime/shaders/spirv/cs_assao_generate_q1.bin | Bin 13983 -> 14093 bytes .../runtime/shaders/spirv/cs_assao_generate_q2.bin | Bin 16903 -> 17045 bytes .../runtime/shaders/spirv/cs_assao_generate_q3.bin | Bin 18532 -> 18692 bytes .../shaders/spirv/cs_assao_generate_q3base.bin | Bin 10447 -> 10585 bytes .../shaders/spirv/cs_assao_load_counter_clear.bin | Bin 554 -> 558 bytes .../shaders/spirv/cs_assao_non_smart_apply.bin | Bin 2487 -> 2527 bytes .../shaders/spirv/cs_assao_non_smart_blur.bin | Bin 3451 -> 3523 bytes .../spirv/cs_assao_non_smart_half_apply.bin | Bin 2135 -> 2175 bytes .../cs_assao_postprocess_importance_map_a.bin | Bin 2714 -> 2794 bytes .../cs_assao_postprocess_importance_map_b.bin | Bin 3346 -> 3422 bytes .../shaders/spirv/cs_assao_prepare_depth_mip.bin | Bin 5354 -> 5578 bytes .../shaders/spirv/cs_assao_prepare_depths.bin | Bin 3129 -> 3201 bytes .../spirv/cs_assao_prepare_depths_and_normals.bin | Bin 14222 -> 15058 bytes .../cs_assao_prepare_depths_and_normals_half.bin | Bin 9406 -> 9954 bytes .../shaders/spirv/cs_assao_prepare_depths_half.bin | Bin 2233 -> 2289 bytes .../runtime/shaders/spirv/cs_assao_smart_blur.bin | Bin 3839 -> 3851 bytes .../shaders/spirv/cs_assao_smart_blur_wide.bin | Bin 4991 -> 5039 bytes .../runtime/shaders/spirv/cs_drawindirect.bin | Bin 0 -> 4227 bytes .../shaders/spirv/cs_drawindirect_count.bin | Bin 0 -> 4593 bytes .../runtime/shaders/spirv/cs_fsr_bilinear_16.bin | Bin 0 -> 4216 bytes .../runtime/shaders/spirv/cs_fsr_bilinear_32.bin | Bin 0 -> 4216 bytes .../runtime/shaders/spirv/cs_fsr_easu_16.bin | Bin 0 -> 66088 bytes .../runtime/shaders/spirv/cs_fsr_easu_32.bin | Bin 0 -> 68352 bytes .../runtime/shaders/spirv/cs_fsr_rcas_16.bin | Bin 0 -> 17976 bytes .../runtime/shaders/spirv/cs_fsr_rcas_32.bin | Bin 0 -> 12984 bytes .../runtime/shaders/spirv/cs_gdr_copy_z.bin | Bin 1361 -> 1385 bytes .../shaders/spirv/cs_gdr_downscale_hi_z.bin | Bin 2119 -> 2183 bytes .../runtime/shaders/spirv/cs_gdr_occlude_props.bin | Bin 5781 -> 5581 bytes .../shaders/spirv/cs_gdr_stream_compaction.bin | Bin 7007 -> 7075 bytes .../examples/runtime/shaders/spirv/cs_indirect.bin | Bin 1226 -> 1230 bytes .../runtime/shaders/spirv/cs_init_instances.bin | Bin 10561 -> 10395 bytes .../runtime/shaders/spirv/cs_terrain_init.bin | Bin 2540 -> 2552 bytes .../runtime/shaders/spirv/cs_terrain_lod.bin | Bin 12424 -> 12314 bytes .../shaders/spirv/cs_terrain_update_draw.bin | Bin 1626 -> 1632 bytes .../shaders/spirv/cs_terrain_update_indirect.bin | Bin 1173 -> 1177 bytes .../examples/runtime/shaders/spirv/cs_update.bin | Bin 1726 -> 1708 bytes .../runtime/shaders/spirv/cs_update_instances.bin | Bin 3801 -> 3811 bytes .../runtime/shaders/spirv/fs_albedo_output.bin | Bin 1158 -> 692 bytes .../shaders/spirv/fs_assao_deferred_combine.bin | Bin 2700 -> 2708 bytes .../runtime/shaders/spirv/fs_assao_gbuffer.bin | Bin 1005 -> 1105 bytes .../runtime/shaders/spirv/fs_bloom_combine.bin | Bin 1513 -> 1347 bytes .../runtime/shaders/spirv/fs_bokeh_copy.bin | Bin 864 -> 744 bytes .../spirv/fs_bokeh_copy_linear_to_gamma.bin | Bin 1112 -> 992 bytes .../runtime/shaders/spirv/fs_bokeh_dof_combine.bin | Bin 1591 -> 1629 bytes .../runtime/shaders/spirv/fs_bokeh_dof_debug.bin | Bin 2435 -> 2273 bytes .../shaders/spirv/fs_bokeh_dof_downsample.bin | Bin 1907 -> 1745 bytes .../shaders/spirv/fs_bokeh_dof_second_pass.bin | Bin 3860 -> 3722 bytes .../shaders/spirv/fs_bokeh_dof_single_pass.bin | Bin 4786 -> 4604 bytes .../runtime/shaders/spirv/fs_bokeh_forward.bin | Bin 3534 -> 3572 bytes .../shaders/spirv/fs_bokeh_forward_grid.bin | Bin 2388 -> 2242 bytes .../shaders/spirv/fs_bokeh_linear_depth.bin | Bin 1369 -> 1251 bytes .../examples/runtime/shaders/spirv/fs_bump.bin | Bin 5121 -> 5015 bytes .../examples/runtime/shaders/spirv/fs_bunnylod.bin | Bin 986 -> 926 bytes .../examples/runtime/shaders/spirv/fs_callback.bin | Bin 986 -> 926 bytes .../examples/runtime/shaders/spirv/fs_cubes.bin | Bin 466 -> 406 bytes .../shaders/spirv/fs_deferred_clear_uav.bin | Bin 725 -> 624 bytes .../runtime/shaders/spirv/fs_deferred_combine.bin | Bin 1837 -> 1671 bytes .../shaders/spirv/fs_deferred_combine_ta.bin | Bin 0 -> 1815 bytes .../runtime/shaders/spirv/fs_deferred_debug.bin | Bin 881 -> 755 bytes .../shaders/spirv/fs_deferred_debug_line.bin | Bin 466 -> 406 bytes .../runtime/shaders/spirv/fs_deferred_debug_ta.bin | Bin 0 -> 1137 bytes .../runtime/shaders/spirv/fs_deferred_geom.bin | Bin 2749 -> 2513 bytes .../runtime/shaders/spirv/fs_deferred_light.bin | Bin 3004 -> 2862 bytes .../runtime/shaders/spirv/fs_deferred_light_ta.bin | Bin 3132 -> 2990 bytes .../shaders/spirv/fs_deferred_light_uav.bin | Bin 3243 -> 3148 bytes .../shaders/spirv/fs_denoise_apply_lighting.bin | Bin 1533 -> 1367 bytes .../runtime/shaders/spirv/fs_denoise_copy.bin | Bin 864 -> 744 bytes .../shaders/spirv/fs_denoise_deferred_combine.bin | Bin 2986 -> 2872 bytes .../runtime/shaders/spirv/fs_denoise_gbuffer.bin | Bin 3900 -> 3902 bytes .../shaders/spirv/fs_denoise_spatial_3x3.bin | Bin 4308 -> 4070 bytes .../shaders/spirv/fs_denoise_spatial_5x5.bin | Bin 4420 -> 4182 bytes .../runtime/shaders/spirv/fs_denoise_temporal.bin | Bin 4738 -> 4444 bytes .../runtime/shaders/spirv/fs_denoise_txaa.bin | Bin 11172 -> 10586 bytes .../runtime/shaders/spirv/fs_downsample.bin | Bin 3378 -> 3264 bytes .../shaders/spirv/fs_fsr_copy_linear_to_gamma.bin | Bin 0 -> 992 bytes .../runtime/shaders/spirv/fs_fsr_forward.bin | Bin 0 -> 3572 bytes .../runtime/shaders/spirv/fs_fsr_forward_grid.bin | Bin 0 -> 2242 bytes .../spirv/fs_gdr_instanced_indirect_rendering.bin | Bin 1252 -> 1264 bytes .../examples/runtime/shaders/spirv/fs_hdr_blur.bin | Bin 2133 -> 2023 bytes .../runtime/shaders/spirv/fs_hdr_bright.bin | Bin 5281 -> 5033 bytes .../examples/runtime/shaders/spirv/fs_hdr_lum.bin | Bin 4330 -> 4150 bytes .../runtime/shaders/spirv/fs_hdr_lumavg.bin | Bin 5970 -> 5614 bytes .../examples/runtime/shaders/spirv/fs_hdr_mesh.bin | Bin 3304 -> 3118 bytes .../runtime/shaders/spirv/fs_hdr_skybox.bin | Bin 1868 -> 1762 bytes .../runtime/shaders/spirv/fs_hdr_tonemap.bin | Bin 5036 -> 4706 bytes .../examples/runtime/shaders/spirv/fs_hextile.bin | Bin 0 -> 7895 bytes .../examples/runtime/shaders/spirv/fs_ibl_mesh.bin | Bin 6128 -> 5864 bytes .../runtime/shaders/spirv/fs_ibl_skybox.bin | Bin 3632 -> 3456 bytes .../runtime/shaders/spirv/fs_instancing.bin | Bin 466 -> 406 bytes .../examples/runtime/shaders/spirv/fs_mesh.bin | Bin 2817 -> 2695 bytes .../bgfx/examples/runtime/shaders/spirv/fs_oit.bin | Bin 710 -> 584 bytes .../examples/runtime/shaders/spirv/fs_oit_wb.bin | Bin 1306 -> 1332 bytes .../runtime/shaders/spirv/fs_oit_wb_blit.bin | Bin 1466 -> 1286 bytes .../runtime/shaders/spirv/fs_oit_wb_separate.bin | Bin 1162 -> 1104 bytes .../shaders/spirv/fs_oit_wb_separate_blit.bin | Bin 1466 -> 1286 bytes .../examples/runtime/shaders/spirv/fs_particle.bin | Bin 1439 -> 1365 bytes .../runtime/shaders/spirv/fs_picking_id.bin | Bin 991 -> 685 bytes .../runtime/shaders/spirv/fs_picking_shaded.bin | Bin 1586 -> 1482 bytes .../bgfx/examples/runtime/shaders/spirv/fs_pom.bin | Bin 4845 -> 4663 bytes .../runtime/shaders/spirv/fs_raymarching.bin | Bin 10175 -> 10111 bytes .../runtime/shaders/spirv/fs_rsm_combine.bin | Bin 9436 -> 9314 bytes .../runtime/shaders/spirv/fs_rsm_gbuffer.bin | Bin 921 -> 863 bytes .../runtime/shaders/spirv/fs_rsm_lbuffer.bin | Bin 2738 -> 2644 bytes .../runtime/shaders/spirv/fs_rsm_shadow.bin | Bin 937 -> 881 bytes .../shaders/spirv/fs_screen_space_shadows.bin | Bin 5177 -> 5197 bytes .../shaders/spirv/fs_shadowmaps_color_black.bin | Bin 438 -> 362 bytes .../spirv/fs_shadowmaps_color_lighting_esm.bin | Bin 6852 -> 6588 bytes .../spirv/fs_shadowmaps_color_lighting_esm_csm.bin | Bin 11615 -> 11301 bytes .../fs_shadowmaps_color_lighting_esm_linear.bin | Bin 6908 -> 6644 bytes ...fs_shadowmaps_color_lighting_esm_linear_csm.bin | Bin 11839 -> 11525 bytes ...s_shadowmaps_color_lighting_esm_linear_omni.bin | Bin 9370 -> 9114 bytes .../fs_shadowmaps_color_lighting_esm_omni.bin | Bin 9314 -> 9058 bytes .../spirv/fs_shadowmaps_color_lighting_hard.bin | Bin 6668 -> 6404 bytes .../fs_shadowmaps_color_lighting_hard_csm.bin | Bin 10927 -> 10613 bytes .../fs_shadowmaps_color_lighting_hard_linear.bin | Bin 6724 -> 6460 bytes ...s_shadowmaps_color_lighting_hard_linear_csm.bin | Bin 11151 -> 10837 bytes ..._shadowmaps_color_lighting_hard_linear_omni.bin | Bin 9186 -> 8930 bytes .../fs_shadowmaps_color_lighting_hard_omni.bin | Bin 9130 -> 8874 bytes .../spirv/fs_shadowmaps_color_lighting_pcf.bin | Bin 16472 -> 16208 bytes .../spirv/fs_shadowmaps_color_lighting_pcf_csm.bin | Bin 48799 -> 48485 bytes .../fs_shadowmaps_color_lighting_pcf_linear.bin | Bin 16628 -> 16364 bytes ...fs_shadowmaps_color_lighting_pcf_linear_csm.bin | Bin 49423 -> 49109 bytes ...s_shadowmaps_color_lighting_pcf_linear_omni.bin | Bin 19126 -> 18870 bytes .../fs_shadowmaps_color_lighting_pcf_omni.bin | Bin 18970 -> 18714 bytes .../spirv/fs_shadowmaps_color_lighting_vsm.bin | Bin 7160 -> 6924 bytes .../spirv/fs_shadowmaps_color_lighting_vsm_csm.bin | Bin 12967 -> 12765 bytes .../fs_shadowmaps_color_lighting_vsm_linear.bin | Bin 7216 -> 6980 bytes ...fs_shadowmaps_color_lighting_vsm_linear_csm.bin | Bin 13191 -> 12989 bytes ...s_shadowmaps_color_lighting_vsm_linear_omni.bin | Bin 9678 -> 9450 bytes .../fs_shadowmaps_color_lighting_vsm_omni.bin | Bin 9622 -> 9394 bytes .../shaders/spirv/fs_shadowmaps_color_texture.bin | Bin 1737 -> 1613 bytes .../runtime/shaders/spirv/fs_shadowmaps_hblur.bin | Bin 2651 -> 2545 bytes .../shaders/spirv/fs_shadowmaps_hblur_vsm.bin | Bin 3679 -> 3581 bytes .../shaders/spirv/fs_shadowmaps_packdepth.bin | Bin 854 -> 794 bytes .../spirv/fs_shadowmaps_packdepth_linear.bin | Bin 750 -> 682 bytes .../shaders/spirv/fs_shadowmaps_packdepth_vsm.bin | Bin 1054 -> 1002 bytes .../spirv/fs_shadowmaps_packdepth_vsm_linear.bin | Bin 950 -> 890 bytes .../shaders/spirv/fs_shadowmaps_texture.bin | Bin 881 -> 755 bytes .../shaders/spirv/fs_shadowmaps_unpackdepth.bin | Bin 1485 -> 1357 bytes .../spirv/fs_shadowmaps_unpackdepth_vsm.bin | Bin 1473 -> 1345 bytes .../runtime/shaders/spirv/fs_shadowmaps_vblur.bin | Bin 2651 -> 2545 bytes .../shaders/spirv/fs_shadowmaps_vblur_vsm.bin | Bin 3679 -> 3581 bytes .../spirv/fs_shadowvolume_color_lighting.bin | Bin 4911 -> 4879 bytes .../spirv/fs_shadowvolume_color_texture.bin | Bin 1737 -> 1613 bytes .../shaders/spirv/fs_shadowvolume_svbackblank.bin | Bin 438 -> 362 bytes .../shaders/spirv/fs_shadowvolume_svbackcolor.bin | Bin 746 -> 688 bytes .../shaders/spirv/fs_shadowvolume_svbacktex1.bin | Bin 1158 -> 1082 bytes .../shaders/spirv/fs_shadowvolume_svbacktex2.bin | Bin 1158 -> 1082 bytes .../shaders/spirv/fs_shadowvolume_svfrontblank.bin | Bin 538 -> 378 bytes .../shaders/spirv/fs_shadowvolume_svfrontcolor.bin | Bin 746 -> 688 bytes .../shaders/spirv/fs_shadowvolume_svfronttex1.bin | Bin 1142 -> 1066 bytes .../shaders/spirv/fs_shadowvolume_svfronttex2.bin | Bin 1142 -> 1066 bytes .../shaders/spirv/fs_shadowvolume_svside.bin | Bin 1238 -> 1162 bytes .../shaders/spirv/fs_shadowvolume_svsideblank.bin | Bin 502 -> 362 bytes .../shaders/spirv/fs_shadowvolume_svsidecolor.bin | Bin 810 -> 688 bytes .../shaders/spirv/fs_shadowvolume_svsidetex.bin | Bin 1661 -> 1587 bytes .../shaders/spirv/fs_shadowvolume_texture.bin | Bin 881 -> 755 bytes .../spirv/fs_shadowvolume_texture_lighting.bin | Bin 5406 -> 5322 bytes .../bgfx/examples/runtime/shaders/spirv/fs_sky.bin | Bin 1822 -> 1662 bytes .../shaders/spirv/fs_sky_color_banding_fix.bin | Bin 2770 -> 2682 bytes .../runtime/shaders/spirv/fs_sky_landscape.bin | Bin 3448 -> 3496 bytes .../examples/runtime/shaders/spirv/fs_sms_mesh.bin | Bin 9145 -> 9025 bytes .../runtime/shaders/spirv/fs_sms_mesh_pd.bin | Bin 9163 -> 9053 bytes .../runtime/shaders/spirv/fs_sms_shadow.bin | Bin 306 -> 362 bytes .../runtime/shaders/spirv/fs_sms_shadow_pd.bin | Bin 1217 -> 1159 bytes .../shaders/spirv/fs_sss_deferred_combine.bin | Bin 5024 -> 4788 bytes .../runtime/shaders/spirv/fs_sss_gbuffer.bin | Bin 4136 -> 4124 bytes .../runtime/shaders/spirv/fs_sss_linear_depth.bin | Bin 1385 -> 1267 bytes .../runtime/shaders/spirv/fs_sss_unlit.bin | Bin 2278 -> 2074 bytes .../shaders/spirv/fs_stencil_color_black.bin | Bin 438 -> 362 bytes .../shaders/spirv/fs_stencil_color_lighting.bin | Bin 4029 -> 3985 bytes .../shaders/spirv/fs_stencil_color_texture.bin | Bin 1737 -> 1613 bytes .../runtime/shaders/spirv/fs_stencil_texture.bin | Bin 881 -> 755 bytes .../shaders/spirv/fs_stencil_texture_lighting.bin | Bin 4704 -> 4610 bytes .../examples/runtime/shaders/spirv/fs_terrain.bin | Bin 742 -> 666 bytes .../runtime/shaders/spirv/fs_terrain_render.bin | Bin 1553 -> 1441 bytes .../shaders/spirv/fs_terrain_render_normal.bin | Bin 1533 -> 1421 bytes .../examples/runtime/shaders/spirv/fs_tree.bin | Bin 3171 -> 3127 bytes .../examples/runtime/shaders/spirv/fs_update.bin | Bin 878 -> 754 bytes .../runtime/shaders/spirv/fs_update_3d.bin | Bin 1476 -> 1344 bytes .../runtime/shaders/spirv/fs_update_cmp.bin | Bin 1001 -> 875 bytes .../examples/runtime/shaders/spirv/fs_upsample.bin | Bin 2702 -> 2590 bytes .../shaders/spirv/fs_vectordisplay_blit.bin | Bin 1486 -> 1306 bytes .../shaders/spirv/fs_vectordisplay_blur.bin | Bin 3986 -> 3758 bytes .../runtime/shaders/spirv/fs_vectordisplay_fb.bin | Bin 1342 -> 1234 bytes .../examples/runtime/shaders/spirv/fs_vt_mip.bin | Bin 1908 -> 1706 bytes .../examples/runtime/shaders/spirv/fs_vt_unlit.bin | Bin 2875 -> 2669 bytes .../examples/runtime/shaders/spirv/fs_wf_mesh.bin | Bin 3887 -> 3761 bytes .../runtime/shaders/spirv/fs_wf_wireframe.bin | Bin 1731 -> 1605 bytes .../runtime/shaders/spirv/vs_albedo_output.bin | Bin 2093 -> 1969 bytes .../examples/runtime/shaders/spirv/vs_assao.bin | Bin 1128 -> 1080 bytes .../runtime/shaders/spirv/vs_assao_gbuffer.bin | Bin 1940 -> 1896 bytes .../runtime/shaders/spirv/vs_bokeh_forward.bin | Bin 2570 -> 2576 bytes .../runtime/shaders/spirv/vs_bokeh_screenquad.bin | Bin 1078 -> 1080 bytes .../examples/runtime/shaders/spirv/vs_bump.bin | Bin 2968 -> 2990 bytes .../runtime/shaders/spirv/vs_bump_instanced.bin | Bin 3180 -> 3104 bytes .../examples/runtime/shaders/spirv/vs_bunnylod.bin | Bin 1586 -> 1590 bytes .../examples/runtime/shaders/spirv/vs_callback.bin | Bin 1514 -> 1518 bytes .../examples/runtime/shaders/spirv/vs_cubes.bin | Bin 1058 -> 1060 bytes .../runtime/shaders/spirv/vs_deferred_combine.bin | Bin 1094 -> 1096 bytes .../runtime/shaders/spirv/vs_deferred_debug.bin | Bin 1094 -> 1096 bytes .../shaders/spirv/vs_deferred_debug_line.bin | Bin 1058 -> 1060 bytes .../runtime/shaders/spirv/vs_deferred_geom.bin | Bin 3296 -> 3302 bytes .../runtime/shaders/spirv/vs_deferred_light.bin | Bin 1094 -> 1096 bytes .../runtime/shaders/spirv/vs_denoise_gbuffer.bin | Bin 3399 -> 3407 bytes .../shaders/spirv/vs_denoise_screenquad.bin | Bin 1078 -> 1080 bytes .../runtime/shaders/spirv/vs_fsr_forward.bin | Bin 0 -> 2570 bytes .../runtime/shaders/spirv/vs_fsr_screenquad.bin | Bin 0 -> 1080 bytes .../runtime/shaders/spirv/vs_fullscreen.bin | Bin 1094 -> 1096 bytes .../spirv/vs_gdr_instanced_indirect_rendering.bin | Bin 1577 -> 1529 bytes .../shaders/spirv/vs_gdr_render_occlusion.bin | Bin 1349 -> 1301 bytes .../examples/runtime/shaders/spirv/vs_hdr_blur.bin | Bin 2658 -> 2662 bytes .../runtime/shaders/spirv/vs_hdr_bright.bin | Bin 1094 -> 1096 bytes .../examples/runtime/shaders/spirv/vs_hdr_lum.bin | Bin 1094 -> 1096 bytes .../runtime/shaders/spirv/vs_hdr_lumavg.bin | Bin 1094 -> 1096 bytes .../examples/runtime/shaders/spirv/vs_hdr_mesh.bin | Bin 1822 -> 1826 bytes .../runtime/shaders/spirv/vs_hdr_skybox.bin | Bin 1094 -> 1096 bytes .../runtime/shaders/spirv/vs_hdr_tonemap.bin | Bin 2414 -> 2438 bytes .../examples/runtime/shaders/spirv/vs_hextile.bin | Bin 0 -> 1705 bytes .../examples/runtime/shaders/spirv/vs_ibl_mesh.bin | Bin 2027 -> 2033 bytes .../runtime/shaders/spirv/vs_ibl_skybox.bin | Bin 2050 -> 1976 bytes .../runtime/shaders/spirv/vs_instancing.bin | Bin 1485 -> 1485 bytes .../examples/runtime/shaders/spirv/vs_mesh.bin | Bin 2713 -> 2671 bytes .../bgfx/examples/runtime/shaders/spirv/vs_oit.bin | Bin 1578 -> 1584 bytes .../examples/runtime/shaders/spirv/vs_oit_blit.bin | Bin 1094 -> 1096 bytes .../examples/runtime/shaders/spirv/vs_particle.bin | Bin 1985 -> 1975 bytes .../runtime/shaders/spirv/vs_picking_shaded.bin | Bin 2097 -> 2103 bytes .../bgfx/examples/runtime/shaders/spirv/vs_pom.bin | Bin 3048 -> 3056 bytes .../runtime/shaders/spirv/vs_raymarching.bin | Bin 1268 -> 1270 bytes .../runtime/shaders/spirv/vs_rsm_combine.bin | Bin 1094 -> 1096 bytes .../runtime/shaders/spirv/vs_rsm_gbuffer.bin | Bin 1630 -> 1634 bytes .../runtime/shaders/spirv/vs_rsm_lbuffer.bin | Bin 2813 -> 2779 bytes .../runtime/shaders/spirv/vs_rsm_shadow.bin | Bin 1490 -> 1494 bytes .../runtime/shaders/spirv/vs_shadowmaps_color.bin | Bin 884 -> 886 bytes .../shaders/spirv/vs_shadowmaps_color_lighting.bin | Bin 2347 -> 2355 bytes .../spirv/vs_shadowmaps_color_lighting_csm.bin | Bin 3624 -> 3640 bytes .../spirv/vs_shadowmaps_color_lighting_linear.bin | Bin 2427 -> 2435 bytes .../vs_shadowmaps_color_lighting_linear_csm.bin | Bin 3896 -> 3912 bytes .../vs_shadowmaps_color_lighting_linear_omni.bin | Bin 3707 -> 3723 bytes .../spirv/vs_shadowmaps_color_lighting_omni.bin | Bin 3435 -> 3451 bytes .../shaders/spirv/vs_shadowmaps_color_texture.bin | Bin 1094 -> 1096 bytes .../runtime/shaders/spirv/vs_shadowmaps_depth.bin | Bin 884 -> 886 bytes .../runtime/shaders/spirv/vs_shadowmaps_hblur.bin | Bin 2553 -> 2599 bytes .../shaders/spirv/vs_shadowmaps_packdepth.bin | Bin 972 -> 974 bytes .../spirv/vs_shadowmaps_packdepth_linear.bin | Bin 1060 -> 1054 bytes .../shaders/spirv/vs_shadowmaps_texture.bin | Bin 1094 -> 1096 bytes .../spirv/vs_shadowmaps_texture_lighting.bin | Bin 1940 -> 1944 bytes .../shaders/spirv/vs_shadowmaps_unpackdepth.bin | Bin 1094 -> 1096 bytes .../runtime/shaders/spirv/vs_shadowmaps_vblur.bin | Bin 2553 -> 2599 bytes .../spirv/vs_shadowvolume_color_lighting.bin | Bin 1878 -> 1738 bytes .../spirv/vs_shadowvolume_color_texture.bin | Bin 1094 -> 1096 bytes .../shaders/spirv/vs_shadowvolume_svback.bin | Bin 1264 -> 1268 bytes .../shaders/spirv/vs_shadowvolume_svfront.bin | Bin 884 -> 886 bytes .../shaders/spirv/vs_shadowvolume_svside.bin | Bin 1614 -> 1618 bytes .../shaders/spirv/vs_shadowvolume_texture.bin | Bin 1094 -> 1096 bytes .../spirv/vs_shadowvolume_texture_lighting.bin | Bin 1940 -> 1944 bytes .../bgfx/examples/runtime/shaders/spirv/vs_sky.bin | Bin 4685 -> 4603 bytes .../runtime/shaders/spirv/vs_sky_landscape.bin | Bin 1768 -> 1772 bytes .../examples/runtime/shaders/spirv/vs_sms_mesh.bin | Bin 2193 -> 2199 bytes .../runtime/shaders/spirv/vs_sms_shadow.bin | Bin 884 -> 886 bytes .../runtime/shaders/spirv/vs_sms_shadow_pd.bin | Bin 972 -> 974 bytes .../runtime/shaders/spirv/vs_sss_gbuffer.bin | Bin 2084 -> 2088 bytes .../runtime/shaders/spirv/vs_sss_screenquad.bin | Bin 1078 -> 1080 bytes .../runtime/shaders/spirv/vs_stencil_color.bin | Bin 884 -> 886 bytes .../shaders/spirv/vs_stencil_color_lighting.bin | Bin 1820 -> 1736 bytes .../shaders/spirv/vs_stencil_color_texture.bin | Bin 1094 -> 1096 bytes .../runtime/shaders/spirv/vs_stencil_texture.bin | Bin 1094 -> 1096 bytes .../shaders/spirv/vs_stencil_texture_lighting.bin | Bin 1940 -> 1944 bytes .../examples/runtime/shaders/spirv/vs_terrain.bin | Bin 1198 -> 1200 bytes .../shaders/spirv/vs_terrain_height_texture.bin | Bin 1688 -> 1630 bytes .../runtime/shaders/spirv/vs_terrain_render.bin | Bin 4093 -> 3981 bytes .../examples/runtime/shaders/spirv/vs_tree.bin | Bin 2096 -> 2100 bytes .../examples/runtime/shaders/spirv/vs_update.bin | Bin 1062 -> 1064 bytes .../runtime/shaders/spirv/vs_vectordisplay_fb.bin | Bin 1268 -> 1270 bytes .../runtime/shaders/spirv/vs_vt_generic.bin | Bin 1409 -> 1413 bytes .../examples/runtime/shaders/spirv/vs_wf_mesh.bin | Bin 2165 -> 2171 bytes .../runtime/shaders/spirv/vs_wf_wireframe.bin | Bin 1731 -> 1737 bytes .../runtime/textures/aerial_rocks_04_diff_2k.ktx | Bin 0 -> 16777327 bytes .../examples/runtime/textures/pf_alpha_test.dds | Bin 0 -> 262272 bytes .../runtime/textures/pf_uv_filtering_test.dds | Bin 0 -> 65664 bytes .../textures/texture_compression_astc_10x10.dds | Bin 0 -> 4000 bytes .../textures/texture_compression_astc_10x5.dds | Bin 7648 -> 7648 bytes .../textures/texture_compression_astc_10x6.dds | Bin 0 -> 6496 bytes .../textures/texture_compression_astc_10x8.dds | Bin 0 -> 4736 bytes .../textures/texture_compression_astc_12x10.dds | Bin 0 -> 3408 bytes .../textures/texture_compression_astc_12x12.dds | Bin 0 -> 2912 bytes .../textures/texture_compression_astc_4x4.dds | Bin 22000 -> 22000 bytes .../textures/texture_compression_astc_5x4.dds | Bin 0 -> 18032 bytes .../textures/texture_compression_astc_5x5.dds | Bin 14800 -> 14800 bytes .../textures/texture_compression_astc_6x5.dds | Bin 0 -> 12544 bytes .../textures/texture_compression_astc_6x6.dds | Bin 10640 -> 10640 bytes .../textures/texture_compression_astc_8x5.dds | Bin 9104 -> 9104 bytes .../textures/texture_compression_astc_8x6.dds | Bin 7728 -> 7728 bytes .../textures/texture_compression_astc_8x8.dds | Bin 0 -> 5632 bytes .../runtime/textures/texture_compression_rgba8.dds | Bin 0 -> 65664 bytes 3rdparty/bgfx/include/bgfx/bgfx.h | 665 +- 3rdparty/bgfx/include/bgfx/c99/bgfx.h | 282 +- 3rdparty/bgfx/include/bgfx/defines.h | 32 +- 3rdparty/bgfx/include/bgfx/embedded_shader.h | 4 +- 3rdparty/bgfx/include/bgfx/platform.h | 17 +- 3rdparty/bgfx/makefile | 29 +- 3rdparty/bgfx/scripts/bgfx.idl | 244 +- 3rdparty/bgfx/scripts/bgfx.lua | 23 +- 3rdparty/bgfx/scripts/bindings-bf.lua | 2 +- 3rdparty/bgfx/scripts/bindings-cs.lua | 4 +- 3rdparty/bgfx/scripts/bindings-d.lua | 36 +- 3rdparty/bgfx/scripts/bindings-zig.lua | 491 + 3rdparty/bgfx/scripts/build.ninja | 45 + 3rdparty/bgfx/scripts/codegen.lua | 4 +- 3rdparty/bgfx/scripts/example-common.lua | 19 +- 3rdparty/bgfx/scripts/genie.lua | 65 +- 3rdparty/bgfx/scripts/geometryc.lua | 8 +- 3rdparty/bgfx/scripts/geometryv.lua | 11 +- 3rdparty/bgfx/scripts/shader-embeded.mk | 14 +- 3rdparty/bgfx/scripts/shader.mk | 6 +- 3rdparty/bgfx/scripts/shaderc.lua | 18 +- 3rdparty/bgfx/scripts/temp.bgfx.h | 4 +- 3rdparty/bgfx/scripts/temp.bgfx.idl.inl | 4 +- 3rdparty/bgfx/scripts/temp.defines.h | 4 +- 3rdparty/bgfx/scripts/texturec.lua | 8 +- 3rdparty/bgfx/scripts/texturev.lua | 11 +- 3rdparty/bgfx/scripts/tools.mk | 4 +- 3rdparty/bgfx/src/amalgamated.cpp | 4 +- 3rdparty/bgfx/src/amalgamated.mm | 4 +- 3rdparty/bgfx/src/bgfx.cpp | 388 +- 3rdparty/bgfx/src/bgfx.idl.inl | 23 +- 3rdparty/bgfx/src/bgfx_compute.sh | 4 +- 3rdparty/bgfx/src/bgfx_p.h | 444 +- 3rdparty/bgfx/src/bgfx_shader.sh | 17 +- 3rdparty/bgfx/src/charset.h | 4 +- 3rdparty/bgfx/src/config.h | 15 +- 3rdparty/bgfx/src/debug_renderdoc.cpp | 8 +- 3rdparty/bgfx/src/debug_renderdoc.h | 4 +- 3rdparty/bgfx/src/dxgi.cpp | 82 +- 3rdparty/bgfx/src/dxgi.h | 9 +- 3rdparty/bgfx/src/emscripten.h | 4 +- 3rdparty/bgfx/src/fs_clear0.sc | 4 +- 3rdparty/bgfx/src/fs_clear1.sc | 4 +- 3rdparty/bgfx/src/fs_clear2.sc | 4 +- 3rdparty/bgfx/src/fs_clear3.sc | 4 +- 3rdparty/bgfx/src/fs_clear4.sc | 4 +- 3rdparty/bgfx/src/fs_clear5.sc | 4 +- 3rdparty/bgfx/src/fs_clear6.sc | 4 +- 3rdparty/bgfx/src/fs_clear7.sc | 4 +- 3rdparty/bgfx/src/fs_debugfont.sc | 4 +- 3rdparty/bgfx/src/glcontext_eagl.h | 9 +- 3rdparty/bgfx/src/glcontext_eagl.mm | 6 +- 3rdparty/bgfx/src/glcontext_egl.cpp | 31 +- 3rdparty/bgfx/src/glcontext_egl.h | 9 +- 3rdparty/bgfx/src/glcontext_glx.cpp | 9 +- 3rdparty/bgfx/src/glcontext_glx.h | 9 +- 3rdparty/bgfx/src/glcontext_html5.cpp | 31 +- 3rdparty/bgfx/src/glcontext_html5.h | 9 +- 3rdparty/bgfx/src/glcontext_nsgl.h | 10 +- 3rdparty/bgfx/src/glcontext_nsgl.mm | 35 +- 3rdparty/bgfx/src/glcontext_wgl.cpp | 8 +- 3rdparty/bgfx/src/glcontext_wgl.h | 9 +- 3rdparty/bgfx/src/glimports.h | 41 +- 3rdparty/bgfx/src/makefile | 4 +- 3rdparty/bgfx/src/nvapi.cpp | 4 +- 3rdparty/bgfx/src/nvapi.h | 4 +- 3rdparty/bgfx/src/renderer.h | 7 +- 3rdparty/bgfx/src/renderer_agc.cpp | 4 +- 3rdparty/bgfx/src/renderer_d3d.h | 8 +- 3rdparty/bgfx/src/renderer_d3d11.cpp | 198 +- 3rdparty/bgfx/src/renderer_d3d11.h | 12 +- 3rdparty/bgfx/src/renderer_d3d12.cpp | 875 +- 3rdparty/bgfx/src/renderer_d3d12.h | 38 +- 3rdparty/bgfx/src/renderer_d3d9.cpp | 135 +- 3rdparty/bgfx/src/renderer_d3d9.h | 18 +- 3rdparty/bgfx/src/renderer_gl.cpp | 1183 +- 3rdparty/bgfx/src/renderer_gl.h | 136 +- 3rdparty/bgfx/src/renderer_gnm.cpp | 4 +- 3rdparty/bgfx/src/renderer_mtl.h | 20 +- 3rdparty/bgfx/src/renderer_mtl.mm | 604 +- 3rdparty/bgfx/src/renderer_noop.cpp | 5 +- 3rdparty/bgfx/src/renderer_nvn.cpp | 4 +- 3rdparty/bgfx/src/renderer_vk.cpp | 537 +- 3rdparty/bgfx/src/renderer_vk.h | 232 +- 3rdparty/bgfx/src/renderer_webgpu.cpp | 61 +- 3rdparty/bgfx/src/renderer_webgpu.h | 6 +- 3rdparty/bgfx/src/shader.cpp | 32 +- 3rdparty/bgfx/src/shader.h | 4 +- 3rdparty/bgfx/src/shader_dx9bc.cpp | 6 +- 3rdparty/bgfx/src/shader_dx9bc.h | 4 +- 3rdparty/bgfx/src/shader_dxbc.cpp | 143 +- 3rdparty/bgfx/src/shader_dxbc.h | 74 +- 3rdparty/bgfx/src/shader_spirv.cpp | 4 +- 3rdparty/bgfx/src/shader_spirv.h | 4 +- 3rdparty/bgfx/src/topology.cpp | 4 +- 3rdparty/bgfx/src/topology.h | 4 +- 3rdparty/bgfx/src/version.h | 8 +- 3rdparty/bgfx/src/vertexlayout.cpp | 73 +- 3rdparty/bgfx/src/vertexlayout.h | 7 +- 3rdparty/bgfx/src/vs_clear.sc | 4 +- 3rdparty/bgfx/src/vs_debugfont.sc | 4 +- 3rdparty/bgfx/tools/geometryc/geometryc.cpp | 224 +- 3rdparty/bgfx/tools/geometryv/fs_mesh.sc | 2 +- 3rdparty/bgfx/tools/geometryv/geometryv.cpp | 77 +- 3rdparty/bgfx/tools/geometryv/makefile | 2 +- 3rdparty/bgfx/tools/geometryv/vs_mesh.sc | 2 +- 3rdparty/bgfx/tools/shaderc/shaderc.cpp | 262 +- 3rdparty/bgfx/tools/shaderc/shaderc.h | 33 +- 3rdparty/bgfx/tools/shaderc/shaderc_glsl.cpp | 47 +- 3rdparty/bgfx/tools/shaderc/shaderc_hlsl.cpp | 43 +- 3rdparty/bgfx/tools/shaderc/shaderc_metal.cpp | 66 +- 3rdparty/bgfx/tools/shaderc/shaderc_pssl.cpp | 4 +- 3rdparty/bgfx/tools/shaderc/shaderc_spirv.cpp | 65 +- 3rdparty/bgfx/tools/texturev/common.sh | 4 +- 3rdparty/bgfx/tools/texturev/fs_texture.sc | 4 +- 3rdparty/bgfx/tools/texturev/fs_texture_3d.sc | 4 +- 3rdparty/bgfx/tools/texturev/fs_texture_array.sc | 4 +- 3rdparty/bgfx/tools/texturev/fs_texture_cube.sc | 4 +- 3rdparty/bgfx/tools/texturev/fs_texture_cube2.sc | 4 +- 3rdparty/bgfx/tools/texturev/fs_texture_msdf.sc | 4 +- 3rdparty/bgfx/tools/texturev/fs_texture_sdf.sc | 4 +- 3rdparty/bgfx/tools/texturev/makefile | 4 +- 3rdparty/bgfx/tools/texturev/texturev.cpp | 52 +- 3rdparty/bgfx/tools/texturev/vs_texture.sc | 4 +- 3rdparty/bgfx/tools/texturev/vs_texture_cube.sc | 4 +- 3rdparty/bimg/3rdparty/astc-codec/.gitignore | 5 - 3rdparty/bimg/3rdparty/astc-codec/BUILD.bazel | 29 - 3rdparty/bimg/3rdparty/astc-codec/CMakeLists.txt | 46 - 3rdparty/bimg/3rdparty/astc-codec/CONTRIBUTING.md | 28 - .../astc-codec/GoogleTest-CMakeLists.txt.in | 15 - 3rdparty/bimg/3rdparty/astc-codec/LICENSE | 202 - 3rdparty/bimg/3rdparty/astc-codec/README.md | 71 - 3rdparty/bimg/3rdparty/astc-codec/WORKSPACE | 37 - .../bimg/3rdparty/astc-codec/cmake-format.json | 38 - .../astc-codec/include/astc-codec/astc-codec.h | 75 - .../bimg/3rdparty/astc-codec/src/.clang-format | 4 - .../bimg/3rdparty/astc-codec/src/base/BUILD.bazel | 49 - .../3rdparty/astc-codec/src/base/CMakeLists.txt | 27 - .../bimg/3rdparty/astc-codec/src/base/bit_stream.h | 77 - .../bimg/3rdparty/astc-codec/src/base/bottom_n.h | 78 - .../bimg/3rdparty/astc-codec/src/base/math_utils.h | 80 - .../bimg/3rdparty/astc-codec/src/base/optional.h | 520 - .../3rdparty/astc-codec/src/base/string_utils.h | 69 - .../astc-codec/src/base/test/bit_stream_test.cpp | 141 - .../astc-codec/src/base/test/bottom_n_test.cpp | 108 - .../astc-codec/src/base/test/math_utils_test.cpp | 78 - .../astc-codec/src/base/test/optional_test.cpp | 481 - .../astc-codec/src/base/test/string_utils_test.cpp | 110 - .../astc-codec/src/base/test/type_traits_test.cpp | 130 - .../astc-codec/src/base/test/uint128_test.cpp | 140 - .../3rdparty/astc-codec/src/base/type_traits.h | 172 - .../bimg/3rdparty/astc-codec/src/base/uint128.h | 175 - 3rdparty/bimg/3rdparty/astc-codec/src/base/utils.h | 35 - .../3rdparty/astc-codec/src/decoder/BUILD.bazel | 246 - .../3rdparty/astc-codec/src/decoder/CMakeLists.txt | 95 - .../3rdparty/astc-codec/src/decoder/astc_file.cc | 185 - .../3rdparty/astc-codec/src/decoder/astc_file.h | 97 - .../bimg/3rdparty/astc-codec/src/decoder/codec.cc | 132 - .../bimg/3rdparty/astc-codec/src/decoder/codec.h | 41 - .../astc-codec/src/decoder/endpoint_codec.cc | 963 - .../astc-codec/src/decoder/endpoint_codec.h | 90 - .../3rdparty/astc-codec/src/decoder/footprint.cc | 162 - .../3rdparty/astc-codec/src/decoder/footprint.h | 106 - .../src/decoder/integer_sequence_codec.cc | 574 - .../src/decoder/integer_sequence_codec.h | 169 - .../src/decoder/intermediate_astc_block.cc | 591 - .../src/decoder/intermediate_astc_block.h | 128 - .../astc-codec/src/decoder/logical_astc_block.cc | 262 - .../astc-codec/src/decoder/logical_astc_block.h | 127 - .../3rdparty/astc-codec/src/decoder/partition.cc | 601 - .../3rdparty/astc-codec/src/decoder/partition.h | 97 - .../astc-codec/src/decoder/physical_astc_block.cc | 761 - .../astc-codec/src/decoder/physical_astc_block.h | 128 - .../astc-codec/src/decoder/quantization.cc | 462 - .../3rdparty/astc-codec/src/decoder/quantization.h | 65 - .../astc-codec/src/decoder/test/astc_fuzzer.cc | 36 - .../astc-codec/src/decoder/test/codec_test.cc | 181 - .../src/decoder/test/endpoint_codec_test.cc | 463 - .../astc-codec/src/decoder/test/footprint_test.cc | 97 - .../astc-codec/src/decoder/test/image_utils.h | 217 - .../decoder/test/integer_sequence_codec_test.cc | 336 - .../decoder/test/intermediate_astc_block_test.cc | 454 - .../src/decoder/test/logical_astc_block_test.cc | 273 - .../astc-codec/src/decoder/test/partition_test.cc | 263 - .../src/decoder/test/physical_astc_block_test.cc | 361 - .../src/decoder/test/quantization_test.cc | 288 - .../src/decoder/test/weight_infill_test.cc | 69 - .../src/decoder/testdata/atlas_small_4x4.astc | Bin 65552 -> 0 bytes .../src/decoder/testdata/atlas_small_4x4.bmp | Bin 262282 -> 0 bytes .../src/decoder/testdata/atlas_small_5x5.astc | Bin 43280 -> 0 bytes .../src/decoder/testdata/atlas_small_5x5.bmp | Bin 262282 -> 0 bytes .../src/decoder/testdata/atlas_small_6x6.astc | Bin 29600 -> 0 bytes .../src/decoder/testdata/atlas_small_6x6.bmp | Bin 262282 -> 0 bytes .../src/decoder/testdata/atlas_small_8x8.astc | Bin 16400 -> 0 bytes .../src/decoder/testdata/atlas_small_8x8.bmp | Bin 262282 -> 0 bytes .../src/decoder/testdata/checkerboard.astc | Bin 80 -> 0 bytes .../src/decoder/testdata/checkered_10.astc | Bin 1616 -> 0 bytes .../src/decoder/testdata/checkered_11.astc | Bin 1952 -> 0 bytes .../src/decoder/testdata/checkered_12.astc | Bin 2320 -> 0 bytes .../src/decoder/testdata/checkered_4.astc | Bin 272 -> 0 bytes .../src/decoder/testdata/checkered_5.astc | Bin 416 -> 0 bytes .../src/decoder/testdata/checkered_6.astc | Bin 592 -> 0 bytes .../src/decoder/testdata/checkered_7.astc | Bin 800 -> 0 bytes .../src/decoder/testdata/checkered_8.astc | Bin 1040 -> 0 bytes .../src/decoder/testdata/checkered_9.astc | Bin 1312 -> 0 bytes .../src/decoder/testdata/footprint_10x10.astc | Bin 272 -> 0 bytes .../src/decoder/testdata/footprint_10x10.bmp | Bin 3210 -> 0 bytes .../src/decoder/testdata/footprint_10x5.astc | Bin 464 -> 0 bytes .../src/decoder/testdata/footprint_10x5.bmp | Bin 3210 -> 0 bytes .../src/decoder/testdata/footprint_10x6.astc | Bin 400 -> 0 bytes .../src/decoder/testdata/footprint_10x6.bmp | Bin 3210 -> 0 bytes .../src/decoder/testdata/footprint_10x8.astc | Bin 272 -> 0 bytes .../src/decoder/testdata/footprint_10x8.bmp | Bin 3210 -> 0 bytes .../src/decoder/testdata/footprint_12x10.astc | Bin 208 -> 0 bytes .../src/decoder/testdata/footprint_12x10.bmp | Bin 3210 -> 0 bytes .../src/decoder/testdata/footprint_12x12.astc | Bin 160 -> 0 bytes .../src/decoder/testdata/footprint_12x12.bmp | Bin 3210 -> 0 bytes .../src/decoder/testdata/footprint_4x4.astc | Bin 1040 -> 0 bytes .../src/decoder/testdata/footprint_4x4.bmp | Bin 3210 -> 0 bytes .../src/decoder/testdata/footprint_5x4.astc | Bin 912 -> 0 bytes .../src/decoder/testdata/footprint_5x4.bmp | Bin 3210 -> 0 bytes .../src/decoder/testdata/footprint_5x5.astc | Bin 800 -> 0 bytes .../src/decoder/testdata/footprint_5x5.bmp | Bin 3210 -> 0 bytes .../src/decoder/testdata/footprint_6x5.astc | Bin 688 -> 0 bytes .../src/decoder/testdata/footprint_6x5.bmp | Bin 3210 -> 0 bytes .../src/decoder/testdata/footprint_6x6.astc | Bin 592 -> 0 bytes .../src/decoder/testdata/footprint_6x6.bmp | Bin 3210 -> 0 bytes .../src/decoder/testdata/footprint_8x5.astc | Bin 464 -> 0 bytes .../src/decoder/testdata/footprint_8x5.bmp | Bin 3210 -> 0 bytes .../src/decoder/testdata/footprint_8x6.astc | Bin 400 -> 0 bytes .../src/decoder/testdata/footprint_8x6.bmp | Bin 3210 -> 0 bytes .../src/decoder/testdata/footprint_8x8.astc | Bin 272 -> 0 bytes .../src/decoder/testdata/footprint_8x8.bmp | Bin 3210 -> 0 bytes .../astc-codec/src/decoder/testdata/rgb_12x12.astc | Bin 7312 -> 0 bytes .../astc-codec/src/decoder/testdata/rgb_12x12.bmp | Bin 193674 -> 0 bytes .../astc-codec/src/decoder/testdata/rgb_4x4.astc | Bin 64528 -> 0 bytes .../astc-codec/src/decoder/testdata/rgb_4x4.bmp | Bin 193674 -> 0 bytes .../astc-codec/src/decoder/testdata/rgb_5x4.astc | Bin 51856 -> 0 bytes .../astc-codec/src/decoder/testdata/rgb_5x4.bmp | Bin 193674 -> 0 bytes .../astc-codec/src/decoder/testdata/rgb_6x6.astc | Bin 29200 -> 0 bytes .../astc-codec/src/decoder/testdata/rgb_6x6.bmp | Bin 193674 -> 0 bytes .../astc-codec/src/decoder/testdata/rgb_8x8.astc | Bin 16144 -> 0 bytes .../astc-codec/src/decoder/testdata/rgb_8x8.bmp | Bin 193674 -> 0 bytes .../src/decoder/tools/astc_inspector_cli.cc | 785 - .../bimg/3rdparty/astc-codec/src/decoder/types.h | 74 - .../astc-codec/src/decoder/weight_infill.cc | 122 - .../astc-codec/src/decoder/weight_infill.h | 38 - .../bimg/3rdparty/astc-codec/third_party/BUILD | 0 .../astc-codec/third_party/honggfuzz.BUILD | 39 - .../astc-codec/tools/build-ci/linux/build.sh | 76 - .../astc-codec/tools/build-ci/linux/continuous.cfg | 3 - .../astc-codec/tools/build-ci/linux/presubmit.cfg | 3 - 3rdparty/bimg/3rdparty/astc-encoder/LICENSE.txt | 175 + .../bimg/3rdparty/astc-encoder/include/astcenc.h | 834 + .../source/astcenc_averages_and_directions.cpp | 995 + .../astc-encoder/source/astcenc_block_sizes.cpp | 1210 + .../astc-encoder/source/astcenc_color_quantize.cpp | 2071 ++ .../source/astcenc_color_unquantize.cpp | 941 + .../source/astcenc_compress_symbolic.cpp | 1459 + .../source/astcenc_compute_variance.cpp | 472 + .../source/astcenc_decompress_symbolic.cpp | 623 + .../source/astcenc_diagnostic_trace.cpp | 230 + .../astc-encoder/source/astcenc_diagnostic_trace.h | 219 + .../3rdparty/astc-encoder/source/astcenc_entry.cpp | 1442 + .../source/astcenc_find_best_partitioning.cpp | 776 + .../source/astcenc_ideal_endpoints_and_weights.cpp | 1656 ++ .../3rdparty/astc-encoder/source/astcenc_image.cpp | 558 + .../source/astcenc_integer_sequence.cpp | 744 + .../astc-encoder/source/astcenc_internal.h | 2185 ++ .../astc-encoder/source/astcenc_internal_entry.h | 273 + .../astc-encoder/source/astcenc_mathlib.cpp | 48 + .../3rdparty/astc-encoder/source/astcenc_mathlib.h | 478 + .../source/astcenc_mathlib_softfloat.cpp | 411 + .../source/astcenc_partition_tables.cpp | 461 + .../source/astcenc_percentile_tables.cpp | 1251 + .../source/astcenc_pick_best_endpoint_format.cpp | 1357 + .../source/astcenc_platform_isa_detection.cpp | 166 + .../astc-encoder/source/astcenc_quantization.cpp | 904 + .../source/astcenc_symbolic_physical.cpp | 530 + .../astc-encoder/source/astcenc_vecmathlib.h | 570 + .../source/astcenc_vecmathlib_avx2_8.h | 1204 + .../source/astcenc_vecmathlib_common_4.h | 423 + .../source/astcenc_vecmathlib_neon_4.h | 1073 + .../source/astcenc_vecmathlib_none_4.h | 1169 + .../astc-encoder/source/astcenc_vecmathlib_sse_4.h | 1283 + .../astc-encoder/source/astcenc_weight_align.cpp | 479 + .../source/astcenc_weight_quant_xfer_tables.cpp | 159 + .../3rdparty/astc/astc_averages_and_directions.cpp | 627 - 3rdparty/bimg/3rdparty/astc/astc_block_sizes2.cpp | 977 - 3rdparty/bimg/3rdparty/astc/astc_codec_internals.h | 816 - .../bimg/3rdparty/astc/astc_color_quantize.cpp | 2096 -- .../bimg/3rdparty/astc/astc_color_unquantize.cpp | 970 - .../bimg/3rdparty/astc/astc_compress_symbolic.cpp | 1792 -- .../bimg/3rdparty/astc/astc_compute_variance.cpp | 524 - .../3rdparty/astc/astc_decompress_symbolic.cpp | 317 - .../3rdparty/astc/astc_encoding_choice_error.cpp | 310 - .../3rdparty/astc/astc_find_best_partitioning.cpp | 865 - .../astc/astc_ideal_endpoints_and_weights.cpp | 2163 -- 3rdparty/bimg/3rdparty/astc/astc_imageblock.cpp | 324 - .../bimg/3rdparty/astc/astc_integer_sequence.cpp | 649 - .../3rdparty/astc/astc_kmeans_partitioning.cpp | 520 - 3rdparty/bimg/3rdparty/astc/astc_lib.cpp | 565 - 3rdparty/bimg/3rdparty/astc/astc_lib.h | 75 - .../bimg/3rdparty/astc/astc_partition_tables.cpp | 323 - .../bimg/3rdparty/astc/astc_percentile_tables.cpp | 4768 --- .../astc/astc_pick_best_endpoint_format.cpp | 938 - 3rdparty/bimg/3rdparty/astc/astc_quantization.cpp | 558 - .../bimg/3rdparty/astc/astc_symbolic_physical.cpp | 431 - 3rdparty/bimg/3rdparty/astc/astc_weight_align.cpp | 600 - .../astc/astc_weight_quant_xfer_tables.cpp | 1003 - 3rdparty/bimg/3rdparty/astc/license.txt | 137 - 3rdparty/bimg/3rdparty/astc/mathlib.cpp | 781 - 3rdparty/bimg/3rdparty/astc/mathlib.h | 200 - 3rdparty/bimg/3rdparty/astc/readme.txt | 1 - 3rdparty/bimg/3rdparty/astc/softfloat.cpp | 398 - 3rdparty/bimg/3rdparty/astc/softfloat.h | 95 - 3rdparty/bimg/3rdparty/astc/vectypes.h | 16209 ----------- 3rdparty/bimg/3rdparty/nvtt/nvtt.cpp | 4 +- 3rdparty/bimg/LICENSE | 2 +- 3rdparty/bimg/README.md | 2 +- 3rdparty/bimg/include/bimg/bimg.h | 15 +- 3rdparty/bimg/include/bimg/decode.h | 4 +- 3rdparty/bimg/include/bimg/encode.h | 4 +- 3rdparty/bimg/makefile | 12 +- 3rdparty/bimg/scripts/bimg.lua | 29 +- 3rdparty/bimg/scripts/bimg_decode.lua | 5 +- 3rdparty/bimg/scripts/bimg_encode.lua | 16 +- 3rdparty/bimg/scripts/genie.lua | 8 +- 3rdparty/bimg/scripts/texturec.lua | 8 +- 3rdparty/bimg/src/bimg_p.h | 39 +- 3rdparty/bimg/src/config.h | 4 +- 3rdparty/bimg/src/image.cpp | 312 +- 3rdparty/bimg/src/image_cubemap_filter.cpp | 22 +- 3rdparty/bimg/src/image_decode.cpp | 8 +- 3rdparty/bimg/src/image_encode.cpp | 116 +- 3rdparty/bimg/src/image_gnf.cpp | 6 +- 3rdparty/bimg/tools/texturec/texturec.cpp | 8 +- 3rdparty/bx/3rdparty/catch/catch.hpp | 17881 ------------ 3rdparty/bx/3rdparty/catch/catch_amalgamated.cpp | 10360 +++++++ 3rdparty/bx/3rdparty/catch/catch_amalgamated.hpp | 12233 ++++++++ 3rdparty/bx/LICENSE | 2 +- 3rdparty/bx/README.md | 2 +- 3rdparty/bx/include/bx/allocator.h | 27 +- 3rdparty/bx/include/bx/bounds.h | 526 + 3rdparty/bx/include/bx/bx.h | 150 +- 3rdparty/bx/include/bx/commandline.h | 4 +- 3rdparty/bx/include/bx/config.h | 12 +- 3rdparty/bx/include/bx/constants.h | 70 + 3rdparty/bx/include/bx/cpu.h | 4 +- 3rdparty/bx/include/bx/debug.h | 8 +- 3rdparty/bx/include/bx/easing.h | 4 +- 3rdparty/bx/include/bx/endian.h | 12 +- 3rdparty/bx/include/bx/error.h | 37 +- 3rdparty/bx/include/bx/file.h | 14 +- 3rdparty/bx/include/bx/filepath.h | 4 +- 3rdparty/bx/include/bx/float4x4_t.h | 4 +- 3rdparty/bx/include/bx/handlealloc.h | 4 +- 3rdparty/bx/include/bx/hash.h | 98 +- 3rdparty/bx/include/bx/inline/allocator.inl | 6 +- 3rdparty/bx/include/bx/inline/bounds.inl | 257 + 3rdparty/bx/include/bx/inline/bx.inl | 102 +- 3rdparty/bx/include/bx/inline/cpu.inl | 4 +- 3rdparty/bx/include/bx/inline/easing.inl | 4 +- 3rdparty/bx/include/bx/inline/endian.inl | 4 +- 3rdparty/bx/include/bx/inline/error.inl | 56 +- 3rdparty/bx/include/bx/inline/float4x4_t.inl | 4 +- 3rdparty/bx/include/bx/inline/handlealloc.inl | 4 +- 3rdparty/bx/include/bx/inline/hash.inl | 182 +- 3rdparty/bx/include/bx/inline/math.inl | 139 +- 3rdparty/bx/include/bx/inline/mpscqueue.inl | 4 +- 3rdparty/bx/include/bx/inline/mutex.inl | 4 +- 3rdparty/bx/include/bx/inline/os.inl | 4 +- 3rdparty/bx/include/bx/inline/pixelformat.inl | 39 +- 3rdparty/bx/include/bx/inline/readerwriter.inl | 4 +- 3rdparty/bx/include/bx/inline/ringbuffer.inl | 4 +- 3rdparty/bx/include/bx/inline/rng.inl | 4 +- 3rdparty/bx/include/bx/inline/simd128_langext.inl | 4 +- 3rdparty/bx/include/bx/inline/simd128_neon.inl | 4 +- 3rdparty/bx/include/bx/inline/simd128_ref.inl | 12 +- 3rdparty/bx/include/bx/inline/simd128_sse.inl | 4 +- 3rdparty/bx/include/bx/inline/simd128_swizzle.inl | 2 +- 3rdparty/bx/include/bx/inline/simd256_avx.inl | 4 +- 3rdparty/bx/include/bx/inline/simd256_ref.inl | 4 +- 3rdparty/bx/include/bx/inline/simd_ni.inl | 4 +- 3rdparty/bx/include/bx/inline/sort.inl | 110 +- 3rdparty/bx/include/bx/inline/spscqueue.inl | 4 +- 3rdparty/bx/include/bx/inline/string.inl | 115 +- 3rdparty/bx/include/bx/inline/typetraits.inl | 462 + 3rdparty/bx/include/bx/inline/uint32_t.inl | 73 +- 3rdparty/bx/include/bx/macros.h | 72 +- 3rdparty/bx/include/bx/maputil.h | 4 +- 3rdparty/bx/include/bx/math.h | 120 +- 3rdparty/bx/include/bx/mpscqueue.h | 8 +- 3rdparty/bx/include/bx/mutex.h | 6 +- 3rdparty/bx/include/bx/os.h | 8 +- 3rdparty/bx/include/bx/pixelformat.h | 10 +- 3rdparty/bx/include/bx/platform.h | 39 +- 3rdparty/bx/include/bx/process.h | 4 +- 3rdparty/bx/include/bx/readerwriter.h | 50 +- 3rdparty/bx/include/bx/ringbuffer.h | 10 +- 3rdparty/bx/include/bx/rng.h | 4 +- 3rdparty/bx/include/bx/semaphore.h | 5 +- 3rdparty/bx/include/bx/settings.h | 8 +- 3rdparty/bx/include/bx/simd_t.h | 4 +- 3rdparty/bx/include/bx/sort.h | 277 +- 3rdparty/bx/include/bx/spscqueue.h | 12 +- 3rdparty/bx/include/bx/string.h | 72 +- 3rdparty/bx/include/bx/thread.h | 5 +- 3rdparty/bx/include/bx/timer.h | 4 +- 3rdparty/bx/include/bx/typetraits.h | 285 + 3rdparty/bx/include/bx/uint32_t.h | 40 +- 3rdparty/bx/include/bx/url.h | 4 +- 3rdparty/bx/include/compat/linux/sal.h | 1 + 3rdparty/bx/include/compat/mingw/salieri.h | 16 + 3rdparty/bx/makefile | 12 +- 3rdparty/bx/scripts/bin2c.lua | 16 +- 3rdparty/bx/scripts/bx.lua | 42 +- 3rdparty/bx/scripts/genie.lua | 24 +- 3rdparty/bx/scripts/lemon.lua | 4 +- 3rdparty/bx/scripts/toolchain.lua | 305 +- 3rdparty/bx/src/allocator.cpp | 11 +- 3rdparty/bx/src/amalgamated.cpp | 5 +- 3rdparty/bx/src/bounds.cpp | 2039 ++ 3rdparty/bx/src/bx.cpp | 25 +- 3rdparty/bx/src/bx_p.h | 45 - 3rdparty/bx/src/commandline.cpp | 7 +- 3rdparty/bx/src/crtnone.cpp | 20 +- 3rdparty/bx/src/debug.cpp | 5 +- 3rdparty/bx/src/dtoa.cpp | 7 +- 3rdparty/bx/src/easing.cpp | 5 +- 3rdparty/bx/src/file.cpp | 15 +- 3rdparty/bx/src/filepath.cpp | 5 +- 3rdparty/bx/src/hash.cpp | 125 +- 3rdparty/bx/src/math.cpp | 63 +- 3rdparty/bx/src/mutex.cpp | 17 +- 3rdparty/bx/src/os.cpp | 32 +- 3rdparty/bx/src/process.cpp | 5 +- 3rdparty/bx/src/semaphore.cpp | 8 +- 3rdparty/bx/src/settings.cpp | 5 +- 3rdparty/bx/src/sort.cpp | 124 +- 3rdparty/bx/src/string.cpp | 148 +- 3rdparty/bx/src/thread.cpp | 17 +- 3rdparty/bx/src/timer.cpp | 8 +- 3rdparty/bx/src/url.cpp | 3 +- 3rdparty/bx/tests/allocator_test.cpp | 78 + 3rdparty/bx/tests/atomic_test.cpp | 4 +- 3rdparty/bx/tests/crt_test.cpp | 27 +- 3rdparty/bx/tests/dbg.h | 4 +- 3rdparty/bx/tests/easing_test.cpp | 6 +- 3rdparty/bx/tests/filepath_test.cpp | 4 +- 3rdparty/bx/tests/handle_bench.cpp | 4 +- 3rdparty/bx/tests/handle_test.cpp | 4 +- 3rdparty/bx/tests/hash_test.cpp | 111 +- 3rdparty/bx/tests/macros_test.cpp | 31 +- 3rdparty/bx/tests/main_test.cpp | 4 +- 3rdparty/bx/tests/math_bench.cpp | 4 +- 3rdparty/bx/tests/math_test.cpp | 188 +- 3rdparty/bx/tests/nlalloc_test.cpp | 229 - 3rdparty/bx/tests/os_test.cpp | 18 +- 3rdparty/bx/tests/queue_test.cpp | 4 +- 3rdparty/bx/tests/readerwriter_test.cpp | 4 +- 3rdparty/bx/tests/ringbuffer_test.cpp | 4 +- 3rdparty/bx/tests/rng_test.cpp | 4 +- 3rdparty/bx/tests/run_test.cpp | 16 +- 3rdparty/bx/tests/settings_test.cpp | 12 +- 3rdparty/bx/tests/simd_bench.cpp | 4 +- 3rdparty/bx/tests/simd_test.cpp | 28 +- 3rdparty/bx/tests/sort_test.cpp | 148 +- 3rdparty/bx/tests/string_test.cpp | 65 +- 3rdparty/bx/tests/test.h | 12 +- 3rdparty/bx/tests/thread_test.cpp | 8 +- 3rdparty/bx/tests/tokenizecmd_test.cpp | 4 +- 3rdparty/bx/tests/typetraits_test.cpp | 688 + 3rdparty/bx/tests/uint32_test.cpp | 6 +- 3rdparty/bx/tests/url_test.cpp | 4 +- 3rdparty/bx/tests/vsnprintf_test.cpp | 104 +- 3rdparty/bx/tools/bin/darwin/genie | Bin 549136 -> 549032 bytes 3rdparty/bx/tools/bin/darwin/lempar.c | 2 +- 3rdparty/bx/tools/bin/linux/bin2c | Bin 88112 -> 96464 bytes 3rdparty/bx/tools/bin/linux/genie | Bin 543624 -> 547720 bytes 3rdparty/bx/tools/bin/linux/lemon | Bin 84576 -> 84728 bytes 3rdparty/bx/tools/bin/linux/lempar.c | 2 +- 3rdparty/bx/tools/bin/windows/genie.exe | Bin 547328 -> 551936 bytes 3rdparty/bx/tools/bin/windows/lempar.c | 2 +- 3rdparty/bx/tools/bin2c/bin2c.cpp | 12 +- 3rdparty/bx/tools/lemon/lemon.c | 6 +- 3rdparty/bx/tools/lemon/lempar.c | 2 +- bgfx/shaders/essl/chains/blurs/vs_smart-blur.bin | Bin 1190 -> 1190 bytes bgfx/shaders/essl/chains/crt-geom/vs_crt-geom.bin | Bin 5042 -> 5042 bytes bgfx/shaders/essl/chains/crt-geom/vs_gaussx.bin | Bin 832 -> 832 bytes bgfx/shaders/essl/chains/crt-geom/vs_gaussy.bin | Bin 832 -> 832 bytes bgfx/shaders/essl/chains/crt-geom/vs_lowpass.bin | Bin 2722 -> 2722 bytes bgfx/shaders/essl/chains/crt-geom/vs_mipmap8.bin | Bin 342 -> 342 bytes .../essl/chains/crt-geom/vs_phosphor_apply.bin | Bin 342 -> 342 bytes .../essl/chains/crt-geom/vs_phosphor_update.bin | Bin 342 -> 342 bytes bgfx/shaders/essl/chains/crt/vs_crt-caligari.bin | Bin 741 -> 741 bytes bgfx/shaders/essl/chains/default/vs_blit.bin | Bin 427 -> 427 bytes bgfx/shaders/essl/chains/eagle/vs_eagle.bin | Bin 2453 -> 2453 bytes bgfx/shaders/essl/chains/hlsl/vs_chroma.bin | Bin 427 -> 427 bytes bgfx/shaders/essl/chains/hlsl/vs_color.bin | Bin 427 -> 427 bytes bgfx/shaders/essl/chains/hlsl/vs_deconverge.bin | Bin 1506 -> 1506 bytes bgfx/shaders/essl/chains/hlsl/vs_defocus.bin | Bin 427 -> 427 bytes bgfx/shaders/essl/chains/hlsl/vs_distortion.bin | Bin 427 -> 427 bytes bgfx/shaders/essl/chains/hlsl/vs_ntsc_decode.bin | Bin 427 -> 427 bytes bgfx/shaders/essl/chains/hlsl/vs_ntsc_encode.bin | Bin 427 -> 427 bytes bgfx/shaders/essl/chains/hlsl/vs_phosphor.bin | Bin 427 -> 427 bytes bgfx/shaders/essl/chains/hlsl/vs_post.bin | Bin 427 -> 427 bytes bgfx/shaders/essl/chains/hlsl/vs_prescale.bin | Bin 427 -> 427 bytes bgfx/shaders/essl/chains/hlsl/vs_scanline.bin | Bin 427 -> 427 bytes bgfx/shaders/essl/chains/hqx/vs_hq2x.bin | Bin 1190 -> 1190 bytes bgfx/shaders/essl/chains/hqx/vs_hq3x.bin | Bin 1190 -> 1190 bytes bgfx/shaders/essl/chains/hqx/vs_hq4x.bin | Bin 1190 -> 1190 bytes bgfx/shaders/essl/chains/lcd-grid/vs_lcd-grid.bin | Bin 427 -> 427 bytes .../essl/chains/lcd-grid/vs_persistence.bin | Bin 427 -> 427 bytes bgfx/shaders/essl/chains/misc/vs_blit.bin | Bin 427 -> 427 bytes .../chains/misc/vs_bob-and-ghost-deinterlace.bin | Bin 427 -> 427 bytes .../essl/chains/misc/vs_deposterize-pass0.bin | Bin 755 -> 755 bytes .../essl/chains/misc/vs_deposterize-pass1.bin | Bin 755 -> 755 bytes bgfx/shaders/essl/chains/misc/vs_lut.bin | Bin 427 -> 427 bytes bgfx/shaders/essl/chains/misc/vs_saturation.bin | Bin 427 -> 427 bytes .../pillarbox_left_horizontal/vs_gaussian.bin | Bin 427 -> 427 bytes .../pillarbox_left_horizontal/vs_offset_sat.bin | Bin 466 -> 466 bytes .../chains/pillarbox_left_vertical/vs_gaussian.bin | Bin 427 -> 427 bytes .../pillarbox_left_vertical/vs_offset_sat.bin | Bin 471 -> 471 bytes .../pillarbox_right_horizontal/vs_gaussian.bin | Bin 427 -> 427 bytes .../pillarbox_right_horizontal/vs_offset_sat.bin | Bin 467 -> 467 bytes .../pillarbox_right_vertical/vs_gaussian.bin | Bin 427 -> 427 bytes .../pillarbox_right_vertical/vs_offset_sat.bin | Bin 477 -> 477 bytes bgfx/shaders/essl/chains/unfiltered/vs_blit.bin | Bin 427 -> 427 bytes .../chains/warp/vs_dilation-horizontal-fast.bin | Bin 634 -> 634 bytes .../xbr/super-xbr/vs_custom-jinc2-sharper.bin | Bin 427 -> 427 bytes .../xbr/super-xbr/vs_super-2xbr-3d-pass0.bin | Bin 427 -> 427 bytes .../xbr/super-xbr/vs_super-2xbr-3d-pass1.bin | Bin 427 -> 427 bytes .../xbr/super-xbr/vs_super-2xbr-3d-pass2.bin | Bin 1427 -> 1427 bytes .../xbr/super-xbr/vs_super-4xbr-3d-pass0.bin | Bin 427 -> 427 bytes .../xbr/super-xbr/vs_super-4xbr-3d-pass1.bin | Bin 427 -> 427 bytes .../xbr/super-xbr/vs_super-4xbr-3d-pass1f.bin | Bin 1427 -> 1427 bytes .../xbr/super-xbr/vs_super-4xbr-3d-pass2.bin | Bin 427 -> 427 bytes .../xbr/super-xbr/vs_super-4xbr-3d-pass3.bin | Bin 427 -> 427 bytes .../xbr/super-xbr/vs_super-4xbr-3d-pass3f.bin | Bin 1427 -> 1427 bytes .../xbr/super-xbr/vs_super-xbr-fast-pass0.bin | Bin 427 -> 427 bytes .../xbr/super-xbr/vs_super-xbr-fast-pass1.bin | Bin 427 -> 427 bytes .../xbr/super-xbr/vs_super-xbr-fast-pass2.bin | Bin 427 -> 427 bytes .../chains/xbr/super-xbr/vs_super-xbr-pass0.bin | Bin 1448 -> 1448 bytes .../chains/xbr/super-xbr/vs_super-xbr-pass1.bin | Bin 427 -> 427 bytes .../chains/xbr/super-xbr/vs_super-xbr-pass2.bin | Bin 1427 -> 1427 bytes .../chains/xbr/super-xbr/vs_super-xbr-pass3.bin | Bin 1427 -> 1427 bytes .../shaders/essl/chains/xbr/vs_xbr-lv1-noblend.bin | Bin 777 -> 777 bytes bgfx/shaders/essl/chains/xbr/vs_xbr-lv2-3d.bin | Bin 2152 -> 2152 bytes bgfx/shaders/essl/chains/xbr/vs_xbr-lv2-fast.bin | Bin 1190 -> 1190 bytes .../shaders/essl/chains/xbr/vs_xbr-lv2-noblend.bin | Bin 2099 -> 2099 bytes bgfx/shaders/essl/chains/xbr/vs_xbr-lv2.bin | Bin 2099 -> 2099 bytes .../shaders/essl/chains/xbr/vs_xbr-lv3-noblend.bin | Bin 2099 -> 2099 bytes bgfx/shaders/essl/chains/xbr/vs_xbr-lv3.bin | Bin 2099 -> 2099 bytes .../chains/xbr/xbr-hybrid/vs_2xbr-hybrid-sharp.bin | Bin 2099 -> 2099 bytes .../xbr/xbr-hybrid/vs_2xbr-hybrid-v2-gamma.bin | Bin 2099 -> 2099 bytes .../chains/xbr/xbr-hybrid/vs_2xbr-hybrid-v2.bin | Bin 2099 -> 2099 bytes .../xbr/xbr-hybrid/vs_2xbr-hybrid-v4-gamma.bin | Bin 2099 -> 2099 bytes .../chains/xbr/xbr-hybrid/vs_2xbr-hybrid-v4.bin | Bin 2099 -> 2099 bytes .../chains/xbr/xbr-hybrid/vs_2xbr-hybrid-v4b.bin | Bin 2099 -> 2099 bytes .../xbr/xbr-hybrid/vs_2xbr-hybrid-v5-gamma.bin | Bin 2099 -> 2099 bytes .../essl/chains/xbr/xbr-hybrid/vs_2xbr-hybrid.bin | Bin 2099 -> 2099 bytes .../xbr/xbr-lv2-multipass/vs_xbr-lv2-a-pass0.bin | Bin 2099 -> 2099 bytes .../vs_xbr-lv2-accuracy-pass0.bin | Bin 2099 -> 2099 bytes .../vs_xbr-lv2-accuracy-pass1.bin | Bin 923 -> 923 bytes .../xbr/xbr-lv2-multipass/vs_xbr-lv2-b-pass0.bin | Bin 2099 -> 2099 bytes .../xbr/xbr-lv2-multipass/vs_xbr-lv2-c-pass0.bin | Bin 2099 -> 2099 bytes .../xbr/xbr-lv2-multipass/vs_xbr-lv2-d-pass0.bin | Bin 2099 -> 2099 bytes .../xbr-lv2-multipass/vs_xbr-lv2-noblend-pass1.bin | Bin 923 -> 923 bytes .../xbr/xbr-lv2-multipass/vs_xbr-lv2-pass1.bin | Bin 923 -> 923 bytes .../xbr/xbr-lv3-multipass/vs_xbr-lv3-pass0.bin | Bin 2099 -> 2099 bytes .../xbr/xbr-lv3-multipass/vs_xbr-lv3-pass1.bin | Bin 987 -> 987 bytes .../xbr/xbr-mlv4-multipass/vs_xbr-mlv4-pass1.bin | Bin 555 -> 555 bytes .../xbr/xbr-mlv4-multipass/vs_xbr-mlv4-pass2.bin | Bin 2099 -> 2099 bytes .../xbr/xbr-mlv4-multipass/vs_xbr-mlv4-pass3.bin | Bin 708 -> 708 bytes .../xbr/xbr-mlv4-multipass/vs_xbr-mlv4-pass4.bin | Bin 708 -> 708 bytes bgfx/shaders/essl/vs_gui.bin | Bin 427 -> 427 bytes bgfx/shaders/essl/vs_screen.bin | Bin 427 -> 427 bytes bgfx/shaders/glsl/chains/blurs/vs_smart-blur.bin | Bin 1094 -> 1094 bytes bgfx/shaders/glsl/chains/crt-geom/vs_crt-geom.bin | Bin 4730 -> 4730 bytes bgfx/shaders/glsl/chains/crt-geom/vs_gaussx.bin | Bin 766 -> 766 bytes bgfx/shaders/glsl/chains/crt-geom/vs_gaussy.bin | Bin 766 -> 766 bytes bgfx/shaders/glsl/chains/crt-geom/vs_lowpass.bin | Bin 2632 -> 2632 bytes bgfx/shaders/glsl/chains/crt-geom/vs_mipmap8.bin | Bin 312 -> 312 bytes .../glsl/chains/crt-geom/vs_phosphor_apply.bin | Bin 312 -> 312 bytes .../glsl/chains/crt-geom/vs_phosphor_update.bin | Bin 312 -> 312 bytes bgfx/shaders/glsl/chains/crt/vs_crt-caligari.bin | Bin 675 -> 675 bytes bgfx/shaders/glsl/chains/default/vs_blit.bin | Bin 385 -> 385 bytes bgfx/shaders/glsl/chains/eagle/vs_eagle.bin | Bin 2261 -> 2261 bytes bgfx/shaders/glsl/chains/hlsl/vs_chroma.bin | Bin 385 -> 385 bytes bgfx/shaders/glsl/chains/hlsl/vs_color.bin | Bin 385 -> 385 bytes bgfx/shaders/glsl/chains/hlsl/vs_deconverge.bin | Bin 1392 -> 1392 bytes bgfx/shaders/glsl/chains/hlsl/vs_defocus.bin | Bin 385 -> 385 bytes bgfx/shaders/glsl/chains/hlsl/vs_distortion.bin | Bin 385 -> 385 bytes bgfx/shaders/glsl/chains/hlsl/vs_ntsc_decode.bin | Bin 385 -> 385 bytes bgfx/shaders/glsl/chains/hlsl/vs_ntsc_encode.bin | Bin 385 -> 385 bytes bgfx/shaders/glsl/chains/hlsl/vs_phosphor.bin | Bin 385 -> 385 bytes bgfx/shaders/glsl/chains/hlsl/vs_post.bin | Bin 385 -> 385 bytes bgfx/shaders/glsl/chains/hlsl/vs_prescale.bin | Bin 385 -> 385 bytes bgfx/shaders/glsl/chains/hlsl/vs_scanline.bin | Bin 385 -> 385 bytes bgfx/shaders/glsl/chains/hqx/vs_hq2x.bin | Bin 1094 -> 1094 bytes bgfx/shaders/glsl/chains/hqx/vs_hq3x.bin | Bin 1094 -> 1094 bytes bgfx/shaders/glsl/chains/hqx/vs_hq4x.bin | Bin 1094 -> 1094 bytes bgfx/shaders/glsl/chains/lcd-grid/vs_lcd-grid.bin | Bin 385 -> 385 bytes .../glsl/chains/lcd-grid/vs_persistence.bin | Bin 385 -> 385 bytes bgfx/shaders/glsl/chains/misc/vs_blit.bin | Bin 385 -> 385 bytes .../chains/misc/vs_bob-and-ghost-deinterlace.bin | Bin 385 -> 385 bytes .../glsl/chains/misc/vs_deposterize-pass0.bin | Bin 689 -> 689 bytes .../glsl/chains/misc/vs_deposterize-pass1.bin | Bin 689 -> 689 bytes bgfx/shaders/glsl/chains/misc/vs_lut.bin | Bin 385 -> 385 bytes bgfx/shaders/glsl/chains/misc/vs_saturation.bin | Bin 385 -> 385 bytes .../pillarbox_left_horizontal/vs_gaussian.bin | Bin 385 -> 385 bytes .../pillarbox_left_horizontal/vs_offset_sat.bin | Bin 424 -> 424 bytes .../chains/pillarbox_left_vertical/vs_gaussian.bin | Bin 385 -> 385 bytes .../pillarbox_left_vertical/vs_offset_sat.bin | Bin 429 -> 429 bytes .../pillarbox_right_horizontal/vs_gaussian.bin | Bin 385 -> 385 bytes .../pillarbox_right_horizontal/vs_offset_sat.bin | Bin 425 -> 425 bytes .../pillarbox_right_vertical/vs_gaussian.bin | Bin 385 -> 385 bytes .../pillarbox_right_vertical/vs_offset_sat.bin | Bin 435 -> 435 bytes bgfx/shaders/glsl/chains/unfiltered/vs_blit.bin | Bin 385 -> 385 bytes .../chains/warp/vs_dilation-horizontal-fast.bin | Bin 574 -> 574 bytes .../xbr/super-xbr/vs_custom-jinc2-sharper.bin | Bin 385 -> 385 bytes .../xbr/super-xbr/vs_super-2xbr-3d-pass0.bin | Bin 385 -> 385 bytes .../xbr/super-xbr/vs_super-2xbr-3d-pass1.bin | Bin 385 -> 385 bytes .../xbr/super-xbr/vs_super-2xbr-3d-pass2.bin | Bin 1313 -> 1313 bytes .../xbr/super-xbr/vs_super-4xbr-3d-pass0.bin | Bin 385 -> 385 bytes .../xbr/super-xbr/vs_super-4xbr-3d-pass1.bin | Bin 385 -> 385 bytes .../xbr/super-xbr/vs_super-4xbr-3d-pass1f.bin | Bin 1313 -> 1313 bytes .../xbr/super-xbr/vs_super-4xbr-3d-pass2.bin | Bin 385 -> 385 bytes .../xbr/super-xbr/vs_super-4xbr-3d-pass3.bin | Bin 385 -> 385 bytes .../xbr/super-xbr/vs_super-4xbr-3d-pass3f.bin | Bin 1313 -> 1313 bytes .../xbr/super-xbr/vs_super-xbr-fast-pass0.bin | Bin 385 -> 385 bytes .../xbr/super-xbr/vs_super-xbr-fast-pass1.bin | Bin 385 -> 385 bytes .../xbr/super-xbr/vs_super-xbr-fast-pass2.bin | Bin 385 -> 385 bytes .../chains/xbr/super-xbr/vs_super-xbr-pass0.bin | Bin 1334 -> 1334 bytes .../chains/xbr/super-xbr/vs_super-xbr-pass1.bin | Bin 385 -> 385 bytes .../chains/xbr/super-xbr/vs_super-xbr-pass2.bin | Bin 1313 -> 1313 bytes .../chains/xbr/super-xbr/vs_super-xbr-pass3.bin | Bin 1313 -> 1313 bytes .../shaders/glsl/chains/xbr/vs_xbr-lv1-noblend.bin | Bin 705 -> 705 bytes bgfx/shaders/glsl/chains/xbr/vs_xbr-lv2-3d.bin | Bin 1996 -> 1996 bytes bgfx/shaders/glsl/chains/xbr/vs_xbr-lv2-fast.bin | Bin 1094 -> 1094 bytes .../shaders/glsl/chains/xbr/vs_xbr-lv2-noblend.bin | Bin 1949 -> 1949 bytes bgfx/shaders/glsl/chains/xbr/vs_xbr-lv2.bin | Bin 1949 -> 1949 bytes .../shaders/glsl/chains/xbr/vs_xbr-lv3-noblend.bin | Bin 1949 -> 1949 bytes bgfx/shaders/glsl/chains/xbr/vs_xbr-lv3.bin | Bin 1949 -> 1949 bytes .../chains/xbr/xbr-hybrid/vs_2xbr-hybrid-sharp.bin | Bin 1949 -> 1949 bytes .../xbr/xbr-hybrid/vs_2xbr-hybrid-v2-gamma.bin | Bin 1949 -> 1949 bytes .../chains/xbr/xbr-hybrid/vs_2xbr-hybrid-v2.bin | Bin 1949 -> 1949 bytes .../xbr/xbr-hybrid/vs_2xbr-hybrid-v4-gamma.bin | Bin 1949 -> 1949 bytes .../chains/xbr/xbr-hybrid/vs_2xbr-hybrid-v4.bin | Bin 1949 -> 1949 bytes .../chains/xbr/xbr-hybrid/vs_2xbr-hybrid-v4b.bin | Bin 1949 -> 1949 bytes .../xbr/xbr-hybrid/vs_2xbr-hybrid-v5-gamma.bin | Bin 1949 -> 1949 bytes .../glsl/chains/xbr/xbr-hybrid/vs_2xbr-hybrid.bin | Bin 1949 -> 1949 bytes .../xbr/xbr-lv2-multipass/vs_xbr-lv2-a-pass0.bin | Bin 1949 -> 1949 bytes .../vs_xbr-lv2-accuracy-pass0.bin | Bin 1949 -> 1949 bytes .../vs_xbr-lv2-accuracy-pass1.bin | Bin 845 -> 845 bytes .../xbr/xbr-lv2-multipass/vs_xbr-lv2-b-pass0.bin | Bin 1949 -> 1949 bytes .../xbr/xbr-lv2-multipass/vs_xbr-lv2-c-pass0.bin | Bin 1949 -> 1949 bytes .../xbr/xbr-lv2-multipass/vs_xbr-lv2-d-pass0.bin | Bin 1949 -> 1949 bytes .../xbr-lv2-multipass/vs_xbr-lv2-noblend-pass1.bin | Bin 845 -> 845 bytes .../xbr/xbr-lv2-multipass/vs_xbr-lv2-pass1.bin | Bin 845 -> 845 bytes .../xbr/xbr-lv3-multipass/vs_xbr-lv3-pass0.bin | Bin 1949 -> 1949 bytes .../xbr/xbr-lv3-multipass/vs_xbr-lv3-pass1.bin | Bin 903 -> 903 bytes .../xbr/xbr-mlv4-multipass/vs_xbr-mlv4-pass1.bin | Bin 501 -> 501 bytes .../xbr/xbr-mlv4-multipass/vs_xbr-mlv4-pass2.bin | Bin 1949 -> 1949 bytes .../xbr/xbr-mlv4-multipass/vs_xbr-mlv4-pass3.bin | Bin 642 -> 642 bytes .../xbr/xbr-mlv4-multipass/vs_xbr-mlv4-pass4.bin | Bin 642 -> 642 bytes bgfx/shaders/glsl/vs_gui.bin | Bin 385 -> 385 bytes bgfx/shaders/glsl/vs_screen.bin | Bin 385 -> 385 bytes bgfx/shaders/metal/chains/blurs/fs_smart-blur.bin | Bin 2919 -> 2939 bytes .../metal/chains/crt-geom/fs_crt-geom-deluxe.bin | Bin 15960 -> 15906 bytes bgfx/shaders/metal/chains/crt-geom/fs_crt-geom.bin | Bin 12535 -> 12613 bytes bgfx/shaders/metal/chains/crt-geom/fs_gaussx.bin | Bin 3485 -> 3535 bytes bgfx/shaders/metal/chains/crt-geom/fs_gaussy.bin | Bin 3485 -> 3535 bytes bgfx/shaders/metal/chains/crt-geom/fs_lowpass.bin | Bin 4650 -> 4656 bytes bgfx/shaders/metal/chains/crt-geom/fs_mipmap8.bin | Bin 18279 -> 18204 bytes .../metal/chains/crt-geom/fs_phosphor_apply.bin | Bin 1711 -> 1711 bytes .../metal/chains/crt-geom/fs_phosphor_update.bin | Bin 2107 -> 2106 bytes bgfx/shaders/metal/chains/crt-geom/vs_crt-geom.bin | Bin 4154 -> 4134 bytes bgfx/shaders/metal/chains/crt-geom/vs_lowpass.bin | Bin 4327 -> 3457 bytes bgfx/shaders/metal/chains/crt/fs_crt-caligari.bin | Bin 2744 -> 2745 bytes bgfx/shaders/metal/chains/crt/vs_crt-caligari.bin | Bin 1214 -> 1061 bytes bgfx/shaders/metal/chains/eagle/fs_eagle.bin | Bin 11380 -> 11318 bytes bgfx/shaders/metal/chains/eagle/vs_eagle.bin | Bin 3943 -> 2372 bytes bgfx/shaders/metal/chains/hlsl/fs_chroma.bin | Bin 1797 -> 1741 bytes bgfx/shaders/metal/chains/hlsl/fs_color.bin | Bin 1317 -> 1318 bytes bgfx/shaders/metal/chains/hlsl/fs_defocus.bin | Bin 1938 -> 1906 bytes bgfx/shaders/metal/chains/hlsl/fs_distortion.bin | Bin 4626 -> 4478 bytes bgfx/shaders/metal/chains/hlsl/fs_ntsc_decode.bin | Bin 4769 -> 4599 bytes bgfx/shaders/metal/chains/hlsl/fs_ntsc_encode.bin | Bin 3231 -> 3230 bytes bgfx/shaders/metal/chains/hlsl/fs_post.bin | Bin 5209 -> 4865 bytes bgfx/shaders/metal/chains/hlsl/fs_scanline.bin | Bin 3113 -> 3030 bytes bgfx/shaders/metal/chains/hlsl/vs_deconverge.bin | Bin 2064 -> 2046 bytes bgfx/shaders/metal/chains/hqx/fs_hq2x.bin | Bin 8133 -> 8117 bytes bgfx/shaders/metal/chains/hqx/fs_hq3x.bin | Bin 8188 -> 8172 bytes bgfx/shaders/metal/chains/hqx/fs_hq4x.bin | Bin 8113 -> 8097 bytes bgfx/shaders/metal/chains/lcd-grid/fs_lcd-grid.bin | Bin 10120 -> 9976 bytes .../metal/chains/misc/fs_blit_palette16.bin | Bin 2007 -> 1815 bytes bgfx/shaders/metal/chains/misc/fs_blit_yuy16.bin | Bin 1923 -> 2036 bytes .../chains/misc/fs_bob-and-ghost-deinterlace.bin | Bin 1733 -> 1733 bytes bgfx/shaders/metal/chains/misc/fs_lut.bin | Bin 1434 -> 1490 bytes .../pillarbox_left_horizontal/fs_gaussian.bin | Bin 3335 -> 3354 bytes .../pillarbox_left_horizontal/vs_offset_sat.bin | Bin 944 -> 945 bytes .../chains/pillarbox_left_vertical/fs_gaussian.bin | Bin 3335 -> 3354 bytes .../pillarbox_left_vertical/vs_offset_sat.bin | Bin 942 -> 943 bytes .../pillarbox_right_horizontal/fs_gaussian.bin | Bin 3335 -> 3354 bytes .../pillarbox_right_horizontal/vs_offset_sat.bin | Bin 950 -> 951 bytes .../pillarbox_right_vertical/fs_gaussian.bin | Bin 3335 -> 3354 bytes .../pillarbox_right_vertical/vs_offset_sat.bin | Bin 971 -> 972 bytes .../chains/warp/fs_dilation-horizontal-fast.bin | Bin 820 -> 818 bytes .../metal/chains/xbr/fs_xbr-lv1-noblend.bin | Bin 4547 -> 4785 bytes bgfx/shaders/metal/chains/xbr/fs_xbr-lv2-3d.bin | Bin 8137 -> 7968 bytes bgfx/shaders/metal/chains/xbr/fs_xbr-lv2-fast.bin | Bin 4660 -> 4471 bytes .../metal/chains/xbr/fs_xbr-lv2-noblend.bin | Bin 5602 -> 5462 bytes bgfx/shaders/metal/chains/xbr/fs_xbr-lv2.bin | Bin 6071 -> 5902 bytes .../metal/chains/xbr/fs_xbr-lv3-noblend.bin | Bin 7543 -> 7114 bytes bgfx/shaders/metal/chains/xbr/fs_xbr-lv3.bin | Bin 10102 -> 9531 bytes .../xbr/super-xbr/fs_custom-jinc2-sharper.bin | Bin 5447 -> 5805 bytes .../xbr/super-xbr/fs_super-2xbr-3d-pass0.bin | Bin 7161 -> 7199 bytes .../xbr/super-xbr/fs_super-2xbr-3d-pass1.bin | Bin 7532 -> 7580 bytes .../xbr/super-xbr/fs_super-2xbr-3d-pass2.bin | Bin 6799 -> 6841 bytes .../xbr/super-xbr/fs_super-4xbr-3d-pass0.bin | Bin 7163 -> 7201 bytes .../xbr/super-xbr/fs_super-4xbr-3d-pass1.bin | Bin 7522 -> 7570 bytes .../xbr/super-xbr/fs_super-4xbr-3d-pass1f.bin | Bin 6788 -> 6830 bytes .../xbr/super-xbr/fs_super-4xbr-3d-pass2.bin | Bin 7161 -> 7199 bytes .../xbr/super-xbr/fs_super-4xbr-3d-pass3.bin | Bin 7520 -> 7568 bytes .../xbr/super-xbr/fs_super-4xbr-3d-pass3f.bin | Bin 6787 -> 6829 bytes .../xbr/super-xbr/fs_super-xbr-fast-pass0.bin | Bin 5089 -> 5105 bytes .../xbr/super-xbr/fs_super-xbr-fast-pass1.bin | Bin 4869 -> 4895 bytes .../xbr/super-xbr/fs_super-xbr-fast-pass2.bin | Bin 4536 -> 4550 bytes .../chains/xbr/super-xbr/fs_super-xbr-pass0.bin | Bin 5337 -> 5341 bytes .../chains/xbr/super-xbr/fs_super-xbr-pass1.bin | Bin 6754 -> 6772 bytes .../chains/xbr/super-xbr/fs_super-xbr-pass2.bin | Bin 5167 -> 5183 bytes .../metal/chains/xbr/vs_xbr-lv1-noblend.bin | Bin 1223 -> 1070 bytes .../chains/xbr/xbr-hybrid/fs_2xbr-hybrid-sharp.bin | Bin 16386 -> 16011 bytes .../xbr/xbr-hybrid/fs_2xbr-hybrid-v2-gamma.bin | Bin 8185 -> 7802 bytes .../chains/xbr/xbr-hybrid/fs_2xbr-hybrid-v2.bin | Bin 8028 -> 7645 bytes .../xbr/xbr-hybrid/fs_2xbr-hybrid-v4-gamma.bin | Bin 9749 -> 9206 bytes .../chains/xbr/xbr-hybrid/fs_2xbr-hybrid-v4.bin | Bin 9310 -> 8853 bytes .../chains/xbr/xbr-hybrid/fs_2xbr-hybrid-v4b.bin | Bin 9096 -> 8617 bytes .../xbr/xbr-hybrid/fs_2xbr-hybrid-v5-gamma.bin | Bin 9899 -> 9520 bytes .../metal/chains/xbr/xbr-hybrid/fs_2xbr-hybrid.bin | Bin 16342 -> 15967 bytes .../xbr/xbr-lv2-multipass/fs_xbr-lv2-a-pass0.bin | Bin 3676 -> 3368 bytes .../fs_xbr-lv2-accuracy-pass0.bin | Bin 13828 -> 14206 bytes .../fs_xbr-lv2-accuracy-pass1.bin | Bin 6195 -> 5690 bytes .../xbr/xbr-lv2-multipass/fs_xbr-lv2-b-pass0.bin | Bin 3947 -> 3610 bytes .../xbr/xbr-lv2-multipass/fs_xbr-lv2-c-pass0.bin | Bin 4301 -> 3986 bytes .../xbr/xbr-lv2-multipass/fs_xbr-lv2-d-pass0.bin | Bin 4383 -> 3854 bytes .../xbr-lv2-multipass/fs_xbr-lv2-noblend-pass1.bin | Bin 4421 -> 3959 bytes .../xbr/xbr-lv2-multipass/fs_xbr-lv2-pass1.bin | Bin 5136 -> 4648 bytes .../xbr/xbr-lv3-multipass/fs_xbr-lv3-pass0.bin | Bin 16852 -> 16171 bytes .../xbr/xbr-lv3-multipass/fs_xbr-lv3-pass1.bin | Bin 5624 -> 5575 bytes .../xbr/xbr-mlv4-multipass/fs_xbr-mlv4-pass1.bin | Bin 12120 -> 11490 bytes .../xbr/xbr-mlv4-multipass/fs_xbr-mlv4-pass2.bin | Bin 6985 -> 6349 bytes .../xbr/xbr-mlv4-multipass/fs_xbr-mlv4-pass3.bin | Bin 7618 -> 6581 bytes .../xbr/xbr-mlv4-multipass/fs_xbr-mlv4-pass4.bin | Bin 7036 -> 6087 bytes bgfx/shaders/spirv/chains/blurs/fs_smart-blur.bin | Bin 5391 -> 5203 bytes bgfx/shaders/spirv/chains/blurs/vs_smart-blur.bin | Bin 2083 -> 2083 bytes .../spirv/chains/crt-geom/fs_crt-geom-deluxe.bin | Bin 24660 -> 24512 bytes bgfx/shaders/spirv/chains/crt-geom/fs_crt-geom.bin | Bin 19259 -> 19139 bytes bgfx/shaders/spirv/chains/crt-geom/fs_gaussx.bin | Bin 7294 -> 7106 bytes bgfx/shaders/spirv/chains/crt-geom/fs_gaussy.bin | Bin 7310 -> 7122 bytes bgfx/shaders/spirv/chains/crt-geom/fs_lowpass.bin | Bin 7779 -> 7607 bytes bgfx/shaders/spirv/chains/crt-geom/fs_mipmap8.bin | Bin 25947 -> 25863 bytes .../spirv/chains/crt-geom/fs_phosphor_apply.bin | Bin 3094 -> 3002 bytes .../spirv/chains/crt-geom/fs_phosphor_update.bin | Bin 3495 -> 3395 bytes bgfx/shaders/spirv/chains/crt-geom/vs_crt-geom.bin | Bin 8384 -> 8328 bytes bgfx/shaders/spirv/chains/crt-geom/vs_gaussx.bin | Bin 2224 -> 2152 bytes bgfx/shaders/spirv/chains/crt-geom/vs_gaussy.bin | Bin 2240 -> 2168 bytes bgfx/shaders/spirv/chains/crt-geom/vs_lowpass.bin | Bin 4700 -> 4424 bytes bgfx/shaders/spirv/chains/crt-geom/vs_mipmap8.bin | Bin 1157 -> 1085 bytes .../spirv/chains/crt-geom/vs_phosphor_apply.bin | Bin 1157 -> 1085 bytes .../spirv/chains/crt-geom/vs_phosphor_update.bin | Bin 1157 -> 1085 bytes bgfx/shaders/spirv/chains/crt/fs_crt-caligari.bin | Bin 4656 -> 4548 bytes bgfx/shaders/spirv/chains/crt/vs_crt-caligari.bin | Bin 1745 -> 1649 bytes bgfx/shaders/spirv/chains/default/fs_blit.bin | Bin 910 -> 850 bytes bgfx/shaders/spirv/chains/default/vs_blit.bin | Bin 1257 -> 1257 bytes bgfx/shaders/spirv/chains/eagle/fs_eagle.bin | Bin 9068 -> 8904 bytes bgfx/shaders/spirv/chains/eagle/vs_eagle.bin | Bin 4355 -> 3879 bytes bgfx/shaders/spirv/chains/hlsl/fs_chroma.bin | Bin 3156 -> 3096 bytes bgfx/shaders/spirv/chains/hlsl/fs_color.bin | Bin 2459 -> 2319 bytes bgfx/shaders/spirv/chains/hlsl/fs_deconverge.bin | Bin 1354 -> 1294 bytes bgfx/shaders/spirv/chains/hlsl/fs_defocus.bin | Bin 2446 -> 2322 bytes bgfx/shaders/spirv/chains/hlsl/fs_distortion.bin | Bin 7738 -> 7594 bytes bgfx/shaders/spirv/chains/hlsl/fs_ntsc_decode.bin | Bin 7320 -> 7204 bytes bgfx/shaders/spirv/chains/hlsl/fs_ntsc_encode.bin | Bin 3805 -> 3617 bytes bgfx/shaders/spirv/chains/hlsl/fs_phosphor.bin | Bin 1940 -> 1808 bytes bgfx/shaders/spirv/chains/hlsl/fs_post.bin | Bin 7919 -> 7851 bytes bgfx/shaders/spirv/chains/hlsl/fs_prescale.bin | Bin 956 -> 896 bytes bgfx/shaders/spirv/chains/hlsl/fs_scanline.bin | Bin 5375 -> 5259 bytes bgfx/shaders/spirv/chains/hlsl/vs_chroma.bin | Bin 1257 -> 1257 bytes bgfx/shaders/spirv/chains/hlsl/vs_color.bin | Bin 1257 -> 1257 bytes bgfx/shaders/spirv/chains/hlsl/vs_deconverge.bin | Bin 3294 -> 3246 bytes bgfx/shaders/spirv/chains/hlsl/vs_defocus.bin | Bin 1257 -> 1257 bytes bgfx/shaders/spirv/chains/hlsl/vs_distortion.bin | Bin 1257 -> 1257 bytes bgfx/shaders/spirv/chains/hlsl/vs_ntsc_decode.bin | Bin 1257 -> 1257 bytes bgfx/shaders/spirv/chains/hlsl/vs_ntsc_encode.bin | Bin 1257 -> 1257 bytes bgfx/shaders/spirv/chains/hlsl/vs_phosphor.bin | Bin 1257 -> 1257 bytes bgfx/shaders/spirv/chains/hlsl/vs_post.bin | Bin 1257 -> 1257 bytes bgfx/shaders/spirv/chains/hlsl/vs_prescale.bin | Bin 1257 -> 1257 bytes bgfx/shaders/spirv/chains/hlsl/vs_scanline.bin | Bin 1257 -> 1257 bytes bgfx/shaders/spirv/chains/hqx/fs_hq2x.bin | Bin 12130 -> 11934 bytes bgfx/shaders/spirv/chains/hqx/fs_hq3x.bin | Bin 12162 -> 11966 bytes bgfx/shaders/spirv/chains/hqx/fs_hq4x.bin | Bin 12098 -> 11902 bytes bgfx/shaders/spirv/chains/hqx/vs_hq2x.bin | Bin 2083 -> 2083 bytes bgfx/shaders/spirv/chains/hqx/vs_hq3x.bin | Bin 2083 -> 2083 bytes bgfx/shaders/spirv/chains/hqx/vs_hq4x.bin | Bin 2083 -> 2083 bytes bgfx/shaders/spirv/chains/lcd-grid/fs_lcd-grid.bin | Bin 14483 -> 13747 bytes .../spirv/chains/lcd-grid/fs_persistence.bin | Bin 1500 -> 1368 bytes bgfx/shaders/spirv/chains/lcd-grid/vs_lcd-grid.bin | Bin 1257 -> 1257 bytes .../spirv/chains/lcd-grid/vs_persistence.bin | Bin 1257 -> 1257 bytes bgfx/shaders/spirv/chains/misc/fs_blit.bin | Bin 910 -> 850 bytes bgfx/shaders/spirv/chains/misc/fs_blit_bcg.bin | Bin 2072 -> 2012 bytes .../spirv/chains/misc/fs_blit_palette16.bin | Bin 3392 -> 3216 bytes bgfx/shaders/spirv/chains/misc/fs_blit_rgb32.bin | Bin 1014 -> 954 bytes bgfx/shaders/spirv/chains/misc/fs_blit_yuy16.bin | Bin 2950 -> 2890 bytes .../chains/misc/fs_bob-and-ghost-deinterlace.bin | Bin 2833 -> 2709 bytes .../spirv/chains/misc/fs_deposterize-pass0.bin | Bin 2586 -> 2398 bytes .../spirv/chains/misc/fs_deposterize-pass1.bin | Bin 2586 -> 2398 bytes bgfx/shaders/spirv/chains/misc/fs_lut.bin | Bin 2464 -> 2424 bytes bgfx/shaders/spirv/chains/misc/fs_saturation.bin | Bin 1545 -> 1413 bytes bgfx/shaders/spirv/chains/misc/vs_blit.bin | Bin 1257 -> 1257 bytes .../chains/misc/vs_bob-and-ghost-deinterlace.bin | Bin 1257 -> 1257 bytes .../spirv/chains/misc/vs_deposterize-pass0.bin | Bin 1727 -> 1727 bytes .../spirv/chains/misc/vs_deposterize-pass1.bin | Bin 1727 -> 1727 bytes bgfx/shaders/spirv/chains/misc/vs_lut.bin | Bin 1257 -> 1257 bytes bgfx/shaders/spirv/chains/misc/vs_saturation.bin | Bin 1257 -> 1257 bytes .../pillarbox_left_horizontal/fs_gaussian.bin | Bin 4985 -> 4785 bytes .../pillarbox_left_horizontal/fs_offset_sat.bin | Bin 1545 -> 1413 bytes .../pillarbox_left_horizontal/vs_gaussian.bin | Bin 1257 -> 1257 bytes .../pillarbox_left_horizontal/vs_offset_sat.bin | Bin 1385 -> 1377 bytes .../chains/pillarbox_left_vertical/fs_gaussian.bin | Bin 4985 -> 4785 bytes .../pillarbox_left_vertical/fs_offset_sat.bin | Bin 1545 -> 1413 bytes .../chains/pillarbox_left_vertical/vs_gaussian.bin | Bin 1257 -> 1257 bytes .../pillarbox_left_vertical/vs_offset_sat.bin | Bin 1385 -> 1377 bytes .../pillarbox_right_horizontal/fs_gaussian.bin | Bin 4985 -> 4785 bytes .../pillarbox_right_horizontal/fs_offset_sat.bin | Bin 1545 -> 1413 bytes .../pillarbox_right_horizontal/vs_gaussian.bin | Bin 1257 -> 1257 bytes .../pillarbox_right_horizontal/vs_offset_sat.bin | Bin 1401 -> 1393 bytes .../pillarbox_right_vertical/fs_gaussian.bin | Bin 4985 -> 4785 bytes .../pillarbox_right_vertical/fs_offset_sat.bin | Bin 1545 -> 1413 bytes .../pillarbox_right_vertical/vs_gaussian.bin | Bin 1257 -> 1257 bytes .../pillarbox_right_vertical/vs_offset_sat.bin | Bin 1401 -> 1393 bytes bgfx/shaders/spirv/chains/unfiltered/fs_blit.bin | Bin 910 -> 850 bytes bgfx/shaders/spirv/chains/unfiltered/vs_blit.bin | Bin 1257 -> 1257 bytes .../chains/warp/fs_dilation-horizontal-fast.bin | Bin 1506 -> 1374 bytes .../chains/warp/vs_dilation-horizontal-fast.bin | Bin 1619 -> 1619 bytes .../spirv/chains/xbr/fs_xbr-lv1-noblend.bin | Bin 6970 -> 7110 bytes bgfx/shaders/spirv/chains/xbr/fs_xbr-lv2-3d.bin | Bin 14834 -> 14694 bytes bgfx/shaders/spirv/chains/xbr/fs_xbr-lv2-fast.bin | Bin 8456 -> 8332 bytes .../spirv/chains/xbr/fs_xbr-lv2-noblend.bin | Bin 9225 -> 9093 bytes bgfx/shaders/spirv/chains/xbr/fs_xbr-lv2.bin | Bin 10992 -> 10852 bytes .../spirv/chains/xbr/fs_xbr-lv3-noblend.bin | Bin 13289 -> 13117 bytes bgfx/shaders/spirv/chains/xbr/fs_xbr-lv3.bin | Bin 14076 -> 13984 bytes .../xbr/super-xbr/fs_custom-jinc2-sharper.bin | Bin 8391 -> 8619 bytes .../xbr/super-xbr/fs_super-2xbr-3d-pass0.bin | Bin 10436 -> 10224 bytes .../xbr/super-xbr/fs_super-2xbr-3d-pass1.bin | Bin 10143 -> 9947 bytes .../xbr/super-xbr/fs_super-2xbr-3d-pass2.bin | Bin 9539 -> 9375 bytes .../xbr/super-xbr/fs_super-4xbr-3d-pass0.bin | Bin 10472 -> 10260 bytes .../xbr/super-xbr/fs_super-4xbr-3d-pass1.bin | Bin 10543 -> 10347 bytes .../xbr/super-xbr/fs_super-4xbr-3d-pass1f.bin | Bin 9939 -> 9775 bytes .../xbr/super-xbr/fs_super-4xbr-3d-pass2.bin | Bin 10436 -> 10224 bytes .../xbr/super-xbr/fs_super-4xbr-3d-pass3.bin | Bin 10523 -> 10327 bytes .../xbr/super-xbr/fs_super-4xbr-3d-pass3f.bin | Bin 9919 -> 9755 bytes .../xbr/super-xbr/fs_super-xbr-fast-pass0.bin | Bin 6628 -> 6448 bytes .../xbr/super-xbr/fs_super-xbr-fast-pass1.bin | Bin 6468 -> 6304 bytes .../xbr/super-xbr/fs_super-xbr-fast-pass2.bin | Bin 6208 -> 6044 bytes .../chains/xbr/super-xbr/fs_super-xbr-pass0.bin | Bin 7754 -> 7486 bytes .../chains/xbr/super-xbr/fs_super-xbr-pass1.bin | Bin 8875 -> 8679 bytes .../chains/xbr/super-xbr/fs_super-xbr-pass2.bin | Bin 7274 -> 7038 bytes .../xbr/super-xbr/vs_custom-jinc2-sharper.bin | Bin 1257 -> 1257 bytes .../xbr/super-xbr/vs_super-2xbr-3d-pass0.bin | Bin 1257 -> 1257 bytes .../xbr/super-xbr/vs_super-2xbr-3d-pass1.bin | Bin 1257 -> 1257 bytes .../xbr/super-xbr/vs_super-2xbr-3d-pass2.bin | Bin 2351 -> 2351 bytes .../xbr/super-xbr/vs_super-4xbr-3d-pass0.bin | Bin 1257 -> 1257 bytes .../xbr/super-xbr/vs_super-4xbr-3d-pass1.bin | Bin 1257 -> 1257 bytes .../xbr/super-xbr/vs_super-4xbr-3d-pass1f.bin | Bin 2351 -> 2351 bytes .../xbr/super-xbr/vs_super-4xbr-3d-pass2.bin | Bin 1257 -> 1257 bytes .../xbr/super-xbr/vs_super-4xbr-3d-pass3.bin | Bin 1257 -> 1257 bytes .../xbr/super-xbr/vs_super-4xbr-3d-pass3f.bin | Bin 2351 -> 2351 bytes .../xbr/super-xbr/vs_super-xbr-fast-pass0.bin | Bin 1257 -> 1257 bytes .../xbr/super-xbr/vs_super-xbr-fast-pass1.bin | Bin 1257 -> 1257 bytes .../xbr/super-xbr/vs_super-xbr-fast-pass2.bin | Bin 1257 -> 1257 bytes .../chains/xbr/super-xbr/vs_super-xbr-pass0.bin | Bin 2351 -> 2351 bytes .../chains/xbr/super-xbr/vs_super-xbr-pass1.bin | Bin 1257 -> 1257 bytes .../chains/xbr/super-xbr/vs_super-xbr-pass2.bin | Bin 2351 -> 2351 bytes .../chains/xbr/super-xbr/vs_super-xbr-pass3.bin | Bin 2351 -> 2351 bytes .../spirv/chains/xbr/vs_xbr-lv1-noblend.bin | Bin 1747 -> 1651 bytes bgfx/shaders/spirv/chains/xbr/vs_xbr-lv2-3d.bin | Bin 3069 -> 3069 bytes bgfx/shaders/spirv/chains/xbr/vs_xbr-lv2-fast.bin | Bin 2083 -> 2083 bytes .../spirv/chains/xbr/vs_xbr-lv2-noblend.bin | Bin 2947 -> 2947 bytes bgfx/shaders/spirv/chains/xbr/vs_xbr-lv2.bin | Bin 2947 -> 2947 bytes .../spirv/chains/xbr/vs_xbr-lv3-noblend.bin | Bin 2947 -> 2947 bytes bgfx/shaders/spirv/chains/xbr/vs_xbr-lv3.bin | Bin 2947 -> 2947 bytes .../chains/xbr/xbr-hybrid/fs_2xbr-hybrid-sharp.bin | Bin 16480 -> 16340 bytes .../xbr/xbr-hybrid/fs_2xbr-hybrid-v2-gamma.bin | Bin 11884 -> 11752 bytes .../chains/xbr/xbr-hybrid/fs_2xbr-hybrid-v2.bin | Bin 11688 -> 11556 bytes .../xbr/xbr-hybrid/fs_2xbr-hybrid-v4-gamma.bin | Bin 13216 -> 13084 bytes .../chains/xbr/xbr-hybrid/fs_2xbr-hybrid-v4.bin | Bin 12788 -> 12656 bytes .../chains/xbr/xbr-hybrid/fs_2xbr-hybrid-v4b.bin | Bin 12356 -> 12240 bytes .../xbr/xbr-hybrid/fs_2xbr-hybrid-v5-gamma.bin | Bin 12840 -> 12708 bytes .../spirv/chains/xbr/xbr-hybrid/fs_2xbr-hybrid.bin | Bin 16880 -> 16740 bytes .../chains/xbr/xbr-hybrid/vs_2xbr-hybrid-sharp.bin | Bin 2947 -> 2947 bytes .../xbr/xbr-hybrid/vs_2xbr-hybrid-v2-gamma.bin | Bin 2947 -> 2947 bytes .../chains/xbr/xbr-hybrid/vs_2xbr-hybrid-v2.bin | Bin 2947 -> 2947 bytes .../xbr/xbr-hybrid/vs_2xbr-hybrid-v4-gamma.bin | Bin 2947 -> 2947 bytes .../chains/xbr/xbr-hybrid/vs_2xbr-hybrid-v4.bin | Bin 2947 -> 2947 bytes .../chains/xbr/xbr-hybrid/vs_2xbr-hybrid-v4b.bin | Bin 2947 -> 2947 bytes .../xbr/xbr-hybrid/vs_2xbr-hybrid-v5-gamma.bin | Bin 2947 -> 2947 bytes .../spirv/chains/xbr/xbr-hybrid/vs_2xbr-hybrid.bin | Bin 2947 -> 2947 bytes .../xbr/xbr-lv2-multipass/fs_xbr-lv2-a-pass0.bin | Bin 5334 -> 5086 bytes .../fs_xbr-lv2-accuracy-pass0.bin | Bin 20911 -> 21923 bytes .../fs_xbr-lv2-accuracy-pass1.bin | Bin 9235 -> 9131 bytes .../xbr/xbr-lv2-multipass/fs_xbr-lv2-b-pass0.bin | Bin 5814 -> 5558 bytes .../xbr/xbr-lv2-multipass/fs_xbr-lv2-c-pass0.bin | Bin 6598 -> 6326 bytes .../xbr/xbr-lv2-multipass/fs_xbr-lv2-d-pass0.bin | Bin 6398 -> 6126 bytes .../xbr-lv2-multipass/fs_xbr-lv2-noblend-pass1.bin | Bin 6895 -> 6635 bytes .../xbr/xbr-lv2-multipass/fs_xbr-lv2-pass1.bin | Bin 7289 -> 7029 bytes .../xbr/xbr-lv2-multipass/vs_xbr-lv2-a-pass0.bin | Bin 2947 -> 2947 bytes .../vs_xbr-lv2-accuracy-pass0.bin | Bin 2947 -> 2947 bytes .../vs_xbr-lv2-accuracy-pass1.bin | Bin 1879 -> 1879 bytes .../xbr/xbr-lv2-multipass/vs_xbr-lv2-b-pass0.bin | Bin 2947 -> 2947 bytes .../xbr/xbr-lv2-multipass/vs_xbr-lv2-c-pass0.bin | Bin 2947 -> 2947 bytes .../xbr/xbr-lv2-multipass/vs_xbr-lv2-d-pass0.bin | Bin 2947 -> 2947 bytes .../xbr-lv2-multipass/vs_xbr-lv2-noblend-pass1.bin | Bin 1879 -> 1879 bytes .../xbr/xbr-lv2-multipass/vs_xbr-lv2-pass1.bin | Bin 1879 -> 1879 bytes .../xbr/xbr-lv3-multipass/fs_xbr-lv3-pass0.bin | Bin 15198 -> 14986 bytes .../xbr/xbr-lv3-multipass/fs_xbr-lv3-pass1.bin | Bin 8399 -> 8411 bytes .../xbr/xbr-lv3-multipass/vs_xbr-lv3-pass0.bin | Bin 2947 -> 2947 bytes .../xbr/xbr-lv3-multipass/vs_xbr-lv3-pass1.bin | Bin 2111 -> 2111 bytes .../xbr/xbr-mlv4-multipass/fs_xbr-mlv4-pass1.bin | Bin 16730 -> 16278 bytes .../xbr/xbr-mlv4-multipass/fs_xbr-mlv4-pass2.bin | Bin 10345 -> 9817 bytes .../xbr/xbr-mlv4-multipass/fs_xbr-mlv4-pass3.bin | Bin 7851 -> 7591 bytes .../xbr/xbr-mlv4-multipass/fs_xbr-mlv4-pass4.bin | Bin 10511 -> 10159 bytes .../xbr/xbr-mlv4-multipass/vs_xbr-mlv4-pass1.bin | Bin 1567 -> 1567 bytes .../xbr/xbr-mlv4-multipass/vs_xbr-mlv4-pass2.bin | Bin 2947 -> 2947 bytes .../xbr/xbr-mlv4-multipass/vs_xbr-mlv4-pass3.bin | Bin 1619 -> 1619 bytes .../xbr/xbr-mlv4-multipass/vs_xbr-mlv4-pass4.bin | Bin 1619 -> 1619 bytes bgfx/shaders/spirv/fs_gui.bin | Bin 910 -> 850 bytes bgfx/shaders/spirv/fs_screen.bin | Bin 910 -> 850 bytes bgfx/shaders/spirv/vs_gui.bin | Bin 1257 -> 1257 bytes bgfx/shaders/spirv/vs_screen.bin | Bin 1257 -> 1257 bytes scripts/src/3rdparty.lua | 65 +- scripts/src/osd/modules.lua | 1 + scripts/src/osd/sdl.lua | 1 + src/osd/modules/debugger/debugimgui.cpp | 119 +- src/osd/modules/render/bgfx/chainmanager.cpp | 3 +- src/osd/modules/render/bgfx/effectmanager.cpp | 3 +- src/osd/modules/render/bgfx/shadermanager.cpp | 6 +- 3714 files changed, 253128 insertions(+), 308698 deletions(-) delete mode 100644 3rdparty/bgfx/.appveyor.yml create mode 100644 3rdparty/bgfx/.github/ISSUE_TEMPLATE/bug_report.md create mode 100644 3rdparty/bgfx/.github/workflows/main.yml create mode 100644 3rdparty/bgfx/3rdparty/dear-imgui/LICENSE.txt create mode 100644 3rdparty/bgfx/3rdparty/directx-headers/LICENSE create mode 100644 3rdparty/bgfx/3rdparty/directx-headers/include/directx/PIXEventsCommon.h create mode 100644 3rdparty/bgfx/3rdparty/directx-headers/include/directx/PIXEventsGenerated.h create mode 100644 3rdparty/bgfx/3rdparty/directx-headers/include/directx/d3d10.h create mode 100644 3rdparty/bgfx/3rdparty/directx-headers/include/directx/d3d10_1.h create mode 100644 3rdparty/bgfx/3rdparty/directx-headers/include/directx/d3d10_1shader.h create mode 100644 3rdparty/bgfx/3rdparty/directx-headers/include/directx/d3d10effect.h create mode 100644 3rdparty/bgfx/3rdparty/directx-headers/include/directx/d3d10misc.h create mode 100644 3rdparty/bgfx/3rdparty/directx-headers/include/directx/d3d10sdklayers.h create mode 100644 3rdparty/bgfx/3rdparty/directx-headers/include/directx/d3d10shader.h create mode 100644 3rdparty/bgfx/3rdparty/directx-headers/include/directx/d3d11.h create mode 100644 3rdparty/bgfx/3rdparty/directx-headers/include/directx/d3d11_1.h create mode 100644 3rdparty/bgfx/3rdparty/directx-headers/include/directx/d3d11_2.h create mode 100644 3rdparty/bgfx/3rdparty/directx-headers/include/directx/d3d11_3.h create mode 100644 3rdparty/bgfx/3rdparty/directx-headers/include/directx/d3d11_4.h create mode 100644 3rdparty/bgfx/3rdparty/directx-headers/include/directx/d3d11sdklayers.h create mode 100644 3rdparty/bgfx/3rdparty/directx-headers/include/directx/d3d11shader.h create mode 100644 3rdparty/bgfx/3rdparty/directx-headers/include/directx/d3d11shadertracing.h create mode 100644 3rdparty/bgfx/3rdparty/directx-headers/include/directx/d3d12.h create mode 100644 3rdparty/bgfx/3rdparty/directx-headers/include/directx/d3d12compatibility.h create mode 100644 3rdparty/bgfx/3rdparty/directx-headers/include/directx/d3d12sdklayers.h create mode 100644 3rdparty/bgfx/3rdparty/directx-headers/include/directx/d3d12shader.h create mode 100644 3rdparty/bgfx/3rdparty/directx-headers/include/directx/d3d12video.h create mode 100644 3rdparty/bgfx/3rdparty/directx-headers/include/directx/d3d9.h create mode 100644 3rdparty/bgfx/3rdparty/directx-headers/include/directx/d3d9caps.h create mode 100644 3rdparty/bgfx/3rdparty/directx-headers/include/directx/d3d9types.h create mode 100644 3rdparty/bgfx/3rdparty/directx-headers/include/directx/d3dcommon.h create mode 100644 3rdparty/bgfx/3rdparty/directx-headers/include/directx/d3dcompiler.h create mode 100644 3rdparty/bgfx/3rdparty/directx-headers/include/directx/dxcore.h create mode 100644 3rdparty/bgfx/3rdparty/directx-headers/include/directx/dxcore_interface.h create mode 100644 3rdparty/bgfx/3rdparty/directx-headers/include/directx/dxgi.h create mode 100644 3rdparty/bgfx/3rdparty/directx-headers/include/directx/dxgi1_2.h create mode 100644 3rdparty/bgfx/3rdparty/directx-headers/include/directx/dxgi1_3.h create mode 100644 3rdparty/bgfx/3rdparty/directx-headers/include/directx/dxgi1_4.h create mode 100644 3rdparty/bgfx/3rdparty/directx-headers/include/directx/dxgi1_5.h create mode 100644 3rdparty/bgfx/3rdparty/directx-headers/include/directx/dxgi1_6.h create mode 100644 3rdparty/bgfx/3rdparty/directx-headers/include/directx/dxgicommon.h create mode 100644 3rdparty/bgfx/3rdparty/directx-headers/include/directx/dxgidebug.h create mode 100644 3rdparty/bgfx/3rdparty/directx-headers/include/directx/dxgiformat.h create mode 100644 3rdparty/bgfx/3rdparty/directx-headers/include/directx/dxgitype.h create mode 100644 3rdparty/bgfx/3rdparty/directx-headers/include/directx/dxva2api.h create mode 100644 3rdparty/bgfx/3rdparty/directx-headers/include/directx/pix3.h create mode 100644 3rdparty/bgfx/3rdparty/directx-headers/include/directx/pix3_win.h create mode 100644 3rdparty/bgfx/3rdparty/directx-headers/include/directx/winapifamily.h create mode 100644 3rdparty/bgfx/3rdparty/directx-headers/include/wsl/stubs/basetsd.h create mode 100644 3rdparty/bgfx/3rdparty/directx-headers/include/wsl/stubs/oaidl.h create mode 100644 3rdparty/bgfx/3rdparty/directx-headers/include/wsl/stubs/objbase.h create mode 100644 3rdparty/bgfx/3rdparty/directx-headers/include/wsl/stubs/ocidl.h create mode 100644 3rdparty/bgfx/3rdparty/directx-headers/include/wsl/stubs/rpc.h create mode 100644 3rdparty/bgfx/3rdparty/directx-headers/include/wsl/stubs/rpcndr.h create mode 100644 3rdparty/bgfx/3rdparty/directx-headers/include/wsl/stubs/unknwn.h create mode 100644 3rdparty/bgfx/3rdparty/directx-headers/include/wsl/stubs/unknwnbase.h create mode 100644 3rdparty/bgfx/3rdparty/directx-headers/include/wsl/stubs/winapifamily.h create mode 100644 3rdparty/bgfx/3rdparty/directx-headers/include/wsl/stubs/windows.h create mode 100644 3rdparty/bgfx/3rdparty/directx-headers/include/wsl/stubs/wrl/client.h create mode 100644 3rdparty/bgfx/3rdparty/directx-headers/include/wsl/stubs/wrl/implements.h create mode 100644 3rdparty/bgfx/3rdparty/directx-headers/include/wsl/winadapter.h create mode 100644 3rdparty/bgfx/3rdparty/directx-headers/include/wsl/wrladapter.h delete mode 100644 3rdparty/bgfx/3rdparty/dxsdk/directx-sdk-eula.txt delete mode 100644 3rdparty/bgfx/3rdparty/dxsdk/include/PIXEventsCommon.h delete mode 100644 3rdparty/bgfx/3rdparty/dxsdk/include/PIXEventsGenerated.h delete mode 100644 3rdparty/bgfx/3rdparty/dxsdk/include/d3d11.h delete mode 100644 3rdparty/bgfx/3rdparty/dxsdk/include/d3d11_1.h delete mode 100644 3rdparty/bgfx/3rdparty/dxsdk/include/d3d11_2.h delete mode 100644 3rdparty/bgfx/3rdparty/dxsdk/include/d3d11_3.h delete mode 100644 3rdparty/bgfx/3rdparty/dxsdk/include/d3d11_4.h delete mode 100644 3rdparty/bgfx/3rdparty/dxsdk/include/d3d11sdklayers.h delete mode 100644 3rdparty/bgfx/3rdparty/dxsdk/include/d3d11shader.h delete mode 100644 3rdparty/bgfx/3rdparty/dxsdk/include/d3d11shadertracing.h delete mode 100644 3rdparty/bgfx/3rdparty/dxsdk/include/d3d12.h delete mode 100644 3rdparty/bgfx/3rdparty/dxsdk/include/d3d12_1.h delete mode 100644 3rdparty/bgfx/3rdparty/dxsdk/include/d3d12sdklayers.h delete mode 100644 3rdparty/bgfx/3rdparty/dxsdk/include/d3d12shader.h delete mode 100644 3rdparty/bgfx/3rdparty/dxsdk/include/d3d12video.h delete mode 100644 3rdparty/bgfx/3rdparty/dxsdk/include/d3d9.h delete mode 100644 3rdparty/bgfx/3rdparty/dxsdk/include/d3d9caps.h delete mode 100644 3rdparty/bgfx/3rdparty/dxsdk/include/d3d9types.h delete mode 100644 3rdparty/bgfx/3rdparty/dxsdk/include/d3dcommon.h delete mode 100644 3rdparty/bgfx/3rdparty/dxsdk/include/d3dcompiler.h delete mode 100644 3rdparty/bgfx/3rdparty/dxsdk/include/d3dx12.h delete mode 100644 3rdparty/bgfx/3rdparty/dxsdk/include/dxgi.h delete mode 100644 3rdparty/bgfx/3rdparty/dxsdk/include/dxgi1_2.h delete mode 100644 3rdparty/bgfx/3rdparty/dxsdk/include/dxgi1_3.h delete mode 100644 3rdparty/bgfx/3rdparty/dxsdk/include/dxgi1_4.h delete mode 100644 3rdparty/bgfx/3rdparty/dxsdk/include/dxgi1_5.h delete mode 100644 3rdparty/bgfx/3rdparty/dxsdk/include/dxgi1_6.h delete mode 100644 3rdparty/bgfx/3rdparty/dxsdk/include/dxgicommon.h delete mode 100644 3rdparty/bgfx/3rdparty/dxsdk/include/dxgidebug.h delete mode 100644 3rdparty/bgfx/3rdparty/dxsdk/include/dxgiformat.h delete mode 100644 3rdparty/bgfx/3rdparty/dxsdk/include/dxgitype.h delete mode 100644 3rdparty/bgfx/3rdparty/dxsdk/include/dxva2api.h delete mode 100644 3rdparty/bgfx/3rdparty/dxsdk/include/pix3.h delete mode 100644 3rdparty/bgfx/3rdparty/dxsdk/include/pix3_win.h delete mode 100644 3rdparty/bgfx/3rdparty/dxsdk/include/winapifamily.h delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/.gitattributes delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/.gitignore delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/.npmignore delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/CMakeLists.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/Changelog.md delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/README.md delete mode 100755 3rdparty/bgfx/3rdparty/glsl-optimizer/autogen.sh delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/binding.gyp delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/contrib/glslopt/Main.cpp delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/contrib/glslopt/Makefile delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/contrib/glslopt/Readme delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/contrib/glslopt/SourceFiles delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/contrib/glslopt/glslopt.bdgcfg delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/contrib/glslopt/glslopt.sln delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/contrib/glslopt/glslopt.vcproj delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/contrib/staticlib/Build/Tool/SourceFiles delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/contrib/staticlib/Build/Tool/glsloptlib.bdgcfg delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/contrib/staticlib/Build/Tool/glsloptlib.vcproj delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/package.json delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/projects/vs2010/glsl_optimizer.sln delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/projects/vs2010/glsl_optimizer_lib.vcxproj delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/projects/vs2010/glsl_optimizer_lib.vcxproj.filters delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/projects/vs2010/glsl_optimizer_tests.vcxproj delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/projects/xcode5/glsl_optimizer_lib.xcodeproj/project.pbxproj delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/projects/xcode5/glsl_optimizer_tests.xcodeproj/project.pbxproj delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/removeDeletedByUs.sh delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/src/getopt/SConscript delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/.gitignore delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/.npmignore delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/README delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/SConscript delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/TODO delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/glcpp/.gitignore delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/glcpp/.npmignore delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/glcpp/README delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/src/mesa/main/.gitignore delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/src/mesa/program/.gitignore delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/src/util/.gitignore delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/src/util/SConscript delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/target_defaults.gypi delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/array-const-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/array-const-inES.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/array-const-inES3.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/array-const-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/array-const-outES.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/array-const-outES3.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/array-const-outES3Metal.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/array-constconst-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/array-constconst-inES.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/array-constconst-inES3.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/array-constconst-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/array-constconst-outES.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/array-constconst-outES3.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/array-constconst-outES3Metal.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/ast-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/ast-inES3.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/ast-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/ast-outES3.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/ast-outES3Metal.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/basic-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/basic-inES.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/basic-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/basic-outES.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/bug-bad-framebufferfetch-metal-translation-inES3.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/bug-bad-framebufferfetch-metal-translation-outES3.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/bug-bad-framebufferfetch-metal-translation-outES3Metal.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/bug-const-variable-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/bug-const-variable-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/bug-global-init-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/bug-global-init-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/bug-inline-names-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/bug-inline-names-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/bug-loop-null-from-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/bug-loop-null-from-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/bug-loop-share-index-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/bug-loop-share-index-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/bug-loop-undeclaredinductor-inES3.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/bug-loop-undeclaredinductor-outES3.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/bug-loop-undeclaredinductor-outES3Metal.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/bug-op-parens-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/bug-op-parens-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/bug-sampler-highp-inES3.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/bug-sampler-highp-outES3.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/bug-sampler-highp-outES3Metal.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/bug-sampler-highpfull-inES3.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/bug-sampler-highpfull-outES3.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/bug-sampler-highpfull-outES3Metal.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/bug-vectorize-tex-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/bug-vectorize-tex-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/builtin-vars-inES3.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/builtin-vars-outES3.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/builtin-vars-outES3Metal.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/const-precision-inES3.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/const-precision-outES3.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/const-precision-outES3Metal.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/derivatives-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/derivatives-inES.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/derivatives-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/derivatives-outES.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/estest1-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/estest1-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/float-literals-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/float-literals-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/fragdepth-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/fragdepth-inES.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/fragdepth-inES3.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/fragdepth-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/fragdepth-outES.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/fragdepth-outES3.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/fragdepth-outES3Metal.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/framebuffer_fetch-inES.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/framebuffer_fetch-inES3.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/framebuffer_fetch-outES.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/framebuffer_fetch-outES3.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/framebuffer_fetch-outES3Metal.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/global-struct-constant-init-metal-inES3.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/global-struct-constant-init-metal-outES3.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/global-struct-constant-init-metal-outES3Metal.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/glsl120-basic-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/glsl120-basic-inES3.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/glsl120-basic-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/glsl120-basic-outES3.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/glsl120-basic-outES3Metal.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/glsl140-basic-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/glsl140-basic-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/in-struct-ret-vals-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/in-struct-ret-vals-inES.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/in-struct-ret-vals-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/in-struct-ret-vals-outES.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/in-vals-ret-vals-inES.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/in-vals-ret-vals-outES.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/intrinsics-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/intrinsics-inES.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/intrinsics-inES3.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/intrinsics-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/intrinsics-outES.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/intrinsics-outES3.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/intrinsics-outES3Metal.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/loop-for-inES.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/loop-for-inES3.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/loop-for-outES.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/loop-for-outES3.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/loop-for-outES3Metal.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/loop-forafterdiscard-inES.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/loop-forafterdiscard-inES3.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/loop-forafterdiscard-outES.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/loop-forafterdiscard-outES3.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/loop-forafterdiscard-outES3Metal.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/loop-foraliasinductor-inES.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/loop-foraliasinductor-outES.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/loop-forarounddiscard-inES.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/loop-forarounddiscard-outES.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/loop-fornounroll-inES.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/loop-fornounroll-outES.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/loop-forunbounded-inES.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/loop-forunbounded-outES.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/loop-forvariants-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/loop-forvariants-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/loop-forwronginductor-inES.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/loop-forwronginductor-outES.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/matrix-cast-types-inES3.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/matrix-cast-types-outES3.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/matrix-cast-types-outES3Metal.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/matrix-ops-inES3.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/matrix-ops-outES3.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/matrix-ops-outES3Metal.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/mrt-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/mrt-inES.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/mrt-inES3.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/mrt-mixed-array-inES3.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/mrt-mixed-array-outES3.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/mrt-mixed-array-outES3Metal.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/mrt-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/mrt-outES.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/mrt-outES3.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/mrt-outES3Metal.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/mrt-unused-inES3.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/mrt-unused-outES3.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/mrt-unused-outES3Metal.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/nested-inlining-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/nested-inlining-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/opt-copyprop-struct-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/opt-copyprop-struct-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/opt-copypropelems-swizzle-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/opt-copypropelems-swizzle-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/opt-dead-texloads-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/opt-dead-texloads-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/opt-dead-texloadstreeshadow-inES3.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/opt-dead-texloadstreeshadow-outES3.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/opt-dead-texloadstreeshadow-outES3Metal.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/opt-deadcode-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/opt-deadcode-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/opt-deadcodestruct-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/opt-deadcodestruct-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/opt-grafting-precision-inES.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/opt-grafting-precision-inES3.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/opt-grafting-precision-outES.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/opt-grafting-precision-outES3.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/opt-grafting-precision-outES3Metal.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/opt-ifs-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/opt-ifs-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/opt-inline-inoutstruct-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/opt-inline-inoutstruct-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/opt-movevars-sideeffect-inES.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/opt-movevars-sideeffect-outES.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/opt-movevars-sideeffect2-inES.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/opt-movevars-sideeffect2-outES.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/opt-movevars-simple-inES.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/opt-movevars-simple-outES.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/opt-vec-var-index-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/opt-vec-var-index-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/opt-vectorize-ifs-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/opt-vectorize-ifs-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/opt-vectorize-retval-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/opt-vectorize-retval-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/opt-vectorize-types-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/opt-vectorize-types-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/pp-basic-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/pp-basic-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/prec-default-inES.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/prec-default-outES.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/prec-expressions-inES3.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/prec-expressions-outES3.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/prec-expressions-outES3Metal.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/prec-inlineexpr1-inES.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/prec-inlineexpr1-outES.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/prec-inlineexpr2-inES.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/prec-inlineexpr2-outES.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/prec-matrix-constr-inES3.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/prec-matrix-constr-outES3.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/prec-matrix-constr-outES3Metal.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/prec-temps-inES.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/prec-temps-outES.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/prec-tempssimple-inES.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/prec-tempssimple-outES.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/prec-treegrafting-inES.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/prec-treegrafting-outES.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/qualifiers-layout-inES3.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/qualifiers-layout-outES3.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/qualifiers-layout-outES3Metal.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/sampler-precision-inES.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/sampler-precision-inES3.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/sampler-precision-outES.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/sampler-precision-outES3.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/sampler-precision-outES3Metal.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/small-float-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/small-float-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/struct-array-var-index-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/struct-array-var-index-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/struct-initializer-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/struct-initializer-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/struct-unused-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/struct-unused-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/swizzle-writemask-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/swizzle-writemask-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/syntax-inES.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/syntax-outES.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/ternary-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/ternary-inES.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/ternary-inES3.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/ternary-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/ternary-outES.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/ternary-outES3.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/ternary-outES3Metal.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/ternary-vec4-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/ternary-vec4-inES.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/ternary-vec4-inES3.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/ternary-vec4-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/ternary-vec4-outES.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/ternary-vec4-outES3.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/ternary-vec4-outES3Metal.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/tex2DArray-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/tex2DArray-inES3.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/tex2DArray-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/tex2DArray-outES3.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/tex2DArray-outES3Metal.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/tex2dgrad-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/tex2dgrad-inES.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/tex2dgrad-inES3.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/tex2dgrad-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/tex2dgrad-outES.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/tex2dgrad-outES3.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/tex2dgrad-outES3Metal.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/tex2dlod-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/tex2dlod-inES.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/tex2dlod-inES3.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/tex2dlod-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/tex2dlod-outES.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/tex2dlod-outES3.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/tex2dlod-outES3Metal.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/tex2dshadow-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/tex2dshadow-inES.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/tex2dshadow-inES3.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/tex2dshadow-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/tex2dshadow-outES.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/tex2dshadow-outES3.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/tex2dshadow-outES3Metal.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/tex3D-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/tex3D-inES3.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/tex3D-inES__.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/tex3D-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/tex3D-outES3.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/tex3D-outES3Metal.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/texCubeShadow-inES3.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/texCubeShadow-outES3.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/texCubeShadow-outES3Metal.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/texOffset-inES3.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/texOffset-outES3.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/texOffset-outES3Metal.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/texProj-inES.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/texProj-inES3.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/texProj-outES.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/texProj-outES3.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/texProj-outES3Metal.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/texSize-inES3.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/texSize-outES3.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/texSize-outES3Metal.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/texelFetchMSAA-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/texelFetchMSAA-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/types-writemask-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/types-writemask-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/variables-initialization-inES3.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/variables-initialization-outES3.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/variables-initialization-outES3Metal.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/varyings-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/varyings-inES.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/varyings-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/varyings-outES.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/vface-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/vface-inES.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/vface-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/vface-outES.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/vpos-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/vpos-inES.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/vpos-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/vpos-outES.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-DirLMBasis-inES3.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-DirLMBasis-outES3.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-DirLMBasis-outES3Metal.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-LightShaftsCoord-inES3.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-LightShaftsCoord-outES3.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-LightShaftsCoord-outES3Metal.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-alphabumpspec-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-alphabumpspec-inES3.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-alphabumpspec-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-alphabumpspec-outES3.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-alphabumpspec-outES3Metal.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-collectshadows-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-collectshadows-inES.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-collectshadows-inES3.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-collectshadows-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-collectshadows-outES.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-collectshadows-outES3.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-collectshadows-outES3Metal.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-flare-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-flare-inES.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-flare-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-flare-outES.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-fxaa-preset1-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-fxaa-preset1-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-fxaa-preset3-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-fxaa-preset3-inES3.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-fxaa-preset3-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-fxaa-preset3-outES3.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-fxaa-preset3-outES3Metal.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-fxaa3-11-consolepc-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-fxaa3-11-consolepc-inES.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-fxaa3-11-consolepc-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-fxaa3-11-consolepc-outES.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-fxaa3-11-pc39-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-fxaa3-11-pc39-inES.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-fxaa3-11-pc39-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-fxaa3-11-pc39-outES.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-particle-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-particle-inES.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-particle-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-particle-outES.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-prepasslight-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-prepasslight-inES.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-prepasslight-inES3.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-prepasslight-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-prepasslight-outES.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-prepasslight-outES3.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-prepasslight-outES3Metal.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-tonemap-usercurve-inES3.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-tonemap-usercurve-outES3.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-tonemap-usercurve-outES3Metal.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-treeleaf-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-treeleaf-inES.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-treeleaf-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-treeleaf-outES.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-treeleafloop-inES.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-treeleafloop-inES3.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-treeleafloop-outES.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-treeleafloop-outES3.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-treeleafloop-outES3Metal.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-unishader-dirlm-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-unishader-dirlm-inES3.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-unishader-dirlm-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-unishader-dirlm-outES3.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-unishader-dirlm-outES3Metal.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-unity-spot-inES3.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-unity-spot-outES3.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-unity-spot-outES3Metal.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Bumped_Diffuse-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Bumped_Diffuse-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Bumped_Diffuse1-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Bumped_Diffuse1-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Bumped_Specular-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Bumped_Specular-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Bumped_Specular1-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Bumped_Specular1-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Bumped_Specular2-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Bumped_Specular2-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Decal-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Decal-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Decal1-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Decal1-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Decal2-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Decal2-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Diffuse-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Diffuse-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Diffuse1-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Diffuse1-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Diffuse2-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Diffuse2-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Diffuse_Alpha_Shadowed_ZWrite-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Diffuse_Alpha_Shadowed_ZWrite-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Diffuse_Detail-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Diffuse_Detail-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Diffuse_Detail1-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Diffuse_Detail1-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-FX_Glass_Stained_BumpDistort-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-FX_Glass_Stained_BumpDistort-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-FX_Water_(simple)-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-FX_Water_(simple)-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Grab_Invert-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Grab_Invert-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Camera-DepthNormalTexture-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Camera-DepthNormalTexture-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Camera-DepthNormalTexture1-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Camera-DepthNormalTexture1-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Camera-DepthTexture-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Camera-DepthTexture-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Color_Correction_Effect-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Color_Correction_Effect-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Edge_Detect_X-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Edge_Detect_X-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_GlowConeTap-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_GlowConeTap-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Glow_Downsample-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Glow_Downsample-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Grayscale_Effect-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Grayscale_Effect-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Internal-CombineDepthNormals-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Internal-CombineDepthNormals-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Internal-GUITextureBlit-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Internal-GUITextureBlit-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Internal-GUITextureClip-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Internal-GUITextureClip-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Internal-Halo-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Internal-Halo-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Internal-PrePassCollectShadows-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Internal-PrePassCollectShadows-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Internal-PrePassLighting-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Internal-PrePassLighting-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Noise_Shader_RGB-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Noise_Shader_RGB-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Noise_Shader_YUV-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Noise_Shader_YUV-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Sepiatone_Effect-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Sepiatone_Effect-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Shadow-ScreenBlur-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Shadow-ScreenBlur-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_ShowDepthNTexture-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_ShowDepthNTexture-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_ShowDepthTexture-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_ShowDepthTexture-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_BillboardTree-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_BillboardTree-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Details_BillboardWavingDoublePass-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Details_BillboardWavingDoublePass-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Details_BillboardWavingDoublePass1-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Details_BillboardWavingDoublePass1-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Details_BillboardWavingDoublePass2-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Details_BillboardWavingDoublePass2-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Details_Vertexlit-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Details_Vertexlit-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Details_Vertexlit1-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Details_Vertexlit1-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Details_WavingDoublePass-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Details_WavingDoublePass-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Details_WavingDoublePass1-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Details_WavingDoublePass1-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Details_WavingDoublePass2-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Details_WavingDoublePass2-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_My_Soft_Occlusion_Leaves_rendertex-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_My_Soft_Occlusion_Leaves_rendertex-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Soft_Occlusion_Bark_rendertex-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Soft_Occlusion_Bark_rendertex-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Soft_Occlusion_Leaves_rendertex-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Soft_Occlusion_Leaves_rendertex-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Splatmap_Lightmap-AddPass-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Splatmap_Lightmap-AddPass-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Splatmap_Lightmap-AddPass1-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Splatmap_Lightmap-AddPass1-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Splatmap_Lightmap-FirstPass-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Splatmap_Lightmap-FirstPass-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Splatmap_Lightmap-FirstPass1-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Splatmap_Lightmap-FirstPass1-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Tree_Bark_Shader_Rendertex-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Tree_Bark_Shader_Rendertex-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Tree_Leaf_Shader_Rendertex-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Tree_Leaf_Shader_Rendertex-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Tree_Optimized_Bark_Shader-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Tree_Optimized_Bark_Shader-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Tree_Optimized_Bark_Shader1-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Tree_Optimized_Bark_Shader1-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Tree_Optimized_Leaf_Shader-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Tree_Optimized_Leaf_Shader-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Tree_Optimized_Leaf_Shader1-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Tree_Optimized_Leaf_Shader1-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Twirt_Effect_Shader-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Twirt_Effect_Shader-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Twist_Effect-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Twist_Effect-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Legacy_Shaders_Lightmapped_Bumped_Diffuse-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Legacy_Shaders_Lightmapped_Bumped_Diffuse-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Legacy_Shaders_Lightmapped_Bumped_Diffuse2-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Legacy_Shaders_Lightmapped_Bumped_Diffuse2-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Legacy_Shaders_Lightmapped_Diffuse-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Legacy_Shaders_Lightmapped_Diffuse-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-MobileBumpSpec-inES.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-MobileBumpSpec-inES3.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-MobileBumpSpec-outES.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-MobileBumpSpec-outES3.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-MobileBumpSpec-outES3Metal.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Nature_My_Soft_Occlusion_Leaves-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Nature_My_Soft_Occlusion_Leaves-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Nature_Soft_Occlusion_Bark-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Nature_Soft_Occlusion_Bark-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Nature_Soft_Occlusion_Bark1-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Nature_Soft_Occlusion_Bark1-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Nature_Soft_Occlusion_Bark2-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Nature_Soft_Occlusion_Bark2-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Nature_Soft_Occlusion_Bark3-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Nature_Soft_Occlusion_Bark3-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Nature_Soft_Occlusion_Leaves-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Nature_Soft_Occlusion_Leaves-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Nature_Soft_Occlusion_Leaves1-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Nature_Soft_Occlusion_Leaves1-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Nature_Soft_Occlusion_Leaves2-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Nature_Soft_Occlusion_Leaves2-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Nature_Soft_Occlusion_Leaves3-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Nature_Soft_Occlusion_Leaves3-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Nature_Vegetation_Two_Pass_unlit-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Nature_Vegetation_Two_Pass_unlit-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Parallax_Diffuse-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Parallax_Diffuse-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Parallax_Diffuse1-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Parallax_Diffuse1-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Parallax_Diffuse2-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Parallax_Diffuse2-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Parallax_Specular-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Parallax_Specular-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Particles_Additive-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Particles_Additive-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Particles_Additive_(Soft)-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Particles_Additive_(Soft)-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Particles_Alpha_Blended_Premultiply-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Particles_Alpha_Blended_Premultiply-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Particles_Multiply-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Particles_Multiply-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Particles_Multiply_(Double)-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Particles_Multiply_(Double)-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Particles__Additive-Multiply-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Particles__Additive-Multiply-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Bumped_Diffuse-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Bumped_Diffuse-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Bumped_Diffuse1-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Bumped_Diffuse1-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Bumped_Specular-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Bumped_Specular-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Bumped_Specular1-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Bumped_Specular1-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Bumped_Specular2-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Bumped_Specular2-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Bumped_Unlit-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Bumped_Unlit-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Diffuse-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Diffuse-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Diffuse1-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Diffuse1-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Parallax_Diffuse-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Parallax_Diffuse-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Parallax_Diffuse1-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Parallax_Diffuse1-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Parallax_Specular-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Parallax_Specular-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Parallax_Specular1-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Parallax_Specular1-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Specular-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Specular-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Specular1-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Specular1-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Specular2-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Specular2-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-RenderFX_Skybox-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-RenderFX_Skybox-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-RenderFX_Skybox_Cubed-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-RenderFX_Skybox_Cubed-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-SSAO24-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-SSAO24-inES3.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-SSAO24-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-SSAO24-outES3.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-SSAO24-outES3Metal.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-SSAO8-inES.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-SSAO8-outES.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Bumped_Diffuse-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Bumped_Diffuse-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Bumped_Diffuse1-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Bumped_Diffuse1-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Bumped_Diffuse2-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Bumped_Diffuse2-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Bumped_Specular-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Bumped_Specular-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Bumped_Specular1-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Bumped_Specular1-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Diffuse-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Diffuse-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Diffuse1-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Diffuse1-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Parallax_Diffuse-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Parallax_Diffuse-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Parallax_Diffuse1-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Parallax_Diffuse1-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Parallax_Diffuse2-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Parallax_Diffuse2-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Parallax_Specular-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Parallax_Specular-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Parallax_Specular1-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Parallax_Specular1-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Specular-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Specular-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Specular1-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Specular1-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Specular2-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Specular2-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Specular-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Specular-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Specular1-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Specular1-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Specular2-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Specular2-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_2UV-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_2UV-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_2UV1-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_2UV1-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Colored_Specular-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Colored_Specular-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Colored_Specular1-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Colored_Specular1-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Custom_Data-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Custom_Data-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Custom_Data1-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Custom_Data1-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Custom_Data2-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Custom_Data2-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_DecalAdd-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_DecalAdd-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_DecalAddBump3-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_DecalAddBump3-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_DecalAddBump5-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_DecalAddBump5-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Diffuse_Wrapped-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Diffuse_Wrapped-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Rim-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Rim-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Rim1-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Rim1-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Rim2-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Rim2-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Rim_Bump-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Rim_Bump-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Rim_Bump1-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Rim_Bump1-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_ScreenPos-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_ScreenPos-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_ScreenPos1-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_ScreenPos1-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_ScreenPos2-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_ScreenPos2-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_ScreenPosAlbedo-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_ScreenPosAlbedo-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_ScreenPosAlbedo1-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_ScreenPosAlbedo1-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Slices-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Slices-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Slices1-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Slices1-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Slices2-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Slices2-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Slices3-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Slices3-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_WorldRefl-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_WorldRefl-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_WorldRefl1-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_WorldRefl1-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Test_CgNormals-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Test_CgNormals-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Test_FontShaderCull-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Test_FontShaderCull-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Test_VertexShaderDepthTexture-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Test_VertexShaderDepthTexture-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Test_VertexShaderTexture-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Test_VertexShaderTexture-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Tests_Blend_Many_Textures-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Tests_Blend_Many_Textures-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Tests_Fwd-Def-Vert-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Tests_Fwd-Def-Vert-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Tests_Fwd-Def-Vert1-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Tests_Fwd-Def-Vert1-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-TexGen_Cube_Refl-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-TexGen_Cube_Refl-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Toon_Basic-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Toon_Basic-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Toon_Lighted-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Toon_Lighted-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Bumped_Specular-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Bumped_Specular-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Cutout_Bumped_Diffuse-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Cutout_Bumped_Diffuse-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Cutout_Bumped_Diffuse1-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Cutout_Bumped_Diffuse1-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Cutout_Bumped_Specular-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Cutout_Bumped_Specular-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Cutout_Bumped_Specular1-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Cutout_Bumped_Specular1-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Cutout_Diffuse-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Cutout_Diffuse-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Cutout_Specular-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Cutout_Specular-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Cutout_Specular1-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Cutout_Specular1-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Cutout_Specular2-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Cutout_Specular2-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Diffuse-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Diffuse-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Specular-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Specular-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-TreeCreatorLeavesRT-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-TreeCreatorLeavesRT-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Tree_Editor_Bark_Shader-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Tree_Editor_Bark_Shader-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Tree_Editor_Bark_Shader1-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Tree_Editor_Bark_Shader1-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Tree_Editor_Leaf_Shader-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Tree_Editor_Leaf_Shader-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Tree_Editor_Leaf_Shader1-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Tree_Editor_Leaf_Shader1-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Vertex_Colored-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Vertex_Colored-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-currently_adapted-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-currently_adapted-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zunity-MotionBlur-TileMax-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zunity-MotionBlur-TileMax-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/global-mutable-inES.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/global-mutable-inES3.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/global-mutable-outES.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/global-mutable-outES3.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/global-mutable-outES3Metal.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/glsl_optimizer_tests.cpp delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/tests.gyp delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/tests.js delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/MF-GodRays-inES.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/MF-GodRays-inES3.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/MF-GodRays-outES.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/MF-GodRays-outES3.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/MF-GodRays-outES3Metal.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/bug-chained-assign-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/bug-chained-assign-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/bug-loops-for-while-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/bug-loops-for-while-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/bug-struct-uniform-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/bug-struct-uniform-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/bug-swizzle-lhs-cast-inES3.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/bug-swizzle-lhs-cast-outES3.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/bug-swizzle-lhs-cast-outES3Metal.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/bug-varying-const-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/bug-varying-const-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/builtin-vars-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/builtin-vars-inES.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/builtin-vars-inES3.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/builtin-vars-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/builtin-vars-outES.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/builtin-vars-outES3.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/builtin-vars-outES3Metal.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/estest1-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/estest1-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/glsl140-basic-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/glsl140-basic-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/glsl140-integers-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/glsl140-integers-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/inputs-inES3.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/inputs-outES3.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/inputs-outES3Metal.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/loops-for-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/loops-for-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/loops-for-withvec4-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/loops-for-withvec4-inES3.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/loops-for-withvec4-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/loops-for-withvec4-outES3.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/loops-for-withvec4-outES3Metal.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/loops-for-withvec4inductorW-inES3.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/loops-for-withvec4inductorW-outES3.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/loops-for-withvec4inductorW-outES3Metal.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/loops-forlimitbreak-inES.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/loops-forlimitbreak-inES3.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/loops-forlimitbreak-outES.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/loops-forlimitbreak-outES3.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/loops-forlimitbreak-outES3Metal.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/loops-forsimple-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/loops-forsimple-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/loops-forvarious-inES.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/loops-forvarious-inES3.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/loops-forvarious-outES.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/loops-forvarious-outES3.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/loops-forvarious-outES3Metal.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/loops-forwithcalls-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/loops-forwithcalls-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/matrix-casts-inES3.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/matrix-casts-outES3.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/matrix-casts-outES3Metal.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/opt-inline-varnames-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/opt-inline-varnames-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/opt-matrix-constr-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/opt-matrix-constr-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/opt-matrix-transpose-mul-inES.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/opt-matrix-transpose-mul-inES3.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/opt-matrix-transpose-mul-outES.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/opt-matrix-transpose-mul-outES3.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/opt-matrix-transpose-mul-outES3Metal.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/opt-negsub-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/opt-negsub-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/opt-normalize-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/opt-normalize-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/opt-unroll-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/opt-unroll-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/opt-unusedvars-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/opt-unusedvars-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/swizzle-casts-inES3.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/swizzle-casts-outES3.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/swizzle-casts-outES3Metal.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/swizzlemask-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/swizzlemask-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/types-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/types-inES.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/types-inES3.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/types-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/types-outES.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/types-outES3.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/types-outES3Metal.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/uniforms-arrays-inES3.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/uniforms-arrays-outES3.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/uniforms-arrays-outES3Metal.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/z-NichsHybridLight-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/z-NichsHybridLight-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/z-NichsHybridLightVectorInsertBug-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/z-NichsHybridLightVectorInsertBug-inES.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/z-NichsHybridLightVectorInsertBug-inES3.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/z-NichsHybridLightVectorInsertBug-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/z-NichsHybridLightVectorInsertBug-outES.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/z-NichsHybridLightVectorInsertBug-outES3.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/z-NichsHybridLightVectorInsertBug-outES3Metal.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/z-alphabumpspec-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/z-alphabumpspec-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/z-particle-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/z-particle-inES.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/z-particle-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/z-particle-outES.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/z-prepasslight-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/z-prepasslight-inES.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/z-prepasslight-inES3.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/z-prepasslight-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/z-prepasslight-outES.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/z-prepasslight-outES3.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/z-prepasslight-outES3Metal.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/z-treeleaf-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/z-treeleaf-inES.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/z-treeleaf-inES3.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/z-treeleaf-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/z-treeleaf-outES.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/z-treeleaf-outES3.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/z-treeleaf-outES3Metal.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/z-unishader-dirlm-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/z-unishader-dirlm-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Bumped_Diffuse-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Bumped_Diffuse-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Bumped_Diffuse1-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Bumped_Diffuse1-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Bumped_Specular-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Bumped_Specular-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Bumped_Specular2-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Bumped_Specular2-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Decal-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Decal-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Diffuse-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Diffuse-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Diffuse2-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Diffuse2-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Diffuse_Alpha_Shadowed_ZWrite-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Diffuse_Alpha_Shadowed_ZWrite-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-FX_Glass_Stained_BumpDistort-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-FX_Glass_Stained_BumpDistort-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-FX_Water_(simple)-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-FX_Water_(simple)-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Grab_Invert-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Grab_Invert-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Camera-DepthNormalTexture-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Camera-DepthNormalTexture-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Camera-DepthNormalTexture1-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Camera-DepthNormalTexture1-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Camera-DepthTexture-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Camera-DepthTexture-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Glow_Downsample-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Glow_Downsample-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Internal-GUITextureClip-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Internal-GUITextureClip-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Internal-PrePassLighting-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Internal-PrePassLighting-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Noise_Shader_RGB-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Noise_Shader_RGB-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_TerrainEngine_BillboardTree-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_TerrainEngine_BillboardTree-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_TerrainEngine_Details_BillboardWavingDoublePass-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_TerrainEngine_Details_BillboardWavingDoublePass-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_TerrainEngine_Details_BillboardWavingDoublePass1-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_TerrainEngine_Details_BillboardWavingDoublePass1-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_TerrainEngine_Details_BillboardWavingDoublePass2-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_TerrainEngine_Details_BillboardWavingDoublePass2-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_TerrainEngine_Details_WavingDoublePass1-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_TerrainEngine_Details_WavingDoublePass1-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_TerrainEngine_Soft_Occlusion_Bark_rendertex-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_TerrainEngine_Soft_Occlusion_Bark_rendertex-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_TerrainEngine_Soft_Occlusion_Leaves_rendertex-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_TerrainEngine_Soft_Occlusion_Leaves_rendertex-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_TerrainEngine_Splatmap_Lightmap-AddPass-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_TerrainEngine_Splatmap_Lightmap-AddPass-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_TerrainEngine_Splatmap_Lightmap-FirstPass1-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_TerrainEngine_Splatmap_Lightmap-FirstPass1-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Tree_Bark_Shader_Rendertex-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Tree_Bark_Shader_Rendertex-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Tree_Leaf_Shader_Rendertex-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Tree_Leaf_Shader_Rendertex-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Tree_Optimized_Bark_Shader-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Tree_Optimized_Bark_Shader-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Tree_Optimized_Bark_Shader1-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Tree_Optimized_Bark_Shader1-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Tree_Optimized_Leaf_Shader-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Tree_Optimized_Leaf_Shader-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Tree_Optimized_Leaf_Shader1-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Tree_Optimized_Leaf_Shader1-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Twist_Effect-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Twist_Effect-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Legacy_Shaders_Lightmapped_Bumped_Diffuse-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Legacy_Shaders_Lightmapped_Bumped_Diffuse-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Nature_Soft_Occlusion_Bark-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Nature_Soft_Occlusion_Bark-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Nature_Soft_Occlusion_Bark2-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Nature_Soft_Occlusion_Bark2-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Nature_Soft_Occlusion_Bark3-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Nature_Soft_Occlusion_Bark3-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Nature_Soft_Occlusion_Leaves1-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Nature_Soft_Occlusion_Leaves1-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Nature_Soft_Occlusion_Leaves3-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Nature_Soft_Occlusion_Leaves3-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Parallax_Diffuse-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Parallax_Diffuse-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Parallax_Diffuse1-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Parallax_Diffuse1-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Parallax_Diffuse2-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Parallax_Diffuse2-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Particles_Blend-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Particles_Blend-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Bumped_Diffuse-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Bumped_Diffuse-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Bumped_Diffuse1-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Bumped_Diffuse1-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Bumped_Specular-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Bumped_Specular-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Bumped_Specular1-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Bumped_Specular1-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Bumped_Specular2-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Bumped_Specular2-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Bumped_Unlit-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Bumped_Unlit-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Diffuse-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Diffuse-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Diffuse1-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Diffuse1-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Parallax_Diffuse-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Parallax_Diffuse-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Parallax_Diffuse1-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Parallax_Diffuse1-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Parallax_Specular-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Parallax_Specular-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Parallax_Specular1-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Parallax_Specular1-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Specular-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Specular-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Specular1-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Specular1-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Specular2-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Specular2-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-RenderFX_Skybox_Cubed-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-RenderFX_Skybox_Cubed-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Self-Illumin_Bumped_Diffuse-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Self-Illumin_Bumped_Diffuse-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Self-Illumin_Bumped_Specular1-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Self-Illumin_Bumped_Specular1-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Self-Illumin_Diffuse1-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Self-Illumin_Diffuse1-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Self-Illumin_Parallax_Diffuse-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Self-Illumin_Parallax_Diffuse-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Self-Illumin_Parallax_Specular1-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Self-Illumin_Parallax_Specular1-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Self-Illumin_Specular1-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Self-Illumin_Specular1-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-ShowDestAlpha-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-ShowDestAlpha-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Specular-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Specular-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Specular1-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Specular1-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Specular2-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Specular2-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_2UV-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_2UV-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_2UV1-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_2UV1-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Colored_Specular-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Colored_Specular-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Colored_Specular1-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Colored_Specular1-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Custom_Data-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Custom_Data-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Custom_Data1-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Custom_Data1-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Custom_Data2-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Custom_Data2-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_DecalAddBump-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_DecalAddBump-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_DecalAddBump1-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_DecalAddBump1-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_DecalAddBump2-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_DecalAddBump2-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_DecalAddBump3-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_DecalAddBump3-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Diffuse_Wrapped-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Diffuse_Wrapped-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Rim-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Rim-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Rim1-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Rim1-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Rim2-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Rim2-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Rim_Bump-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Rim_Bump-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Rim_Bump1-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Rim_Bump1-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_ScreenPos-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_ScreenPos-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_ScreenPos1-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_ScreenPos1-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_ScreenPos2-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_ScreenPos2-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_ScreenPosAlbedo-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_ScreenPosAlbedo-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_ScreenPosAlbedo1-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_ScreenPosAlbedo1-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Slices-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Slices-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Slices1-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Slices1-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Slices2-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Slices2-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Slices3-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Slices3-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_WorldRefl-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_WorldRefl-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_WorldRefl1-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_WorldRefl1-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Test_CgNormals-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Test_CgNormals-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Test_VertexShaderDepthTexture-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Test_VertexShaderDepthTexture-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Test_VertexShaderTexture-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Test_VertexShaderTexture-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-TexGen_Cube_Refl-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-TexGen_Cube_Refl-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Toon_Basic-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Toon_Basic-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Transparent_Bumped_Specular-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Transparent_Bumped_Specular-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Transparent_Cutout_Bumped_Diffuse-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Transparent_Cutout_Bumped_Diffuse-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Transparent_Cutout_Bumped_Diffuse1-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Transparent_Cutout_Bumped_Diffuse1-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Transparent_Cutout_Bumped_Specular-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Transparent_Cutout_Bumped_Specular-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Transparent_Cutout_Bumped_Specular1-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Transparent_Cutout_Bumped_Specular1-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Transparent_Cutout_Diffuse-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Transparent_Cutout_Diffuse-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Transparent_Cutout_Specular-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Transparent_Cutout_Specular-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Transparent_Specular-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Transparent_Specular-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-TreeCreatorLeavesRT-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-TreeCreatorLeavesRT-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Tree_Editor_Bark_Shader-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Tree_Editor_Bark_Shader-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Tree_Editor_Bark_Shader1-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Tree_Editor_Bark_Shader1-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Tree_Editor_Leaf_Shader-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Tree_Editor_Leaf_Shader-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Tree_Editor_Leaf_Shader1-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Tree_Editor_Leaf_Shader1-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Vertex_Colored-in.txt delete mode 100644 3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Vertex_Colored-out.txt delete mode 100644 3rdparty/bgfx/3rdparty/glslang/CHANGES.md create mode 100644 3rdparty/bgfx/3rdparty/glslang/SPIRV/NonSemanticShaderDebugInfo100.h delete mode 100644 3rdparty/bgfx/3rdparty/glslang/StandAlone/ResourceLimits.h delete mode 100644 3rdparty/bgfx/3rdparty/glslang/StandAlone/resource_limits_c.h delete mode 100644 3rdparty/bgfx/3rdparty/glslang/build_info.h.tmpl delete mode 100755 3rdparty/bgfx/3rdparty/glslang/build_info.py create mode 100644 3rdparty/bgfx/3rdparty/glslang/glslang/ExtensionHeaders/GL_EXT_shader_realtime_clock.glsl delete mode 100644 3rdparty/bgfx/3rdparty/glslang/glslang/OSDependent/Web/glslang.after.js delete mode 100644 3rdparty/bgfx/3rdparty/glslang/glslang/OSDependent/Web/glslang.js.cpp delete mode 100644 3rdparty/bgfx/3rdparty/glslang/glslang/OSDependent/Web/glslang.pre.js delete mode 100644 3rdparty/bgfx/3rdparty/glslang/glslang/OSDependent/Windows/main.cpp create mode 100644 3rdparty/bgfx/3rdparty/glslang/glslang/Public/ResourceLimits.h create mode 100644 3rdparty/bgfx/3rdparty/glslang/glslang/Public/resource_limits_c.h delete mode 100644 3rdparty/bgfx/3rdparty/iconfontheaders/.gitignore delete mode 100644 3rdparty/bgfx/3rdparty/iconfontheaders/README.md create mode 100644 3rdparty/bgfx/3rdparty/native_app_glue/LICENSE create mode 100644 3rdparty/bgfx/3rdparty/native_app_glue/android_native_app_glue.c create mode 100644 3rdparty/bgfx/3rdparty/native_app_glue/android_native_app_glue.h delete mode 100644 3rdparty/bgfx/3rdparty/spirv-headers/SPIRV-Headers.pc.in delete mode 100644 3rdparty/bgfx/3rdparty/spirv-headers/include/spirv/1.0/spirv.cs delete mode 100644 3rdparty/bgfx/3rdparty/spirv-headers/include/spirv/1.0/spirv.hpp delete mode 100644 3rdparty/bgfx/3rdparty/spirv-headers/include/spirv/1.0/spirv.hpp11 delete mode 100644 3rdparty/bgfx/3rdparty/spirv-headers/include/spirv/1.0/spirv.lua delete mode 100644 3rdparty/bgfx/3rdparty/spirv-headers/include/spirv/1.0/spirv.py delete mode 100644 3rdparty/bgfx/3rdparty/spirv-headers/include/spirv/1.1/spirv.cs delete mode 100644 3rdparty/bgfx/3rdparty/spirv-headers/include/spirv/1.1/spirv.hpp delete mode 100644 3rdparty/bgfx/3rdparty/spirv-headers/include/spirv/1.1/spirv.hpp11 delete mode 100644 3rdparty/bgfx/3rdparty/spirv-headers/include/spirv/1.1/spirv.lua delete mode 100644 3rdparty/bgfx/3rdparty/spirv-headers/include/spirv/1.1/spirv.py delete mode 100644 3rdparty/bgfx/3rdparty/spirv-headers/include/spirv/1.2/spirv.cs delete mode 100644 3rdparty/bgfx/3rdparty/spirv-headers/include/spirv/1.2/spirv.hpp delete mode 100644 3rdparty/bgfx/3rdparty/spirv-headers/include/spirv/1.2/spirv.hpp11 delete mode 100644 3rdparty/bgfx/3rdparty/spirv-headers/include/spirv/1.2/spirv.lua delete mode 100644 3rdparty/bgfx/3rdparty/spirv-headers/include/spirv/1.2/spirv.py delete mode 100644 3rdparty/bgfx/3rdparty/spirv-headers/include/spirv/unified1/spirv.cs delete mode 100644 3rdparty/bgfx/3rdparty/spirv-headers/include/spirv/unified1/spirv.hpp delete mode 100644 3rdparty/bgfx/3rdparty/spirv-headers/include/spirv/unified1/spirv.hpp11 delete mode 100644 3rdparty/bgfx/3rdparty/spirv-headers/include/spirv/unified1/spirv.lua delete mode 100644 3rdparty/bgfx/3rdparty/spirv-headers/include/spirv/unified1/spirv.py delete mode 100644 3rdparty/bgfx/3rdparty/spirv-headers/include/spirv/unified1/spv.d create mode 100644 3rdparty/bgfx/3rdparty/spirv-tools/source/diff/diff.cpp create mode 100644 3rdparty/bgfx/3rdparty/spirv-tools/source/diff/diff.h create mode 100644 3rdparty/bgfx/3rdparty/spirv-tools/source/diff/lcs.h create mode 100644 3rdparty/bgfx/3rdparty/spirv-tools/source/opt/desc_sroa_util.cpp create mode 100644 3rdparty/bgfx/3rdparty/spirv-tools/source/opt/desc_sroa_util.h create mode 100644 3rdparty/bgfx/3rdparty/spirv-tools/source/opt/eliminate_dead_input_components_pass.cpp create mode 100644 3rdparty/bgfx/3rdparty/spirv-tools/source/opt/eliminate_dead_input_components_pass.h create mode 100644 3rdparty/bgfx/3rdparty/spirv-tools/source/opt/fix_func_call_arguments.cpp create mode 100644 3rdparty/bgfx/3rdparty/spirv-tools/source/opt/fix_func_call_arguments.h create mode 100644 3rdparty/bgfx/3rdparty/spirv-tools/source/opt/interface_var_sroa.cpp create mode 100644 3rdparty/bgfx/3rdparty/spirv-tools/source/opt/interface_var_sroa.h create mode 100644 3rdparty/bgfx/3rdparty/spirv-tools/source/opt/remove_dontinline_pass.cpp create mode 100644 3rdparty/bgfx/3rdparty/spirv-tools/source/opt/remove_dontinline_pass.h create mode 100644 3rdparty/bgfx/3rdparty/spirv-tools/source/opt/replace_desc_array_access_using_var_index.cpp create mode 100644 3rdparty/bgfx/3rdparty/spirv-tools/source/opt/replace_desc_array_access_using_var_index.h create mode 100644 3rdparty/bgfx/3rdparty/spirv-tools/source/opt/spread_volatile_semantics.cpp create mode 100644 3rdparty/bgfx/3rdparty/spirv-tools/source/opt/spread_volatile_semantics.h create mode 100644 3rdparty/bgfx/3rdparty/spirv-tools/source/opt/strip_nonsemantic_info_pass.cpp create mode 100644 3rdparty/bgfx/3rdparty/spirv-tools/source/opt/strip_nonsemantic_info_pass.h delete mode 100644 3rdparty/bgfx/3rdparty/spirv-tools/source/opt/strip_reflect_info_pass.cpp delete mode 100644 3rdparty/bgfx/3rdparty/spirv-tools/source/opt/strip_reflect_info_pass.h create mode 100644 3rdparty/bgfx/3rdparty/spirv-tools/source/util/hash_combine.h create mode 100644 3rdparty/bgfx/3rdparty/spirv-tools/source/val/validate_mesh_shading.cpp create mode 100644 3rdparty/bgfx/3rdparty/spirv-tools/source/val/validate_ray_query.cpp create mode 100644 3rdparty/bgfx/3rdparty/spirv-tools/source/val/validate_ray_tracing.cpp create mode 100644 3rdparty/bgfx/3rdparty/stb/LICENSE create mode 100644 3rdparty/bgfx/bindings/zig/bgfx.zig create mode 100644 3rdparty/bgfx/docs/bgfx.rst create mode 100644 3rdparty/bgfx/docs/build.rst create mode 100644 3rdparty/bgfx/docs/examples.rst create mode 100644 3rdparty/bgfx/docs/index.rst create mode 100644 3rdparty/bgfx/docs/internals.rst create mode 100644 3rdparty/bgfx/docs/license.rst create mode 100644 3rdparty/bgfx/docs/overview.rst create mode 100644 3rdparty/bgfx/docs/tools.rst create mode 100644 3rdparty/bgfx/examples/21-deferred/fs_deferred_combine_ta.sc create mode 100644 3rdparty/bgfx/examples/21-deferred/fs_deferred_debug_ta.sc create mode 100644 3rdparty/bgfx/examples/46-fsr/app.cpp create mode 100644 3rdparty/bgfx/examples/46-fsr/cs_fsr.h create mode 100644 3rdparty/bgfx/examples/46-fsr/cs_fsr_bilinear_16.sc create mode 100644 3rdparty/bgfx/examples/46-fsr/cs_fsr_bilinear_32.sc create mode 100644 3rdparty/bgfx/examples/46-fsr/cs_fsr_easu_16.sc create mode 100644 3rdparty/bgfx/examples/46-fsr/cs_fsr_easu_32.sc create mode 100644 3rdparty/bgfx/examples/46-fsr/cs_fsr_rcas_16.sc create mode 100644 3rdparty/bgfx/examples/46-fsr/cs_fsr_rcas_32.sc create mode 100644 3rdparty/bgfx/examples/46-fsr/ffx_a.h create mode 100644 3rdparty/bgfx/examples/46-fsr/ffx_fsr1.h create mode 100644 3rdparty/bgfx/examples/46-fsr/fs_fsr_copy_linear_to_gamma.sc create mode 100644 3rdparty/bgfx/examples/46-fsr/fs_fsr_forward.sc create mode 100644 3rdparty/bgfx/examples/46-fsr/fs_fsr_forward_grid.sc create mode 100644 3rdparty/bgfx/examples/46-fsr/fsr.cpp create mode 100644 3rdparty/bgfx/examples/46-fsr/fsr.h create mode 100644 3rdparty/bgfx/examples/46-fsr/makefile create mode 100644 3rdparty/bgfx/examples/46-fsr/screenshot.png create mode 100644 3rdparty/bgfx/examples/46-fsr/varying.def.sc create mode 100644 3rdparty/bgfx/examples/46-fsr/vs_fsr_forward.sc create mode 100644 3rdparty/bgfx/examples/46-fsr/vs_fsr_screenquad.sc create mode 100644 3rdparty/bgfx/examples/47-pixelformats/makefile create mode 100644 3rdparty/bgfx/examples/47-pixelformats/pixelformats.cpp create mode 100644 3rdparty/bgfx/examples/47-pixelformats/screenshot.png create mode 100644 3rdparty/bgfx/examples/48-drawindirect/cs_drawindirect.sc create mode 100644 3rdparty/bgfx/examples/48-drawindirect/cs_drawindirect_count.sc create mode 100644 3rdparty/bgfx/examples/48-drawindirect/drawindirect.cpp create mode 100644 3rdparty/bgfx/examples/48-drawindirect/makefile create mode 100644 3rdparty/bgfx/examples/48-drawindirect/screenshot.png create mode 100644 3rdparty/bgfx/examples/49-hextile/fs_hextile.bin create mode 100644 3rdparty/bgfx/examples/49-hextile/fs_hextile.sc create mode 100644 3rdparty/bgfx/examples/49-hextile/hextile.cpp create mode 100644 3rdparty/bgfx/examples/49-hextile/makefile create mode 100644 3rdparty/bgfx/examples/49-hextile/screenshot.png create mode 100644 3rdparty/bgfx/examples/49-hextile/varying.def.sc create mode 100644 3rdparty/bgfx/examples/49-hextile/vs_hextile.sc create mode 100644 3rdparty/bgfx/examples/assets/textures/aerial_rocks_04_diff_2k.jpg delete mode 100644 3rdparty/bgfx/examples/common/bounds.cpp delete mode 100644 3rdparty/bgfx/examples/common/bounds.h delete mode 100644 3rdparty/bgfx/examples/common/bounds.inl delete mode 100644 3rdparty/bgfx/examples/common/entry/entry_winrt.cx create mode 100755 3rdparty/bgfx/examples/runtime/shaders/dx11/cs_drawindirect.bin create mode 100644 3rdparty/bgfx/examples/runtime/shaders/dx11/cs_drawindirect_count.bin create mode 100644 3rdparty/bgfx/examples/runtime/shaders/dx11/cs_fsr_bilinear_16.bin create mode 100644 3rdparty/bgfx/examples/runtime/shaders/dx11/cs_fsr_bilinear_32.bin create mode 100644 3rdparty/bgfx/examples/runtime/shaders/dx11/cs_fsr_easu_16.bin create mode 100644 3rdparty/bgfx/examples/runtime/shaders/dx11/cs_fsr_easu_32.bin create mode 100644 3rdparty/bgfx/examples/runtime/shaders/dx11/cs_fsr_rcas_16.bin create mode 100644 3rdparty/bgfx/examples/runtime/shaders/dx11/cs_fsr_rcas_32.bin create mode 100644 3rdparty/bgfx/examples/runtime/shaders/dx11/fs_deferred_combine_ta.bin create mode 100644 3rdparty/bgfx/examples/runtime/shaders/dx11/fs_deferred_debug_ta.bin create mode 100644 3rdparty/bgfx/examples/runtime/shaders/dx11/fs_fsr_copy_linear_to_gamma.bin create mode 100644 3rdparty/bgfx/examples/runtime/shaders/dx11/fs_fsr_forward.bin create mode 100644 3rdparty/bgfx/examples/runtime/shaders/dx11/fs_fsr_forward_grid.bin create mode 100644 3rdparty/bgfx/examples/runtime/shaders/dx11/fs_hextile.bin create mode 100644 3rdparty/bgfx/examples/runtime/shaders/dx11/vs_fsr_forward.bin create mode 100644 3rdparty/bgfx/examples/runtime/shaders/dx11/vs_fsr_screenquad.bin create mode 100644 3rdparty/bgfx/examples/runtime/shaders/dx11/vs_hextile.bin create mode 100755 3rdparty/bgfx/examples/runtime/shaders/essl/cs_drawindirect.bin create mode 100644 3rdparty/bgfx/examples/runtime/shaders/essl/fs_hextile.bin create mode 100644 3rdparty/bgfx/examples/runtime/shaders/essl/vs_hextile.bin create mode 100755 3rdparty/bgfx/examples/runtime/shaders/glsl/cs_drawindirect.bin create mode 100644 3rdparty/bgfx/examples/runtime/shaders/glsl/cs_drawindirect_count.bin create mode 100644 3rdparty/bgfx/examples/runtime/shaders/glsl/cs_fsr_bilinear_16.bin create mode 100644 3rdparty/bgfx/examples/runtime/shaders/glsl/cs_fsr_bilinear_32.bin create mode 100644 3rdparty/bgfx/examples/runtime/shaders/glsl/cs_fsr_easu_16.bin create mode 100644 3rdparty/bgfx/examples/runtime/shaders/glsl/cs_fsr_easu_32.bin create mode 100644 3rdparty/bgfx/examples/runtime/shaders/glsl/cs_fsr_rcas_16.bin create mode 100644 3rdparty/bgfx/examples/runtime/shaders/glsl/cs_fsr_rcas_32.bin create mode 100644 3rdparty/bgfx/examples/runtime/shaders/glsl/fs_deferred_combine_ta.bin create mode 100644 3rdparty/bgfx/examples/runtime/shaders/glsl/fs_deferred_debug_ta.bin create mode 100644 3rdparty/bgfx/examples/runtime/shaders/glsl/fs_fsr_copy_linear_to_gamma.bin create mode 100644 3rdparty/bgfx/examples/runtime/shaders/glsl/fs_fsr_forward.bin create mode 100644 3rdparty/bgfx/examples/runtime/shaders/glsl/fs_fsr_forward_grid.bin create mode 100644 3rdparty/bgfx/examples/runtime/shaders/glsl/fs_hextile.bin create mode 100644 3rdparty/bgfx/examples/runtime/shaders/glsl/vs_fsr_forward.bin create mode 100644 3rdparty/bgfx/examples/runtime/shaders/glsl/vs_fsr_screenquad.bin create mode 100644 3rdparty/bgfx/examples/runtime/shaders/glsl/vs_hextile.bin create mode 100755 3rdparty/bgfx/examples/runtime/shaders/metal/cs_drawindirect.bin create mode 100644 3rdparty/bgfx/examples/runtime/shaders/metal/cs_drawindirect_count.bin create mode 100644 3rdparty/bgfx/examples/runtime/shaders/metal/cs_fsr_bilinear_16.bin create mode 100644 3rdparty/bgfx/examples/runtime/shaders/metal/cs_fsr_bilinear_32.bin create mode 100644 3rdparty/bgfx/examples/runtime/shaders/metal/cs_fsr_easu_16.bin create mode 100644 3rdparty/bgfx/examples/runtime/shaders/metal/cs_fsr_easu_32.bin create mode 100644 3rdparty/bgfx/examples/runtime/shaders/metal/cs_fsr_rcas_16.bin create mode 100644 3rdparty/bgfx/examples/runtime/shaders/metal/cs_fsr_rcas_32.bin create mode 100644 3rdparty/bgfx/examples/runtime/shaders/metal/fs_deferred_combine_ta.bin create mode 100644 3rdparty/bgfx/examples/runtime/shaders/metal/fs_deferred_debug_ta.bin create mode 100644 3rdparty/bgfx/examples/runtime/shaders/metal/fs_fsr_copy_linear_to_gamma.bin create mode 100644 3rdparty/bgfx/examples/runtime/shaders/metal/fs_fsr_forward.bin create mode 100644 3rdparty/bgfx/examples/runtime/shaders/metal/fs_fsr_forward_grid.bin create mode 100644 3rdparty/bgfx/examples/runtime/shaders/metal/fs_hextile.bin create mode 100644 3rdparty/bgfx/examples/runtime/shaders/metal/vs_fsr_forward.bin create mode 100644 3rdparty/bgfx/examples/runtime/shaders/metal/vs_fsr_screenquad.bin create mode 100644 3rdparty/bgfx/examples/runtime/shaders/metal/vs_hextile.bin create mode 100755 3rdparty/bgfx/examples/runtime/shaders/spirv/cs_drawindirect.bin create mode 100644 3rdparty/bgfx/examples/runtime/shaders/spirv/cs_drawindirect_count.bin create mode 100644 3rdparty/bgfx/examples/runtime/shaders/spirv/cs_fsr_bilinear_16.bin create mode 100644 3rdparty/bgfx/examples/runtime/shaders/spirv/cs_fsr_bilinear_32.bin create mode 100644 3rdparty/bgfx/examples/runtime/shaders/spirv/cs_fsr_easu_16.bin create mode 100644 3rdparty/bgfx/examples/runtime/shaders/spirv/cs_fsr_easu_32.bin create mode 100644 3rdparty/bgfx/examples/runtime/shaders/spirv/cs_fsr_rcas_16.bin create mode 100644 3rdparty/bgfx/examples/runtime/shaders/spirv/cs_fsr_rcas_32.bin create mode 100644 3rdparty/bgfx/examples/runtime/shaders/spirv/fs_deferred_combine_ta.bin create mode 100644 3rdparty/bgfx/examples/runtime/shaders/spirv/fs_deferred_debug_ta.bin create mode 100644 3rdparty/bgfx/examples/runtime/shaders/spirv/fs_fsr_copy_linear_to_gamma.bin create mode 100644 3rdparty/bgfx/examples/runtime/shaders/spirv/fs_fsr_forward.bin create mode 100644 3rdparty/bgfx/examples/runtime/shaders/spirv/fs_fsr_forward_grid.bin create mode 100644 3rdparty/bgfx/examples/runtime/shaders/spirv/fs_hextile.bin create mode 100644 3rdparty/bgfx/examples/runtime/shaders/spirv/vs_fsr_forward.bin create mode 100644 3rdparty/bgfx/examples/runtime/shaders/spirv/vs_fsr_screenquad.bin create mode 100644 3rdparty/bgfx/examples/runtime/shaders/spirv/vs_hextile.bin create mode 100644 3rdparty/bgfx/examples/runtime/textures/aerial_rocks_04_diff_2k.ktx create mode 100644 3rdparty/bgfx/examples/runtime/textures/pf_alpha_test.dds create mode 100644 3rdparty/bgfx/examples/runtime/textures/pf_uv_filtering_test.dds create mode 100644 3rdparty/bgfx/examples/runtime/textures/texture_compression_astc_10x10.dds create mode 100644 3rdparty/bgfx/examples/runtime/textures/texture_compression_astc_10x6.dds create mode 100644 3rdparty/bgfx/examples/runtime/textures/texture_compression_astc_10x8.dds create mode 100644 3rdparty/bgfx/examples/runtime/textures/texture_compression_astc_12x10.dds create mode 100644 3rdparty/bgfx/examples/runtime/textures/texture_compression_astc_12x12.dds create mode 100644 3rdparty/bgfx/examples/runtime/textures/texture_compression_astc_5x4.dds create mode 100644 3rdparty/bgfx/examples/runtime/textures/texture_compression_astc_6x5.dds create mode 100644 3rdparty/bgfx/examples/runtime/textures/texture_compression_astc_8x8.dds create mode 100644 3rdparty/bgfx/examples/runtime/textures/texture_compression_rgba8.dds create mode 100644 3rdparty/bgfx/scripts/bindings-zig.lua delete mode 100644 3rdparty/bimg/3rdparty/astc-codec/.gitignore delete mode 100644 3rdparty/bimg/3rdparty/astc-codec/BUILD.bazel delete mode 100644 3rdparty/bimg/3rdparty/astc-codec/CMakeLists.txt delete mode 100644 3rdparty/bimg/3rdparty/astc-codec/CONTRIBUTING.md delete mode 100644 3rdparty/bimg/3rdparty/astc-codec/GoogleTest-CMakeLists.txt.in delete mode 100644 3rdparty/bimg/3rdparty/astc-codec/LICENSE delete mode 100644 3rdparty/bimg/3rdparty/astc-codec/README.md delete mode 100644 3rdparty/bimg/3rdparty/astc-codec/WORKSPACE delete mode 100644 3rdparty/bimg/3rdparty/astc-codec/cmake-format.json delete mode 100644 3rdparty/bimg/3rdparty/astc-codec/include/astc-codec/astc-codec.h delete mode 100644 3rdparty/bimg/3rdparty/astc-codec/src/.clang-format delete mode 100644 3rdparty/bimg/3rdparty/astc-codec/src/base/BUILD.bazel delete mode 100644 3rdparty/bimg/3rdparty/astc-codec/src/base/CMakeLists.txt delete mode 100644 3rdparty/bimg/3rdparty/astc-codec/src/base/bit_stream.h delete mode 100644 3rdparty/bimg/3rdparty/astc-codec/src/base/bottom_n.h delete mode 100644 3rdparty/bimg/3rdparty/astc-codec/src/base/math_utils.h delete mode 100644 3rdparty/bimg/3rdparty/astc-codec/src/base/optional.h delete mode 100644 3rdparty/bimg/3rdparty/astc-codec/src/base/string_utils.h delete mode 100644 3rdparty/bimg/3rdparty/astc-codec/src/base/test/bit_stream_test.cpp delete mode 100644 3rdparty/bimg/3rdparty/astc-codec/src/base/test/bottom_n_test.cpp delete mode 100644 3rdparty/bimg/3rdparty/astc-codec/src/base/test/math_utils_test.cpp delete mode 100644 3rdparty/bimg/3rdparty/astc-codec/src/base/test/optional_test.cpp delete mode 100644 3rdparty/bimg/3rdparty/astc-codec/src/base/test/string_utils_test.cpp delete mode 100644 3rdparty/bimg/3rdparty/astc-codec/src/base/test/type_traits_test.cpp delete mode 100644 3rdparty/bimg/3rdparty/astc-codec/src/base/test/uint128_test.cpp delete mode 100644 3rdparty/bimg/3rdparty/astc-codec/src/base/type_traits.h delete mode 100644 3rdparty/bimg/3rdparty/astc-codec/src/base/uint128.h delete mode 100644 3rdparty/bimg/3rdparty/astc-codec/src/base/utils.h delete mode 100644 3rdparty/bimg/3rdparty/astc-codec/src/decoder/BUILD.bazel delete mode 100644 3rdparty/bimg/3rdparty/astc-codec/src/decoder/CMakeLists.txt delete mode 100644 3rdparty/bimg/3rdparty/astc-codec/src/decoder/astc_file.cc delete mode 100644 3rdparty/bimg/3rdparty/astc-codec/src/decoder/astc_file.h delete mode 100644 3rdparty/bimg/3rdparty/astc-codec/src/decoder/codec.cc delete mode 100644 3rdparty/bimg/3rdparty/astc-codec/src/decoder/codec.h delete mode 100644 3rdparty/bimg/3rdparty/astc-codec/src/decoder/endpoint_codec.cc delete mode 100644 3rdparty/bimg/3rdparty/astc-codec/src/decoder/endpoint_codec.h delete mode 100644 3rdparty/bimg/3rdparty/astc-codec/src/decoder/footprint.cc delete mode 100644 3rdparty/bimg/3rdparty/astc-codec/src/decoder/footprint.h delete mode 100644 3rdparty/bimg/3rdparty/astc-codec/src/decoder/integer_sequence_codec.cc delete mode 100644 3rdparty/bimg/3rdparty/astc-codec/src/decoder/integer_sequence_codec.h delete mode 100644 3rdparty/bimg/3rdparty/astc-codec/src/decoder/intermediate_astc_block.cc delete mode 100644 3rdparty/bimg/3rdparty/astc-codec/src/decoder/intermediate_astc_block.h delete mode 100644 3rdparty/bimg/3rdparty/astc-codec/src/decoder/logical_astc_block.cc delete mode 100644 3rdparty/bimg/3rdparty/astc-codec/src/decoder/logical_astc_block.h delete mode 100644 3rdparty/bimg/3rdparty/astc-codec/src/decoder/partition.cc delete mode 100644 3rdparty/bimg/3rdparty/astc-codec/src/decoder/partition.h delete mode 100644 3rdparty/bimg/3rdparty/astc-codec/src/decoder/physical_astc_block.cc delete mode 100644 3rdparty/bimg/3rdparty/astc-codec/src/decoder/physical_astc_block.h delete mode 100644 3rdparty/bimg/3rdparty/astc-codec/src/decoder/quantization.cc delete mode 100644 3rdparty/bimg/3rdparty/astc-codec/src/decoder/quantization.h delete mode 100644 3rdparty/bimg/3rdparty/astc-codec/src/decoder/test/astc_fuzzer.cc delete mode 100644 3rdparty/bimg/3rdparty/astc-codec/src/decoder/test/codec_test.cc delete mode 100644 3rdparty/bimg/3rdparty/astc-codec/src/decoder/test/endpoint_codec_test.cc delete mode 100644 3rdparty/bimg/3rdparty/astc-codec/src/decoder/test/footprint_test.cc delete mode 100644 3rdparty/bimg/3rdparty/astc-codec/src/decoder/test/image_utils.h delete mode 100644 3rdparty/bimg/3rdparty/astc-codec/src/decoder/test/integer_sequence_codec_test.cc delete mode 100644 3rdparty/bimg/3rdparty/astc-codec/src/decoder/test/intermediate_astc_block_test.cc delete mode 100644 3rdparty/bimg/3rdparty/astc-codec/src/decoder/test/logical_astc_block_test.cc delete mode 100644 3rdparty/bimg/3rdparty/astc-codec/src/decoder/test/partition_test.cc delete mode 100644 3rdparty/bimg/3rdparty/astc-codec/src/decoder/test/physical_astc_block_test.cc delete mode 100644 3rdparty/bimg/3rdparty/astc-codec/src/decoder/test/quantization_test.cc delete mode 100644 3rdparty/bimg/3rdparty/astc-codec/src/decoder/test/weight_infill_test.cc delete mode 100644 3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/atlas_small_4x4.astc delete mode 100644 3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/atlas_small_4x4.bmp delete mode 100644 3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/atlas_small_5x5.astc delete mode 100644 3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/atlas_small_5x5.bmp delete mode 100644 3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/atlas_small_6x6.astc delete mode 100644 3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/atlas_small_6x6.bmp delete mode 100644 3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/atlas_small_8x8.astc delete mode 100644 3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/atlas_small_8x8.bmp delete mode 100644 3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/checkerboard.astc delete mode 100644 3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/checkered_10.astc delete mode 100644 3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/checkered_11.astc delete mode 100644 3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/checkered_12.astc delete mode 100644 3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/checkered_4.astc delete mode 100644 3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/checkered_5.astc delete mode 100644 3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/checkered_6.astc delete mode 100644 3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/checkered_7.astc delete mode 100644 3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/checkered_8.astc delete mode 100644 3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/checkered_9.astc delete mode 100644 3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/footprint_10x10.astc delete mode 100644 3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/footprint_10x10.bmp delete mode 100644 3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/footprint_10x5.astc delete mode 100644 3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/footprint_10x5.bmp delete mode 100644 3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/footprint_10x6.astc delete mode 100644 3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/footprint_10x6.bmp delete mode 100644 3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/footprint_10x8.astc delete mode 100644 3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/footprint_10x8.bmp delete mode 100644 3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/footprint_12x10.astc delete mode 100644 3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/footprint_12x10.bmp delete mode 100644 3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/footprint_12x12.astc delete mode 100644 3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/footprint_12x12.bmp delete mode 100644 3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/footprint_4x4.astc delete mode 100644 3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/footprint_4x4.bmp delete mode 100644 3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/footprint_5x4.astc delete mode 100644 3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/footprint_5x4.bmp delete mode 100644 3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/footprint_5x5.astc delete mode 100644 3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/footprint_5x5.bmp delete mode 100644 3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/footprint_6x5.astc delete mode 100644 3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/footprint_6x5.bmp delete mode 100644 3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/footprint_6x6.astc delete mode 100644 3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/footprint_6x6.bmp delete mode 100644 3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/footprint_8x5.astc delete mode 100644 3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/footprint_8x5.bmp delete mode 100644 3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/footprint_8x6.astc delete mode 100644 3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/footprint_8x6.bmp delete mode 100644 3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/footprint_8x8.astc delete mode 100644 3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/footprint_8x8.bmp delete mode 100644 3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/rgb_12x12.astc delete mode 100644 3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/rgb_12x12.bmp delete mode 100644 3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/rgb_4x4.astc delete mode 100644 3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/rgb_4x4.bmp delete mode 100644 3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/rgb_5x4.astc delete mode 100644 3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/rgb_5x4.bmp delete mode 100644 3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/rgb_6x6.astc delete mode 100644 3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/rgb_6x6.bmp delete mode 100644 3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/rgb_8x8.astc delete mode 100644 3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/rgb_8x8.bmp delete mode 100644 3rdparty/bimg/3rdparty/astc-codec/src/decoder/tools/astc_inspector_cli.cc delete mode 100644 3rdparty/bimg/3rdparty/astc-codec/src/decoder/types.h delete mode 100644 3rdparty/bimg/3rdparty/astc-codec/src/decoder/weight_infill.cc delete mode 100644 3rdparty/bimg/3rdparty/astc-codec/src/decoder/weight_infill.h delete mode 100644 3rdparty/bimg/3rdparty/astc-codec/third_party/BUILD delete mode 100644 3rdparty/bimg/3rdparty/astc-codec/third_party/honggfuzz.BUILD delete mode 100755 3rdparty/bimg/3rdparty/astc-codec/tools/build-ci/linux/build.sh delete mode 100644 3rdparty/bimg/3rdparty/astc-codec/tools/build-ci/linux/continuous.cfg delete mode 100644 3rdparty/bimg/3rdparty/astc-codec/tools/build-ci/linux/presubmit.cfg create mode 100644 3rdparty/bimg/3rdparty/astc-encoder/LICENSE.txt create mode 100644 3rdparty/bimg/3rdparty/astc-encoder/include/astcenc.h create mode 100644 3rdparty/bimg/3rdparty/astc-encoder/source/astcenc_averages_and_directions.cpp create mode 100644 3rdparty/bimg/3rdparty/astc-encoder/source/astcenc_block_sizes.cpp create mode 100644 3rdparty/bimg/3rdparty/astc-encoder/source/astcenc_color_quantize.cpp create mode 100644 3rdparty/bimg/3rdparty/astc-encoder/source/astcenc_color_unquantize.cpp create mode 100644 3rdparty/bimg/3rdparty/astc-encoder/source/astcenc_compress_symbolic.cpp create mode 100644 3rdparty/bimg/3rdparty/astc-encoder/source/astcenc_compute_variance.cpp create mode 100644 3rdparty/bimg/3rdparty/astc-encoder/source/astcenc_decompress_symbolic.cpp create mode 100644 3rdparty/bimg/3rdparty/astc-encoder/source/astcenc_diagnostic_trace.cpp create mode 100644 3rdparty/bimg/3rdparty/astc-encoder/source/astcenc_diagnostic_trace.h create mode 100644 3rdparty/bimg/3rdparty/astc-encoder/source/astcenc_entry.cpp create mode 100644 3rdparty/bimg/3rdparty/astc-encoder/source/astcenc_find_best_partitioning.cpp create mode 100644 3rdparty/bimg/3rdparty/astc-encoder/source/astcenc_ideal_endpoints_and_weights.cpp create mode 100644 3rdparty/bimg/3rdparty/astc-encoder/source/astcenc_image.cpp create mode 100644 3rdparty/bimg/3rdparty/astc-encoder/source/astcenc_integer_sequence.cpp create mode 100644 3rdparty/bimg/3rdparty/astc-encoder/source/astcenc_internal.h create mode 100644 3rdparty/bimg/3rdparty/astc-encoder/source/astcenc_internal_entry.h create mode 100644 3rdparty/bimg/3rdparty/astc-encoder/source/astcenc_mathlib.cpp create mode 100644 3rdparty/bimg/3rdparty/astc-encoder/source/astcenc_mathlib.h create mode 100644 3rdparty/bimg/3rdparty/astc-encoder/source/astcenc_mathlib_softfloat.cpp create mode 100644 3rdparty/bimg/3rdparty/astc-encoder/source/astcenc_partition_tables.cpp create mode 100644 3rdparty/bimg/3rdparty/astc-encoder/source/astcenc_percentile_tables.cpp create mode 100644 3rdparty/bimg/3rdparty/astc-encoder/source/astcenc_pick_best_endpoint_format.cpp create mode 100644 3rdparty/bimg/3rdparty/astc-encoder/source/astcenc_platform_isa_detection.cpp create mode 100644 3rdparty/bimg/3rdparty/astc-encoder/source/astcenc_quantization.cpp create mode 100644 3rdparty/bimg/3rdparty/astc-encoder/source/astcenc_symbolic_physical.cpp create mode 100644 3rdparty/bimg/3rdparty/astc-encoder/source/astcenc_vecmathlib.h create mode 100644 3rdparty/bimg/3rdparty/astc-encoder/source/astcenc_vecmathlib_avx2_8.h create mode 100644 3rdparty/bimg/3rdparty/astc-encoder/source/astcenc_vecmathlib_common_4.h create mode 100644 3rdparty/bimg/3rdparty/astc-encoder/source/astcenc_vecmathlib_neon_4.h create mode 100644 3rdparty/bimg/3rdparty/astc-encoder/source/astcenc_vecmathlib_none_4.h create mode 100644 3rdparty/bimg/3rdparty/astc-encoder/source/astcenc_vecmathlib_sse_4.h create mode 100644 3rdparty/bimg/3rdparty/astc-encoder/source/astcenc_weight_align.cpp create mode 100644 3rdparty/bimg/3rdparty/astc-encoder/source/astcenc_weight_quant_xfer_tables.cpp delete mode 100644 3rdparty/bimg/3rdparty/astc/astc_averages_and_directions.cpp delete mode 100644 3rdparty/bimg/3rdparty/astc/astc_block_sizes2.cpp delete mode 100644 3rdparty/bimg/3rdparty/astc/astc_codec_internals.h delete mode 100644 3rdparty/bimg/3rdparty/astc/astc_color_quantize.cpp delete mode 100644 3rdparty/bimg/3rdparty/astc/astc_color_unquantize.cpp delete mode 100644 3rdparty/bimg/3rdparty/astc/astc_compress_symbolic.cpp delete mode 100644 3rdparty/bimg/3rdparty/astc/astc_compute_variance.cpp delete mode 100644 3rdparty/bimg/3rdparty/astc/astc_decompress_symbolic.cpp delete mode 100644 3rdparty/bimg/3rdparty/astc/astc_encoding_choice_error.cpp delete mode 100644 3rdparty/bimg/3rdparty/astc/astc_find_best_partitioning.cpp delete mode 100644 3rdparty/bimg/3rdparty/astc/astc_ideal_endpoints_and_weights.cpp delete mode 100644 3rdparty/bimg/3rdparty/astc/astc_imageblock.cpp delete mode 100644 3rdparty/bimg/3rdparty/astc/astc_integer_sequence.cpp delete mode 100644 3rdparty/bimg/3rdparty/astc/astc_kmeans_partitioning.cpp delete mode 100644 3rdparty/bimg/3rdparty/astc/astc_lib.cpp delete mode 100644 3rdparty/bimg/3rdparty/astc/astc_lib.h delete mode 100644 3rdparty/bimg/3rdparty/astc/astc_partition_tables.cpp delete mode 100644 3rdparty/bimg/3rdparty/astc/astc_percentile_tables.cpp delete mode 100644 3rdparty/bimg/3rdparty/astc/astc_pick_best_endpoint_format.cpp delete mode 100644 3rdparty/bimg/3rdparty/astc/astc_quantization.cpp delete mode 100644 3rdparty/bimg/3rdparty/astc/astc_symbolic_physical.cpp delete mode 100644 3rdparty/bimg/3rdparty/astc/astc_weight_align.cpp delete mode 100644 3rdparty/bimg/3rdparty/astc/astc_weight_quant_xfer_tables.cpp delete mode 100644 3rdparty/bimg/3rdparty/astc/license.txt delete mode 100644 3rdparty/bimg/3rdparty/astc/mathlib.cpp delete mode 100644 3rdparty/bimg/3rdparty/astc/mathlib.h delete mode 100644 3rdparty/bimg/3rdparty/astc/readme.txt delete mode 100644 3rdparty/bimg/3rdparty/astc/softfloat.cpp delete mode 100644 3rdparty/bimg/3rdparty/astc/softfloat.h delete mode 100644 3rdparty/bimg/3rdparty/astc/vectypes.h delete mode 100644 3rdparty/bx/3rdparty/catch/catch.hpp create mode 100644 3rdparty/bx/3rdparty/catch/catch_amalgamated.cpp create mode 100644 3rdparty/bx/3rdparty/catch/catch_amalgamated.hpp create mode 100644 3rdparty/bx/include/bx/bounds.h create mode 100644 3rdparty/bx/include/bx/constants.h create mode 100644 3rdparty/bx/include/bx/inline/bounds.inl create mode 100644 3rdparty/bx/include/bx/inline/typetraits.inl create mode 100644 3rdparty/bx/include/bx/typetraits.h create mode 100644 3rdparty/bx/include/compat/linux/sal.h create mode 100644 3rdparty/bx/src/bounds.cpp delete mode 100644 3rdparty/bx/src/bx_p.h create mode 100644 3rdparty/bx/tests/allocator_test.cpp delete mode 100644 3rdparty/bx/tests/nlalloc_test.cpp create mode 100644 3rdparty/bx/tests/typetraits_test.cpp diff --git a/3rdparty/bgfx/.appveyor.yml b/3rdparty/bgfx/.appveyor.yml deleted file mode 100644 index 8c1698d8b05..00000000000 --- a/3rdparty/bgfx/.appveyor.yml +++ /dev/null @@ -1,25 +0,0 @@ -shallow_clone: true - -os: - - Visual Studio 2019 - -environment: - matrix: - - TOOLSET: vs2017 -# - TOOLSET: vs2019 - -platform: - - Win32 - - x64 - -configuration: - - Debug - - Release - -install: - - git clone --depth 1 https://github.com/bkaradzic/bx ..\bx - - git clone --depth 1 https://github.com/bkaradzic/bimg ..\bimg - - ..\bx\tools\bin\windows\genie --with-tools --with-examples %TOOLSET% - -build: - project: .build/projects/$(TOOLSET)/bgfx.sln diff --git a/3rdparty/bgfx/.editorconfig b/3rdparty/bgfx/.editorconfig index a1395a709b8..1fd7d0ccec8 100644 --- a/3rdparty/bgfx/.editorconfig +++ b/3rdparty/bgfx/.editorconfig @@ -18,3 +18,7 @@ indent_style = space [*.md] trim_trailing_whitespace = false max_line_length = 80 + +[.github/workflows/*.yml] +indent_style = space +indent_size = 2 diff --git a/3rdparty/bgfx/.gitattributes b/3rdparty/bgfx/.gitattributes index e89cf41267e..dde21f78733 100644 --- a/3rdparty/bgfx/.gitattributes +++ b/3rdparty/bgfx/.gitattributes @@ -1,11 +1,12 @@ +*.bin binary diff=hex *.c eol=lf *.cpp eol=lf *.h eol=lf -*.sc eol=lf -*.sh eol=lf +*.lua eol=lf *.m eol=lf -*.mm eol=lf *.md eol=lf -*.lua eol=lf *.mk eol=lf +*.mm eol=lf +*.sc eol=lf +*.sh eol=lf makefile eol=lf diff --git a/3rdparty/bgfx/.github/ISSUE_TEMPLATE/bug_report.md b/3rdparty/bgfx/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 00000000000..9a1f2e73ad4 --- /dev/null +++ b/3rdparty/bgfx/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,54 @@ +--- +name: Bug report (FOR BUGS ONLY! DO NOT SUBMIT QUESTIONS HERE!) +about: Create a report to help us improve +title: '' +labels: '' +assignees: '' + +--- + + + +**Describe the bug** +A clear and concise description of what the bug is. + +**To Reproduce** +Steps to reproduce the behavior: +1. Go to '...' +2. Click on '....' +3. Scroll down to '....' +4. See error + +**Expected behavior** +A clear and concise description of what you expected to happen. + +**Screenshots** +If applicable, add screenshots to help explain your problem. + +**Additional context** +Add any other context about the problem here. OS, drivers, etc. diff --git a/3rdparty/bgfx/.github/workflows/main.yml b/3rdparty/bgfx/.github/workflows/main.yml new file mode 100644 index 00000000000..63772b046ee --- /dev/null +++ b/3rdparty/bgfx/.github/workflows/main.yml @@ -0,0 +1,250 @@ +name: CI + +concurrency: + group: ${{ github.ref }} + cancel-in-progress: true + +on: + push: + pull_request: + +jobs: + msvc: + strategy: + fail-fast: true + matrix: + include: [ + { config: Debug, platform: Win32, bindir: 'win32_vs2019' }, + { config: Debug, platform: x64, bindir: 'win64_vs2019' }, + { config: Release, platform: Win32, bindir: 'win32_vs2019' }, + { config: Release, platform: x64, bindir: 'win64_vs2019' }, + ] + name: msvc-${{ matrix.config }}-${{ matrix.platform }} + runs-on: windows-2019 + steps: + - name: Checkout bgfx + uses: actions/checkout@v3 + with: + path: bgfx + - name: Checkout bx + uses: actions/checkout@v3 + with: + repository: bkaradzic/bx + path: bx + - name: Checkout bimg + uses: actions/checkout@v3 + with: + repository: bkaradzic/bimg + path: bimg + - name: Prepare + uses: microsoft/setup-msbuild@v1.1 + - name: Build + shell: cmd + run: | + cd bgfx + ..\bx\tools\bin\windows\genie.exe --with-tools --with-combined-examples --with-shared-lib vs2019 + msbuild ".build/projects/vs2019/bgfx.sln" /m /v:minimal /p:Configuration=${{ matrix.config }} /p:Platform=${{ matrix.platform }} + - name: Check + shell: cmd + run: | + cd bgfx + dir /s ".build\${{ matrix.bindir }}\bin" + ".build\${{ matrix.bindir }}\bin\geometryc${{ matrix.config }}.exe" --version + ".build\${{ matrix.bindir }}\bin\shaderc${{ matrix.config }}.exe" --version + ".build\${{ matrix.bindir }}\bin\texturec${{ matrix.config }}.exe" --version + mingw: + strategy: + fail-fast: true + matrix: + include: [ + { msystem: MINGW64, project: 'mingw-gcc', bindir: 'win64_mingw-gcc' }, + { msystem: CLANG64, project: 'mingw-clang', bindir: 'win64_mingw-clang' }, + ] + name: mingw-${{ matrix.msystem }} + runs-on: windows-latest + steps: + - name: Checkout bgfx + uses: actions/checkout@v3 + with: + path: bgfx + - name: Checkout bx + uses: actions/checkout@v3 + with: + repository: bkaradzic/bx + path: bx + - name: Checkout bimg + uses: actions/checkout@v3 + with: + repository: bkaradzic/bimg + path: bimg + - name: Prepare + uses: msys2/setup-msys2@v2 + with: + msystem: ${{ matrix.msystem }} + update: true + install: make + pacboy: cc:p + - name: Build + shell: msys2 {0} + run: | + cd bgfx + make ${{ matrix.project }}-release64 -j$(nproc) AR=ar CC=cc CXX=c++ MINGW=$MINGW_PREFIX + - name: Check + shell: cmd + run: | + cd bgfx + dir /s ".build\${{ matrix.bindir }}\bin" + ".build\${{ matrix.bindir }}\bin\geometrycRelease.exe" --version + ".build\${{ matrix.bindir }}\bin\shadercRelease.exe" --version + ".build\${{ matrix.bindir }}\bin\texturecRelease.exe" --version + linux: + strategy: + fail-fast: true + matrix: + include: [ + { config: debug, binsuffix: Debug }, + { config: release, binsuffix: Release }, + ] + name: linux-${{ matrix.config }}64 + runs-on: ubuntu-22.04 + steps: + - name: Checkout bgfx + uses: actions/checkout@v3 + with: + path: bgfx + - name: Checkout bx + uses: actions/checkout@v3 + with: + repository: bkaradzic/bx + path: bx + - name: Checkout bimg + uses: actions/checkout@v3 + with: + repository: bkaradzic/bimg + path: bimg + - name: Build + run: | + sudo apt install libgl-dev + cd bgfx + make -j$(nproc) linux-${{ matrix.config }}64 + - name: Check + run: | + cd bgfx + ls -lash ".build/linux64_gcc/bin" + ".build/linux64_gcc/bin/geometryc${{ matrix.binsuffix}}" --version + ".build/linux64_gcc/bin/shaderc${{ matrix.binsuffix}}" --version + ".build/linux64_gcc/bin/texturec${{ matrix.binsuffix}}" --version + wasm: + strategy: + fail-fast: true + matrix: + config: [ debug, release] + name: wasm-${{ matrix.config }} + runs-on: ubuntu-22.04 + steps: + - name: Checkout bgfx + uses: actions/checkout@v3 + with: + path: bgfx + - name: Checkout bx + uses: actions/checkout@v3 + with: + repository: bkaradzic/bx + path: bx + - name: Checkout bimg + uses: actions/checkout@v3 + with: + repository: bkaradzic/bimg + path: bimg + - name: Prepare + run: | + docker pull emscripten/emsdk + docker run --rm emscripten/emsdk which emcc em++ emar + cd bgfx + EMSCRIPTEN=/emsdk/upstream/emscripten ../bx/tools/bin/linux/genie --with-examples --gcc=wasm gmake + - name: Build + run: > + docker run --rm -u $(id -u):$(id -g) -v $(pwd):/bgfx emscripten/emsdk + make -C /bgfx/bgfx wasm-${{ matrix.config }} -j$(nproc) EMSCRIPTEN=/emsdk/upstream/emscripten + - name: Check + run: | + cd bgfx + ls -lash ".build/wasm/bin" + osx: + strategy: + fail-fast: true + matrix: + include: [ + { config: debug, binsuffix: Debug }, + { config: release, binsuffix: Release }, + ] + name: osx-x64-${{ matrix.config }} + runs-on: macos-latest + steps: + - name: Checkout bgfx + uses: actions/checkout@v3 + with: + path: bgfx + - name: Checkout bx + uses: actions/checkout@v3 + with: + repository: bkaradzic/bx + path: bx + - name: Checkout bimg + uses: actions/checkout@v3 + with: + repository: bkaradzic/bimg + path: bimg + - name: Build + run: | + cd bgfx + make -j$(sysctl -n hw.physicalcpu) osx-x64-${{ matrix.config }} + - name: Check + run: | + cd bgfx + ls -lash ".build/osx-x64/bin" + ".build/osx-x64/bin/geometryc${{ matrix.binsuffix}}" --version + ".build/osx-x64/bin/shaderc${{ matrix.binsuffix}}" --version + ".build/osx-x64/bin/texturec${{ matrix.binsuffix}}" --version + android: + strategy: + fail-fast: true + matrix: + include: [ + { platform: arm }, + { platform: arm64 }, + { platform: x86 }, + { platform: x86_64 }, + ] + name: android-${{ matrix.platform }} + runs-on: ubuntu-22.04 + steps: + - uses: nttld/setup-ndk@v1 + id: setup-ndk + with: + ndk-version: r25b + add-to-path: false + - name: Checkout bgfx + uses: actions/checkout@v3 + with: + path: bgfx + - name: Checkout bx + uses: actions/checkout@v3 + with: + repository: bkaradzic/bx + path: bx + - name: Checkout bimg + uses: actions/checkout@v3 + with: + repository: bkaradzic/bimg + path: bimg + - name: Build + run: | + cd bgfx + make -j$(sysctl -n hw.physicalcpu) android-${{ matrix.platform }} + env: + ANDROID_NDK_ROOT: ${{ steps.setup-ndk.outputs.ndk-path }} + - name: Check + run: | + cd bgfx + ls -lash ".build/android-${{ matrix.platform }}/bin" diff --git a/3rdparty/bgfx/.gitignore b/3rdparty/bgfx/.gitignore index 362a7c691a6..0e292f5cfec 100644 --- a/3rdparty/bgfx/.gitignore +++ b/3rdparty/bgfx/.gitignore @@ -1,9 +1,11 @@ +*.TMP +*.dxvk-cache +*.log +.DS_Store .build .debug -.DS_Store +.gdb_history .git .svn -tags -.gdb_history .vscode -*.TMP +tags diff --git a/3rdparty/bgfx/3rdparty/cgltf/cgltf.h b/3rdparty/bgfx/3rdparty/cgltf/cgltf.h index 5650038019d..0e9c67eaa55 100644 --- a/3rdparty/bgfx/3rdparty/cgltf/cgltf.h +++ b/3rdparty/bgfx/3rdparty/cgltf/cgltf.h @@ -1,7 +1,7 @@ /** * cgltf - a single-file glTF 2.0 parser written in C99. * - * Version: 1.11 + * Version: 1.13 * * Website: https://github.com/jkuhlmann/cgltf * @@ -63,7 +63,7 @@ * By passing null for the output pointer, users can find out how many floats are required in the * output buffer. * - * `cgltf_accessor_num_components` is a tiny utility that tells you the dimensionality of + * `cgltf_num_components` is a tiny utility that tells you the dimensionality of * a certain accessor type. This can be used before `cgltf_accessor_unpack_floats` to help allocate * the necessary amount of memory. * @@ -80,25 +80,23 @@ * `cgltf_accessor_read_index` is similar to its floating-point counterpart, but it returns size_t * and only works with single-component data types. * - * `cgltf_result cgltf_copy_extras_json(const cgltf_data*, const cgltf_extras*, - * char* dest, cgltf_size* dest_size)` allows users to retrieve the "extras" data that - * can be attached to many glTF objects (which can be arbitrary JSON data). The - * `cgltf_extras` struct stores the offsets of the start and end of the extras JSON data - * as it appears in the complete glTF JSON data. This function copies the extras data - * into the provided buffer. If `dest` is NULL, the length of the data is written into - * `dest_size`. You can then parse this data using your own JSON parser + * `cgltf_copy_extras_json` allows users to retrieve the "extras" data that can be attached to many + * glTF objects (which can be arbitrary JSON data). This is a legacy function, consider using + * cgltf_extras::data directly instead. You can parse this data using your own JSON parser * or, if you've included the cgltf implementation using the integrated JSMN JSON parser. */ #ifndef CGLTF_H_INCLUDED__ #define CGLTF_H_INCLUDED__ #include +#include /* For uint8_t, uint32_t */ #ifdef __cplusplus extern "C" { #endif typedef size_t cgltf_size; +typedef long long int cgltf_ssize; typedef float cgltf_float; typedef int cgltf_int; typedef unsigned int cgltf_uint; @@ -109,6 +107,7 @@ typedef enum cgltf_file_type cgltf_file_type_invalid, cgltf_file_type_gltf, cgltf_file_type_glb, + cgltf_file_type_max_enum } cgltf_file_type; typedef enum cgltf_result @@ -123,12 +122,13 @@ typedef enum cgltf_result cgltf_result_io_error, cgltf_result_out_of_memory, cgltf_result_legacy_gltf, + cgltf_result_max_enum } cgltf_result; typedef struct cgltf_memory_options { - void* (*alloc)(void* user, cgltf_size size); - void (*free) (void* user, void* ptr); + void* (*alloc_func)(void* user, cgltf_size size); + void (*free_func) (void* user, void* ptr); void* user_data; } cgltf_memory_options; @@ -152,6 +152,7 @@ typedef enum cgltf_buffer_view_type cgltf_buffer_view_type_invalid, cgltf_buffer_view_type_indices, cgltf_buffer_view_type_vertices, + cgltf_buffer_view_type_max_enum } cgltf_buffer_view_type; typedef enum cgltf_attribute_type @@ -164,6 +165,8 @@ typedef enum cgltf_attribute_type cgltf_attribute_type_color, cgltf_attribute_type_joints, cgltf_attribute_type_weights, + cgltf_attribute_type_custom, + cgltf_attribute_type_max_enum } cgltf_attribute_type; typedef enum cgltf_component_type @@ -175,6 +178,7 @@ typedef enum cgltf_component_type cgltf_component_type_r_16u, /* UNSIGNED_SHORT */ cgltf_component_type_r_32u, /* UNSIGNED_INT */ cgltf_component_type_r_32f, /* FLOAT */ + cgltf_component_type_max_enum } cgltf_component_type; typedef enum cgltf_type @@ -187,6 +191,7 @@ typedef enum cgltf_type cgltf_type_mat2, cgltf_type_mat3, cgltf_type_mat4, + cgltf_type_max_enum } cgltf_type; typedef enum cgltf_primitive_type @@ -198,6 +203,7 @@ typedef enum cgltf_primitive_type cgltf_primitive_type_triangles, cgltf_primitive_type_triangle_strip, cgltf_primitive_type_triangle_fan, + cgltf_primitive_type_max_enum } cgltf_primitive_type; typedef enum cgltf_alpha_mode @@ -205,6 +211,7 @@ typedef enum cgltf_alpha_mode cgltf_alpha_mode_opaque, cgltf_alpha_mode_mask, cgltf_alpha_mode_blend, + cgltf_alpha_mode_max_enum } cgltf_alpha_mode; typedef enum cgltf_animation_path_type { @@ -213,18 +220,21 @@ typedef enum cgltf_animation_path_type { cgltf_animation_path_type_rotation, cgltf_animation_path_type_scale, cgltf_animation_path_type_weights, + cgltf_animation_path_type_max_enum } cgltf_animation_path_type; typedef enum cgltf_interpolation_type { cgltf_interpolation_type_linear, cgltf_interpolation_type_step, cgltf_interpolation_type_cubic_spline, + cgltf_interpolation_type_max_enum } cgltf_interpolation_type; typedef enum cgltf_camera_type { cgltf_camera_type_invalid, cgltf_camera_type_perspective, cgltf_camera_type_orthographic, + cgltf_camera_type_max_enum } cgltf_camera_type; typedef enum cgltf_light_type { @@ -232,17 +242,21 @@ typedef enum cgltf_light_type { cgltf_light_type_directional, cgltf_light_type_point, cgltf_light_type_spot, + cgltf_light_type_max_enum } cgltf_light_type; typedef enum cgltf_data_free_method { cgltf_data_free_method_none, cgltf_data_free_method_file_release, cgltf_data_free_method_memory_free, + cgltf_data_free_method_max_enum } cgltf_data_free_method; typedef struct cgltf_extras { - cgltf_size start_offset; - cgltf_size end_offset; + cgltf_size start_offset; /* this field is deprecated and will be removed in the future; use data instead */ + cgltf_size end_offset; /* this field is deprecated and will be removed in the future; use data instead */ + + char* data; } cgltf_extras; typedef struct cgltf_extension { @@ -267,6 +281,7 @@ typedef enum cgltf_meshopt_compression_mode { cgltf_meshopt_compression_mode_attributes, cgltf_meshopt_compression_mode_triangles, cgltf_meshopt_compression_mode_indices, + cgltf_meshopt_compression_mode_max_enum } cgltf_meshopt_compression_mode; typedef enum cgltf_meshopt_compression_filter { @@ -274,6 +289,7 @@ typedef enum cgltf_meshopt_compression_filter { cgltf_meshopt_compression_filter_octahedral, cgltf_meshopt_compression_filter_quaternion, cgltf_meshopt_compression_filter_exponential, + cgltf_meshopt_compression_filter_max_enum } cgltf_meshopt_compression_filter; typedef struct cgltf_meshopt_compression @@ -415,8 +431,6 @@ typedef struct cgltf_pbr_metallic_roughness cgltf_float base_color_factor[4]; cgltf_float metallic_factor; cgltf_float roughness_factor; - - cgltf_extras extras; } cgltf_pbr_metallic_roughness; typedef struct cgltf_pbr_specular_glossiness @@ -474,6 +488,21 @@ typedef struct cgltf_sheen cgltf_float sheen_roughness_factor; } cgltf_sheen; +typedef struct cgltf_emissive_strength +{ + cgltf_float emissive_strength; +} cgltf_emissive_strength; + +typedef struct cgltf_iridescence +{ + cgltf_float iridescence_factor; + cgltf_texture_view iridescence_texture; + cgltf_float iridescence_ior; + cgltf_float iridescence_thickness_min; + cgltf_float iridescence_thickness_max; + cgltf_texture_view iridescence_thickness_texture; +} cgltf_iridescence; + typedef struct cgltf_material { char* name; @@ -485,6 +514,8 @@ typedef struct cgltf_material cgltf_bool has_ior; cgltf_bool has_specular; cgltf_bool has_sheen; + cgltf_bool has_emissive_strength; + cgltf_bool has_iridescence; cgltf_pbr_metallic_roughness pbr_metallic_roughness; cgltf_pbr_specular_glossiness pbr_specular_glossiness; cgltf_clearcoat clearcoat; @@ -493,6 +524,8 @@ typedef struct cgltf_material cgltf_sheen sheen; cgltf_transmission transmission; cgltf_volume volume; + cgltf_emissive_strength emissive_strength; + cgltf_iridescence iridescence; cgltf_texture_view normal_texture; cgltf_texture_view occlusion_texture; cgltf_texture_view emissive_texture; @@ -524,6 +557,12 @@ typedef struct cgltf_draco_mesh_compression { cgltf_size attributes_count; } cgltf_draco_mesh_compression; +typedef struct cgltf_mesh_gpu_instancing { + cgltf_buffer_view* buffer_view; + cgltf_attribute* attributes; + cgltf_size attributes_count; +} cgltf_mesh_gpu_instancing; + typedef struct cgltf_primitive { cgltf_primitive_type type; cgltf_accessor* indices; @@ -628,6 +667,8 @@ struct cgltf_node { cgltf_float scale[3]; cgltf_float matrix[16]; cgltf_extras extras; + cgltf_bool has_mesh_gpu_instancing; + cgltf_mesh_gpu_instancing mesh_gpu_instancing; cgltf_size extensions_count; cgltf_extension* extensions; }; @@ -779,8 +820,8 @@ cgltf_result cgltf_load_buffers( cgltf_result cgltf_load_buffer_base64(const cgltf_options* options, cgltf_size size, const char* base64, void** out_data); -void cgltf_decode_string(char* string); -void cgltf_decode_uri(char* uri); +cgltf_size cgltf_decode_string(char* string); +cgltf_size cgltf_decode_uri(char* uri); cgltf_result cgltf_validate(cgltf_data* data); @@ -789,6 +830,8 @@ void cgltf_free(cgltf_data* data); void cgltf_node_transform_local(const cgltf_node* node, cgltf_float* out_matrix); void cgltf_node_transform_world(const cgltf_node* node, cgltf_float* out_matrix); +const uint8_t* cgltf_buffer_view_data(const cgltf_buffer_view* view); + cgltf_bool cgltf_accessor_read_float(const cgltf_accessor* accessor, cgltf_size index, cgltf_float* out, cgltf_size element_size); cgltf_bool cgltf_accessor_read_uint(const cgltf_accessor* accessor, cgltf_size index, cgltf_uint* out, cgltf_size element_size); cgltf_size cgltf_accessor_read_index(const cgltf_accessor* accessor, cgltf_size index); @@ -797,6 +840,7 @@ cgltf_size cgltf_num_components(cgltf_type type); cgltf_size cgltf_accessor_unpack_floats(const cgltf_accessor* accessor, cgltf_float* out, cgltf_size float_count); +/* this function is deprecated and will be removed in the future; use cgltf_extras::data instead */ cgltf_result cgltf_copy_extras_json(const cgltf_data* data, const cgltf_extras* extras, char* dest, cgltf_size* dest_size); #ifdef __cplusplus @@ -819,7 +863,6 @@ cgltf_result cgltf_copy_extras_json(const cgltf_data* data, const cgltf_extras* #ifdef CGLTF_IMPLEMENTATION -#include /* For uint8_t, uint32_t */ #include /* For strncpy */ #include /* For fopen */ #include /* For UINT_MAX etc */ @@ -829,6 +872,10 @@ cgltf_result cgltf_copy_extras_json(const cgltf_data* data, const cgltf_extras* #include /* For malloc, free, atoi, atof */ #endif +#if CGLTF_VALIDATE_ENABLE_ASSERTS +#include +#endif + /* JSMN_PARENT_LINKS is necessary to make parsing large structures linear in input size */ #define JSMN_PARENT_LINKS @@ -876,12 +923,15 @@ static int jsmn_parse(jsmn_parser *parser, const char *js, size_t len, jsmntok_t */ +#ifndef CGLTF_CONSTS static const cgltf_size GlbHeaderSize = 12; static const cgltf_size GlbChunkHeaderSize = 8; static const uint32_t GlbVersion = 2; static const uint32_t GlbMagic = 0x46546C67; static const uint32_t GlbMagicJsonChunk = 0x4E4F534A; static const uint32_t GlbMagicBinChunk = 0x004E4942; +#define CGLTF_CONSTS +#endif #ifndef CGLTF_MALLOC #define CGLTF_MALLOC(size) malloc(size) @@ -920,7 +970,7 @@ static void* cgltf_calloc(cgltf_options* options, size_t element_size, cgltf_siz { return NULL; } - void* result = options->memory.alloc(options->memory.user_data, element_size * count); + void* result = options->memory.alloc_func(options->memory.user_data, element_size * count); if (!result) { return NULL; @@ -932,8 +982,8 @@ static void* cgltf_calloc(cgltf_options* options, size_t element_size, cgltf_siz static cgltf_result cgltf_default_file_read(const struct cgltf_memory_options* memory_options, const struct cgltf_file_options* file_options, const char* path, cgltf_size* size, void** data) { (void)file_options; - void* (*memory_alloc)(void*, cgltf_size) = memory_options->alloc ? memory_options->alloc : &cgltf_default_alloc; - void (*memory_free)(void*, void*) = memory_options->free ? memory_options->free : &cgltf_default_free; + void* (*memory_alloc)(void*, cgltf_size) = memory_options->alloc_func ? memory_options->alloc_func : &cgltf_default_alloc; + void (*memory_free)(void*, void*) = memory_options->free_func ? memory_options->free_func : &cgltf_default_free; FILE* file = fopen(path, "rb"); if (!file) @@ -995,7 +1045,7 @@ static cgltf_result cgltf_default_file_read(const struct cgltf_memory_options* m static void cgltf_default_file_release(const struct cgltf_memory_options* memory_options, const struct cgltf_file_options* file_options, void* data) { (void)file_options; - void (*memfree)(void*, void*) = memory_options->free ? memory_options->free : &cgltf_default_free; + void (*memfree)(void*, void*) = memory_options->free_func ? memory_options->free_func : &cgltf_default_free; memfree(memory_options->user_data, data); } @@ -1014,13 +1064,13 @@ cgltf_result cgltf_parse(const cgltf_options* options, const void* data, cgltf_s } cgltf_options fixed_options = *options; - if (fixed_options.memory.alloc == NULL) + if (fixed_options.memory.alloc_func == NULL) { - fixed_options.memory.alloc = &cgltf_default_alloc; + fixed_options.memory.alloc_func = &cgltf_default_alloc; } - if (fixed_options.memory.free == NULL) + if (fixed_options.memory.free_func == NULL) { - fixed_options.memory.free = &cgltf_default_free; + fixed_options.memory.free_func = &cgltf_default_free; } uint32_t tmp; @@ -1185,8 +1235,8 @@ static void cgltf_combine_paths(char* path, const char* base, const char* uri) static cgltf_result cgltf_load_buffer_file(const cgltf_options* options, cgltf_size size, const char* uri, const char* gltf_path, void** out_data) { - void* (*memory_alloc)(void*, cgltf_size) = options->memory.alloc ? options->memory.alloc : &cgltf_default_alloc; - void (*memory_free)(void*, void*) = options->memory.free ? options->memory.free : &cgltf_default_free; + void* (*memory_alloc)(void*, cgltf_size) = options->memory.alloc_func ? options->memory.alloc_func : &cgltf_default_alloc; + void (*memory_free)(void*, void*) = options->memory.free_func ? options->memory.free_func : &cgltf_default_free; cgltf_result (*file_read)(const struct cgltf_memory_options*, const struct cgltf_file_options*, const char*, cgltf_size*, void**) = options->file.read ? options->file.read : &cgltf_default_file_read; char* path = (char*)memory_alloc(options->memory.user_data, strlen(uri) + strlen(gltf_path) + 1); @@ -1212,8 +1262,8 @@ static cgltf_result cgltf_load_buffer_file(const cgltf_options* options, cgltf_s cgltf_result cgltf_load_buffer_base64(const cgltf_options* options, cgltf_size size, const char* base64, void** out_data) { - void* (*memory_alloc)(void*, cgltf_size) = options->memory.alloc ? options->memory.alloc : &cgltf_default_alloc; - void (*memory_free)(void*, void*) = options->memory.free ? options->memory.free : &cgltf_default_free; + void* (*memory_alloc)(void*, cgltf_size) = options->memory.alloc_func ? options->memory.alloc_func : &cgltf_default_alloc; + void (*memory_free)(void*, void*) = options->memory.free_func ? options->memory.free_func : &cgltf_default_free; unsigned char* data = (unsigned char*)memory_alloc(options->memory.user_data, size); if (!data) @@ -1266,25 +1316,29 @@ static int cgltf_unhex(char ch) -1; } -void cgltf_decode_string(char* string) +cgltf_size cgltf_decode_string(char* string) { - char* read = strchr(string, '\\'); - if (read == NULL) + char* read = string + strcspn(string, "\\"); + if (*read == 0) { - return; + return read - string; } char* write = string; char* last = string; - while (read) + for (;;) { // Copy characters since last escaped sequence cgltf_size written = read - last; - strncpy(write, last, written); + memmove(write, last, written); write += written; + if (*read++ == 0) + { + break; + } + // jsmn already checked that all escape sequences are valid - ++read; switch (*read++) { case '\"': *write++ = '\"'; break; @@ -1326,13 +1380,14 @@ void cgltf_decode_string(char* string) } last = read; - read = strchr(read, '\\'); + read += strcspn(read, "\\"); } - strcpy(write, last); + *write = 0; + return write - string; } -void cgltf_decode_uri(char* uri) +cgltf_size cgltf_decode_uri(char* uri) { char* write = uri; char* i = uri; @@ -1360,6 +1415,7 @@ void cgltf_decode_uri(char* uri) } *write = 0; + return write - uri; } cgltf_result cgltf_load_buffers(const cgltf_options* options, cgltf_data* data, const char* gltf_path) @@ -1691,14 +1747,25 @@ cgltf_result cgltf_copy_extras_json(const cgltf_data* data, const cgltf_extras* return cgltf_result_success; } -void cgltf_free_extensions(cgltf_data* data, cgltf_extension* extensions, cgltf_size extensions_count) +static void cgltf_free_extras(cgltf_data* data, cgltf_extras* extras) +{ + data->memory.free_func(data->memory.user_data, extras->data); +} + +static void cgltf_free_extensions(cgltf_data* data, cgltf_extension* extensions, cgltf_size extensions_count) { for (cgltf_size i = 0; i < extensions_count; ++i) { - data->memory.free(data->memory.user_data, extensions[i].name); - data->memory.free(data->memory.user_data, extensions[i].data); + data->memory.free_func(data->memory.user_data, extensions[i].name); + data->memory.free_func(data->memory.user_data, extensions[i].data); } - data->memory.free(data->memory.user_data, extensions); + data->memory.free_func(data->memory.user_data, extensions); +} + +static void cgltf_free_texture_view(cgltf_data* data, cgltf_texture_view* view) +{ + cgltf_free_extensions(data, view->extensions, view->extensions_count); + cgltf_free_extras(data, &view->extras); } void cgltf_free(cgltf_data* data) @@ -1710,39 +1777,45 @@ void cgltf_free(cgltf_data* data) void (*file_release)(const struct cgltf_memory_options*, const struct cgltf_file_options*, void* data) = data->file.release ? data->file.release : cgltf_default_file_release; - data->memory.free(data->memory.user_data, data->asset.copyright); - data->memory.free(data->memory.user_data, data->asset.generator); - data->memory.free(data->memory.user_data, data->asset.version); - data->memory.free(data->memory.user_data, data->asset.min_version); + data->memory.free_func(data->memory.user_data, data->asset.copyright); + data->memory.free_func(data->memory.user_data, data->asset.generator); + data->memory.free_func(data->memory.user_data, data->asset.version); + data->memory.free_func(data->memory.user_data, data->asset.min_version); cgltf_free_extensions(data, data->asset.extensions, data->asset.extensions_count); + cgltf_free_extras(data, &data->asset.extras); for (cgltf_size i = 0; i < data->accessors_count; ++i) { - data->memory.free(data->memory.user_data, data->accessors[i].name); + data->memory.free_func(data->memory.user_data, data->accessors[i].name); if(data->accessors[i].is_sparse) { cgltf_free_extensions(data, data->accessors[i].sparse.extensions, data->accessors[i].sparse.extensions_count); cgltf_free_extensions(data, data->accessors[i].sparse.indices_extensions, data->accessors[i].sparse.indices_extensions_count); cgltf_free_extensions(data, data->accessors[i].sparse.values_extensions, data->accessors[i].sparse.values_extensions_count); + cgltf_free_extras(data, &data->accessors[i].sparse.extras); + cgltf_free_extras(data, &data->accessors[i].sparse.indices_extras); + cgltf_free_extras(data, &data->accessors[i].sparse.values_extras); } cgltf_free_extensions(data, data->accessors[i].extensions, data->accessors[i].extensions_count); + cgltf_free_extras(data, &data->accessors[i].extras); } - data->memory.free(data->memory.user_data, data->accessors); + data->memory.free_func(data->memory.user_data, data->accessors); for (cgltf_size i = 0; i < data->buffer_views_count; ++i) { - data->memory.free(data->memory.user_data, data->buffer_views[i].name); - data->memory.free(data->memory.user_data, data->buffer_views[i].data); + data->memory.free_func(data->memory.user_data, data->buffer_views[i].name); + data->memory.free_func(data->memory.user_data, data->buffer_views[i].data); cgltf_free_extensions(data, data->buffer_views[i].extensions, data->buffer_views[i].extensions_count); + cgltf_free_extras(data, &data->buffer_views[i].extras); } - data->memory.free(data->memory.user_data, data->buffer_views); + data->memory.free_func(data->memory.user_data, data->buffer_views); for (cgltf_size i = 0; i < data->buffers_count; ++i) { - data->memory.free(data->memory.user_data, data->buffers[i].name); + data->memory.free_func(data->memory.user_data, data->buffers[i].name); if (data->buffers[i].data_free_method == cgltf_data_free_method_file_release) { @@ -1750,237 +1823,288 @@ void cgltf_free(cgltf_data* data) } else if (data->buffers[i].data_free_method == cgltf_data_free_method_memory_free) { - data->memory.free(data->memory.user_data, data->buffers[i].data); + data->memory.free_func(data->memory.user_data, data->buffers[i].data); } - data->memory.free(data->memory.user_data, data->buffers[i].uri); + data->memory.free_func(data->memory.user_data, data->buffers[i].uri); cgltf_free_extensions(data, data->buffers[i].extensions, data->buffers[i].extensions_count); + cgltf_free_extras(data, &data->buffers[i].extras); } - - data->memory.free(data->memory.user_data, data->buffers); + data->memory.free_func(data->memory.user_data, data->buffers); for (cgltf_size i = 0; i < data->meshes_count; ++i) { - data->memory.free(data->memory.user_data, data->meshes[i].name); + data->memory.free_func(data->memory.user_data, data->meshes[i].name); for (cgltf_size j = 0; j < data->meshes[i].primitives_count; ++j) { for (cgltf_size k = 0; k < data->meshes[i].primitives[j].attributes_count; ++k) { - data->memory.free(data->memory.user_data, data->meshes[i].primitives[j].attributes[k].name); + data->memory.free_func(data->memory.user_data, data->meshes[i].primitives[j].attributes[k].name); } - data->memory.free(data->memory.user_data, data->meshes[i].primitives[j].attributes); + data->memory.free_func(data->memory.user_data, data->meshes[i].primitives[j].attributes); for (cgltf_size k = 0; k < data->meshes[i].primitives[j].targets_count; ++k) { for (cgltf_size m = 0; m < data->meshes[i].primitives[j].targets[k].attributes_count; ++m) { - data->memory.free(data->memory.user_data, data->meshes[i].primitives[j].targets[k].attributes[m].name); + data->memory.free_func(data->memory.user_data, data->meshes[i].primitives[j].targets[k].attributes[m].name); } - data->memory.free(data->memory.user_data, data->meshes[i].primitives[j].targets[k].attributes); + data->memory.free_func(data->memory.user_data, data->meshes[i].primitives[j].targets[k].attributes); } - data->memory.free(data->memory.user_data, data->meshes[i].primitives[j].targets); + data->memory.free_func(data->memory.user_data, data->meshes[i].primitives[j].targets); if (data->meshes[i].primitives[j].has_draco_mesh_compression) { for (cgltf_size k = 0; k < data->meshes[i].primitives[j].draco_mesh_compression.attributes_count; ++k) { - data->memory.free(data->memory.user_data, data->meshes[i].primitives[j].draco_mesh_compression.attributes[k].name); + data->memory.free_func(data->memory.user_data, data->meshes[i].primitives[j].draco_mesh_compression.attributes[k].name); } - data->memory.free(data->memory.user_data, data->meshes[i].primitives[j].draco_mesh_compression.attributes); + data->memory.free_func(data->memory.user_data, data->meshes[i].primitives[j].draco_mesh_compression.attributes); + } + + for (cgltf_size k = 0; k < data->meshes[i].primitives[j].mappings_count; ++k) + { + cgltf_free_extras(data, &data->meshes[i].primitives[j].mappings[k].extras); } - data->memory.free(data->memory.user_data, data->meshes[i].primitives[j].mappings); + data->memory.free_func(data->memory.user_data, data->meshes[i].primitives[j].mappings); cgltf_free_extensions(data, data->meshes[i].primitives[j].extensions, data->meshes[i].primitives[j].extensions_count); + cgltf_free_extras(data, &data->meshes[i].primitives[j].extras); } - data->memory.free(data->memory.user_data, data->meshes[i].primitives); - data->memory.free(data->memory.user_data, data->meshes[i].weights); + data->memory.free_func(data->memory.user_data, data->meshes[i].primitives); + data->memory.free_func(data->memory.user_data, data->meshes[i].weights); for (cgltf_size j = 0; j < data->meshes[i].target_names_count; ++j) { - data->memory.free(data->memory.user_data, data->meshes[i].target_names[j]); + data->memory.free_func(data->memory.user_data, data->meshes[i].target_names[j]); } cgltf_free_extensions(data, data->meshes[i].extensions, data->meshes[i].extensions_count); + cgltf_free_extras(data, &data->meshes[i].extras); - data->memory.free(data->memory.user_data, data->meshes[i].target_names); + data->memory.free_func(data->memory.user_data, data->meshes[i].target_names); } - data->memory.free(data->memory.user_data, data->meshes); + data->memory.free_func(data->memory.user_data, data->meshes); for (cgltf_size i = 0; i < data->materials_count; ++i) { - data->memory.free(data->memory.user_data, data->materials[i].name); + data->memory.free_func(data->memory.user_data, data->materials[i].name); if(data->materials[i].has_pbr_metallic_roughness) { - cgltf_free_extensions(data, data->materials[i].pbr_metallic_roughness.metallic_roughness_texture.extensions, data->materials[i].pbr_metallic_roughness.metallic_roughness_texture.extensions_count); - cgltf_free_extensions(data, data->materials[i].pbr_metallic_roughness.base_color_texture.extensions, data->materials[i].pbr_metallic_roughness.base_color_texture.extensions_count); + cgltf_free_texture_view(data, &data->materials[i].pbr_metallic_roughness.metallic_roughness_texture); + cgltf_free_texture_view(data, &data->materials[i].pbr_metallic_roughness.base_color_texture); } if(data->materials[i].has_pbr_specular_glossiness) { - cgltf_free_extensions(data, data->materials[i].pbr_specular_glossiness.diffuse_texture.extensions, data->materials[i].pbr_specular_glossiness.diffuse_texture.extensions_count); - cgltf_free_extensions(data, data->materials[i].pbr_specular_glossiness.specular_glossiness_texture.extensions, data->materials[i].pbr_specular_glossiness.specular_glossiness_texture.extensions_count); + cgltf_free_texture_view(data, &data->materials[i].pbr_specular_glossiness.diffuse_texture); + cgltf_free_texture_view(data, &data->materials[i].pbr_specular_glossiness.specular_glossiness_texture); } if(data->materials[i].has_clearcoat) { - cgltf_free_extensions(data, data->materials[i].clearcoat.clearcoat_texture.extensions, data->materials[i].clearcoat.clearcoat_texture.extensions_count); - cgltf_free_extensions(data, data->materials[i].clearcoat.clearcoat_roughness_texture.extensions, data->materials[i].clearcoat.clearcoat_roughness_texture.extensions_count); - cgltf_free_extensions(data, data->materials[i].clearcoat.clearcoat_normal_texture.extensions, data->materials[i].clearcoat.clearcoat_normal_texture.extensions_count); + cgltf_free_texture_view(data, &data->materials[i].clearcoat.clearcoat_texture); + cgltf_free_texture_view(data, &data->materials[i].clearcoat.clearcoat_roughness_texture); + cgltf_free_texture_view(data, &data->materials[i].clearcoat.clearcoat_normal_texture); } if(data->materials[i].has_specular) { - cgltf_free_extensions(data, data->materials[i].specular.specular_texture.extensions, data->materials[i].specular.specular_texture.extensions_count); - cgltf_free_extensions(data, data->materials[i].specular.specular_color_texture.extensions, data->materials[i].specular.specular_color_texture.extensions_count); + cgltf_free_texture_view(data, &data->materials[i].specular.specular_texture); + cgltf_free_texture_view(data, &data->materials[i].specular.specular_color_texture); } if(data->materials[i].has_transmission) { - cgltf_free_extensions(data, data->materials[i].transmission.transmission_texture.extensions, data->materials[i].transmission.transmission_texture.extensions_count); + cgltf_free_texture_view(data, &data->materials[i].transmission.transmission_texture); } if (data->materials[i].has_volume) { - cgltf_free_extensions(data, data->materials[i].volume.thickness_texture.extensions, data->materials[i].volume.thickness_texture.extensions_count); + cgltf_free_texture_view(data, &data->materials[i].volume.thickness_texture); } if(data->materials[i].has_sheen) { - cgltf_free_extensions(data, data->materials[i].sheen.sheen_color_texture.extensions, data->materials[i].sheen.sheen_color_texture.extensions_count); - cgltf_free_extensions(data, data->materials[i].sheen.sheen_roughness_texture.extensions, data->materials[i].sheen.sheen_roughness_texture.extensions_count); + cgltf_free_texture_view(data, &data->materials[i].sheen.sheen_color_texture); + cgltf_free_texture_view(data, &data->materials[i].sheen.sheen_roughness_texture); + } + if(data->materials[i].has_iridescence) + { + cgltf_free_texture_view(data, &data->materials[i].iridescence.iridescence_texture); + cgltf_free_texture_view(data, &data->materials[i].iridescence.iridescence_thickness_texture); } - cgltf_free_extensions(data, data->materials[i].normal_texture.extensions, data->materials[i].normal_texture.extensions_count); - cgltf_free_extensions(data, data->materials[i].occlusion_texture.extensions, data->materials[i].occlusion_texture.extensions_count); - cgltf_free_extensions(data, data->materials[i].emissive_texture.extensions, data->materials[i].emissive_texture.extensions_count); + cgltf_free_texture_view(data, &data->materials[i].normal_texture); + cgltf_free_texture_view(data, &data->materials[i].occlusion_texture); + cgltf_free_texture_view(data, &data->materials[i].emissive_texture); cgltf_free_extensions(data, data->materials[i].extensions, data->materials[i].extensions_count); + cgltf_free_extras(data, &data->materials[i].extras); } - data->memory.free(data->memory.user_data, data->materials); + data->memory.free_func(data->memory.user_data, data->materials); for (cgltf_size i = 0; i < data->images_count; ++i) { - data->memory.free(data->memory.user_data, data->images[i].name); - data->memory.free(data->memory.user_data, data->images[i].uri); - data->memory.free(data->memory.user_data, data->images[i].mime_type); + data->memory.free_func(data->memory.user_data, data->images[i].name); + data->memory.free_func(data->memory.user_data, data->images[i].uri); + data->memory.free_func(data->memory.user_data, data->images[i].mime_type); cgltf_free_extensions(data, data->images[i].extensions, data->images[i].extensions_count); + cgltf_free_extras(data, &data->images[i].extras); } - data->memory.free(data->memory.user_data, data->images); + data->memory.free_func(data->memory.user_data, data->images); for (cgltf_size i = 0; i < data->textures_count; ++i) { - data->memory.free(data->memory.user_data, data->textures[i].name); + data->memory.free_func(data->memory.user_data, data->textures[i].name); + cgltf_free_extensions(data, data->textures[i].extensions, data->textures[i].extensions_count); + cgltf_free_extras(data, &data->textures[i].extras); } - data->memory.free(data->memory.user_data, data->textures); + data->memory.free_func(data->memory.user_data, data->textures); for (cgltf_size i = 0; i < data->samplers_count; ++i) { - data->memory.free(data->memory.user_data, data->samplers[i].name); + data->memory.free_func(data->memory.user_data, data->samplers[i].name); + cgltf_free_extensions(data, data->samplers[i].extensions, data->samplers[i].extensions_count); + cgltf_free_extras(data, &data->samplers[i].extras); } - data->memory.free(data->memory.user_data, data->samplers); + data->memory.free_func(data->memory.user_data, data->samplers); for (cgltf_size i = 0; i < data->skins_count; ++i) { - data->memory.free(data->memory.user_data, data->skins[i].name); - data->memory.free(data->memory.user_data, data->skins[i].joints); + data->memory.free_func(data->memory.user_data, data->skins[i].name); + data->memory.free_func(data->memory.user_data, data->skins[i].joints); cgltf_free_extensions(data, data->skins[i].extensions, data->skins[i].extensions_count); + cgltf_free_extras(data, &data->skins[i].extras); } - data->memory.free(data->memory.user_data, data->skins); + data->memory.free_func(data->memory.user_data, data->skins); for (cgltf_size i = 0; i < data->cameras_count; ++i) { - data->memory.free(data->memory.user_data, data->cameras[i].name); + data->memory.free_func(data->memory.user_data, data->cameras[i].name); + + if (data->cameras[i].type == cgltf_camera_type_perspective) + { + cgltf_free_extras(data, &data->cameras[i].data.perspective.extras); + } + else if (data->cameras[i].type == cgltf_camera_type_orthographic) + { + cgltf_free_extras(data, &data->cameras[i].data.orthographic.extras); + } + cgltf_free_extensions(data, data->cameras[i].extensions, data->cameras[i].extensions_count); + cgltf_free_extras(data, &data->cameras[i].extras); } - data->memory.free(data->memory.user_data, data->cameras); + data->memory.free_func(data->memory.user_data, data->cameras); for (cgltf_size i = 0; i < data->lights_count; ++i) { - data->memory.free(data->memory.user_data, data->lights[i].name); + data->memory.free_func(data->memory.user_data, data->lights[i].name); + + cgltf_free_extras(data, &data->lights[i].extras); } - data->memory.free(data->memory.user_data, data->lights); + data->memory.free_func(data->memory.user_data, data->lights); for (cgltf_size i = 0; i < data->nodes_count; ++i) { - data->memory.free(data->memory.user_data, data->nodes[i].name); - data->memory.free(data->memory.user_data, data->nodes[i].children); - data->memory.free(data->memory.user_data, data->nodes[i].weights); + data->memory.free_func(data->memory.user_data, data->nodes[i].name); + data->memory.free_func(data->memory.user_data, data->nodes[i].children); + data->memory.free_func(data->memory.user_data, data->nodes[i].weights); + + if (data->nodes[i].has_mesh_gpu_instancing) + { + for (cgltf_size j = 0; j < data->nodes[i].mesh_gpu_instancing.attributes_count; ++j) + { + data->memory.free_func(data->memory.user_data, data->nodes[i].mesh_gpu_instancing.attributes[j].name); + } + + data->memory.free_func(data->memory.user_data, data->nodes[i].mesh_gpu_instancing.attributes); + } + cgltf_free_extensions(data, data->nodes[i].extensions, data->nodes[i].extensions_count); + cgltf_free_extras(data, &data->nodes[i].extras); } - data->memory.free(data->memory.user_data, data->nodes); + data->memory.free_func(data->memory.user_data, data->nodes); for (cgltf_size i = 0; i < data->scenes_count; ++i) { - data->memory.free(data->memory.user_data, data->scenes[i].name); - data->memory.free(data->memory.user_data, data->scenes[i].nodes); + data->memory.free_func(data->memory.user_data, data->scenes[i].name); + data->memory.free_func(data->memory.user_data, data->scenes[i].nodes); cgltf_free_extensions(data, data->scenes[i].extensions, data->scenes[i].extensions_count); + cgltf_free_extras(data, &data->scenes[i].extras); } - data->memory.free(data->memory.user_data, data->scenes); + data->memory.free_func(data->memory.user_data, data->scenes); for (cgltf_size i = 0; i < data->animations_count; ++i) { - data->memory.free(data->memory.user_data, data->animations[i].name); + data->memory.free_func(data->memory.user_data, data->animations[i].name); for (cgltf_size j = 0; j < data->animations[i].samplers_count; ++j) { cgltf_free_extensions(data, data->animations[i].samplers[j].extensions, data->animations[i].samplers[j].extensions_count); + cgltf_free_extras(data, &data->animations[i].samplers[j].extras); } - data->memory.free(data->memory.user_data, data->animations[i].samplers); + data->memory.free_func(data->memory.user_data, data->animations[i].samplers); for (cgltf_size j = 0; j < data->animations[i].channels_count; ++j) { cgltf_free_extensions(data, data->animations[i].channels[j].extensions, data->animations[i].channels[j].extensions_count); + cgltf_free_extras(data, &data->animations[i].channels[j].extras); } - data->memory.free(data->memory.user_data, data->animations[i].channels); + data->memory.free_func(data->memory.user_data, data->animations[i].channels); cgltf_free_extensions(data, data->animations[i].extensions, data->animations[i].extensions_count); + cgltf_free_extras(data, &data->animations[i].extras); } - data->memory.free(data->memory.user_data, data->animations); + data->memory.free_func(data->memory.user_data, data->animations); for (cgltf_size i = 0; i < data->variants_count; ++i) { - data->memory.free(data->memory.user_data, data->variants[i].name); + data->memory.free_func(data->memory.user_data, data->variants[i].name); + + cgltf_free_extras(data, &data->variants[i].extras); } - data->memory.free(data->memory.user_data, data->variants); + data->memory.free_func(data->memory.user_data, data->variants); cgltf_free_extensions(data, data->data_extensions, data->data_extensions_count); + cgltf_free_extras(data, &data->extras); for (cgltf_size i = 0; i < data->extensions_used_count; ++i) { - data->memory.free(data->memory.user_data, data->extensions_used[i]); + data->memory.free_func(data->memory.user_data, data->extensions_used[i]); } - data->memory.free(data->memory.user_data, data->extensions_used); + data->memory.free_func(data->memory.user_data, data->extensions_used); for (cgltf_size i = 0; i < data->extensions_required_count; ++i) { - data->memory.free(data->memory.user_data, data->extensions_required[i]); + data->memory.free_func(data->memory.user_data, data->extensions_required[i]); } - data->memory.free(data->memory.user_data, data->extensions_required); + data->memory.free_func(data->memory.user_data, data->extensions_required); file_release(&data->memory, &data->file, data->file_data); - data->memory.free(data->memory.user_data, data); + data->memory.free_func(data->memory.user_data, data); } void cgltf_node_transform_local(const cgltf_node* node, cgltf_float* out_matrix) @@ -2063,7 +2187,7 @@ void cgltf_node_transform_world(const cgltf_node* node, cgltf_float* out_matrix) } } -static cgltf_size cgltf_component_read_index(const void* in, cgltf_component_type component_type) +static cgltf_ssize cgltf_component_read_integer(const void* in, cgltf_component_type component_type) { switch (component_type) { @@ -2074,7 +2198,7 @@ static cgltf_size cgltf_component_read_index(const void* in, cgltf_component_typ case cgltf_component_type_r_32u: return *((const uint32_t*) in); case cgltf_component_type_r_32f: - return (cgltf_size)*((const float*) in); + return (cgltf_ssize)*((const float*) in); case cgltf_component_type_r_8: return *((const int8_t*) in); case cgltf_component_type_r_8u: @@ -2084,6 +2208,23 @@ static cgltf_size cgltf_component_read_index(const void* in, cgltf_component_typ } } +static cgltf_size cgltf_component_read_index(const void* in, cgltf_component_type component_type) +{ + switch (component_type) + { + case cgltf_component_type_r_16u: + return *((const uint16_t*) in); + case cgltf_component_type_r_32u: + return *((const uint32_t*) in); + case cgltf_component_type_r_32f: + return (cgltf_size)*((const float*) in); + case cgltf_component_type_r_8u: + return *((const uint8_t*) in); + default: + return 0; + } +} + static cgltf_float cgltf_component_read_float(const void* in, cgltf_component_type component_type, cgltf_bool normalized) { if (component_type == cgltf_component_type_r_32f) @@ -2109,7 +2250,7 @@ static cgltf_float cgltf_component_read_float(const void* in, cgltf_component_ty } } - return (cgltf_float)cgltf_component_read_index(in, component_type); + return (cgltf_float)cgltf_component_read_integer(in, component_type); } static cgltf_size cgltf_component_size(cgltf_component_type component_type); @@ -2467,7 +2608,7 @@ static int cgltf_parse_json_string(cgltf_options* options, jsmntok_t const* toke return CGLTF_ERROR_JSON; } int size = tokens[i].end - tokens[i].start; - char* result = (char*)options->memory.alloc(options->memory.user_data, size + 1); + char* result = (char*)options->memory.alloc_func(options->memory.user_data, size + 1); if (!result) { return CGLTF_ERROR_NOMEM; @@ -2522,6 +2663,12 @@ static int cgltf_parse_json_string_array(cgltf_options* options, jsmntok_t const static void cgltf_parse_attribute_type(const char* name, cgltf_attribute_type* out_type, int* out_index) { + if (*name == '_') + { + *out_type = cgltf_attribute_type_custom; + return; + } + const char* us = strchr(name, '_'); size_t len = us ? (size_t)(us - name) : strlen(name); @@ -2601,11 +2748,27 @@ static int cgltf_parse_json_attribute_list(cgltf_options* options, jsmntok_t con return i; } -static int cgltf_parse_json_extras(jsmntok_t const* tokens, int i, const uint8_t* json_chunk, cgltf_extras* out_extras) +static int cgltf_parse_json_extras(cgltf_options* options, jsmntok_t const* tokens, int i, const uint8_t* json_chunk, cgltf_extras* out_extras) { - (void)json_chunk; + if (out_extras->data) + { + return CGLTF_ERROR_JSON; + } + + /* fill deprecated fields for now, this will be removed in the future */ out_extras->start_offset = tokens[i].start; out_extras->end_offset = tokens[i].end; + + size_t start = tokens[i].start; + size_t size = tokens[i].end - start; + out_extras->data = (char*)options->memory.alloc_func(options->memory.user_data, size + 1); + if (!out_extras->data) + { + return CGLTF_ERROR_NOMEM; + } + strncpy(out_extras->data, (const char*)json_chunk + start, size); + out_extras->data[size] = '\0'; + i = cgltf_skip_json(tokens, i); return i; } @@ -2620,7 +2783,7 @@ static int cgltf_parse_json_unprocessed_extension(cgltf_options* options, jsmnto } cgltf_size name_length = tokens[i].end - tokens[i].start; - out_extension->name = (char*)options->memory.alloc(options->memory.user_data, name_length + 1); + out_extension->name = (char*)options->memory.alloc_func(options->memory.user_data, name_length + 1); if (!out_extension->name) { return CGLTF_ERROR_NOMEM; @@ -2631,7 +2794,7 @@ static int cgltf_parse_json_unprocessed_extension(cgltf_options* options, jsmnto size_t start = tokens[i].start; size_t size = tokens[i].end - start; - out_extension->data = (char*)options->memory.alloc(options->memory.user_data, size + 1); + out_extension->data = (char*)options->memory.alloc_func(options->memory.user_data, size + 1); if (!out_extension->data) { return CGLTF_ERROR_NOMEM; @@ -2712,6 +2875,37 @@ static int cgltf_parse_json_draco_mesh_compression(cgltf_options* options, jsmnt return i; } +static int cgltf_parse_json_mesh_gpu_instancing(cgltf_options* options, jsmntok_t const* tokens, int i, const uint8_t* json_chunk, cgltf_mesh_gpu_instancing* out_mesh_gpu_instancing) +{ + CGLTF_CHECK_TOKTYPE(tokens[i], JSMN_OBJECT); + + int size = tokens[i].size; + ++i; + + for (int j = 0; j < size; ++j) + { + CGLTF_CHECK_KEY(tokens[i]); + + if (cgltf_json_strcmp(tokens + i, json_chunk, "attributes") == 0) + { + i = cgltf_parse_json_attribute_list(options, tokens, i + 1, json_chunk, &out_mesh_gpu_instancing->attributes, &out_mesh_gpu_instancing->attributes_count); + } + else if (cgltf_json_strcmp(tokens + i, json_chunk, "bufferView") == 0) + { + ++i; + out_mesh_gpu_instancing->buffer_view = CGLTF_PTRINDEX(cgltf_buffer_view, cgltf_json_to_int(tokens + i, json_chunk)); + ++i; + } + + if (i < 0) + { + return i; + } + } + + return i; +} + static int cgltf_parse_json_material_mapping_data(cgltf_options* options, jsmntok_t const* tokens, int i, const uint8_t* json_chunk, cgltf_material_mapping* out_mappings, cgltf_size* offset) { (void)options; @@ -2729,7 +2923,7 @@ static int cgltf_parse_json_material_mapping_data(cgltf_options* options, jsmnto int material = -1; int variants_tok = -1; - cgltf_extras extras = {0, 0}; + int extras_tok = -1; for (int k = 0; k < obj_size; ++k) { @@ -2750,7 +2944,8 @@ static int cgltf_parse_json_material_mapping_data(cgltf_options* options, jsmnto } else if (cgltf_json_strcmp(tokens + i, json_chunk, "extras") == 0) { - i = cgltf_parse_json_extras(tokens, i + 1, json_chunk, &extras); + extras_tok = i + 1; + i = cgltf_skip_json(tokens, extras_tok); } else { @@ -2778,7 +2973,13 @@ static int cgltf_parse_json_material_mapping_data(cgltf_options* options, jsmnto out_mappings[*offset].material = CGLTF_PTRINDEX(cgltf_material, material); out_mappings[*offset].variant = variant; - out_mappings[*offset].extras = extras; + + if (extras_tok >= 0) + { + int e = cgltf_parse_json_extras(options, tokens, extras_tok, json_chunk, &out_mappings[*offset].extras); + if (e < 0) + return e; + } (*offset)++; } @@ -2893,7 +3094,7 @@ static int cgltf_parse_json_primitive(cgltf_options* options, jsmntok_t const* t } else if (cgltf_json_strcmp(tokens + i, json_chunk, "extras") == 0) { - i = cgltf_parse_json_extras(tokens, i + 1, json_chunk, &out_prim->extras); + i = cgltf_parse_json_extras(options, tokens, i + 1, json_chunk, &out_prim->extras); } else if (cgltf_json_strcmp(tokens + i, json_chunk, "extensions") == 0) { @@ -3140,7 +3341,7 @@ static int cgltf_parse_json_accessor_sparse(cgltf_options* options, jsmntok_t co } else if (cgltf_json_strcmp(tokens + i, json_chunk, "extras") == 0) { - i = cgltf_parse_json_extras(tokens, i + 1, json_chunk, &out_sparse->indices_extras); + i = cgltf_parse_json_extras(options, tokens, i + 1, json_chunk, &out_sparse->indices_extras); } else if (cgltf_json_strcmp(tokens + i, json_chunk, "extensions") == 0) { @@ -3183,7 +3384,7 @@ static int cgltf_parse_json_accessor_sparse(cgltf_options* options, jsmntok_t co } else if (cgltf_json_strcmp(tokens + i, json_chunk, "extras") == 0) { - i = cgltf_parse_json_extras(tokens, i + 1, json_chunk, &out_sparse->values_extras); + i = cgltf_parse_json_extras(options, tokens, i + 1, json_chunk, &out_sparse->values_extras); } else if (cgltf_json_strcmp(tokens + i, json_chunk, "extensions") == 0) { @@ -3202,7 +3403,7 @@ static int cgltf_parse_json_accessor_sparse(cgltf_options* options, jsmntok_t co } else if (cgltf_json_strcmp(tokens + i, json_chunk, "extras") == 0) { - i = cgltf_parse_json_extras(tokens, i + 1, json_chunk, &out_sparse->extras); + i = cgltf_parse_json_extras(options, tokens, i + 1, json_chunk, &out_sparse->extras); } else if (cgltf_json_strcmp(tokens + i, json_chunk, "extensions") == 0) { @@ -3325,7 +3526,7 @@ static int cgltf_parse_json_accessor(cgltf_options* options, jsmntok_t const* to } else if (cgltf_json_strcmp(tokens + i, json_chunk, "extras") == 0) { - i = cgltf_parse_json_extras(tokens, i + 1, json_chunk, &out_accessor->extras); + i = cgltf_parse_json_extras(options, tokens, i + 1, json_chunk, &out_accessor->extras); } else if (cgltf_json_strcmp(tokens + i, json_chunk, "extensions") == 0) { @@ -3431,7 +3632,7 @@ static int cgltf_parse_json_texture_view(cgltf_options* options, jsmntok_t const } else if (cgltf_json_strcmp(tokens + i, json_chunk, "extras") == 0) { - i = cgltf_parse_json_extras(tokens, i + 1, json_chunk, &out_texture_view->extras); + i = cgltf_parse_json_extras(options, tokens, i + 1, json_chunk, &out_texture_view->extras); } else if (cgltf_json_strcmp(tokens + i, json_chunk, "extensions") == 0) { @@ -3527,10 +3728,6 @@ static int cgltf_parse_json_pbr_metallic_roughness(cgltf_options* options, jsmnt i = cgltf_parse_json_texture_view(options, tokens, i + 1, json_chunk, &out_pbr->metallic_roughness_texture); } - else if (cgltf_json_strcmp(tokens + i, json_chunk, "extras") == 0) - { - i = cgltf_parse_json_extras(tokens, i + 1, json_chunk, &out_pbr->extras); - } else { i = cgltf_skip_json(tokens, i+1); @@ -3838,6 +4035,100 @@ static int cgltf_parse_json_sheen(cgltf_options* options, jsmntok_t const* token return i; } +static int cgltf_parse_json_emissive_strength(jsmntok_t const* tokens, int i, const uint8_t* json_chunk, cgltf_emissive_strength* out_emissive_strength) +{ + CGLTF_CHECK_TOKTYPE(tokens[i], JSMN_OBJECT); + int size = tokens[i].size; + ++i; + + // Default + out_emissive_strength->emissive_strength = 1.f; + + for (int j = 0; j < size; ++j) + { + CGLTF_CHECK_KEY(tokens[i]); + + if (cgltf_json_strcmp(tokens + i, json_chunk, "emissiveStrength") == 0) + { + ++i; + out_emissive_strength->emissive_strength = cgltf_json_to_float(tokens + i, json_chunk); + ++i; + } + else + { + i = cgltf_skip_json(tokens, i + 1); + } + + if (i < 0) + { + return i; + } + } + + return i; +} + +static int cgltf_parse_json_iridescence(cgltf_options* options, jsmntok_t const* tokens, int i, const uint8_t* json_chunk, cgltf_iridescence* out_iridescence) +{ + CGLTF_CHECK_TOKTYPE(tokens[i], JSMN_OBJECT); + int size = tokens[i].size; + ++i; + + // Default + out_iridescence->iridescence_ior = 1.3f; + out_iridescence->iridescence_thickness_min = 100.f; + out_iridescence->iridescence_thickness_max = 400.f; + + for (int j = 0; j < size; ++j) + { + CGLTF_CHECK_KEY(tokens[i]); + + if (cgltf_json_strcmp(tokens + i, json_chunk, "iridescenceFactor") == 0) + { + ++i; + out_iridescence->iridescence_factor = cgltf_json_to_float(tokens + i, json_chunk); + ++i; + } + else if (cgltf_json_strcmp(tokens + i, json_chunk, "iridescenceTexture") == 0) + { + i = cgltf_parse_json_texture_view(options, tokens, i + 1, json_chunk, &out_iridescence->iridescence_texture); + } + else if (cgltf_json_strcmp(tokens + i, json_chunk, "iridescenceIor") == 0) + { + ++i; + out_iridescence->iridescence_ior = cgltf_json_to_float(tokens + i, json_chunk); + ++i; + } + else if (cgltf_json_strcmp(tokens + i, json_chunk, "iridescenceThicknessMinimum") == 0) + { + ++i; + out_iridescence->iridescence_thickness_min = cgltf_json_to_float(tokens + i, json_chunk); + ++i; + } + else if (cgltf_json_strcmp(tokens + i, json_chunk, "iridescenceThicknessMaximum") == 0) + { + ++i; + out_iridescence->iridescence_thickness_max = cgltf_json_to_float(tokens + i, json_chunk); + ++i; + } + else if (cgltf_json_strcmp(tokens + i, json_chunk, "iridescenceThicknessTexture") == 0) + { + i = cgltf_parse_json_texture_view(options, tokens, i + 1, json_chunk, &out_iridescence->iridescence_thickness_texture); + } + else + { + i = cgltf_skip_json(tokens, i + 1); + } + + if (i < 0) + { + return i; + } + } + + return i; +} + static int cgltf_parse_json_image(cgltf_options* options, jsmntok_t const* tokens, int i, const uint8_t* json_chunk, cgltf_image* out_image) { CGLTF_CHECK_TOKTYPE(tokens[i], JSMN_OBJECT); @@ -3869,7 +4160,7 @@ static int cgltf_parse_json_image(cgltf_options* options, jsmntok_t const* token } else if (cgltf_json_strcmp(tokens + i, json_chunk, "extras") == 0) { - i = cgltf_parse_json_extras(tokens, i + 1, json_chunk, &out_image->extras); + i = cgltf_parse_json_extras(options, tokens, i + 1, json_chunk, &out_image->extras); } else if (cgltf_json_strcmp(tokens + i, json_chunk, "extensions") == 0) { @@ -3938,7 +4229,7 @@ static int cgltf_parse_json_sampler(cgltf_options* options, jsmntok_t const* tok } else if (cgltf_json_strcmp(tokens + i, json_chunk, "extras") == 0) { - i = cgltf_parse_json_extras(tokens, i + 1, json_chunk, &out_sampler->extras); + i = cgltf_parse_json_extras(options, tokens, i + 1, json_chunk, &out_sampler->extras); } else if (cgltf_json_strcmp(tokens + i, json_chunk, "extensions") == 0) { @@ -3987,7 +4278,7 @@ static int cgltf_parse_json_texture(cgltf_options* options, jsmntok_t const* tok } else if (cgltf_json_strcmp(tokens + i, json_chunk, "extras") == 0) { - i = cgltf_parse_json_extras(tokens, i + 1, json_chunk, &out_texture->extras); + i = cgltf_parse_json_extras(options, tokens, i + 1, json_chunk, &out_texture->extras); } else if (cgltf_json_strcmp(tokens + i, json_chunk, "extensions") == 0) { @@ -4035,6 +4326,10 @@ static int cgltf_parse_json_texture(cgltf_options* options, jsmntok_t const* tok { i = cgltf_skip_json(tokens, i + 1); } + if (i < 0) + { + return i; + } } } else @@ -4146,7 +4441,7 @@ static int cgltf_parse_json_material(cgltf_options* options, jsmntok_t const* to } else if (cgltf_json_strcmp(tokens + i, json_chunk, "extras") == 0) { - i = cgltf_parse_json_extras(tokens, i + 1, json_chunk, &out_material->extras); + i = cgltf_parse_json_extras(options, tokens, i + 1, json_chunk, &out_material->extras); } else if (cgltf_json_strcmp(tokens + i, json_chunk, "extensions") == 0) { @@ -4212,6 +4507,16 @@ static int cgltf_parse_json_material(cgltf_options* options, jsmntok_t const* to out_material->has_sheen = 1; i = cgltf_parse_json_sheen(options, tokens, i + 1, json_chunk, &out_material->sheen); } + else if (cgltf_json_strcmp(tokens + i, json_chunk, "KHR_materials_emissive_strength") == 0) + { + out_material->has_emissive_strength = 1; + i = cgltf_parse_json_emissive_strength(tokens, i + 1, json_chunk, &out_material->emissive_strength); + } + else if (cgltf_json_strcmp(tokens + i, json_chunk, "KHR_materials_iridescence") == 0) + { + out_material->has_iridescence = 1; + i = cgltf_parse_json_iridescence(options, tokens, i + 1, json_chunk, &out_material->iridescence); + } else { i = cgltf_parse_json_unprocessed_extension(options, tokens, i, json_chunk, &(out_material->extensions[out_material->extensions_count++])); @@ -4489,7 +4794,7 @@ static int cgltf_parse_json_buffer_view(cgltf_options* options, jsmntok_t const* } else if (cgltf_json_strcmp(tokens + i, json_chunk, "extras") == 0) { - i = cgltf_parse_json_extras(tokens, i + 1, json_chunk, &out_buffer_view->extras); + i = cgltf_parse_json_extras(options, tokens, i + 1, json_chunk, &out_buffer_view->extras); } else if (cgltf_json_strcmp(tokens + i, json_chunk, "extensions") == 0) { @@ -4592,7 +4897,7 @@ static int cgltf_parse_json_buffer(cgltf_options* options, jsmntok_t const* toke } else if (cgltf_json_strcmp(tokens + i, json_chunk, "extras") == 0) { - i = cgltf_parse_json_extras(tokens, i + 1, json_chunk, &out_buffer->extras); + i = cgltf_parse_json_extras(options, tokens, i + 1, json_chunk, &out_buffer->extras); } else if (cgltf_json_strcmp(tokens + i, json_chunk, "extensions") == 0) { @@ -4676,7 +4981,7 @@ static int cgltf_parse_json_skin(cgltf_options* options, jsmntok_t const* tokens } else if (cgltf_json_strcmp(tokens + i, json_chunk, "extras") == 0) { - i = cgltf_parse_json_extras(tokens, i + 1, json_chunk, &out_skin->extras); + i = cgltf_parse_json_extras(options, tokens, i + 1, json_chunk, &out_skin->extras); } else if (cgltf_json_strcmp(tokens + i, json_chunk, "extensions") == 0) { @@ -4730,19 +5035,6 @@ static int cgltf_parse_json_camera(cgltf_options* options, jsmntok_t const* toke { i = cgltf_parse_json_string(options, tokens, i + 1, json_chunk, &out_camera->name); } - else if (cgltf_json_strcmp(tokens+i, json_chunk, "type") == 0) - { - ++i; - if (cgltf_json_strcmp(tokens + i, json_chunk, "perspective") == 0) - { - out_camera->type = cgltf_camera_type_perspective; - } - else if (cgltf_json_strcmp(tokens + i, json_chunk, "orthographic") == 0) - { - out_camera->type = cgltf_camera_type_orthographic; - } - ++i; - } else if (cgltf_json_strcmp(tokens+i, json_chunk, "perspective") == 0) { ++i; @@ -4752,6 +5044,11 @@ static int cgltf_parse_json_camera(cgltf_options* options, jsmntok_t const* toke int data_size = tokens[i].size; ++i; + if (out_camera->type != cgltf_camera_type_invalid) + { + return CGLTF_ERROR_JSON; + } + out_camera->type = cgltf_camera_type_perspective; for (int k = 0; k < data_size; ++k) @@ -4786,7 +5083,7 @@ static int cgltf_parse_json_camera(cgltf_options* options, jsmntok_t const* toke } else if (cgltf_json_strcmp(tokens + i, json_chunk, "extras") == 0) { - i = cgltf_parse_json_extras(tokens, i + 1, json_chunk, &out_camera->data.perspective.extras); + i = cgltf_parse_json_extras(options, tokens, i + 1, json_chunk, &out_camera->data.perspective.extras); } else { @@ -4808,6 +5105,11 @@ static int cgltf_parse_json_camera(cgltf_options* options, jsmntok_t const* toke int data_size = tokens[i].size; ++i; + if (out_camera->type != cgltf_camera_type_invalid) + { + return CGLTF_ERROR_JSON; + } + out_camera->type = cgltf_camera_type_orthographic; for (int k = 0; k < data_size; ++k) @@ -4840,7 +5142,7 @@ static int cgltf_parse_json_camera(cgltf_options* options, jsmntok_t const* toke } else if (cgltf_json_strcmp(tokens + i, json_chunk, "extras") == 0) { - i = cgltf_parse_json_extras(tokens, i + 1, json_chunk, &out_camera->data.orthographic.extras); + i = cgltf_parse_json_extras(options, tokens, i + 1, json_chunk, &out_camera->data.orthographic.extras); } else { @@ -4855,7 +5157,7 @@ static int cgltf_parse_json_camera(cgltf_options* options, jsmntok_t const* toke } else if (cgltf_json_strcmp(tokens + i, json_chunk, "extras") == 0) { - i = cgltf_parse_json_extras(tokens, i + 1, json_chunk, &out_camera->extras); + i = cgltf_parse_json_extras(options, tokens, i + 1, json_chunk, &out_camera->extras); } else if (cgltf_json_strcmp(tokens + i, json_chunk, "extensions") == 0) { @@ -4988,7 +5290,7 @@ static int cgltf_parse_json_light(cgltf_options* options, jsmntok_t const* token } else if (cgltf_json_strcmp(tokens + i, json_chunk, "extras") == 0) { - i = cgltf_parse_json_extras(tokens, i + 1, json_chunk, &out_light->extras); + i = cgltf_parse_json_extras(options, tokens, i + 1, json_chunk, &out_light->extras); } else { @@ -5114,7 +5416,7 @@ static int cgltf_parse_json_node(cgltf_options* options, jsmntok_t const* tokens } else if (cgltf_json_strcmp(tokens + i, json_chunk, "extras") == 0) { - i = cgltf_parse_json_extras(tokens, i + 1, json_chunk, &out_node->extras); + i = cgltf_parse_json_extras(options, tokens, i + 1, json_chunk, &out_node->extras); } else if (cgltf_json_strcmp(tokens + i, json_chunk, "extensions") == 0) { @@ -5172,6 +5474,11 @@ static int cgltf_parse_json_node(cgltf_options* options, jsmntok_t const* tokens } } } + else if (cgltf_json_strcmp(tokens + i, json_chunk, "EXT_mesh_gpu_instancing") == 0) + { + out_node->has_mesh_gpu_instancing = 1; + i = cgltf_parse_json_mesh_gpu_instancing(options, tokens, i + 1, json_chunk, &out_node->mesh_gpu_instancing); + } else { i = cgltf_parse_json_unprocessed_extension(options, tokens, i, json_chunk, &(out_node->extensions[out_node->extensions_count++])); @@ -5247,7 +5554,7 @@ static int cgltf_parse_json_scene(cgltf_options* options, jsmntok_t const* token } else if (cgltf_json_strcmp(tokens + i, json_chunk, "extras") == 0) { - i = cgltf_parse_json_extras(tokens, i + 1, json_chunk, &out_scene->extras); + i = cgltf_parse_json_extras(options, tokens, i + 1, json_chunk, &out_scene->extras); } else if (cgltf_json_strcmp(tokens + i, json_chunk, "extensions") == 0) { @@ -5329,7 +5636,7 @@ static int cgltf_parse_json_animation_sampler(cgltf_options* options, jsmntok_t } else if (cgltf_json_strcmp(tokens + i, json_chunk, "extras") == 0) { - i = cgltf_parse_json_extras(tokens, i + 1, json_chunk, &out_sampler->extras); + i = cgltf_parse_json_extras(options, tokens, i + 1, json_chunk, &out_sampler->extras); } else if (cgltf_json_strcmp(tokens + i, json_chunk, "extensions") == 0) { @@ -5409,7 +5716,7 @@ static int cgltf_parse_json_animation_channel(cgltf_options* options, jsmntok_t } else if (cgltf_json_strcmp(tokens + i, json_chunk, "extras") == 0) { - i = cgltf_parse_json_extras(tokens, i + 1, json_chunk, &out_channel->extras); + i = cgltf_parse_json_extras(options, tokens, i + 1, json_chunk, &out_channel->extras); } else if (cgltf_json_strcmp(tokens + i, json_chunk, "extensions") == 0) { @@ -5491,7 +5798,7 @@ static int cgltf_parse_json_animation(cgltf_options* options, jsmntok_t const* t } else if (cgltf_json_strcmp(tokens + i, json_chunk, "extras") == 0) { - i = cgltf_parse_json_extras(tokens, i + 1, json_chunk, &out_animation->extras); + i = cgltf_parse_json_extras(options, tokens, i + 1, json_chunk, &out_animation->extras); } else if (cgltf_json_strcmp(tokens + i, json_chunk, "extensions") == 0) { @@ -5547,7 +5854,7 @@ static int cgltf_parse_json_variant(cgltf_options* options, jsmntok_t const* tok } else if (cgltf_json_strcmp(tokens + i, json_chunk, "extras") == 0) { - i = cgltf_parse_json_extras(tokens, i + 1, json_chunk, &out_variant->extras); + i = cgltf_parse_json_extras(options, tokens, i + 1, json_chunk, &out_variant->extras); } else { @@ -5611,7 +5918,7 @@ static int cgltf_parse_json_asset(cgltf_options* options, jsmntok_t const* token } else if (cgltf_json_strcmp(tokens + i, json_chunk, "extras") == 0) { - i = cgltf_parse_json_extras(tokens, i + 1, json_chunk, &out_asset->extras); + i = cgltf_parse_json_extras(options, tokens, i + 1, json_chunk, &out_asset->extras); } else if (cgltf_json_strcmp(tokens + i, json_chunk, "extensions") == 0) { @@ -5767,7 +6074,7 @@ static int cgltf_parse_json_root(cgltf_options* options, jsmntok_t const* tokens } else if (cgltf_json_strcmp(tokens+i, json_chunk, "extras") == 0) { - i = cgltf_parse_json_extras(tokens, i + 1, json_chunk, &out_data->extras); + i = cgltf_parse_json_extras(options, tokens, i + 1, json_chunk, &out_data->extras); } else if (cgltf_json_strcmp(tokens + i, json_chunk, "extensions") == 0) { @@ -5899,7 +6206,7 @@ cgltf_result cgltf_parse_json(cgltf_options* options, const uint8_t* json_chunk, options->json_token_count = token_count; } - jsmntok_t* tokens = (jsmntok_t*)options->memory.alloc(options->memory.user_data, sizeof(jsmntok_t) * (options->json_token_count + 1)); + jsmntok_t* tokens = (jsmntok_t*)options->memory.alloc_func(options->memory.user_data, sizeof(jsmntok_t) * (options->json_token_count + 1)); if (!tokens) { @@ -5912,7 +6219,7 @@ cgltf_result cgltf_parse_json(cgltf_options* options, const uint8_t* json_chunk, if (token_count <= 0) { - options->memory.free(options->memory.user_data, tokens); + options->memory.free_func(options->memory.user_data, tokens); return cgltf_result_invalid_json; } @@ -5920,11 +6227,11 @@ cgltf_result cgltf_parse_json(cgltf_options* options, const uint8_t* json_chunk, // for invalid JSON inputs this makes sure we don't perform out of bound reads of token data tokens[token_count].type = JSMN_UNDEFINED; - cgltf_data* data = (cgltf_data*)options->memory.alloc(options->memory.user_data, sizeof(cgltf_data)); + cgltf_data* data = (cgltf_data*)options->memory.alloc_func(options->memory.user_data, sizeof(cgltf_data)); if (!data) { - options->memory.free(options->memory.user_data, tokens); + options->memory.free_func(options->memory.user_data, tokens); return cgltf_result_out_of_memory; } @@ -5934,7 +6241,7 @@ cgltf_result cgltf_parse_json(cgltf_options* options, const uint8_t* json_chunk, int i = cgltf_parse_json_root(options, tokens, 0, json_chunk, data); - options->memory.free(options->memory.user_data, tokens); + options->memory.free_func(options->memory.user_data, tokens); if (i < 0) { @@ -6058,6 +6365,9 @@ static int cgltf_fixup_pointers(cgltf_data* data) CGLTF_PTRFIXUP(data->materials[i].sheen.sheen_color_texture.texture, data->textures, data->textures_count); CGLTF_PTRFIXUP(data->materials[i].sheen.sheen_roughness_texture.texture, data->textures, data->textures_count); + + CGLTF_PTRFIXUP(data->materials[i].iridescence.iridescence_texture.texture, data->textures, data->textures_count); + CGLTF_PTRFIXUP(data->materials[i].iridescence.iridescence_thickness_texture.texture, data->textures, data->textures_count); } for (cgltf_size i = 0; i < data->buffer_views_count; ++i) @@ -6099,6 +6409,15 @@ static int cgltf_fixup_pointers(cgltf_data* data) CGLTF_PTRFIXUP(data->nodes[i].skin, data->skins, data->skins_count); CGLTF_PTRFIXUP(data->nodes[i].camera, data->cameras, data->cameras_count); CGLTF_PTRFIXUP(data->nodes[i].light, data->lights, data->lights_count); + + if (data->nodes[i].has_mesh_gpu_instancing) + { + CGLTF_PTRFIXUP_REQ(data->nodes[i].mesh_gpu_instancing.buffer_view, data->buffer_views, data->buffer_views_count); + for (cgltf_size m = 0; m < data->nodes[i].mesh_gpu_instancing.attributes_count; ++m) + { + CGLTF_PTRFIXUP_REQ(data->nodes[i].mesh_gpu_instancing.attributes[m].data, data->accessors, data->accessors_count); + } + } } for (cgltf_size i = 0; i < data->scenes_count; ++i) diff --git a/3rdparty/bgfx/3rdparty/cgltf/cgltf_write.h b/3rdparty/bgfx/3rdparty/cgltf/cgltf_write.h index 8b96eb2b664..033b0d1ccab 100644 --- a/3rdparty/bgfx/3rdparty/cgltf/cgltf_write.h +++ b/3rdparty/bgfx/3rdparty/cgltf/cgltf_write.h @@ -1,7 +1,7 @@ /** * cgltf_write - a single-file glTF 2.0 writer written in C99. * - * Version: 1.11 + * Version: 1.13 * * Website: https://github.com/jkuhlmann/cgltf * @@ -15,19 +15,17 @@ * * Reference: * `cgltf_result cgltf_write_file(const cgltf_options* options, const char* - * path, const cgltf_data* data)` writes JSON to the given file path. Buffer - * files and external images are not written out. `data` is not deallocated. + * path, const cgltf_data* data)` writes a glTF data to the given file path. + * If `options->type` is `cgltf_file_type_glb`, both JSON content and binary + * buffer of the given glTF data will be written in a GLB format. + * Otherwise, only the JSON part will be written. + * External buffers and images are not written out. `data` is not deallocated. * * `cgltf_size cgltf_write(const cgltf_options* options, char* buffer, * cgltf_size size, const cgltf_data* data)` writes JSON into the given memory * buffer. Returns the number of bytes written to `buffer`, including a null * terminator. If buffer is null, returns the number of bytes that would have * been written. `data` is not deallocated. - * - * To write custom JSON into the `extras` field, aggregate all the custom JSON - * into a single buffer, then set `file_data` to this buffer. By supplying - * start_offset and end_offset values for various objects, you can select a - * range of characters within the aggregated buffer. */ #ifndef CGLTF_WRITE_H_INCLUDED__ #define CGLTF_WRITE_H_INCLUDED__ @@ -59,7 +57,7 @@ cgltf_size cgltf_write(const cgltf_options* options, char* buffer, cgltf_size si #if defined(__INTELLISENSE__) || defined(__JETBRAINS_IDE__) /* This makes MSVC/CLion intellisense work. */ -#define CGLTF_IMPLEMENTATION +#define CGLTF_WRITE_IMPLEMENTATION #endif #ifdef CGLTF_WRITE_IMPLEMENTATION @@ -84,6 +82,9 @@ cgltf_size cgltf_write(const cgltf_options* options, char* buffer, cgltf_size si #define CGLTF_EXTENSION_FLAG_MATERIALS_VARIANTS (1 << 10) #define CGLTF_EXTENSION_FLAG_MATERIALS_VOLUME (1 << 11) #define CGLTF_EXTENSION_FLAG_TEXTURE_BASISU (1 << 12) +#define CGLTF_EXTENSION_FLAG_MATERIALS_EMISSIVE_STRENGTH (1 << 13) +#define CGLTF_EXTENSION_FLAG_MESH_GPU_INSTANCING (1 << 14) +#define CGLTF_EXTENSION_FLAG_MATERIALS_IRIDESCENCE (1 << 15) typedef struct { char* buffer; @@ -144,6 +145,17 @@ typedef struct { context->needs_comma = 1; } #define CGLTF_WRITE_TEXTURE_INFO(label, info) if (info.texture) { \ + cgltf_write_line(context, "\"" label "\": {"); \ + CGLTF_WRITE_IDXPROP("index", info.texture, context->data->textures); \ + cgltf_write_intprop(context, "texCoord", info.texcoord, 0); \ + if (info.has_transform) { \ + context->extension_flags |= CGLTF_EXTENSION_FLAG_TEXTURE_TRANSFORM; \ + cgltf_write_texture_transform(context, &info.transform); \ + } \ + cgltf_write_extras(context, &info.extras); \ + cgltf_write_line(context, "}"); } + +#define CGLTF_WRITE_NORMAL_TEXTURE_INFO(label, info) if (info.texture) { \ cgltf_write_line(context, "\"" label "\": {"); \ CGLTF_WRITE_IDXPROP("index", info.texture, context->data->textures); \ cgltf_write_intprop(context, "texCoord", info.texcoord, 0); \ @@ -155,6 +167,28 @@ typedef struct { cgltf_write_extras(context, &info.extras); \ cgltf_write_line(context, "}"); } +#define CGLTF_WRITE_OCCLUSION_TEXTURE_INFO(label, info) if (info.texture) { \ + cgltf_write_line(context, "\"" label "\": {"); \ + CGLTF_WRITE_IDXPROP("index", info.texture, context->data->textures); \ + cgltf_write_intprop(context, "texCoord", info.texcoord, 0); \ + cgltf_write_floatprop(context, "strength", info.scale, 1.0f); \ + if (info.has_transform) { \ + context->extension_flags |= CGLTF_EXTENSION_FLAG_TEXTURE_TRANSFORM; \ + cgltf_write_texture_transform(context, &info.transform); \ + } \ + cgltf_write_extras(context, &info.extras); \ + cgltf_write_line(context, "}"); } + +#ifndef CGLTF_CONSTS +static const cgltf_size GlbHeaderSize = 12; +static const cgltf_size GlbChunkHeaderSize = 8; +static const uint32_t GlbVersion = 2; +static const uint32_t GlbMagic = 0x46546C67; +static const uint32_t GlbMagicJsonChunk = 0x4E4F534A; +static const uint32_t GlbMagicBinChunk = 0x004E4942; +#define CGLTF_CONSTS +#endif + static void cgltf_write_indent(cgltf_write_context* context) { if (context->needs_comma) @@ -205,15 +239,24 @@ static void cgltf_write_strprop(cgltf_write_context* context, const char* label, static void cgltf_write_extras(cgltf_write_context* context, const cgltf_extras* extras) { - cgltf_size length = extras->end_offset - extras->start_offset; - if (length > 0 && context->data->file_data) + if (extras->data) { - char* json_string = ((char*) context->data->file_data) + extras->start_offset; cgltf_write_indent(context); - CGLTF_SPRINTF("%s", "\"extras\": "); - CGLTF_SNPRINTF(length, "%.*s", (int)(extras->end_offset - extras->start_offset), json_string); + CGLTF_SPRINTF("\"extras\": %s", extras->data); context->needs_comma = 1; } + else + { + cgltf_size length = extras->end_offset - extras->start_offset; + if (length > 0 && context->data->json) + { + char* json_string = ((char*) context->data->json) + extras->start_offset; + cgltf_write_indent(context); + CGLTF_SPRINTF("%s", "\"extras\": "); + CGLTF_SNPRINTF(length, "%.*s", (int)(extras->end_offset - extras->start_offset), json_string); + context->needs_comma = 1; + } + } } static void cgltf_write_stritem(cgltf_write_context* context, const char* item) @@ -508,6 +551,7 @@ static void cgltf_write_mesh(cgltf_write_context* context, const cgltf_mesh* mes { cgltf_write_floatarrayprop(context, "weights", mesh->weights, mesh->weights_count); } + cgltf_write_extras(context, &mesh->extras); cgltf_write_line(context, "}"); } @@ -544,7 +588,7 @@ static void cgltf_write_material(cgltf_write_context* context, const cgltf_mater { cgltf_write_floatprop(context, "alphaCutoff", material->alpha_cutoff, 0.5f); } - cgltf_write_boolprop_optional(context, "doubleSided", material->double_sided, false); + cgltf_write_boolprop_optional(context, "doubleSided", (bool)material->double_sided, false); // cgltf_write_boolprop_optional(context, "unlit", material->unlit, false); if (material->unlit) @@ -587,6 +631,16 @@ static void cgltf_write_material(cgltf_write_context* context, const cgltf_mater context->extension_flags |= CGLTF_EXTENSION_FLAG_MATERIALS_SHEEN; } + if (material->has_emissive_strength) + { + context->extension_flags |= CGLTF_EXTENSION_FLAG_MATERIALS_EMISSIVE_STRENGTH; + } + + if (material->has_iridescence) + { + context->extension_flags |= CGLTF_EXTENSION_FLAG_MATERIALS_IRIDESCENCE; + } + if (material->has_pbr_metallic_roughness) { const cgltf_pbr_metallic_roughness* params = &material->pbr_metallic_roughness; @@ -599,11 +653,10 @@ static void cgltf_write_material(cgltf_write_context* context, const cgltf_mater { cgltf_write_floatarrayprop(context, "baseColorFactor", params->base_color_factor, 4); } - cgltf_write_extras(context, ¶ms->extras); cgltf_write_line(context, "}"); } - if (material->unlit || material->has_pbr_specular_glossiness || material->has_clearcoat || material->has_ior || material->has_specular || material->has_transmission || material->has_sheen || material->has_volume) + if (material->unlit || material->has_pbr_specular_glossiness || material->has_clearcoat || material->has_ior || material->has_specular || material->has_transmission || material->has_sheen || material->has_volume || material->has_emissive_strength || material->has_iridescence) { cgltf_write_line(context, "\"extensions\": {"); if (material->has_clearcoat) @@ -612,7 +665,7 @@ static void cgltf_write_material(cgltf_write_context* context, const cgltf_mater cgltf_write_line(context, "\"KHR_materials_clearcoat\": {"); CGLTF_WRITE_TEXTURE_INFO("clearcoatTexture", params->clearcoat_texture); CGLTF_WRITE_TEXTURE_INFO("clearcoatRoughnessTexture", params->clearcoat_roughness_texture); - CGLTF_WRITE_TEXTURE_INFO("clearcoatNormalTexture", params->clearcoat_normal_texture); + CGLTF_WRITE_NORMAL_TEXTURE_INFO("clearcoatNormalTexture", params->clearcoat_normal_texture); cgltf_write_floatprop(context, "clearcoatFactor", params->clearcoat_factor, 0.0f); cgltf_write_floatprop(context, "clearcoatRoughnessFactor", params->clearcoat_roughness_factor, 0.0f); cgltf_write_line(context, "}"); @@ -695,11 +748,30 @@ static void cgltf_write_material(cgltf_write_context* context, const cgltf_mater { cgltf_write_line(context, "\"KHR_materials_unlit\": {}"); } + if (material->has_emissive_strength) + { + cgltf_write_line(context, "\"KHR_materials_emissive_strength\": {"); + const cgltf_emissive_strength* params = &material->emissive_strength; + cgltf_write_floatprop(context, "emissiveStrength", params->emissive_strength, 1.f); + cgltf_write_line(context, "}"); + } + if (material->has_iridescence) + { + cgltf_write_line(context, "\"KHR_materials_iridescence\": {"); + const cgltf_iridescence* params = &material->iridescence; + cgltf_write_floatprop(context, "iridescenceFactor", params->iridescence_factor, 0.f); + CGLTF_WRITE_TEXTURE_INFO("iridescenceTexture", params->iridescence_texture); + cgltf_write_floatprop(context, "iridescenceIor", params->iridescence_ior, 1.3f); + cgltf_write_floatprop(context, "iridescenceThicknessMinimum", params->iridescence_thickness_min, 100.f); + cgltf_write_floatprop(context, "iridescenceThicknessMaximum", params->iridescence_thickness_max, 400.f); + CGLTF_WRITE_TEXTURE_INFO("iridescenceThicknessTexture", params->iridescence_thickness_texture); + cgltf_write_line(context, "}"); + } cgltf_write_line(context, "}"); } - CGLTF_WRITE_TEXTURE_INFO("normalTexture", material->normal_texture); - CGLTF_WRITE_TEXTURE_INFO("occlusionTexture", material->occlusion_texture); + CGLTF_WRITE_NORMAL_TEXTURE_INFO("normalTexture", material->normal_texture); + CGLTF_WRITE_OCCLUSION_TEXTURE_INFO("occlusionTexture", material->occlusion_texture); CGLTF_WRITE_TEXTURE_INFO("emissiveTexture", material->emissive_texture); if (cgltf_check_floatarray(material->emissive_factor, 3, 0.0f)) { @@ -766,7 +838,7 @@ static const char* cgltf_write_str_path_type(cgltf_animation_path_type path_type return "scale"; case cgltf_animation_path_type_weights: return "weights"; - case cgltf_animation_path_type_invalid: + default: break; } return "invalid"; @@ -782,6 +854,8 @@ static const char* cgltf_write_str_interpolation_type(cgltf_interpolation_type i return "STEP"; case cgltf_interpolation_type_cubic_spline: return "CUBICSPLINE"; + default: + break; } return "invalid"; } @@ -884,16 +958,42 @@ static void cgltf_write_node(cgltf_write_context* context, const cgltf_node* nod CGLTF_WRITE_IDXPROP("skin", node->skin, context->data->skins); } + bool has_extension = node->light || (node->has_mesh_gpu_instancing && node->mesh_gpu_instancing.attributes_count > 0); + if(has_extension) + cgltf_write_line(context, "\"extensions\": {"); + if (node->light) { context->extension_flags |= CGLTF_EXTENSION_FLAG_LIGHTS_PUNCTUAL; - cgltf_write_line(context, "\"extensions\": {"); cgltf_write_line(context, "\"KHR_lights_punctual\": {"); CGLTF_WRITE_IDXPROP("light", node->light, context->data->lights); cgltf_write_line(context, "}"); + } + + if (node->has_mesh_gpu_instancing && node->mesh_gpu_instancing.attributes_count > 0) + { + context->extension_flags |= CGLTF_EXTENSION_FLAG_MESH_GPU_INSTANCING; + context->required_extension_flags |= CGLTF_EXTENSION_FLAG_MESH_GPU_INSTANCING; + + cgltf_write_line(context, "\"EXT_mesh_gpu_instancing\": {"); + { + CGLTF_WRITE_IDXPROP("bufferView", node->mesh_gpu_instancing.buffer_view, context->data->buffer_views); + cgltf_write_line(context, "\"attributes\": {"); + { + for (cgltf_size i = 0; i < node->mesh_gpu_instancing.attributes_count; ++i) + { + const cgltf_attribute* attr = node->mesh_gpu_instancing.attributes + i; + CGLTF_WRITE_IDXPROP(attr->name, attr->data, context->data->accessors); + } + } + cgltf_write_line(context, "}"); + } cgltf_write_line(context, "}"); } + if (has_extension) + cgltf_write_line(context, "}"); + if (node->weights_count > 0) { cgltf_write_floatarrayprop(context, "weights", node->weights, node->weights_count); @@ -925,7 +1025,7 @@ static void cgltf_write_accessor(cgltf_write_context* context, const cgltf_acces cgltf_write_intprop(context, "componentType", cgltf_int_from_component_type(accessor->component_type), 0); cgltf_write_strprop(context, "type", cgltf_str_from_type(accessor->type)); cgltf_size dim = cgltf_dim_from_type(accessor->type); - cgltf_write_boolprop_optional(context, "normalized", accessor->normalized, false); + cgltf_write_boolprop_optional(context, "normalized", (bool)accessor->normalized, false); cgltf_write_sizeprop(context, "byteOffset", (int)accessor->offset, 0); cgltf_write_intprop(context, "count", (int)accessor->count, -1); if (accessor->has_min) @@ -1036,6 +1136,47 @@ static void cgltf_write_variant(cgltf_write_context* context, const cgltf_materi cgltf_write_line(context, "}"); } +static void cgltf_write_glb(FILE* file, const void* json_buf, const cgltf_size json_size, const void* bin_buf, const cgltf_size bin_size) +{ + char header[GlbHeaderSize]; + char chunk_header[GlbChunkHeaderSize]; + char json_pad[3] = { 0x20, 0x20, 0x20 }; + char bin_pad[3] = { 0, 0, 0 }; + + cgltf_size json_padsize = (json_size % 4 != 0) ? 4 - json_size % 4 : 0; + cgltf_size bin_padsize = (bin_size % 4 != 0) ? 4 - bin_size % 4 : 0; + cgltf_size total_size = GlbHeaderSize + GlbChunkHeaderSize + json_size + json_padsize; + if (bin_buf != NULL && bin_size > 0) { + total_size += GlbChunkHeaderSize + bin_size + bin_padsize; + } + + // Write a GLB header + memcpy(header, &GlbMagic, 4); + memcpy(header + 4, &GlbVersion, 4); + memcpy(header + 8, &total_size, 4); + fwrite(header, 1, GlbHeaderSize, file); + + // Write a JSON chunk (header & data) + uint32_t json_chunk_size = (uint32_t)(json_size + json_padsize); + memcpy(chunk_header, &json_chunk_size, 4); + memcpy(chunk_header + 4, &GlbMagicJsonChunk, 4); + fwrite(chunk_header, 1, GlbChunkHeaderSize, file); + + fwrite(json_buf, 1, json_size, file); + fwrite(json_pad, 1, json_padsize, file); + + if (bin_buf != NULL && bin_size > 0) { + // Write a binary chunk (header & data) + uint32_t bin_chunk_size = (uint32_t)(bin_size + bin_padsize); + memcpy(chunk_header, &bin_chunk_size, 4); + memcpy(chunk_header + 4, &GlbMagicBinChunk, 4); + fwrite(chunk_header, 1, GlbChunkHeaderSize, file); + + fwrite(bin_buf, 1, bin_size, file); + fwrite(bin_pad, 1, bin_padsize, file); + } +} + cgltf_result cgltf_write_file(const cgltf_options* options, const char* path, const cgltf_data* data) { cgltf_size expected = cgltf_write(options, NULL, 0, data); @@ -1044,13 +1185,18 @@ cgltf_result cgltf_write_file(const cgltf_options* options, const char* path, co if (expected != actual) { fprintf(stderr, "Error: expected %zu bytes but wrote %zu bytes.\n", expected, actual); } - FILE* file = fopen(path, "wt"); + FILE* file = fopen(path, "wb"); if (!file) { return cgltf_result_file_not_found; } // Note that cgltf_write() includes a null terminator, which we omit from the file content. - fwrite(buffer, actual - 1, 1, file); + if (options->type == cgltf_file_type_glb) { + cgltf_write_glb(file, buffer, actual - 1, data->bin, data->bin_size); + } else { + // Write a plain JSON file. + fwrite(buffer, actual - 1, 1, file); + } fclose(file); free(buffer); return cgltf_result_success; @@ -1097,6 +1243,15 @@ static void cgltf_write_extensions(cgltf_write_context* context, uint32_t extens if (extension_flags & CGLTF_EXTENSION_FLAG_TEXTURE_BASISU) { cgltf_write_stritem(context, "KHR_texture_basisu"); } + if (extension_flags & CGLTF_EXTENSION_FLAG_MATERIALS_EMISSIVE_STRENGTH) { + cgltf_write_stritem(context, "KHR_materials_emissive_strength"); + } + if (extension_flags & CGLTF_EXTENSION_FLAG_MATERIALS_IRIDESCENCE) { + cgltf_write_stritem(context, "KHR_materials_iridescence"); + } + if (extension_flags & CGLTF_EXTENSION_FLAG_MESH_GPU_INSTANCING) { + cgltf_write_stritem(context, "EXT_mesh_gpu_instancing"); + } } cgltf_size cgltf_write(const cgltf_options* options, char* buffer, cgltf_size size, const cgltf_data* data) diff --git a/3rdparty/bgfx/3rdparty/dear-imgui/LICENSE.txt b/3rdparty/bgfx/3rdparty/dear-imgui/LICENSE.txt new file mode 100644 index 00000000000..4023e0caa85 --- /dev/null +++ b/3rdparty/bgfx/3rdparty/dear-imgui/LICENSE.txt @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014-2022 Omar Cornut + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/3rdparty/bgfx/3rdparty/dear-imgui/imconfig.h b/3rdparty/bgfx/3rdparty/dear-imgui/imconfig.h index bd3bea7cecc..bb52b2380ec 100644 --- a/3rdparty/bgfx/3rdparty/dear-imgui/imconfig.h +++ b/3rdparty/bgfx/3rdparty/dear-imgui/imconfig.h @@ -7,6 +7,8 @@ #pragma once #define IMGUI_DISABLE_OBSOLETE_FUNCTIONS +#define IMGUI_DISABLE_OBSOLETE_KEYIO +#define IMGUI_DISABLE_DEFAULT_ALLOCATORS //---- Define your own ImVector<> type if you don't want to use the provided implementation defined in imgui.h //#include diff --git a/3rdparty/bgfx/3rdparty/dear-imgui/imgui.cpp b/3rdparty/bgfx/3rdparty/dear-imgui/imgui.cpp index 4d8b3673cde..bd3f95d77ae 100644 --- a/3rdparty/bgfx/3rdparty/dear-imgui/imgui.cpp +++ b/3rdparty/bgfx/3rdparty/dear-imgui/imgui.cpp @@ -1,4 +1,4 @@ -// dear imgui, v1.85 WIP +// dear imgui, v1.90 WIP // (main code and documentation) // Help: @@ -11,7 +11,7 @@ // - FAQ http://dearimgui.org/faq // - Homepage & latest https://github.com/ocornut/imgui // - Releases & changelog https://github.com/ocornut/imgui/releases -// - Gallery https://github.com/ocornut/imgui/issues/4451 (please post your screenshots/video there!) +// - Gallery https://github.com/ocornut/imgui/issues/5243 (please post your screenshots/video there!) // - Wiki https://github.com/ocornut/imgui/wiki (lots of good stuff there) // - Glossary https://github.com/ocornut/imgui/wiki/Glossary // - Issues & support https://github.com/ocornut/imgui/issues @@ -65,11 +65,12 @@ CODE // [SECTION] MISC HELPERS/UTILITIES (Color functions) // [SECTION] ImGuiStorage // [SECTION] ImGuiTextFilter -// [SECTION] ImGuiTextBuffer +// [SECTION] ImGuiTextBuffer, ImGuiTextIndex // [SECTION] ImGuiListClipper // [SECTION] STYLING // [SECTION] RENDER HELPERS // [SECTION] MAIN CODE (most of the code! lots of stuff, needs tidying up!) +// [SECTION] INPUTS // [SECTION] ERROR CHECKING // [SECTION] LAYOUT // [SECTION] SCROLLING @@ -79,9 +80,12 @@ CODE // [SECTION] DRAG AND DROP // [SECTION] LOGGING/CAPTURING // [SECTION] SETTINGS -// [SECTION] VIEWPORTS +// [SECTION] LOCALIZATION +// [SECTION] VIEWPORTS, PLATFORM WINDOWS // [SECTION] PLATFORM DEPENDENT HELPERS // [SECTION] METRICS/DEBUGGER WINDOW +// [SECTION] DEBUG LOG WINDOW +// [SECTION] OTHER DEBUG TOOLS (ITEM PICKER, STACK TOOL) */ @@ -99,6 +103,7 @@ CODE - Easy to hack and improve. - Minimize setup and maintenance. - Minimize state storage on user side. + - Minimize state synchronization. - Portable, minimize dependencies, run on target (consoles, phones, etc.). - Efficient runtime and memory consumption. @@ -122,14 +127,13 @@ CODE - Hold SHIFT or use mouse to select text. - CTRL+Left/Right to word jump. - CTRL+Shift+Left/Right to select words. - - CTRL+A our Double-Click to select all. + - CTRL+A or Double-Click to select all. - CTRL+X,CTRL+C,CTRL+V to use OS clipboard/ - CTRL+Z,CTRL+Y to undo/redo. - ESCAPE to revert text to its original value. - - You can apply arithmetic operators +,*,/ on numerical values. Use +- to subtract (because - would set a negative value!) - Controls are automatically adjusted for OSX to match standard OSX text editing operations. - General Keyboard controls: enable with ImGuiConfigFlags_NavEnableKeyboard. - - General Gamepad controls: enable with ImGuiConfigFlags_NavEnableGamepad. See suggested mappings in imgui.h ImGuiNavInput_ + download PNG/PSD at http://dearimgui.org/controls_sheets + - General Gamepad controls: enable with ImGuiConfigFlags_NavEnableGamepad. Download controller mapping PNG/PSD at http://dearimgui.org/controls_sheets PROGRAMMER GUIDE @@ -253,9 +257,9 @@ CODE io.DeltaTime = 1.0f/60.0f; // set the time elapsed since the previous frame (in seconds) io.DisplaySize.x = 1920.0f; // set the current display width io.DisplaySize.y = 1280.0f; // set the current display height here - io.MousePos = my_mouse_pos; // set the mouse position - io.MouseDown[0] = my_mouse_buttons[0]; // set the mouse button states - io.MouseDown[1] = my_mouse_buttons[1]; + io.AddMousePosEvent(mouse_x, mouse_y); // update mouse position + io.AddMouseButtonEvent(0, mouse_b[0]); // update mouse button states + io.AddMouseButtonEvent(1, mouse_b[1]); // update mouse button states // Call NewFrame(), after this point you can use ImGui::* functions anytime // (So you want to try calling NewFrame() as early as you can in your main loop to be able to use Dear ImGui everywhere) @@ -287,12 +291,14 @@ CODE --------------------------------------------- The backends in impl_impl_XXX.cpp files contain many working implementations of a rendering function. - void void MyImGuiRenderFunction(ImDrawData* draw_data) + void MyImGuiRenderFunction(ImDrawData* draw_data) { // TODO: Setup render state: alpha-blending enabled, no face culling, no depth testing, scissor enabled + // TODO: Setup texture sampling state: sample with bilinear filtering (NOT point/nearest filtering). Use 'io.Fonts->Flags |= ImFontAtlasFlags_NoBakedLines;' to allow point/nearest filtering. // TODO: Setup viewport covering draw_data->DisplayPos to draw_data->DisplayPos + draw_data->DisplaySize // TODO: Setup orthographic projection matrix cover draw_data->DisplayPos to draw_data->DisplayPos + draw_data->DisplaySize // TODO: Setup shader: vertex { float2 pos, float2 uv, u32 color }, fragment shader sample color from 1 texture, multiply by vertex color. + ImVec2 clip_off = draw_data->DisplayPos; for (int n = 0; n < draw_data->CmdListsCount; n++) { const ImDrawList* cmd_list = draw_data->CmdLists[n]; @@ -307,9 +313,11 @@ CODE } else { - // The texture for the draw call is specified by pcmd->GetTexID(). - // The vast majority of draw calls will use the Dear ImGui texture atlas, which value you have set yourself during initialization. - MyEngineBindTexture((MyTexture*)pcmd->GetTexID()); + // Project scissor/clipping rectangles into framebuffer space + ImVec2 clip_min(pcmd->ClipRect.x - clip_off.x, pcmd->ClipRect.y - clip_off.y); + ImVec2 clip_max(pcmd->ClipRect.z - clip_off.x, pcmd->ClipRect.w - clip_off.y); + if (clip_max.x <= clip_min.x || clip_max.y <= clip_min.y) + continue; // We are using scissoring to clip some objects. All low-level graphics API should support it. // - If your engine doesn't support scissoring yet, you may ignore this at first. You will get some small glitches @@ -320,14 +328,16 @@ CODE // - In the interest of supporting multi-viewport applications (see 'docking' branch on github), // always subtract draw_data->DisplayPos from clipping bounds to convert them to your viewport space. // - Note that pcmd->ClipRect contains Min+Max bounds. Some graphics API may use Min+Max, other may use Min+Size (size being Max-Min) - ImVec2 pos = draw_data->DisplayPos; - MyEngineScissor((int)(pcmd->ClipRect.x - pos.x), (int)(pcmd->ClipRect.y - pos.y), (int)(pcmd->ClipRect.z - pos.x), (int)(pcmd->ClipRect.w - pos.y)); + MyEngineSetScissor(clip_min.x, clip_min.y, clip_max.x, clip_max.y); + + // The texture for the draw call is specified by pcmd->GetTexID(). + // The vast majority of draw calls will use the Dear ImGui texture atlas, which value you have set yourself during initialization. + MyEngineBindTexture((MyTexture*)pcmd->GetTexID()); // Render 'pcmd->ElemCount/3' indexed triangles. // By default the indices ImDrawIdx are 16-bit, you can change them to 32-bit in imconfig.h if your engine doesn't support 16-bit indices. - MyEngineDrawIndexedTriangles(pcmd->ElemCount, sizeof(ImDrawIdx) == 2 ? GL_UNSIGNED_SHORT : GL_UNSIGNED_INT, idx_buffer, vtx_buffer); + MyEngineDrawIndexedTriangles(pcmd->ElemCount, sizeof(ImDrawIdx) == 2 ? GL_UNSIGNED_SHORT : GL_UNSIGNED_INT, idx_buffer + pcmd->IdxOffset, vtx_buffer, pcmd->VtxOffset); } - idx_buffer += pcmd->ElemCount; } } } @@ -336,31 +346,27 @@ CODE USING GAMEPAD/KEYBOARD NAVIGATION CONTROLS ------------------------------------------ - The gamepad/keyboard navigation is fairly functional and keeps being improved. - - Gamepad support is particularly useful to use Dear ImGui on a console system (e.g. PS4, Switch, XB1) without a mouse! - - You can ask questions and report issues at https://github.com/ocornut/imgui/issues/787 + - Gamepad support is particularly useful to use Dear ImGui on a console system (e.g. PlayStation, Switch, Xbox) without a mouse! - The initial focus was to support game controllers, but keyboard is becoming increasingly and decently usable. - Keyboard: - - Set io.ConfigFlags |= ImGuiConfigFlags_NavEnableKeyboard to enable. - NewFrame() will automatically fill io.NavInputs[] based on your io.KeysDown[] + io.KeyMap[] arrays. - - When keyboard navigation is active (io.NavActive + ImGuiConfigFlags_NavEnableKeyboard), the io.WantCaptureKeyboard flag - will be set. For more advanced uses, you may want to read from: + - Application: Set io.ConfigFlags |= ImGuiConfigFlags_NavEnableKeyboard to enable. + - When keyboard navigation is active (io.NavActive + ImGuiConfigFlags_NavEnableKeyboard), + the io.WantCaptureKeyboard flag will be set. For more advanced uses, you may want to read from: - io.NavActive: true when a window is focused and it doesn't have the ImGuiWindowFlags_NoNavInputs flag set. - io.NavVisible: true when the navigation cursor is visible (and usually goes false when mouse is used). - or query focus information with e.g. IsWindowFocused(ImGuiFocusedFlags_AnyWindow), IsItemFocused() etc. functions. Please reach out if you think the game vs navigation input sharing could be improved. - Gamepad: - - Set io.ConfigFlags |= ImGuiConfigFlags_NavEnableGamepad to enable. - - Backend: Set io.BackendFlags |= ImGuiBackendFlags_HasGamepad + fill the io.NavInputs[] fields before calling NewFrame(). - Note that io.NavInputs[] is cleared by EndFrame(). - - See 'enum ImGuiNavInput_' in imgui.h for a description of inputs. For each entry of io.NavInputs[], set the following values: - 0.0f= not held. 1.0f= fully held. Pass intermediate 0.0f..1.0f values for analog triggers/sticks. - - We use a simple >0.0f test for activation testing, and won't attempt to test for a dead-zone. - Your code will probably need to transform your raw inputs (such as e.g. remapping your 0.2..0.9 raw input range to 0.0..1.0 imgui range, etc.). + - Application: Set io.ConfigFlags |= ImGuiConfigFlags_NavEnableGamepad to enable. + - Backend: Set io.BackendFlags |= ImGuiBackendFlags_HasGamepad + call io.AddKeyEvent/AddKeyAnalogEvent() with ImGuiKey_Gamepad_XXX keys. + For analog values (0.0f to 1.0f), backend is responsible to handling a dead-zone and rescaling inputs accordingly. + Backend code will probably need to transform your raw inputs (such as e.g. remapping your 0.2..0.9 raw input range to 0.0..1.0 imgui range, etc.). + - BEFORE 1.87, BACKENDS USED TO WRITE TO io.NavInputs[]. This is now obsolete. Please call io functions instead! - You can download PNG/PSD files depicting the gamepad controls for common controllers at: http://dearimgui.org/controls_sheets - - If you need to share inputs between your game and the imgui parts, the easiest approach is to go all-or-nothing, with a buttons combo - to toggle the target. Please reach out if you think the game vs navigation input sharing could be improved. + - If you need to share inputs between your game and the Dear ImGui interface, the easiest approach is to go all-or-nothing, + with a buttons combo to toggle the target. Please reach out if you think the game vs navigation input sharing could be improved. - Mouse: - - PS4 users: Consider emulating a mouse cursor with DualShock4 touch pad or a spare analog stick as a mouse-emulation fallback. + - PS4/PS5 users: Consider emulating a mouse cursor with DualShock4 touch pad or a spare analog stick as a mouse-emulation fallback. - Consoles/Tablet/Phone users: Consider using a Synergy 1.x server (on your PC) + uSynergy.c (on your console/tablet/phone app) to share your PC mouse/keyboard. - On a TV/console system where readability may be lower or mouse inputs may be awkward, you may want to set the ImGuiConfigFlags_NavEnableSetMousePos flag. Enabling ImGuiConfigFlags_NavEnableSetMousePos + ImGuiBackendFlags_HasSetMousePos instructs dear imgui to move your mouse cursor along with navigation movements. @@ -379,7 +385,77 @@ CODE When you are not sure about an old symbol or function name, try using the Search/Find function of your IDE to look for comments or references in all imgui files. You can read releases logs https://github.com/ocornut/imgui/releases for more details. - - 2021/08/23 (1.85) - removed GetWindowContentRegionWidth() function. keep inline redirection helper. can use 'GetWindowContentRegionMax().x - GetWindowContentRegionMin().x' instead. + - 2022/10/26 (1.89) - commented out redirecting OpenPopupContextItem() which was briefly the name of OpenPopupOnItemClick() from 1.77 to 1.79. + - 2022/10/12 (1.89) - removed runtime patching of invalid "%f"/"%0.f" format strings for DragInt()/SliderInt(). This was obsoleted in 1.61 (May 2018). See 1.61 changelog for details. + - 2022/09/26 (1.89) - renamed and merged keyboard modifiers key enums and flags into a same set. Kept inline redirection enums (will obsolete). + - ImGuiKey_ModCtrl and ImGuiModFlags_Ctrl -> ImGuiMod_Ctrl + - ImGuiKey_ModShift and ImGuiModFlags_Shift -> ImGuiMod_Shift + - ImGuiKey_ModAlt and ImGuiModFlags_Alt -> ImGuiMod_Alt + - ImGuiKey_ModSuper and ImGuiModFlags_Super -> ImGuiMod_Super + the ImGuiKey_ModXXX were introduced in 1.87 and mostly used by backends. + the ImGuiModFlags_XXX have been exposed in imgui.h but not really used by any public api only by third-party extensions. + exceptionally commenting out the older ImGuiKeyModFlags_XXX names ahead of obsolescence schedule to reduce confusion and because they were not meant to be used anyway. + - 2022/09/12 (1.89) - removed the bizarre legacy default argument for 'TreePush(const void* ptr = NULL)', always pass a pointer value explicitly. NULL/nullptr is ok but require cast, e.g. TreePush((void*)nullptr); + - 2022/09/05 (1.89) - commented out redirecting functions/enums names that were marked obsolete in 1.77 and 1.78 (June 2020): + - DragScalar(), DragScalarN(), DragFloat(), DragFloat2(), DragFloat3(), DragFloat4(): For old signatures ending with (..., const char* format, float power = 1.0f) -> use (..., format ImGuiSliderFlags_Logarithmic) if power != 1.0f. + - SliderScalar(), SliderScalarN(), SliderFloat(), SliderFloat2(), SliderFloat3(), SliderFloat4(): For old signatures ending with (..., const char* format, float power = 1.0f) -> use (..., format ImGuiSliderFlags_Logarithmic) if power != 1.0f. + - BeginPopupContextWindow(const char*, ImGuiMouseButton, bool) -> use BeginPopupContextWindow(const char*, ImGuiPopupFlags) + - 2022/09/02 (1.89) - obsoleted using SetCursorPos()/SetCursorScreenPos() to extend parent window/cell boundaries. + this relates to when moving the cursor position beyond current boundaries WITHOUT submitting an item. + - previously this would make the window content size ~200x200: + Begin(...) + SetCursorScreenPos(GetCursorScreenPos() + ImVec2(200,200)) + End(); + - instead, please submit an item: + Begin(...) + SetCursorScreenPos(GetCursorScreenPos() + ImVec2(200,200)) + Dummy(ImVec2(0,0)) + End(); + - alternative: + Begin(...) + Dummy(ImVec2(200,200)) + End(); + - content size is now only extended when submitting an item! + - with '#define IMGUI_DISABLE_OBSOLETE_FUNCTIONS' this will now be detected and assert. + - without '#define IMGUI_DISABLE_OBSOLETE_FUNCTIONS' this will silently be fixed until we obsolete it. + - 2022/08/03 (1.89) - changed signature of ImageButton() function. Kept redirection function (will obsolete). + - added 'const char* str_id' parameter + removed 'int frame_padding = -1' parameter. + - old signature: bool ImageButton(ImTextureID tex_id, ImVec2 size, ImVec2 uv0 = ImVec2(0,0), ImVec2 uv1 = ImVec2(1,1), int frame_padding = -1, ImVec4 bg_col = ImVec4(0,0,0,0), ImVec4 tint_col = ImVec4(1,1,1,1)); + - used the ImTextureID value to create an ID. This was inconsistent with other functions, led to ID conflicts, and caused problems with engines using transient ImTextureID values. + - had a FramePadding override which was inconsistent with other functions and made the already-long signature even longer. + - new signature: bool ImageButton(const char* str_id, ImTextureID tex_id, ImVec2 size, ImVec2 uv0 = ImVec2(0,0), ImVec2 uv1 = ImVec2(1,1), ImVec4 bg_col = ImVec4(0,0,0,0), ImVec4 tint_col = ImVec4(1,1,1,1)); + - requires an explicit identifier. You may still use e.g. PushID() calls and then pass an empty identifier. + - always uses style.FramePadding for padding, to be consistent with other buttons. You may use PushStyleVar() to alter this. + - 2022/07/08 (1.89) - inputs: removed io.NavInputs[] and ImGuiNavInput enum (following 1.87 changes). + - Official backends from 1.87+ -> no issue. + - Official backends from 1.60 to 1.86 -> will build and convert gamepad inputs, unless IMGUI_DISABLE_OBSOLETE_KEYIO is defined. Need updating! + - Custom backends not writing to io.NavInputs[] -> no issue. + - Custom backends writing to io.NavInputs[] -> will build and convert gamepad inputs, unless IMGUI_DISABLE_OBSOLETE_KEYIO is defined. Need fixing! + - TL;DR: Backends should call io.AddKeyEvent()/io.AddKeyAnalogEvent() with ImGuiKey_GamepadXXX values instead of filling io.NavInput[]. + - 2022/06/15 (1.88) - renamed IMGUI_DISABLE_METRICS_WINDOW to IMGUI_DISABLE_DEBUG_TOOLS for correctness. kept support for old define (will obsolete). + - 2022/05/03 (1.88) - backends: osx: removed ImGui_ImplOSX_HandleEvent() from backend API in favor of backend automatically handling event capture. All ImGui_ImplOSX_HandleEvent() calls should be removed as they are now unnecessary. + - 2022/04/05 (1.88) - inputs: renamed ImGuiKeyModFlags to ImGuiModFlags. Kept inline redirection enums (will obsolete). This was never used in public API functions but technically present in imgui.h and ImGuiIO. + - 2022/01/20 (1.87) - inputs: reworded gamepad IO. + - Backend writing to io.NavInputs[] -> backend should call io.AddKeyEvent()/io.AddKeyAnalogEvent() with ImGuiKey_GamepadXXX values. + - 2022/01/19 (1.87) - sliders, drags: removed support for legacy arithmetic operators (+,+-,*,/) when inputing text. This doesn't break any api/code but a feature that used to be accessible by end-users (which seemingly no one used). + - 2022/01/17 (1.87) - inputs: reworked mouse IO. + - Backend writing to io.MousePos -> backend should call io.AddMousePosEvent() + - Backend writing to io.MouseDown[] -> backend should call io.AddMouseButtonEvent() + - Backend writing to io.MouseWheel -> backend should call io.AddMouseWheelEvent() + - Backend writing to io.MouseHoveredViewport -> backend should call io.AddMouseViewportEvent() [Docking branch w/ multi-viewports only] + note: for all calls to IO new functions, the Dear ImGui context should be bound/current. + read https://github.com/ocornut/imgui/issues/4921 for details. + - 2022/01/10 (1.87) - inputs: reworked keyboard IO. Removed io.KeyMap[], io.KeysDown[] in favor of calling io.AddKeyEvent(). Removed GetKeyIndex(), now unecessary. All IsKeyXXX() functions now take ImGuiKey values. All features are still functional until IMGUI_DISABLE_OBSOLETE_KEYIO is defined. Read Changelog and Release Notes for details. + - IsKeyPressed(MY_NATIVE_KEY_XXX) -> use IsKeyPressed(ImGuiKey_XXX) + - IsKeyPressed(GetKeyIndex(ImGuiKey_XXX)) -> use IsKeyPressed(ImGuiKey_XXX) + - Backend writing to io.KeyMap[],io.KeysDown[] -> backend should call io.AddKeyEvent() (+ call io.SetKeyEventNativeData() if you want legacy user code to stil function with legacy key codes). + - Backend writing to io.KeyCtrl, io.KeyShift.. -> backend should call io.AddKeyEvent() with ImGuiMod_XXX values. *IF YOU PULLED CODE BETWEEN 2021/01/10 and 2021/01/27: We used to have a io.AddKeyModsEvent() function which was now replaced by io.AddKeyEvent() with ImGuiMod_XXX values.* + - one case won't work with backward compatibility: if your custom backend used ImGuiKey as mock native indices (e.g. "io.KeyMap[ImGuiKey_A] = ImGuiKey_A") because those values are now larger than the legacy KeyDown[] array. Will assert. + - inputs: added ImGuiKey_ModCtrl/ImGuiKey_ModShift/ImGuiKey_ModAlt/ImGuiKey_ModSuper values to submit keyboard modifiers using io.AddKeyEvent(), instead of writing directly to io.KeyCtrl, io.KeyShift, io.KeyAlt, io.KeySuper. + - 2022/01/05 (1.87) - inputs: renamed ImGuiKey_KeyPadEnter to ImGuiKey_KeypadEnter to align with new symbols. Kept redirection enum. + - 2022/01/05 (1.87) - removed io.ImeSetInputScreenPosFn() in favor of more flexible io.SetPlatformImeDataFn(). Removed 'void* io.ImeWindowHandle' in favor of writing to 'void* ImGuiViewport::PlatformHandleRaw'. + - 2022/01/01 (1.87) - commented out redirecting functions/enums names that were marked obsolete in 1.69, 1.70, 1.71, 1.72 (March-July 2019) + - ImGui::SetNextTreeNodeOpen() -> use ImGui::SetNextItemOpen() + - ImGui::GetContentRegionAvailWidth() -> use ImGui::GetContentRegionAvail().x + - ImGui::TreeAdvanceToLabelPos() -> use ImGui::SetCursorPosX(ImGui::GetCursorPosX() + ImGui::GetTreeNodeToLabelSpacing()); + - ImFontAtlas::CustomRect -> use ImFontAtlasCustomRect + - ImGuiColorEditFlags_RGB/HSV/HEX -> use ImGuiColorEditFlags_DisplayRGB/HSV/Hex + - 2021/12/20 (1.86) - backends: removed obsolete Marmalade backend (imgui_impl_marmalade.cpp) + example. Find last supported version at https://github.com/ocornut/imgui/wiki/Bindings + - 2021/11/04 (1.86) - removed CalcListClipping() function. Prefer using ImGuiListClipper which can return non-contiguous ranges. Please open an issue if you think you really need this function. + - 2021/08/23 (1.85) - removed GetWindowContentRegionWidth() function. keep inline redirection helper. can use 'GetWindowContentRegionMax().x - GetWindowContentRegionMin().x' instead for generally 'GetContentRegionAvail().x' is more useful. - 2021/07/26 (1.84) - commented out redirecting functions/enums names that were marked obsolete in 1.67 and 1.69 (March 2019): - ImGui::GetOverlayDrawList() -> use ImGui::GetForegroundDrawList() - ImFont::GlyphRangesBuilder -> use ImFontGlyphRangesBuilder @@ -722,10 +798,12 @@ CODE Q&A: Usage ---------- - Q: Why is my widget not reacting when I click on it? - Q: How can I have widgets with an empty label? - Q: How can I have multiple widgets with the same label? - Q: How can I display an image? What is ImTextureID, how does it works? + Q: About the ID Stack system.. + - Why is my widget not reacting when I click on it? + - How can I have widgets with an empty label? + - How can I have multiple widgets with the same label? + - How can I have multiple windows with the same label? + Q: How can I display an image? What is ImTextureID, how does it work? Q: How can I use my own math types instead of ImVec2/ImVec4? 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) @@ -784,7 +862,6 @@ CODE #include "imgui_internal.h" // System includes -#include // toupper #include // vsnprintf, sscanf, printf #if defined(_MSC_VER) && _MSC_VER <= 1500 // MSVC 2008 or earlier #include // intptr_t @@ -833,7 +910,7 @@ CODE #if defined(_MSC_VER) && _MSC_VER >= 1922 // MSVC 2019 16.2 or later #pragma warning (disable: 5054) // operator '|': deprecated between enumerations of different types #endif -#pragma warning (disable: 26451) // [Static Analyzer] Arithmetic overflow : Using operator 'xxx' on a 4 byte value and then casting the result to a 8 byte value. Cast the value to the wider type before calling operator 'xxx' to avoid overflow(io.2). +#pragma warning (disable: 26451) // [Static Analyzer] Arithmetic overflow : Using operator 'xxx' on a 4 byte value and then casting the result to an 8 byte value. Cast the value to the wider type before calling operator 'xxx' to avoid overflow(io.2). #pragma warning (disable: 26495) // [Static Analyzer] Variable 'XXX' is uninitialized. Always initialize a member variable (type.6). #pragma warning (disable: 26812) // [Static Analyzer] The enum type 'xxx' is unscoped. Prefer 'enum class' over 'enum' (Enum.3). #endif @@ -856,7 +933,7 @@ CODE #pragma clang diagnostic ignored "-Wdouble-promotion" // warning: implicit conversion from 'float' to 'double' when passing argument to function // using printf() is a misery with this as C++ va_arg ellipsis changes float to double. #pragma clang diagnostic ignored "-Wimplicit-int-float-conversion" // warning: implicit conversion from 'xxx' to 'float' may lose precision #elif defined(__GNUC__) -// We disable -Wpragmas because GCC doesn't provide an has_warning equivalent and some forks/patches may not following the warning/version association. +// We disable -Wpragmas because GCC doesn't provide a has_warning equivalent and some forks/patches may not follow the warning/version association. #pragma GCC diagnostic ignored "-Wpragmas" // warning: unknown option after '#pragma GCC diagnostic' kind #pragma GCC diagnostic ignored "-Wunused-function" // warning: 'xxxx' defined but not used #pragma GCC diagnostic ignored "-Wint-to-pointer-cast" // warning: cast to pointer from integer of different size @@ -880,7 +957,7 @@ static const float NAV_WINDOWING_LIST_APPEAR_DELAY = 0.15f; // Time // Window resizing from edges (when io.ConfigWindowsResizeFromEdges = true and ImGuiBackendFlags_HasMouseCursors is set in io.BackendFlags by backend) static const float WINDOWS_HOVER_PADDING = 4.0f; // Extend outside window for hovering/resizing (maxxed with TouchPadding) and inside windows for borders. Affect FindHoveredWindow(). static const float WINDOWS_RESIZE_FROM_EDGES_FEEDBACK_TIMER = 0.04f; // Reduce visual noise by only highlighting the border after a certain time. -static const float WINDOWS_MOUSE_WHEEL_SCROLL_LOCK_TIMER = 2.00f; // Lock scrolled window (so it doesn't pick child windows that are scrolling through) for a certain time, unless mouse moved. +static const float WINDOWS_MOUSE_WHEEL_SCROLL_LOCK_TIMER = 0.70f; // Lock scrolled window (so it doesn't pick child windows that are scrolling through) for a certain time, unless mouse moved. //------------------------------------------------------------------------- // [SECTION] FORWARD DECLARATIONS @@ -904,7 +981,7 @@ static void WindowSettingsHandler_WriteAll(ImGuiContext*, ImGuiSetti // Platform Dependents default implementation for IO functions static const char* GetClipboardTextFn_DefaultImpl(void* user_data); static void SetClipboardTextFn_DefaultImpl(void* user_data, const char* text); -static void ImeSetInputScreenPosFn_DefaultImpl(int x, int y); +static void SetPlatformImeDataFn_DefaultImpl(ImGuiViewport* viewport, ImGuiPlatformImeData* data); namespace ImGui { @@ -914,32 +991,40 @@ static void NavUpdateWindowing(); static void NavUpdateWindowingOverlay(); static void NavUpdateCancelRequest(); static void NavUpdateCreateMoveRequest(); +static void NavUpdateCreateTabbingRequest(); static float NavUpdatePageUpPageDown(); static inline void NavUpdateAnyRequestFlag(); +static void NavUpdateCreateWrappingRequest(); static void NavEndFrame(); static bool NavScoreItem(ImGuiNavItemData* result); static void NavApplyItemToResult(ImGuiNavItemData* result); static void NavProcessItem(); +static void NavProcessItemForTabbingRequest(ImGuiID id); static ImVec2 NavCalcPreferredRefPos(); static void NavSaveLastChildNavWindowIntoParent(ImGuiWindow* nav_window); static ImGuiWindow* NavRestoreLastChildNavWindow(ImGuiWindow* window); static void NavRestoreLayer(ImGuiNavLayer layer); +static void NavRestoreHighlightAfterMove(); static int FindWindowFocusIndex(ImGuiWindow* window); -// Error Checking +// Error Checking and Debug Tools static void ErrorCheckNewFrameSanityChecks(); static void ErrorCheckEndFrameSanityChecks(); +static void UpdateDebugToolItemPicker(); +static void UpdateDebugToolStackQueries(); // Misc static void UpdateSettings(); +static void UpdateKeyboardInputs(); static void UpdateMouseInputs(); static void UpdateMouseWheel(); -static void UpdateTabFocus(); -static void UpdateDebugToolItemPicker(); static bool UpdateWindowManualResize(ImGuiWindow* window, const ImVec2& size_auto_fit, int* border_held, int resize_grip_count, ImU32 resize_grip_col[4], const ImRect& visibility_rect); static void RenderWindowOuterBorders(ImGuiWindow* window); static void RenderWindowDecorations(ImGuiWindow* window, const ImRect& title_bar_rect, bool title_bar_is_highlight, int resize_grip_count, const ImU32 resize_grip_col[4], float resize_grip_draw_size); static void RenderWindowTitleBarContents(ImGuiWindow* window, const ImRect& title_bar_rect, const char* name, bool* p_open); +static void RenderDimmedBackgroundBehindWindow(ImGuiWindow* window, ImU32 col); +static void RenderDimmedBackgrounds(); +static ImGuiWindow* FindBlockingModal(ImGuiWindow* window); // Viewports static void UpdateViewportsNewFrame(); @@ -1017,12 +1102,12 @@ ImGuiStyle::ImGuiStyle() ColumnsMinSpacing = 6.0f; // Minimum horizontal spacing between two columns. Preferably > (FramePadding.x + 1). ScrollbarSize = 14.0f; // Width of the vertical scrollbar, Height of the horizontal scrollbar ScrollbarRounding = 9.0f; // Radius of grab corners rounding for scrollbar - GrabMinSize = 10.0f; // Minimum width/height of a grab box for slider/scrollbar + GrabMinSize = 12.0f; // Minimum width/height of a grab box for slider/scrollbar 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. TabRounding = 4.0f; // Radius of upper corners of a tab. Set to 0.0f to have rectangular tabs. TabBorderSize = 0.0f; // Thickness of border around tabs. - TabMinWidthForCloseButton = 0.0f; // Minimum width for close button to appears on an unselected tab when hovered. Set to 0.0f to always show when hovering, set to FLT_MAX to never show close button unless selected. + TabMinWidthForCloseButton = 0.0f; // Minimum width for close button to appear on an unselected tab when hovered. Set to 0.0f to always show when hovering, set to FLT_MAX to never show close button unless selected. 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. @@ -1030,7 +1115,7 @@ ImGuiStyle::ImGuiStyle() DisplaySafeAreaPadding = ImVec2(3,3); // If you cannot see the edge of your screen (e.g. on a TV) increase the safe area padding. Covers popups/tooltips as well regular windows. MouseCursorScale = 1.0f; // Scale software rendered mouse cursor (when io.MouseDrawCursor is enabled). May be removed later. AntiAliasedLines = true; // Enable anti-aliased lines/borders. Disable if you are really tight on CPU/GPU. - AntiAliasedLinesUseTex = true; // Enable anti-aliased lines/borders using textures where possible. Require backend to render with bilinear filtering. + AntiAliasedLinesUseTex = true; // Enable anti-aliased lines/borders using textures where possible. Require backend to render with bilinear filtering (NOT point/nearest filtering). AntiAliasedFill = true; // Enable anti-aliased filled shapes (rounded rectangles, circles, etc.). CurveTessellationTol = 1.25f; // Tessellation tolerance when using PathBezierCurveTo() without a specific number of segments. Decrease for highly tessellated curves (higher quality, more polygons), increase to reduce quality. CircleTessellationMaxError = 0.30f; // Maximum error (in pixels) allowed when using AddCircle()/AddCircleFilled() or drawing rounded corner rectangles with no explicit segment count specified. Decrease for higher quality but more geometry. @@ -1072,7 +1157,7 @@ ImGuiIO::ImGuiIO() { // Most fields are initialized with zero memset(this, 0, sizeof(*this)); - IM_ASSERT(IM_ARRAYSIZE(ImGuiIO::MouseDown) == ImGuiMouseButton_COUNT && IM_ARRAYSIZE(ImGuiIO::MouseClicked) == ImGuiMouseButton_COUNT); // Our pre-C++11 IM_STATIC_ASSERT() macros triggers warning on modern compilers so we don't use it here. + IM_STATIC_ASSERT(IM_ARRAYSIZE(ImGuiIO::MouseDown) == ImGuiMouseButton_COUNT && IM_ARRAYSIZE(ImGuiIO::MouseClicked) == ImGuiMouseButton_COUNT); // Settings ConfigFlags = ImGuiConfigFlags_None; @@ -1084,10 +1169,14 @@ ImGuiIO::ImGuiIO() LogFilename = "imgui_log.txt"; MouseDoubleClickTime = 0.30f; MouseDoubleClickMaxDist = 6.0f; +#ifndef IMGUI_DISABLE_OBSOLETE_KEYIO for (int i = 0; i < ImGuiKey_COUNT; i++) KeyMap[i] = -1; +#endif KeyRepeatDelay = 0.275f; KeyRepeatRate = 0.050f; + HoverDelayNormal = 0.30f; + HoverDelayShort = 0.10f; UserData = NULL; Fonts = NULL; @@ -1103,7 +1192,10 @@ ImGuiIO::ImGuiIO() #else ConfigMacOSXBehaviors = false; #endif + ConfigInputTrickleEventQueue = true; ConfigInputTextCursorBlink = true; + ConfigInputTextEnterKeepActive = false; + ConfigDragClickToInputText = false; ConfigWindowsResizeFromEdges = true; ConfigWindowsMoveFromTitleBarOnly = false; ConfigMemoryCompactTimer = 60.0f; @@ -1114,38 +1206,48 @@ ImGuiIO::ImGuiIO() GetClipboardTextFn = GetClipboardTextFn_DefaultImpl; // Platform dependent default implementations SetClipboardTextFn = SetClipboardTextFn_DefaultImpl; ClipboardUserData = NULL; - ImeSetInputScreenPosFn = ImeSetInputScreenPosFn_DefaultImpl; - ImeWindowHandle = NULL; + SetPlatformImeDataFn = SetPlatformImeDataFn_DefaultImpl; // Input (NB: we already have memset zero the entire structure!) MousePos = ImVec2(-FLT_MAX, -FLT_MAX); MousePosPrev = ImVec2(-FLT_MAX, -FLT_MAX); MouseDragThreshold = 6.0f; for (int i = 0; i < IM_ARRAYSIZE(MouseDownDuration); i++) MouseDownDuration[i] = MouseDownDurationPrev[i] = -1.0f; - for (int i = 0; i < IM_ARRAYSIZE(KeysDownDuration); i++) KeysDownDuration[i] = KeysDownDurationPrev[i] = -1.0f; - for (int i = 0; i < IM_ARRAYSIZE(NavInputsDownDuration); i++) NavInputsDownDuration[i] = -1.0f; + for (int i = 0; i < IM_ARRAYSIZE(KeysData); i++) { KeysData[i].DownDuration = KeysData[i].DownDurationPrev = -1.0f; } + AppAcceptingEvents = true; + BackendUsingLegacyKeyArrays = (ImS8)-1; + BackendUsingLegacyNavInputArray = true; // assume using legacy array until proven wrong } // Pass in translated ASCII characters for text input. // - with glfw you can get those from the callback set in glfwSetCharCallback() // - on Windows you can get those using ToAscii+keyboard state, or via the WM_CHAR message +// FIXME: Should in theory be called "AddCharacterEvent()" to be consistent with new API void ImGuiIO::AddInputCharacter(unsigned int c) { - if (c != 0) - InputQueueCharacters.push_back(c <= IM_UNICODE_CODEPOINT_MAX ? (ImWchar)c : IM_UNICODE_CODEPOINT_INVALID); + ImGuiContext& g = *GImGui; + IM_ASSERT(&g.IO == this && "Can only add events to current context."); + if (c == 0 || !AppAcceptingEvents) + return; + + ImGuiInputEvent e; + e.Type = ImGuiInputEventType_Text; + e.Source = ImGuiInputSource_Keyboard; + e.Text.Char = c; + g.InputEventsQueue.push_back(e); } // UTF16 strings use surrogate pairs to encode codepoints >= 0x10000, so // we should save the high surrogate. void ImGuiIO::AddInputCharacterUTF16(ImWchar16 c) { - if (c == 0 && InputQueueSurrogate == 0) + if ((c == 0 && InputQueueSurrogate == 0) || !AppAcceptingEvents) return; if ((c & 0xFC00) == 0xD800) // High surrogate, must save { if (InputQueueSurrogate != 0) - InputQueueCharacters.push_back(IM_UNICODE_CODEPOINT_INVALID); + AddInputCharacter(IM_UNICODE_CODEPOINT_INVALID); InputQueueSurrogate = c; return; } @@ -1155,7 +1257,7 @@ void ImGuiIO::AddInputCharacterUTF16(ImWchar16 c) { if ((c & 0xFC00) != 0xDC00) // Invalid low surrogate { - InputQueueCharacters.push_back(IM_UNICODE_CODEPOINT_INVALID); + AddInputCharacter(IM_UNICODE_CODEPOINT_INVALID); } else { @@ -1168,41 +1270,229 @@ void ImGuiIO::AddInputCharacterUTF16(ImWchar16 c) InputQueueSurrogate = 0; } - InputQueueCharacters.push_back(cp); + AddInputCharacter((unsigned)cp); } void ImGuiIO::AddInputCharactersUTF8(const char* utf8_chars) { + if (!AppAcceptingEvents) + return; while (*utf8_chars != 0) { unsigned int c = 0; utf8_chars += ImTextCharFromUtf8(&c, utf8_chars, NULL); if (c != 0) - InputQueueCharacters.push_back((ImWchar)c); + AddInputCharacter(c); } } +// FIXME: Perhaps we could clear queued events as well? void ImGuiIO::ClearInputCharacters() { InputQueueCharacters.resize(0); } +// FIXME: Perhaps we could clear queued events as well? void ImGuiIO::ClearInputKeys() { +#ifndef IMGUI_DISABLE_OBSOLETE_KEYIO memset(KeysDown, 0, sizeof(KeysDown)); - for (int n = 0; n < IM_ARRAYSIZE(KeysDownDuration); n++) - KeysDownDuration[n] = KeysDownDurationPrev[n] = -1.0f; +#endif + for (int n = 0; n < IM_ARRAYSIZE(KeysData); n++) + { + KeysData[n].Down = false; + KeysData[n].DownDuration = -1.0f; + KeysData[n].DownDurationPrev = -1.0f; + } KeyCtrl = KeyShift = KeyAlt = KeySuper = false; - KeyMods = KeyModsPrev = ImGuiKeyModFlags_None; - for (int n = 0; n < IM_ARRAYSIZE(NavInputsDownDuration); n++) - NavInputsDownDuration[n] = NavInputsDownDurationPrev[n] = -1.0f; + KeyMods = ImGuiMod_None; + MousePos = ImVec2(-FLT_MAX, -FLT_MAX); + for (int n = 0; n < IM_ARRAYSIZE(MouseDown); n++) + { + MouseDown[n] = false; + MouseDownDuration[n] = MouseDownDurationPrev[n] = -1.0f; + } + MouseWheel = MouseWheelH = 0.0f; +} + +static ImGuiInputEvent* FindLatestInputEvent(ImGuiInputEventType type, int arg = -1) +{ + ImGuiContext& g = *GImGui; + for (int n = g.InputEventsQueue.Size - 1; n >= 0; n--) + { + ImGuiInputEvent* e = &g.InputEventsQueue[n]; + if (e->Type != type) + continue; + if (type == ImGuiInputEventType_Key && e->Key.Key != arg) + continue; + if (type == ImGuiInputEventType_MouseButton && e->MouseButton.Button != arg) + continue; + return e; + } + return NULL; +} + +// Queue a new key down/up event. +// - ImGuiKey key: Translated key (as in, generally ImGuiKey_A matches the key end-user would use to emit an 'A' character) +// - bool down: Is the key down? use false to signify a key release. +// - float analog_value: 0.0f..1.0f +void ImGuiIO::AddKeyAnalogEvent(ImGuiKey key, bool down, float analog_value) +{ + //if (e->Down) { IMGUI_DEBUG_LOG_IO("AddKeyEvent() Key='%s' %d, NativeKeycode = %d, NativeScancode = %d\n", ImGui::GetKeyName(e->Key), e->Down, e->NativeKeycode, e->NativeScancode); } + if (key == ImGuiKey_None || !AppAcceptingEvents) + return; + ImGuiContext& g = *GImGui; + IM_ASSERT(&g.IO == this && "Can only add events to current context."); + IM_ASSERT(ImGui::IsNamedKeyOrModKey(key)); // Backend needs to pass a valid ImGuiKey_ constant. 0..511 values are legacy native key codes which are not accepted by this API. + IM_ASSERT(!ImGui::IsAliasKey(key)); // Backend cannot submit ImGuiKey_MouseXXX values they are automatically inferred from AddMouseXXX() events. + + // Verify that backend isn't mixing up using new io.AddKeyEvent() api and old io.KeysDown[] + io.KeyMap[] data. +#ifndef IMGUI_DISABLE_OBSOLETE_KEYIO + IM_ASSERT((BackendUsingLegacyKeyArrays == -1 || BackendUsingLegacyKeyArrays == 0) && "Backend needs to either only use io.AddKeyEvent(), either only fill legacy io.KeysDown[] + io.KeyMap[]. Not both!"); + if (BackendUsingLegacyKeyArrays == -1) + for (int n = ImGuiKey_NamedKey_BEGIN; n < ImGuiKey_NamedKey_END; n++) + IM_ASSERT(KeyMap[n] == -1 && "Backend needs to either only use io.AddKeyEvent(), either only fill legacy io.KeysDown[] + io.KeyMap[]. Not both!"); + BackendUsingLegacyKeyArrays = 0; +#endif + if (ImGui::IsGamepadKey(key)) + BackendUsingLegacyNavInputArray = false; + + // Filter duplicate (in particular: key mods and gamepad analog values are commonly spammed) + const ImGuiInputEvent* latest_event = FindLatestInputEvent(ImGuiInputEventType_Key, (int)key); + const ImGuiKeyData* key_data = ImGui::GetKeyData(key); + const bool latest_key_down = latest_event ? latest_event->Key.Down : key_data->Down; + const float latest_key_analog = latest_event ? latest_event->Key.AnalogValue : key_data->AnalogValue; + if (latest_key_down == down && latest_key_analog == analog_value) + return; + + // Add event + ImGuiInputEvent e; + e.Type = ImGuiInputEventType_Key; + e.Source = ImGui::IsGamepadKey(key) ? ImGuiInputSource_Gamepad : ImGuiInputSource_Keyboard; + e.Key.Key = key; + e.Key.Down = down; + e.Key.AnalogValue = analog_value; + g.InputEventsQueue.push_back(e); +} + +void ImGuiIO::AddKeyEvent(ImGuiKey key, bool down) +{ + if (!AppAcceptingEvents) + return; + AddKeyAnalogEvent(key, down, down ? 1.0f : 0.0f); +} + +// [Optional] Call after AddKeyEvent(). +// Specify native keycode, scancode + Specify index for legacy <1.87 IsKeyXXX() functions with native indices. +// If you are writing a backend in 2022 or don't use IsKeyXXX() with native values that are not ImGuiKey values, you can avoid calling this. +void ImGuiIO::SetKeyEventNativeData(ImGuiKey key, int native_keycode, int native_scancode, int native_legacy_index) +{ + if (key == ImGuiKey_None) + return; + IM_ASSERT(ImGui::IsNamedKey(key)); // >= 512 + IM_ASSERT(native_legacy_index == -1 || ImGui::IsLegacyKey((ImGuiKey)native_legacy_index)); // >= 0 && <= 511 + IM_UNUSED(native_keycode); // Yet unused + IM_UNUSED(native_scancode); // Yet unused + + // Build native->imgui map so old user code can still call key functions with native 0..511 values. +#ifndef IMGUI_DISABLE_OBSOLETE_KEYIO + const int legacy_key = (native_legacy_index != -1) ? native_legacy_index : native_keycode; + if (!ImGui::IsLegacyKey((ImGuiKey)legacy_key)) + return; + KeyMap[legacy_key] = key; + KeyMap[key] = legacy_key; +#else + IM_UNUSED(key); + IM_UNUSED(native_legacy_index); +#endif +} + +// Set master flag for accepting key/mouse/text events (default to true). Useful if you have native dialog boxes that are interrupting your application loop/refresh, and you want to disable events being queued while your app is frozen. +void ImGuiIO::SetAppAcceptingEvents(bool accepting_events) +{ + AppAcceptingEvents = accepting_events; +} + +// Queue a mouse move event +void ImGuiIO::AddMousePosEvent(float x, float y) +{ + ImGuiContext& g = *GImGui; + IM_ASSERT(&g.IO == this && "Can only add events to current context."); + if (!AppAcceptingEvents) + return; + + // Apply same flooring as UpdateMouseInputs() + ImVec2 pos((x > -FLT_MAX) ? ImFloorSigned(x) : x, (y > -FLT_MAX) ? ImFloorSigned(y) : y); + + // Filter duplicate + const ImGuiInputEvent* latest_event = FindLatestInputEvent(ImGuiInputEventType_MousePos); + const ImVec2 latest_pos = latest_event ? ImVec2(latest_event->MousePos.PosX, latest_event->MousePos.PosY) : g.IO.MousePos; + if (latest_pos.x == pos.x && latest_pos.y == pos.y) + return; + + ImGuiInputEvent e; + e.Type = ImGuiInputEventType_MousePos; + e.Source = ImGuiInputSource_Mouse; + e.MousePos.PosX = pos.x; + e.MousePos.PosY = pos.y; + g.InputEventsQueue.push_back(e); +} + +void ImGuiIO::AddMouseButtonEvent(int mouse_button, bool down) +{ + ImGuiContext& g = *GImGui; + IM_ASSERT(&g.IO == this && "Can only add events to current context."); + IM_ASSERT(mouse_button >= 0 && mouse_button < ImGuiMouseButton_COUNT); + if (!AppAcceptingEvents) + return; + + // Filter duplicate + const ImGuiInputEvent* latest_event = FindLatestInputEvent(ImGuiInputEventType_MouseButton, (int)mouse_button); + const bool latest_button_down = latest_event ? latest_event->MouseButton.Down : g.IO.MouseDown[mouse_button]; + if (latest_button_down == down) + return; + + ImGuiInputEvent e; + e.Type = ImGuiInputEventType_MouseButton; + e.Source = ImGuiInputSource_Mouse; + e.MouseButton.Button = mouse_button; + e.MouseButton.Down = down; + g.InputEventsQueue.push_back(e); +} + +// Queue a mouse wheel event (most mouse/API will only have a Y component) +void ImGuiIO::AddMouseWheelEvent(float wheel_x, float wheel_y) +{ + ImGuiContext& g = *GImGui; + IM_ASSERT(&g.IO == this && "Can only add events to current context."); + + // Filter duplicate (unlike most events, wheel values are relative and easy to filter) + if (!AppAcceptingEvents || (wheel_x == 0.0f && wheel_y == 0.0f)) + return; + + ImGuiInputEvent e; + e.Type = ImGuiInputEventType_MouseWheel; + e.Source = ImGuiInputSource_Mouse; + e.MouseWheel.WheelX = wheel_x; + e.MouseWheel.WheelY = wheel_y; + g.InputEventsQueue.push_back(e); } void ImGuiIO::AddFocusEvent(bool focused) { - // We intentionally overwrite this and process in NewFrame(), in order to give a chance - // to multi-viewports backends to queue AddFocusEvent(false),AddFocusEvent(true) in same frame. - AppFocusLost = !focused; + ImGuiContext& g = *GImGui; + IM_ASSERT(&g.IO == this && "Can only add events to current context."); + + // Filter duplicate + const ImGuiInputEvent* latest_event = FindLatestInputEvent(ImGuiInputEventType_Focus); + const bool latest_focused = latest_event ? latest_event->AppFocused.Focused : !g.IO.AppFocusLost; + if (latest_focused == focused) + return; + + ImGuiInputEvent e; + e.Type = ImGuiInputEventType_Focus; + e.AppFocused.Focused = focused; + g.InputEventsQueue.push_back(e); } //----------------------------------------------------------------------------- @@ -1333,14 +1623,14 @@ ImVec2 ImTriangleClosestPoint(const ImVec2& a, const ImVec2& b, const ImVec2& c, int ImStricmp(const char* str1, const char* str2) { int d; - while ((d = toupper(*str2) - toupper(*str1)) == 0 && *str1) { str1++; str2++; } + while ((d = ImToUpper(*str2) - ImToUpper(*str1)) == 0 && *str1) { str1++; str2++; } return d; } int ImStrnicmp(const char* str1, const char* str2, size_t count) { int d = 0; - while (count > 0 && (d = toupper(*str2) - toupper(*str1)) == 0 && *str1) { str1++; str2++; count--; } + while (count > 0 && (d = ImToUpper(*str2) - ImToUpper(*str1)) == 0 && *str1) { str1++; str2++; count--; } return d; } @@ -1407,14 +1697,14 @@ const char* ImStristr(const char* haystack, const char* haystack_end, const char if (!needle_end) needle_end = needle + strlen(needle); - const char un0 = (char)toupper(*needle); + const char un0 = (char)ImToUpper(*needle); while ((!haystack_end && *haystack) || (haystack_end && haystack < haystack_end)) { - if (toupper(*haystack) == un0) + if (ImToUpper(*haystack) == un0) { const char* b = needle + 1; for (const char* a = haystack + 1; b < needle_end; a++, b++) - if (toupper(*a) != toupper(*b)) + if (ImToUpper(*a) != ImToUpper(*b)) break; if (b == needle_end) return haystack; @@ -1458,8 +1748,12 @@ const char* ImStrSkipBlank(const char* str) // designed using two-passes worst case, which probably could be improved using the stbsp_vsprintfcb() function.) #ifdef IMGUI_USE_STB_SPRINTF #define STB_SPRINTF_IMPLEMENTATION +#ifdef IMGUI_STB_SPRINTF_FILENAME +#include IMGUI_STB_SPRINTF_FILENAME +#else #include "stb_sprintf.h" #endif +#endif #if defined(_MSC_VER) && !defined(vsnprintf) #define vsnprintf _vsnprintf @@ -1499,6 +1793,25 @@ int ImFormatStringV(char* buf, size_t buf_size, const char* fmt, va_list args) } #endif // #ifdef IMGUI_DISABLE_DEFAULT_FORMAT_FUNCTIONS +void ImFormatStringToTempBuffer(const char** out_buf, const char** out_buf_end, const char* fmt, ...) +{ + ImGuiContext& g = *GImGui; + va_list args; + va_start(args, fmt); + int buf_len = ImFormatStringV(g.TempBuffer.Data, g.TempBuffer.Size, fmt, args); + *out_buf = g.TempBuffer.Data; + if (out_buf_end) { *out_buf_end = g.TempBuffer.Data + buf_len; } + va_end(args); +} + +void ImFormatStringToTempBufferV(const char** out_buf, const char** out_buf_end, const char* fmt, va_list args) +{ + ImGuiContext& g = *GImGui; + int buf_len = ImFormatStringV(g.TempBuffer.Data, g.TempBuffer.Size, fmt, args); + *out_buf = g.TempBuffer.Data; + if (out_buf_end) { *out_buf_end = g.TempBuffer.Data + buf_len; } +} + // CRC32 needs a 1KB lookup table (not cache friendly) // Although the code to generate the table is simple and shorter than the table itself, using a const table allows us to easily: // - avoid an unnecessary branch/memory tap, - keep the ImHashXXX functions usable by static constructors, - make it thread-safe. @@ -1940,7 +2253,7 @@ void ImGuiStorage::BuildSortByKey() { struct StaticFunc { - static int IMGUI_CDECL PairCompareByID(const void* lhs, const void* rhs) + static int IMGUI_CDECL PairComparerByID(const void* lhs, const void* rhs) { // We can't just do a subtraction because qsort uses signed integers and subtracting our ID doesn't play well with that. if (((const ImGuiStoragePair*)lhs)->key > ((const ImGuiStoragePair*)rhs)->key) return +1; @@ -1948,8 +2261,7 @@ void ImGuiStorage::BuildSortByKey() return 0; } }; - if (Data.Size > 1) - ImQsort(Data.Data, (size_t)Data.Size, sizeof(ImGuiStoragePair), StaticFunc::PairCompareByID); + ImQsort(Data.Data, (size_t)Data.Size, sizeof(ImGuiStoragePair), StaticFunc::PairComparerByID); } int ImGuiStorage::GetInt(ImGuiID key, int default_val) const @@ -2061,18 +2373,15 @@ void ImGuiStorage::SetAllInt(int v) //----------------------------------------------------------------------------- // Helper: Parse and apply text filters. In format "aaaaa[,bbbb][,ccccc]" -ImGuiTextFilter::ImGuiTextFilter(const char* default_filter) +ImGuiTextFilter::ImGuiTextFilter(const char* default_filter) //-V1077 { + InputBuf[0] = 0; + CountGrep = 0; if (default_filter) { ImStrncpy(InputBuf, default_filter, IM_ARRAYSIZE(InputBuf)); Build(); } - else - { - InputBuf[0] = 0; - CountGrep = 0; - } } bool ImGuiTextFilter::Draw(const char* label, float width) @@ -2159,7 +2468,7 @@ bool ImGuiTextFilter::PassFilter(const char* text, const char* text_end) const } //----------------------------------------------------------------------------- -// [SECTION] ImGuiTextBuffer +// [SECTION] ImGuiTextBuffer, ImGuiTextIndex //----------------------------------------------------------------------------- // On some platform vsnprintf() takes va_list by reference and modifies it. @@ -2227,6 +2536,20 @@ void ImGuiTextBuffer::appendfv(const char* fmt, va_list args) va_end(args_copy); } +void ImGuiTextIndex::append(const char* base, int old_size, int new_size) +{ + IM_ASSERT(old_size >= 0 && new_size >= old_size && new_size >= EndOffset); + if (old_size == new_size) + return; + if (EndOffset == 0 || base[EndOffset - 1] == '\n') + LineOffsets.push_back(EndOffset); + const char* base_end = base + new_size; + for (const char* p = base + old_size; (p = (const char*)memchr(p, '\n', base_end - p)) != 0; ) + if (++p < base_end) // Don't push a trailing offset on last \n + LineOffsets.push_back((int)(intptr_t)(p - base)); + EndOffset = ImMax(EndOffset, new_size); +} + //----------------------------------------------------------------------------- // [SECTION] ImGuiListClipper // This is currently not as flexible/powerful as it should be and really confusing/spaghetti, mostly because we changed @@ -2241,9 +2564,10 @@ static bool GetSkipItemForListClipping() return (g.CurrentTable ? g.CurrentTable->HostSkipItems : g.CurrentWindow->SkipItems); } -// Helper to calculate coarse clipping of large list of evenly sized items. -// NB: Prefer using the ImGuiListClipper higher-level helper if you can! Read comments and instructions there on how those use this sort of pattern. -// NB: 'items_count' is only used to clamp the result, if you don't know your count you can use INT_MAX +#ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS +// Legacy helper to calculate coarse clipping of large list of evenly sized items. +// This legacy API is not ideal because it assumes we will return a single contiguous rectangle. +// Prefer using ImGuiListClipper which can returns non-contiguous ranges. void ImGui::CalcListClipping(int items_count, float items_height, int* out_items_display_start, int* out_items_display_end) { ImGuiContext& g = *GImGui; @@ -2262,20 +2586,23 @@ void ImGui::CalcListClipping(int items_count, float items_height, int* out_items } // We create the union of the ClipRect and the scoring rect which at worst should be 1 page away from ClipRect - ImRect unclipped_rect = window->ClipRect; + // We don't include g.NavId's rectangle in there (unless g.NavJustMovedToId is set) because the rectangle enlargement can get costly. + ImRect rect = window->ClipRect; if (g.NavMoveScoringItems) - unclipped_rect.Add(g.NavScoringRect); + rect.Add(g.NavScoringNoClipRect); if (g.NavJustMovedToId && window->NavLastIds[0] == g.NavJustMovedToId) - unclipped_rect.Add(ImRect(window->Pos + window->NavRectRel[0].Min, window->Pos + window->NavRectRel[0].Max)); // Could store and use NavJustMovedToRectRel + rect.Add(WindowRectRelToAbs(window, window->NavRectRel[0])); // Could store and use NavJustMovedToRectRel const ImVec2 pos = window->DC.CursorPos; - int start = (int)((unclipped_rect.Min.y - pos.y) / items_height); - int end = (int)((unclipped_rect.Max.y - pos.y) / items_height); + int start = (int)((rect.Min.y - pos.y) / items_height); + int end = (int)((rect.Max.y - pos.y) / items_height); // When performing a navigation request, ensure we have one item extra in the direction we are moving to - if (g.NavMoveScoringItems && g.NavMoveClipDir == ImGuiDir_Up) + // FIXME: Verify this works with tabbing + const bool is_nav_request = (g.NavMoveScoringItems && g.NavWindow && g.NavWindow->RootWindowForNav == window->RootWindowForNav); + if (is_nav_request && g.NavMoveClipDir == ImGuiDir_Up) start--; - if (g.NavMoveScoringItems && g.NavMoveClipDir == ImGuiDir_Down) + if (is_nav_request && g.NavMoveClipDir == ImGuiDir_Down) end++; start = ImClamp(start, 0, items_count); @@ -2283,17 +2610,42 @@ void ImGui::CalcListClipping(int items_count, float items_height, int* out_items *out_items_display_start = start; *out_items_display_end = end; } +#endif + +static void ImGuiListClipper_SortAndFuseRanges(ImVector& ranges, int offset = 0) +{ + if (ranges.Size - offset <= 1) + return; + + // Helper to order ranges and fuse them together if possible (bubble sort is fine as we are only sorting 2-3 entries) + for (int sort_end = ranges.Size - offset - 1; sort_end > 0; --sort_end) + for (int i = offset; i < sort_end + offset; ++i) + if (ranges[i].Min > ranges[i + 1].Min) + ImSwap(ranges[i], ranges[i + 1]); + + // Now fuse ranges together as much as possible. + for (int i = 1 + offset; i < ranges.Size; i++) + { + IM_ASSERT(!ranges[i].PosToIndexConvert && !ranges[i - 1].PosToIndexConvert); + if (ranges[i - 1].Max < ranges[i].Min) + continue; + ranges[i - 1].Min = ImMin(ranges[i - 1].Min, ranges[i].Min); + ranges[i - 1].Max = ImMax(ranges[i - 1].Max, ranges[i].Max); + ranges.erase(ranges.Data + i); + i--; + } +} -static void SetCursorPosYAndSetupForPrevLine(float pos_y, float line_height) +static void ImGuiListClipper_SeekCursorAndSetupPrevLine(float pos_y, float line_height) { // Set cursor position and a few other things so that SetScrollHereY() and Columns() can work when seeking cursor. // FIXME: It is problematic that we have to do that here, because custom/equivalent end-user code would stumble on the same issue. - // The clipper should probably have a 4th step to display the last item in a regular manner. + // The clipper should probably have a final step to display the last item in a regular manner, maybe with an opt-out flag for data sets which may have costly seek? ImGuiContext& g = *GImGui; ImGuiWindow* window = g.CurrentWindow; float off_y = pos_y - window->DC.CursorPos.y; window->DC.CursorPos.y = pos_y; - window->DC.CursorMaxPos.y = ImMax(window->DC.CursorMaxPos.y, pos_y); + window->DC.CursorMaxPos.y = ImMax(window->DC.CursorMaxPos.y, pos_y - g.Style.ItemSpacing.y); window->DC.CursorPosPrevLine.y = window->DC.CursorPos.y - line_height; // Setting those fields so that SetScrollHereY() can properly function after the end of our clipper usage. window->DC.PrevLineSize.y = (line_height - g.Style.ItemSpacing.y); // If we end up needing more accurate data (to e.g. use SameLine) we may as well make the clipper have a fourth step to let user process and display the last item in their list. if (ImGuiOldColumns* columns = window->DC.CurrentColumns) @@ -2309,6 +2661,15 @@ static void SetCursorPosYAndSetupForPrevLine(float pos_y, float line_height) } } +static void ImGuiListClipper_SeekCursorForItem(ImGuiListClipper* clipper, int item_n) +{ + // StartPosY starts from ItemsFrozen hence the subtraction + // Perform the add and multiply with double to allow seeking through larger ranges + ImGuiListClipperData* data = (ImGuiListClipperData*)clipper->TempData; + float pos_y = (float)((double)clipper->StartPosY + data->LossynessOffset + (double)(item_n - data->ItemsFrozen) * clipper->ItemsHeight); + ImGuiListClipper_SeekCursorAndSetupPrevLine(pos_y, clipper->ItemsHeight); +} + ImGuiListClipper::ImGuiListClipper() { memset(this, 0, sizeof(*this)); @@ -2317,16 +2678,14 @@ ImGuiListClipper::ImGuiListClipper() ImGuiListClipper::~ImGuiListClipper() { - IM_ASSERT(ItemsCount == -1 && "Forgot to call End(), or to Step() until false?"); + End(); } -// Use case A: Begin() called from constructor with items_height<0, then called again from Step() in StepNo 1 -// Use case B: Begin() called from constructor with items_height>0 -// FIXME-LEGACY: Ideally we should remove the Begin/End functions but they are part of the legacy API we still support. This is why some of the code in Step() calling Begin() and reassign some fields, spaghetti style. void ImGuiListClipper::Begin(int items_count, float items_height) { ImGuiContext& g = *GImGui; ImGuiWindow* window = g.CurrentWindow; + IMGUI_DEBUG_LOG_CLIPPER("Clipper: Begin(%d,%.2f) in '%s'\n", items_count, items_height, window->Name); if (ImGuiTable* table = g.CurrentTable) if (table->IsInsideRow) @@ -2335,127 +2694,193 @@ void ImGuiListClipper::Begin(int items_count, float items_height) StartPosY = window->DC.CursorPos.y; ItemsHeight = items_height; ItemsCount = items_count; - ItemsFrozen = 0; - StepNo = 0; DisplayStart = -1; DisplayEnd = 0; + + // Acquire temporary buffer + if (++g.ClipperTempDataStacked > g.ClipperTempData.Size) + g.ClipperTempData.resize(g.ClipperTempDataStacked, ImGuiListClipperData()); + ImGuiListClipperData* data = &g.ClipperTempData[g.ClipperTempDataStacked - 1]; + data->Reset(this); + data->LossynessOffset = window->DC.CursorStartPosLossyness.y; + TempData = data; } void ImGuiListClipper::End() { - if (ItemsCount < 0) // Already ended - return; + ImGuiContext& g = *GImGui; + if (ImGuiListClipperData* data = (ImGuiListClipperData*)TempData) + { + // In theory here we should assert that we are already at the right position, but it seems saner to just seek at the end and not assert/crash the user. + IMGUI_DEBUG_LOG_CLIPPER("Clipper: End() in '%s'\n", g.CurrentWindow->Name); + if (ItemsCount >= 0 && ItemsCount < INT_MAX && DisplayStart >= 0) + ImGuiListClipper_SeekCursorForItem(this, ItemsCount); - // In theory here we should assert that ImGui::GetCursorPosY() == StartPosY + DisplayEnd * ItemsHeight, but it feels saner to just seek at the end and not assert/crash the user. - if (ItemsCount < INT_MAX && DisplayStart >= 0) - SetCursorPosYAndSetupForPrevLine(StartPosY + (ItemsCount - ItemsFrozen) * ItemsHeight, ItemsHeight); + // Restore temporary buffer and fix back pointers which may be invalidated when nesting + IM_ASSERT(data->ListClipper == this); + data->StepNo = data->Ranges.Size; + if (--g.ClipperTempDataStacked > 0) + { + data = &g.ClipperTempData[g.ClipperTempDataStacked - 1]; + data->ListClipper->TempData = data; + } + TempData = NULL; + } ItemsCount = -1; - StepNo = 3; } -bool ImGuiListClipper::Step() +void ImGuiListClipper::ForceDisplayRangeByIndices(int item_min, int item_max) +{ + ImGuiListClipperData* data = (ImGuiListClipperData*)TempData; + IM_ASSERT(DisplayStart < 0); // Only allowed after Begin() and if there has not been a specified range yet. + IM_ASSERT(item_min <= item_max); + if (item_min < item_max) + data->Ranges.push_back(ImGuiListClipperRange::FromIndices(item_min, item_max)); +} + +static bool ImGuiListClipper_StepInternal(ImGuiListClipper* clipper) { ImGuiContext& g = *GImGui; ImGuiWindow* window = g.CurrentWindow; + ImGuiListClipperData* data = (ImGuiListClipperData*)clipper->TempData; + IM_ASSERT(data != NULL && "Called ImGuiListClipper::Step() too many times, or before ImGuiListClipper::Begin() ?"); ImGuiTable* table = g.CurrentTable; if (table && table->IsInsideRow) ImGui::TableEndRow(table); // No items - if (ItemsCount == 0 || GetSkipItemForListClipping()) - { - End(); + if (clipper->ItemsCount == 0 || GetSkipItemForListClipping()) return false; + + // While we are in frozen row state, keep displaying items one by one, unclipped + // FIXME: Could be stored as a table-agnostic state. + if (data->StepNo == 0 && table != NULL && !table->IsUnfrozenRows) + { + clipper->DisplayStart = data->ItemsFrozen; + clipper->DisplayEnd = ImMin(data->ItemsFrozen + 1, clipper->ItemsCount); + if (clipper->DisplayStart < clipper->DisplayEnd) + data->ItemsFrozen++; + return true; } // Step 0: Let you process the first element (regardless of it being visible or not, so we can measure the element height) - if (StepNo == 0) + bool calc_clipping = false; + if (data->StepNo == 0) { - // While we are in frozen row state, keep displaying items one by one, unclipped - // FIXME: Could be stored as a table-agnostic state. - if (table != NULL && !table->IsUnfrozenRows) + clipper->StartPosY = window->DC.CursorPos.y; + if (clipper->ItemsHeight <= 0.0f) { - DisplayStart = ItemsFrozen; - DisplayEnd = ItemsFrozen + 1; - ItemsFrozen++; + // Submit the first item (or range) so we can measure its height (generally the first range is 0..1) + data->Ranges.push_front(ImGuiListClipperRange::FromIndices(data->ItemsFrozen, data->ItemsFrozen + 1)); + clipper->DisplayStart = ImMax(data->Ranges[0].Min, data->ItemsFrozen); + clipper->DisplayEnd = ImMin(data->Ranges[0].Max, clipper->ItemsCount); + data->StepNo = 1; return true; } + calc_clipping = true; // If on the first step with known item height, calculate clipping. + } - StartPosY = window->DC.CursorPos.y; - if (ItemsHeight <= 0.0f) - { - // Submit the first item so we can measure its height (generally it is 0..1) - DisplayStart = ItemsFrozen; - DisplayEnd = ItemsFrozen + 1; - StepNo = 1; - return true; - } + // Step 1: Let the clipper infer height from first range + if (clipper->ItemsHeight <= 0.0f) + { + IM_ASSERT(data->StepNo == 1); + if (table) + IM_ASSERT(table->RowPosY1 == clipper->StartPosY && table->RowPosY2 == window->DC.CursorPos.y); - // Already has item height (given by user in Begin): skip to calculating step - DisplayStart = DisplayEnd; - StepNo = 2; + clipper->ItemsHeight = (window->DC.CursorPos.y - clipper->StartPosY) / (float)(clipper->DisplayEnd - clipper->DisplayStart); + bool affected_by_floating_point_precision = ImIsFloatAboveGuaranteedIntegerPrecision(clipper->StartPosY) || ImIsFloatAboveGuaranteedIntegerPrecision(window->DC.CursorPos.y); + if (affected_by_floating_point_precision) + clipper->ItemsHeight = window->DC.PrevLineSize.y + g.Style.ItemSpacing.y; // FIXME: Technically wouldn't allow multi-line entries. + + IM_ASSERT(clipper->ItemsHeight > 0.0f && "Unable to calculate item height! First item hasn't moved the cursor vertically!"); + calc_clipping = true; // If item height had to be calculated, calculate clipping afterwards. } - // Step 1: the clipper infer height from first element - if (StepNo == 1) + // Step 0 or 1: Calculate the actual ranges of visible elements. + const int already_submitted = clipper->DisplayEnd; + if (calc_clipping) { - IM_ASSERT(ItemsHeight <= 0.0f); - if (table) + if (g.LogEnabled) { - const float pos_y1 = table->RowPosY1; // Using this instead of StartPosY to handle clipper straddling the frozen row - const float pos_y2 = table->RowPosY2; // Using this instead of CursorPos.y to take account of tallest cell. - ItemsHeight = pos_y2 - pos_y1; - window->DC.CursorPos.y = pos_y2; + // If logging is active, do not perform any clipping + data->Ranges.push_back(ImGuiListClipperRange::FromIndices(0, clipper->ItemsCount)); } else { - ItemsHeight = window->DC.CursorPos.y - StartPosY; - } - IM_ASSERT(ItemsHeight > 0.0f && "Unable to calculate item height! First item hasn't moved the cursor vertically!"); - StepNo = 2; - } - - // Reached end of list - if (DisplayEnd >= ItemsCount) - { - End(); - return false; + // Add range selected to be included for navigation + const bool is_nav_request = (g.NavMoveScoringItems && g.NavWindow && g.NavWindow->RootWindowForNav == window->RootWindowForNav); + if (is_nav_request) + data->Ranges.push_back(ImGuiListClipperRange::FromPositions(g.NavScoringNoClipRect.Min.y, g.NavScoringNoClipRect.Max.y, 0, 0)); + if (is_nav_request && (g.NavMoveFlags & ImGuiNavMoveFlags_Tabbing) && g.NavTabbingDir == -1) + data->Ranges.push_back(ImGuiListClipperRange::FromIndices(clipper->ItemsCount - 1, clipper->ItemsCount)); + + // Add focused/active item + ImRect nav_rect_abs = ImGui::WindowRectRelToAbs(window, window->NavRectRel[0]); + if (g.NavId != 0 && window->NavLastIds[0] == g.NavId) + data->Ranges.push_back(ImGuiListClipperRange::FromPositions(nav_rect_abs.Min.y, nav_rect_abs.Max.y, 0, 0)); + + // Add visible range + const int off_min = (is_nav_request && g.NavMoveClipDir == ImGuiDir_Up) ? -1 : 0; + const int off_max = (is_nav_request && g.NavMoveClipDir == ImGuiDir_Down) ? 1 : 0; + data->Ranges.push_back(ImGuiListClipperRange::FromPositions(window->ClipRect.Min.y, window->ClipRect.Max.y, off_min, off_max)); + } + + // Convert position ranges to item index ranges + // - Very important: when a starting position is after our maximum item, we set Min to (ItemsCount - 1). This allows us to handle most forms of wrapping. + // - Due to how Selectable extra padding they tend to be "unaligned" with exact unit in the item list, + // which with the flooring/ceiling tend to lead to 2 items instead of one being submitted. + for (int i = 0; i < data->Ranges.Size; i++) + if (data->Ranges[i].PosToIndexConvert) + { + int m1 = (int)(((double)data->Ranges[i].Min - window->DC.CursorPos.y - data->LossynessOffset) / clipper->ItemsHeight); + int m2 = (int)((((double)data->Ranges[i].Max - window->DC.CursorPos.y - data->LossynessOffset) / clipper->ItemsHeight) + 0.999999f); + data->Ranges[i].Min = ImClamp(already_submitted + m1 + data->Ranges[i].PosToIndexOffsetMin, already_submitted, clipper->ItemsCount - 1); + data->Ranges[i].Max = ImClamp(already_submitted + m2 + data->Ranges[i].PosToIndexOffsetMax, data->Ranges[i].Min + 1, clipper->ItemsCount); + data->Ranges[i].PosToIndexConvert = false; + } + ImGuiListClipper_SortAndFuseRanges(data->Ranges, data->StepNo); } - // Step 2: calculate the actual range of elements to display, and position the cursor before the first element - if (StepNo == 2) + // Step 0+ (if item height is given in advance) or 1+: Display the next range in line. + if (data->StepNo < data->Ranges.Size) { - IM_ASSERT(ItemsHeight > 0.0f); - - int already_submitted = DisplayEnd; - ImGui::CalcListClipping(ItemsCount - already_submitted, ItemsHeight, &DisplayStart, &DisplayEnd); - DisplayStart += already_submitted; - DisplayEnd += already_submitted; - - // Seek cursor - if (DisplayStart > already_submitted) - SetCursorPosYAndSetupForPrevLine(StartPosY + (DisplayStart - ItemsFrozen) * ItemsHeight, ItemsHeight); - - StepNo = 3; + clipper->DisplayStart = ImMax(data->Ranges[data->StepNo].Min, already_submitted); + clipper->DisplayEnd = ImMin(data->Ranges[data->StepNo].Max, clipper->ItemsCount); + if (clipper->DisplayStart > already_submitted) //-V1051 + ImGuiListClipper_SeekCursorForItem(clipper, clipper->DisplayStart); + data->StepNo++; return true; } - // Step 3: the clipper validate that we have reached the expected Y position (corresponding to element DisplayEnd), + // After the last step: Let the clipper validate that we have reached the expected Y position (corresponding to element DisplayEnd), // Advance the cursor to the end of the list and then returns 'false' to end the loop. - if (StepNo == 3) - { - // Seek cursor - if (ItemsCount < INT_MAX) - SetCursorPosYAndSetupForPrevLine(StartPosY + (ItemsCount - ItemsFrozen) * ItemsHeight, ItemsHeight); // advance cursor - ItemsCount = -1; - return false; - } + if (clipper->ItemsCount < INT_MAX) + ImGuiListClipper_SeekCursorForItem(clipper, clipper->ItemsCount); - IM_ASSERT(0); return false; } +bool ImGuiListClipper::Step() +{ + ImGuiContext& g = *GImGui; + bool need_items_height = (ItemsHeight <= 0.0f); + bool ret = ImGuiListClipper_StepInternal(this); + if (ret && (DisplayStart == DisplayEnd)) + ret = false; + if (g.CurrentTable && g.CurrentTable->IsUnfrozenRows == false) + IMGUI_DEBUG_LOG_CLIPPER("Clipper: Step(): inside frozen table row.\n"); + if (need_items_height && ItemsHeight > 0.0f) + IMGUI_DEBUG_LOG_CLIPPER("Clipper: Step(): computed ItemsHeight: %.2f.\n", ItemsHeight); + if (ret) + IMGUI_DEBUG_LOG_CLIPPER("Clipper: Step(): display %d to %d.\n", DisplayStart, DisplayEnd); + else + IMGUI_DEBUG_LOG_CLIPPER("Clipper: Step(): End.\n"); + if (!ret) + End(); + return ret; +} + //----------------------------------------------------------------------------- // [SECTION] STYLING //----------------------------------------------------------------------------- @@ -2522,6 +2947,11 @@ void ImGui::PushStyleColor(ImGuiCol idx, const ImVec4& col) void ImGui::PopStyleColor(int count) { ImGuiContext& g = *GImGui; + if (g.ColorStack.Size < count) + { + IM_ASSERT_USER_ERROR(g.ColorStack.Size > count, "Calling PopStyleColor() too many times: stack underflow."); + count = g.ColorStack.Size; + } while (count > 0) { ImGuiColorMod& backup = g.ColorStack.back(); @@ -2606,6 +3036,11 @@ void ImGui::PushStyleVar(ImGuiStyleVar idx, const ImVec2& val) void ImGui::PopStyleVar(int count) { ImGuiContext& g = *GImGui; + if (g.StyleVarStack.Size < count) + { + IM_ASSERT_USER_ERROR(g.StyleVarStack.Size > count, "Calling PopStyleVar() too many times: stack underflow."); + count = g.StyleVarStack.Size; + } while (count > 0) { // We avoid a generic memcpy(data, &backup.Backup.., GDataTypeSize[info->Type] * info->Count), the overhead in Debug is not worth it. @@ -2929,6 +3364,32 @@ void ImGui::RenderNavHighlight(const ImRect& bb, ImGuiID id, ImGuiNavHighlightFl } } +void ImGui::RenderMouseCursor(ImVec2 base_pos, float base_scale, ImGuiMouseCursor mouse_cursor, ImU32 col_fill, ImU32 col_border, ImU32 col_shadow) +{ + ImGuiContext& g = *GImGui; + IM_ASSERT(mouse_cursor > ImGuiMouseCursor_None && mouse_cursor < ImGuiMouseCursor_COUNT); + for (int n = 0; n < g.Viewports.Size; n++) + { + ImGuiViewportP* viewport = g.Viewports[n]; + ImDrawList* draw_list = GetForegroundDrawList(viewport); + ImFontAtlas* font_atlas = draw_list->_Data->Font->ContainerAtlas; + ImVec2 offset, size, uv[4]; + if (font_atlas->GetMouseCursorTexData(mouse_cursor, &offset, &size, &uv[0], &uv[2])) + { + const ImVec2 pos = base_pos - offset; + const float scale = base_scale; + ImTextureID tex_id = font_atlas->TexID; + draw_list->PushTextureID(tex_id); + draw_list->AddImage(tex_id, pos + ImVec2(1, 0) * scale, pos + (ImVec2(1, 0) + size) * scale, uv[2], uv[3], col_shadow); + draw_list->AddImage(tex_id, pos + ImVec2(2, 0) * scale, pos + (ImVec2(2, 0) + size) * scale, uv[2], uv[3], col_shadow); + draw_list->AddImage(tex_id, pos, pos + size * scale, uv[2], uv[3], col_border); + draw_list->AddImage(tex_id, pos, pos + size * scale, uv[0], uv[1], col_fill); + draw_list->PopTextureID(); + } + } +} + + //----------------------------------------------------------------------------- // [SECTION] MAIN CODE (most of the code! lots of stuff, needs tidying up!) //----------------------------------------------------------------------------- @@ -2968,11 +3429,9 @@ ImGuiID ImGuiWindow::GetID(const char* str, const char* str_end) { ImGuiID seed = IDStack.back(); ImGuiID id = ImHashStr(str, str_end ? (str_end - str) : 0, seed); - ImGui::KeepAliveID(id); -#ifdef IMGUI_ENABLE_TEST_ENGINE ImGuiContext& g = *GImGui; - IMGUI_TEST_ENGINE_ID_INFO2(id, ImGuiDataType_String, str, str_end); -#endif + if (g.DebugHookIdInfo == id) + ImGui::DebugHookIdInfo(id, ImGuiDataType_String, str, str_end); return id; } @@ -2980,11 +3439,9 @@ ImGuiID ImGuiWindow::GetID(const void* ptr) { ImGuiID seed = IDStack.back(); ImGuiID id = ImHashData(&ptr, sizeof(void*), seed); - ImGui::KeepAliveID(id); -#ifdef IMGUI_ENABLE_TEST_ENGINE ImGuiContext& g = *GImGui; - IMGUI_TEST_ENGINE_ID_INFO(id, ImGuiDataType_Pointer, ptr); -#endif + if (g.DebugHookIdInfo == id) + ImGui::DebugHookIdInfo(id, ImGuiDataType_Pointer, ptr, NULL); return id; } @@ -2992,44 +3449,9 @@ ImGuiID ImGuiWindow::GetID(int n) { ImGuiID seed = IDStack.back(); ImGuiID id = ImHashData(&n, sizeof(n), seed); - ImGui::KeepAliveID(id); -#ifdef IMGUI_ENABLE_TEST_ENGINE - ImGuiContext& g = *GImGui; - IMGUI_TEST_ENGINE_ID_INFO(id, ImGuiDataType_S32, (intptr_t)n); -#endif - return id; -} - -ImGuiID ImGuiWindow::GetIDNoKeepAlive(const char* str, const char* str_end) -{ - ImGuiID seed = IDStack.back(); - ImGuiID id = ImHashStr(str, str_end ? (str_end - str) : 0, seed); -#ifdef IMGUI_ENABLE_TEST_ENGINE - ImGuiContext& g = *GImGui; - IMGUI_TEST_ENGINE_ID_INFO2(id, ImGuiDataType_String, str, str_end); -#endif - return id; -} - -ImGuiID ImGuiWindow::GetIDNoKeepAlive(const void* ptr) -{ - ImGuiID seed = IDStack.back(); - ImGuiID id = ImHashData(&ptr, sizeof(void*), seed); -#ifdef IMGUI_ENABLE_TEST_ENGINE - ImGuiContext& g = *GImGui; - IMGUI_TEST_ENGINE_ID_INFO(id, ImGuiDataType_Pointer, ptr); -#endif - return id; -} - -ImGuiID ImGuiWindow::GetIDNoKeepAlive(int n) -{ - ImGuiID seed = IDStack.back(); - ImGuiID id = ImHashData(&n, sizeof(n), seed); -#ifdef IMGUI_ENABLE_TEST_ENGINE ImGuiContext& g = *GImGui; - IMGUI_TEST_ENGINE_ID_INFO(id, ImGuiDataType_S32, (intptr_t)n); -#endif + if (g.DebugHookIdInfo == id) + ImGui::DebugHookIdInfo(id, ImGuiDataType_S32, (void*)(intptr_t)n, NULL); return id; } @@ -3037,9 +3459,8 @@ ImGuiID ImGuiWindow::GetIDNoKeepAlive(int n) ImGuiID ImGuiWindow::GetIDFromRectangle(const ImRect& r_abs) { ImGuiID seed = IDStack.back(); - const int r_rel[4] = { (int)(r_abs.Min.x - Pos.x), (int)(r_abs.Min.y - Pos.y), (int)(r_abs.Max.x - Pos.x), (int)(r_abs.Max.y - Pos.y) }; + ImRect r_rel = ImGui::WindowRectAbsToRel(this, r_abs); ImGuiID id = ImHashData(&r_rel, sizeof(r_rel), seed); - ImGui::KeepAliveID(id); return id; } @@ -3089,9 +3510,21 @@ void ImGui::GcAwakeTransientWindowBuffers(ImGuiWindow* window) void ImGui::SetActiveID(ImGuiID id, ImGuiWindow* window) { ImGuiContext& g = *GImGui; + + // While most behaved code would make an effort to not steal active id during window move/drag operations, + // we at least need to be resilient to it. Cancelling the move is rather aggressive and users of 'master' branch + // may prefer the weird ill-defined half working situation ('docking' did assert), so may need to rework that. + if (g.MovingWindow != NULL && g.ActiveId == g.MovingWindow->MoveId) + { + IMGUI_DEBUG_LOG_ACTIVEID("SetActiveID() cancel MovingWindow\n"); + g.MovingWindow = NULL; + } + + // Set active id 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 : ""); g.ActiveIdTimer = 0.0f; g.ActiveIdHasBeenPressedBefore = false; g.ActiveIdHasBeenEditedBefore = false; @@ -3110,15 +3543,16 @@ void ImGui::SetActiveID(ImGuiID id, ImGuiWindow* window) if (id) { g.ActiveIdIsAlive = id; - g.ActiveIdSource = (g.NavActivateId == id || g.NavActivateInputId == id || g.NavJustTabbedId == id || g.NavJustMovedToId == id) ? ImGuiInputSource_Nav : ImGuiInputSource_Mouse; + g.ActiveIdSource = (g.NavActivateId == id || g.NavActivateInputId == id || g.NavJustMovedToId == id) ? (ImGuiInputSource)ImGuiInputSource_Nav : ImGuiInputSource_Mouse; } // Clear declaration of inputs claimed by the widget // (Please note that this is WIP and not all keys/inputs are thoroughly declared by all widgets yet) - g.ActiveIdUsingMouseWheel = false; g.ActiveIdUsingNavDirMask = 0x00; + g.ActiveIdUsingAllKeyboardKeys = false; +#ifndef IMGUI_DISABLE_OBSOLETE_KEYIO g.ActiveIdUsingNavInputMask = 0x00; - g.ActiveIdUsingKeyInputMask = 0x00; +#endif } void ImGui::ClearActiveID() @@ -3131,7 +3565,6 @@ void ImGui::SetHoveredID(ImGuiID id) ImGuiContext& g = *GImGui; g.HoveredId = id; g.HoveredIdAllowOverlap = false; - g.HoveredIdUsingMouseWheel = false; if (id != 0 && g.HoveredIdPreviousFrame != id) g.HoveredIdTimer = g.HoveredIdNotActiveTimer = 0.0f; } @@ -3142,6 +3575,8 @@ ImGuiID ImGui::GetHoveredID() return g.HoveredId ? g.HoveredId : g.HoveredIdPreviousFrame; } +// This is called by ItemAdd(). +// Code not using ItemAdd() may need to call this manually otherwise ActiveId will be cleared. In IMGUI_VERSION_NUM < 18717 this was called by GetID(). void ImGui::KeepAliveID(ImGuiID id) { ImGuiContext& g = *GImGui; @@ -3154,7 +3589,7 @@ void ImGui::KeepAliveID(ImGuiID id) void ImGui::MarkItemEdited(ImGuiID id) { // This marking is solely 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 need to fill the data. + // 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.ActiveId == id || g.ActiveId == 0 || g.DragDropActive); IM_UNUSED(id); // Avoid unused variable warnings when asserts are compiled out. @@ -3174,11 +3609,17 @@ static inline bool IsWindowContentHoverable(ImGuiWindow* window, ImGuiHoveredFla if (focused_root_window->WasActive && focused_root_window != window->RootWindow) { // For the purpose of those flags we differentiate "standard popup" from "modal popup" - // NB: The order of those two tests is important because Modal windows are also Popups. + // NB: The 'else' is important because Modal windows are also Popups. + bool want_inhibit = false; if (focused_root_window->Flags & ImGuiWindowFlags_Modal) - return false; - if ((focused_root_window->Flags & ImGuiWindowFlags_Popup) && !(flags & ImGuiHoveredFlags_AllowWhenBlockedByPopup)) - return false; + want_inhibit = true; + else if ((focused_root_window->Flags & ImGuiWindowFlags_Popup) && !(flags & ImGuiHoveredFlags_AllowWhenBlockedByPopup)) + want_inhibit = true; + + // Inhibit hover unless the window is within the stack of our modal/popup + if (want_inhibit) + if (!ImGui::IsWindowWithinBeginStackOf(window->RootWindow, focused_root_window)) + return false; } return true; } @@ -3190,46 +3631,69 @@ bool ImGui::IsItemHovered(ImGuiHoveredFlags flags) { ImGuiContext& g = *GImGui; ImGuiWindow* window = g.CurrentWindow; - if (g.NavDisableMouseHover && !g.NavDisableHighlight) + if (g.NavDisableMouseHover && !g.NavDisableHighlight && !(flags & ImGuiHoveredFlags_NoNavOverride)) { if ((g.LastItemData.InFlags & ImGuiItemFlags_Disabled) && !(flags & ImGuiHoveredFlags_AllowWhenDisabled)) return false; - return IsItemFocused(); + if (!IsItemFocused()) + return false; } + else + { + // Test for bounding box overlap, as updated as ItemAdd() + ImGuiItemStatusFlags status_flags = g.LastItemData.StatusFlags; + if (!(status_flags & ImGuiItemStatusFlags_HoveredRect)) + return false; + IM_ASSERT((flags & (ImGuiHoveredFlags_AnyWindow | ImGuiHoveredFlags_RootWindow | ImGuiHoveredFlags_ChildWindows | ImGuiHoveredFlags_NoPopupHierarchy)) == 0); // Flags not supported by this function + + // Done with rectangle culling so we can perform heavier checks now + // Test if we are hovering the right window (our window could be behind another window) + // [2021/03/02] Reworked / reverted the revert, finally. Note we want e.g. BeginGroup/ItemAdd/EndGroup to work as well. (#3851) + // [2017/10/16] Reverted commit 344d48be3 and testing RootWindow instead. I believe it is correct to NOT test for RootWindow but this leaves us unable + // to use IsItemHovered() after EndChild() itself. Until a solution is found I believe reverting to the test from 2017/09/27 is safe since this was + // the test that has been running for a long while. + if (g.HoveredWindow != window && (status_flags & ImGuiItemStatusFlags_HoveredWindow) == 0) + if ((flags & ImGuiHoveredFlags_AllowWhenOverlapped) == 0) + return false; - // Test for bounding box overlap, as updated as ItemAdd() - ImGuiItemStatusFlags status_flags = g.LastItemData.StatusFlags; - if (!(status_flags & ImGuiItemStatusFlags_HoveredRect)) - return false; - IM_ASSERT((flags & (ImGuiHoveredFlags_RootWindow | ImGuiHoveredFlags_ChildWindows)) == 0); // Flags not supported by this function - - // Test if we are hovering the right window (our window could be behind another window) - // [2021/03/02] Reworked / reverted the revert, finally. Note we want e.g. BeginGroup/ItemAdd/EndGroup to work as well. (#3851) - // [2017/10/16] Reverted commit 344d48be3 and testing RootWindow instead. I believe it is correct to NOT test for RootWindow but this leaves us unable - // to use IsItemHovered() after EndChild() itself. Until a solution is found I believe reverting to the test from 2017/09/27 is safe since this was - // the test that has been running for a long while. - if (g.HoveredWindow != window && (status_flags & ImGuiItemStatusFlags_HoveredWindow) == 0) - if ((flags & ImGuiHoveredFlags_AllowWhenOverlapped) == 0) + // Test if another item is active (e.g. being dragged) + if ((flags & ImGuiHoveredFlags_AllowWhenBlockedByActiveItem) == 0) + if (g.ActiveId != 0 && g.ActiveId != g.LastItemData.ID && !g.ActiveIdAllowOverlap && g.ActiveId != window->MoveId) + return false; + + // Test if interactions on this window are blocked by an active popup or modal. + // The ImGuiHoveredFlags_AllowWhenBlockedByPopup flag will be tested here. + if (!IsWindowContentHoverable(window, flags) && !(g.LastItemData.InFlags & ImGuiItemFlags_NoWindowHoverableCheck)) return false; - // Test if another item is active (e.g. being dragged) - if ((flags & ImGuiHoveredFlags_AllowWhenBlockedByActiveItem) == 0) - if (g.ActiveId != 0 && g.ActiveId != g.LastItemData.ID && !g.ActiveIdAllowOverlap && g.ActiveId != window->MoveId) + // Test if the item is disabled + if ((g.LastItemData.InFlags & ImGuiItemFlags_Disabled) && !(flags & ImGuiHoveredFlags_AllowWhenDisabled)) return false; - // Test if interactions on this window are blocked by an active popup or modal. - // The ImGuiHoveredFlags_AllowWhenBlockedByPopup flag will be tested here. - if (!IsWindowContentHoverable(window, flags)) - return false; + // Special handling for calling after Begin() which represent the title bar or tab. + // When the window is collapsed (SkipItems==true) that last item will never be overwritten so we need to detect the case. + if (g.LastItemData.ID == window->MoveId && window->WriteAccessed) + return false; + } - // Test if the item is disabled - if ((g.LastItemData.InFlags & ImGuiItemFlags_Disabled) && !(flags & ImGuiHoveredFlags_AllowWhenDisabled)) - return false; + // Handle hover delay + // (some ideas: https://www.nngroup.com/articles/timing-exposing-content) + float delay; + if (flags & ImGuiHoveredFlags_DelayNormal) + delay = g.IO.HoverDelayNormal; + else if (flags & ImGuiHoveredFlags_DelayShort) + delay = g.IO.HoverDelayShort; + else + delay = 0.0f; + if (delay > 0.0f) + { + ImGuiID hover_delay_id = (g.LastItemData.ID != 0) ? g.LastItemData.ID : window->GetIDFromRectangle(g.LastItemData.Rect); + if ((flags & ImGuiHoveredFlags_NoSharedDelay) && (g.HoverDelayIdPreviousFrame != hover_delay_id)) + g.HoverDelayTimer = 0.0f; + g.HoverDelayId = hover_delay_id; + return g.HoverDelayTimer >= delay; + } - // Special handling for calling after Begin() which represent the title bar or tab. - // When the window is collapsed (SkipItems==true) that last item will never be overwritten so we need to detect the case. - if (g.LastItemData.ID == window->MoveId && window->WriteAccessed) - return false; return true; } @@ -3247,9 +3711,10 @@ bool ImGui::ItemHoverable(const ImRect& bb, ImGuiID id) return false; if (!IsMouseHoveringRect(bb.Min, bb.Max)) return false; - if (g.NavDisableMouseHover) - return false; - if (!IsWindowContentHoverable(window, ImGuiHoveredFlags_None)) + + // Done with rectangle culling so we can perform heavier checks now. + ImGuiItemFlags item_flags = (g.LastItemData.ID == id ? g.LastItemData.InFlags : g.CurrentItemFlags); + if (!(item_flags & ImGuiItemFlags_NoWindowHoverableCheck) && !IsWindowContentHoverable(window, ImGuiHoveredFlags_None)) { g.HoveredIdDisabled = true; return false; @@ -3261,7 +3726,6 @@ bool ImGui::ItemHoverable(const ImRect& bb, ImGuiID id) SetHoveredID(id); // When disabled we'll return false but still set HoveredId - ImGuiItemFlags item_flags = (g.LastItemData.ID == id ? g.LastItemData.InFlags : g.CurrentItemFlags); if (item_flags & ImGuiItemFlags_Disabled) { // Release active id if turning disabled @@ -3276,17 +3740,20 @@ bool ImGui::ItemHoverable(const ImRect& bb, ImGuiID id) // [DEBUG] Item Picker tool! // We perform the check here because SetHoveredID() is not frequently called (1~ time a frame), making // the cost of this tool near-zero. We can get slightly better call-stack and support picking non-hovered - // items if we perform the test in ItemAdd(), but that would incur a small runtime cost. - // #define IMGUI_DEBUG_TOOL_ITEM_PICKER_EX in imconfig.h if you want this check to also be performed in ItemAdd(). + // items if we performed the test in ItemAdd(), but that would incur a small runtime cost. if (g.DebugItemPickerActive && g.HoveredIdPreviousFrame == id) GetForegroundDrawList()->AddRect(bb.Min, bb.Max, IM_COL32(255, 255, 0, 255)); if (g.DebugItemPickerBreakId == id) IM_DEBUG_BREAK(); } + if (g.NavDisableMouseHover) + return false; + return true; } +// FIXME: This is inlined/duplicated in ItemAdd() bool ImGui::IsClippedEx(const ImRect& bb, ImGuiID id) { ImGuiContext& g = *GImGui; @@ -3298,62 +3765,25 @@ bool ImGui::IsClippedEx(const ImRect& bb, ImGuiID id) return false; } -// Called by ItemAdd() -// Process TAB/Shift+TAB. Be mindful that this function may _clear_ the ActiveID when tabbing out. -// [WIP] This will eventually be refactored and moved into NavProcessItem() -void ImGui::ItemInputable(ImGuiWindow* window, ImGuiID id) +// This is also inlined in ItemAdd() +// Note: if ImGuiItemStatusFlags_HasDisplayRect is set, user needs to set window->DC.LastItemDisplayRect! +void ImGui::SetLastItemData(ImGuiID item_id, ImGuiItemFlags in_flags, ImGuiItemStatusFlags item_flags, const ImRect& item_rect) { ImGuiContext& g = *GImGui; - IM_ASSERT(id != 0 && id == g.LastItemData.ID); - - // Increment counters - // FIXME: ImGuiItemFlags_Disabled should disable more. - const bool is_tab_stop = (g.LastItemData.InFlags & (ImGuiItemFlags_NoTabStop | ImGuiItemFlags_Disabled)) == 0; - window->DC.FocusCounterRegular++; - if (is_tab_stop) - { - window->DC.FocusCounterTabStop++; - if (g.NavId == id) - g.NavIdTabCounter = window->DC.FocusCounterTabStop; - } + g.LastItemData.ID = item_id; + g.LastItemData.InFlags = in_flags; + g.LastItemData.StatusFlags = item_flags; + g.LastItemData.Rect = item_rect; +} - // Process TAB/Shift-TAB to tab *OUT* of the currently focused item. - // (Note that we can always TAB out of a widget that doesn't allow tabbing in) - if (g.ActiveId == id && g.TabFocusPressed && !IsActiveIdUsingKey(ImGuiKey_Tab) && g.TabFocusRequestNextWindow == NULL) - { - g.TabFocusRequestNextWindow = window; - g.TabFocusRequestNextCounterTabStop = window->DC.FocusCounterTabStop + (g.IO.KeyShift ? (is_tab_stop ? -1 : 0) : +1); // Modulo on index will be applied at the end of frame once we've got the total counter of items. - } +float ImGui::CalcWrapWidthForPos(const ImVec2& pos, float wrap_pos_x) +{ + if (wrap_pos_x < 0.0f) + return 0.0f; - // Handle focus requests - if (g.TabFocusRequestCurrWindow == window) - { - if (window->DC.FocusCounterRegular == g.TabFocusRequestCurrCounterRegular) - { - g.LastItemData.StatusFlags |= ImGuiItemStatusFlags_FocusedByCode; - return; - } - if (is_tab_stop && window->DC.FocusCounterTabStop == g.TabFocusRequestCurrCounterTabStop) - { - g.NavJustTabbedId = id; // FIXME-NAV: aim to eventually set in NavUpdate() once we finish the refactor - g.LastItemData.StatusFlags |= ImGuiItemStatusFlags_FocusedByTabbing; - return; - } - - // If another item is about to be focused, we clear our own active id - if (g.ActiveId == id) - ClearActiveID(); - } -} - -float ImGui::CalcWrapWidthForPos(const ImVec2& pos, float wrap_pos_x) -{ - if (wrap_pos_x < 0.0f) - return 0.0f; - - ImGuiContext& g = *GImGui; - ImGuiWindow* window = g.CurrentWindow; - if (wrap_pos_x == 0.0f) + ImGuiContext& g = *GImGui; + ImGuiWindow* window = g.CurrentWindow; + if (wrap_pos_x == 0.0f) { // We could decide to setup a default wrapping max point for auto-resizing windows, // or have auto-wrap (with unspecified wrapping pos) behave as a ContentSize extending function? @@ -3438,20 +3868,23 @@ void ImGui::GetAllocatorFunctions(ImGuiMemAllocFunc* p_alloc_func, ImGuiMemFreeF ImGuiContext* ImGui::CreateContext(ImFontAtlas* shared_font_atlas) { + ImGuiContext* prev_ctx = GetCurrentContext(); ImGuiContext* ctx = IM_NEW(ImGuiContext)(shared_font_atlas); - if (GImGui == NULL) - SetCurrentContext(ctx); - Initialize(ctx); + SetCurrentContext(ctx); + Initialize(); + if (prev_ctx != NULL) + SetCurrentContext(prev_ctx); // Restore previous context if any, else keep new one. return ctx; } void ImGui::DestroyContext(ImGuiContext* ctx) { - if (ctx == NULL) - ctx = GImGui; - Shutdown(ctx); - if (GImGui == ctx) - SetCurrentContext(NULL); + ImGuiContext* prev_ctx = GetCurrentContext(); + if (ctx == NULL) //-V1051 + ctx = prev_ctx; + SetCurrentContext(ctx); + Shutdown(); + SetCurrentContext((prev_ctx != ctx) ? prev_ctx : NULL); IM_DELETE(ctx); } @@ -3571,7 +4004,7 @@ void ImGui::StartMouseMovingWindow(ImGuiWindow* window) g.NavDisableHighlight = true; g.ActiveIdClickOffset = g.IO.MouseClickedPos[0] - window->RootWindow->Pos; g.ActiveIdNoClearOnFocusLoss = true; - SetActiveIdUsingNavAndKeys(); + SetActiveIdUsingAllKeyboardKeys(); bool can_move_window = true; if ((window->Flags & ImGuiWindowFlags_NoMove) || (window->RootWindow->Flags & ImGuiWindowFlags_NoMove)) @@ -3598,11 +4031,7 @@ void ImGui::UpdateMouseMovingWindowNewFrame() if (g.IO.MouseDown[0] && IsMousePosValid(&g.IO.MousePos)) { ImVec2 pos = g.IO.MousePos - g.ActiveIdClickOffset; - if (moving_window->Pos.x != pos.x || moving_window->Pos.y != pos.y) - { - MarkIniSettingsDirty(moving_window); - SetWindowPos(moving_window, pos, ImGuiCond_Always); - } + SetWindowPos(moving_window, pos, ImGuiCond_Always); FocusWindow(g.MovingWindow); } else @@ -3672,7 +4101,7 @@ void ImGui::UpdateMouseMovingWindowEndFrame() // Find the top-most window between HoveredWindow and the top-most Modal Window. // This is where we can trim the popup stack. ImGuiWindow* modal = GetTopMostPopupModal(); - bool hovered_window_above_modal = g.HoveredWindow && IsWindowAbove(g.HoveredWindow, modal); + bool hovered_window_above_modal = g.HoveredWindow && (modal == NULL || IsWindowAbove(g.HoveredWindow, modal)); ClosePopupsOverWindow(hovered_window_above_modal ? g.HoveredWindow : modal, true); } } @@ -3682,73 +4111,248 @@ static bool IsWindowActiveAndVisible(ImGuiWindow* window) return (window->Active) && (!window->Hidden); } +static void UpdateAliasKey(ImGuiKey key, bool v, float analog_value) +{ + IM_ASSERT(ImGui::IsAliasKey(key)); + ImGuiKeyData* key_data = ImGui::GetKeyData(key); + key_data->Down = v; + key_data->AnalogValue = analog_value; +} + +// Rewrite routing data buffers to strip old entries + sort by key to make queries not touch scattered data. +// Entries D,A,B,B,A,C,B --> A,A,B,B,B,C,D +// Index A:1 B:2 C:5 D:0 --> A:0 B:2 C:5 D:6 +// See 'Metrics->Key Owners & Shortcut Routing' to visualize the result of that operation. +static void UpdateKeyRoutingTable(ImGuiKeyRoutingTable* rt) +{ + ImGuiContext& g = *GImGui; + rt->EntriesNext.resize(0); + for (ImGuiKey key = ImGuiKey_NamedKey_BEGIN; key < ImGuiKey_NamedKey_END; key = (ImGuiKey)(key + 1)) + { + const int new_routing_start_idx = rt->EntriesNext.Size; + ImGuiKeyRoutingData* routing_entry; + for (int old_routing_idx = rt->Index[key - ImGuiKey_NamedKey_BEGIN]; old_routing_idx != -1; old_routing_idx = routing_entry->NextEntryIndex) + { + routing_entry = &rt->Entries[old_routing_idx]; + routing_entry->RoutingCurr = routing_entry->RoutingNext; // Update entry + routing_entry->RoutingNext = ImGuiKeyOwner_None; + routing_entry->RoutingNextScore = 255; + if (routing_entry->RoutingCurr == ImGuiKeyOwner_None) + continue; + rt->EntriesNext.push_back(*routing_entry); // Write alive ones into new buffer + + // Apply routing to owner if there's no owner already (RoutingCurr == None at this point) + if (routing_entry->Mods == g.IO.KeyMods) + { + ImGuiKeyOwnerData* owner_data = ImGui::GetKeyOwnerData(key); + if (owner_data->OwnerCurr == ImGuiKeyOwner_None) + owner_data->OwnerCurr = routing_entry->RoutingCurr; + } + } + + // Rewrite linked-list + rt->Index[key - ImGuiKey_NamedKey_BEGIN] = (ImGuiKeyRoutingIndex)(new_routing_start_idx < rt->EntriesNext.Size ? new_routing_start_idx : -1); + for (int n = new_routing_start_idx; n < rt->EntriesNext.Size; n++) + rt->EntriesNext[n].NextEntryIndex = (ImGuiKeyRoutingIndex)((n + 1 < rt->EntriesNext.Size) ? n + 1 : -1); + } + rt->Entries.swap(rt->EntriesNext); // Swap new and old indexes +} + +// [Internal] Do not use directly (should read io.KeyMods instead) +static ImGuiKeyChord GetMergedModsFromBools() +{ + ImGuiContext& g = *GImGui; + ImGuiKeyChord key_chord = 0; + if (g.IO.KeyCtrl) { key_chord |= ImGuiMod_Ctrl; } + if (g.IO.KeyShift) { key_chord |= ImGuiMod_Shift; } + if (g.IO.KeyAlt) { key_chord |= ImGuiMod_Alt; } + if (g.IO.KeySuper) { key_chord |= ImGuiMod_Super; } + return key_chord; +} + +static void ImGui::UpdateKeyboardInputs() +{ + ImGuiContext& g = *GImGui; + ImGuiIO& io = g.IO; + + // Import legacy keys or verify they are not used +#ifndef IMGUI_DISABLE_OBSOLETE_KEYIO + if (io.BackendUsingLegacyKeyArrays == 0) + { + // Backend used new io.AddKeyEvent() API: Good! Verify that old arrays are never written to externally. + for (int n = 0; n < ImGuiKey_LegacyNativeKey_END; n++) + IM_ASSERT((io.KeysDown[n] == false || IsKeyDown((ImGuiKey)n)) && "Backend needs to either only use io.AddKeyEvent(), either only fill legacy io.KeysDown[] + io.KeyMap[]. Not both!"); + } + else + { + if (g.FrameCount == 0) + for (int n = ImGuiKey_LegacyNativeKey_BEGIN; n < ImGuiKey_LegacyNativeKey_END; n++) + IM_ASSERT(g.IO.KeyMap[n] == -1 && "Backend is not allowed to write to io.KeyMap[0..511]!"); + + // Build reverse KeyMap (Named -> Legacy) + for (int n = ImGuiKey_NamedKey_BEGIN; n < ImGuiKey_NamedKey_END; n++) + if (io.KeyMap[n] != -1) + { + IM_ASSERT(IsLegacyKey((ImGuiKey)io.KeyMap[n])); + io.KeyMap[io.KeyMap[n]] = n; + } + + // Import legacy keys into new ones + for (int n = ImGuiKey_LegacyNativeKey_BEGIN; n < ImGuiKey_LegacyNativeKey_END; n++) + if (io.KeysDown[n] || io.BackendUsingLegacyKeyArrays == 1) + { + const ImGuiKey key = (ImGuiKey)(io.KeyMap[n] != -1 ? io.KeyMap[n] : n); + IM_ASSERT(io.KeyMap[n] == -1 || IsNamedKey(key)); + io.KeysData[key].Down = io.KeysDown[n]; + if (key != n) + io.KeysDown[key] = io.KeysDown[n]; // Allow legacy code using io.KeysDown[GetKeyIndex()] with old backends + io.BackendUsingLegacyKeyArrays = 1; + } + if (io.BackendUsingLegacyKeyArrays == 1) + { + GetKeyData(ImGuiMod_Ctrl)->Down = io.KeyCtrl; + GetKeyData(ImGuiMod_Shift)->Down = io.KeyShift; + GetKeyData(ImGuiMod_Alt)->Down = io.KeyAlt; + GetKeyData(ImGuiMod_Super)->Down = io.KeySuper; + } + } + +#ifndef IMGUI_DISABLE_OBSOLETE_KEYIO + const bool nav_gamepad_active = (io.ConfigFlags & ImGuiConfigFlags_NavEnableGamepad) != 0 && (io.BackendFlags & ImGuiBackendFlags_HasGamepad) != 0; + if (io.BackendUsingLegacyNavInputArray && nav_gamepad_active) + { + #define MAP_LEGACY_NAV_INPUT_TO_KEY1(_KEY, _NAV1) do { io.KeysData[_KEY].Down = (io.NavInputs[_NAV1] > 0.0f); io.KeysData[_KEY].AnalogValue = io.NavInputs[_NAV1]; } while (0) + #define MAP_LEGACY_NAV_INPUT_TO_KEY2(_KEY, _NAV1, _NAV2) do { io.KeysData[_KEY].Down = (io.NavInputs[_NAV1] > 0.0f) || (io.NavInputs[_NAV2] > 0.0f); io.KeysData[_KEY].AnalogValue = ImMax(io.NavInputs[_NAV1], io.NavInputs[_NAV2]); } while (0) + MAP_LEGACY_NAV_INPUT_TO_KEY1(ImGuiKey_GamepadFaceDown, ImGuiNavInput_Activate); + MAP_LEGACY_NAV_INPUT_TO_KEY1(ImGuiKey_GamepadFaceRight, ImGuiNavInput_Cancel); + MAP_LEGACY_NAV_INPUT_TO_KEY1(ImGuiKey_GamepadFaceLeft, ImGuiNavInput_Menu); + MAP_LEGACY_NAV_INPUT_TO_KEY1(ImGuiKey_GamepadFaceUp, ImGuiNavInput_Input); + MAP_LEGACY_NAV_INPUT_TO_KEY1(ImGuiKey_GamepadDpadLeft, ImGuiNavInput_DpadLeft); + MAP_LEGACY_NAV_INPUT_TO_KEY1(ImGuiKey_GamepadDpadRight, ImGuiNavInput_DpadRight); + MAP_LEGACY_NAV_INPUT_TO_KEY1(ImGuiKey_GamepadDpadUp, ImGuiNavInput_DpadUp); + MAP_LEGACY_NAV_INPUT_TO_KEY1(ImGuiKey_GamepadDpadDown, ImGuiNavInput_DpadDown); + MAP_LEGACY_NAV_INPUT_TO_KEY2(ImGuiKey_GamepadL1, ImGuiNavInput_FocusPrev, ImGuiNavInput_TweakSlow); + MAP_LEGACY_NAV_INPUT_TO_KEY2(ImGuiKey_GamepadR1, ImGuiNavInput_FocusNext, ImGuiNavInput_TweakFast); + MAP_LEGACY_NAV_INPUT_TO_KEY1(ImGuiKey_GamepadLStickLeft, ImGuiNavInput_LStickLeft); + MAP_LEGACY_NAV_INPUT_TO_KEY1(ImGuiKey_GamepadLStickRight, ImGuiNavInput_LStickRight); + MAP_LEGACY_NAV_INPUT_TO_KEY1(ImGuiKey_GamepadLStickUp, ImGuiNavInput_LStickUp); + MAP_LEGACY_NAV_INPUT_TO_KEY1(ImGuiKey_GamepadLStickDown, ImGuiNavInput_LStickDown); + #undef NAV_MAP_KEY + } +#endif + +#endif + + // Synchronize io.KeyMods with individual modifiers io.KeyXXX bools, update aliases + io.KeyMods = GetMergedModsFromBools(); + for (int n = 0; n < ImGuiMouseButton_COUNT; n++) + UpdateAliasKey(MouseButtonToKey(n), io.MouseDown[n], io.MouseDown[n] ? 1.0f : 0.0f); + UpdateAliasKey(ImGuiKey_MouseWheelX, io.MouseWheelH != 0.0f, io.MouseWheelH); + UpdateAliasKey(ImGuiKey_MouseWheelY, io.MouseWheel != 0.0f, io.MouseWheel); + + // Clear gamepad data if disabled + if ((io.BackendFlags & ImGuiBackendFlags_HasGamepad) == 0) + for (int i = ImGuiKey_Gamepad_BEGIN; i < ImGuiKey_Gamepad_END; i++) + { + io.KeysData[i - ImGuiKey_KeysData_OFFSET].Down = false; + io.KeysData[i - ImGuiKey_KeysData_OFFSET].AnalogValue = 0.0f; + } + + // Update keys + for (int i = 0; i < ImGuiKey_KeysData_SIZE; i++) + { + ImGuiKeyData* key_data = &io.KeysData[i]; + key_data->DownDurationPrev = key_data->DownDuration; + key_data->DownDuration = key_data->Down ? (key_data->DownDuration < 0.0f ? 0.0f : key_data->DownDuration + io.DeltaTime) : -1.0f; + } + + // Update keys/input owner (named keys only): one entry per key + for (ImGuiKey key = ImGuiKey_NamedKey_BEGIN; key < ImGuiKey_NamedKey_END; key = (ImGuiKey)(key + 1)) + { + ImGuiKeyData* key_data = &io.KeysData[key - ImGuiKey_KeysData_OFFSET]; + ImGuiKeyOwnerData* owner_data = &g.KeysOwnerData[key - ImGuiKey_NamedKey_BEGIN]; + owner_data->OwnerCurr = owner_data->OwnerNext; + if (!key_data->Down) // Important: ownership is released on the frame after a release. Ensure a 'MouseDown -> CloseWindow -> MouseUp' chain doesn't lead to someone else seeing the MouseUp. + owner_data->OwnerNext = ImGuiKeyOwner_None; + owner_data->LockThisFrame = owner_data->LockUntilRelease = owner_data->LockUntilRelease && key_data->Down; // Clear LockUntilRelease when key is not Down anymore + } + + UpdateKeyRoutingTable(&g.KeysRoutingTable); +} + static void ImGui::UpdateMouseInputs() { ImGuiContext& g = *GImGui; + ImGuiIO& io = g.IO; // Round mouse position to avoid spreading non-rounded position (e.g. UpdateManualResize doesn't support them well) - if (IsMousePosValid(&g.IO.MousePos)) - g.IO.MousePos = g.MouseLastValidPos = ImFloor(g.IO.MousePos); + if (IsMousePosValid(&io.MousePos)) + io.MousePos = g.MouseLastValidPos = ImFloorSigned(io.MousePos); // If mouse just appeared or disappeared (usually denoted by -FLT_MAX components) we cancel out movement in MouseDelta - if (IsMousePosValid(&g.IO.MousePos) && IsMousePosValid(&g.IO.MousePosPrev)) - g.IO.MouseDelta = g.IO.MousePos - g.IO.MousePosPrev; + if (IsMousePosValid(&io.MousePos) && IsMousePosValid(&io.MousePosPrev)) + io.MouseDelta = io.MousePos - io.MousePosPrev; else - g.IO.MouseDelta = ImVec2(0.0f, 0.0f); + io.MouseDelta = ImVec2(0.0f, 0.0f); // If mouse moved we re-enable mouse hovering in case it was disabled by gamepad/keyboard. In theory should use a >0.0f threshold but would need to reset in everywhere we set this to true. - if (g.IO.MouseDelta.x != 0.0f || g.IO.MouseDelta.y != 0.0f) + if (io.MouseDelta.x != 0.0f || io.MouseDelta.y != 0.0f) g.NavDisableMouseHover = false; - g.IO.MousePosPrev = g.IO.MousePos; - for (int i = 0; i < IM_ARRAYSIZE(g.IO.MouseDown); i++) + io.MousePosPrev = io.MousePos; + for (int i = 0; i < IM_ARRAYSIZE(io.MouseDown); i++) { - g.IO.MouseClicked[i] = g.IO.MouseDown[i] && g.IO.MouseDownDuration[i] < 0.0f; - g.IO.MouseReleased[i] = !g.IO.MouseDown[i] && g.IO.MouseDownDuration[i] >= 0.0f; - g.IO.MouseDownDurationPrev[i] = g.IO.MouseDownDuration[i]; - g.IO.MouseDownDuration[i] = g.IO.MouseDown[i] ? (g.IO.MouseDownDuration[i] < 0.0f ? 0.0f : g.IO.MouseDownDuration[i] + g.IO.DeltaTime) : -1.0f; - g.IO.MouseDoubleClicked[i] = false; - if (g.IO.MouseClicked[i]) + io.MouseClicked[i] = io.MouseDown[i] && io.MouseDownDuration[i] < 0.0f; + io.MouseClickedCount[i] = 0; // Will be filled below + io.MouseReleased[i] = !io.MouseDown[i] && io.MouseDownDuration[i] >= 0.0f; + io.MouseDownDurationPrev[i] = io.MouseDownDuration[i]; + io.MouseDownDuration[i] = io.MouseDown[i] ? (io.MouseDownDuration[i] < 0.0f ? 0.0f : io.MouseDownDuration[i] + io.DeltaTime) : -1.0f; + if (io.MouseClicked[i]) { - if ((float)(g.Time - g.IO.MouseClickedTime[i]) < g.IO.MouseDoubleClickTime) + bool is_repeated_click = false; + if ((float)(g.Time - io.MouseClickedTime[i]) < io.MouseDoubleClickTime) { - ImVec2 delta_from_click_pos = IsMousePosValid(&g.IO.MousePos) ? (g.IO.MousePos - g.IO.MouseClickedPos[i]) : ImVec2(0.0f, 0.0f); - if (ImLengthSqr(delta_from_click_pos) < g.IO.MouseDoubleClickMaxDist * g.IO.MouseDoubleClickMaxDist) - g.IO.MouseDoubleClicked[i] = true; - g.IO.MouseClickedTime[i] = -g.IO.MouseDoubleClickTime * 2.0f; // Mark as "old enough" so the third click isn't turned into a double-click + ImVec2 delta_from_click_pos = IsMousePosValid(&io.MousePos) ? (io.MousePos - io.MouseClickedPos[i]) : ImVec2(0.0f, 0.0f); + if (ImLengthSqr(delta_from_click_pos) < io.MouseDoubleClickMaxDist * io.MouseDoubleClickMaxDist) + is_repeated_click = true; } + if (is_repeated_click) + io.MouseClickedLastCount[i]++; else - { - g.IO.MouseClickedTime[i] = g.Time; - } - g.IO.MouseClickedPos[i] = g.IO.MousePos; - g.IO.MouseDownWasDoubleClick[i] = g.IO.MouseDoubleClicked[i]; - g.IO.MouseDragMaxDistanceAbs[i] = ImVec2(0.0f, 0.0f); - g.IO.MouseDragMaxDistanceSqr[i] = 0.0f; + io.MouseClickedLastCount[i] = 1; + io.MouseClickedTime[i] = g.Time; + io.MouseClickedPos[i] = io.MousePos; + io.MouseClickedCount[i] = io.MouseClickedLastCount[i]; + io.MouseDragMaxDistanceSqr[i] = 0.0f; } - else if (g.IO.MouseDown[i]) + else if (io.MouseDown[i]) { // Maintain the maximum distance we reaching from the initial click position, which is used with dragging threshold - ImVec2 delta_from_click_pos = IsMousePosValid(&g.IO.MousePos) ? (g.IO.MousePos - g.IO.MouseClickedPos[i]) : ImVec2(0.0f, 0.0f); - g.IO.MouseDragMaxDistanceSqr[i] = ImMax(g.IO.MouseDragMaxDistanceSqr[i], ImLengthSqr(delta_from_click_pos)); - g.IO.MouseDragMaxDistanceAbs[i].x = ImMax(g.IO.MouseDragMaxDistanceAbs[i].x, delta_from_click_pos.x < 0.0f ? -delta_from_click_pos.x : delta_from_click_pos.x); - g.IO.MouseDragMaxDistanceAbs[i].y = ImMax(g.IO.MouseDragMaxDistanceAbs[i].y, delta_from_click_pos.y < 0.0f ? -delta_from_click_pos.y : delta_from_click_pos.y); - } - if (!g.IO.MouseDown[i] && !g.IO.MouseReleased[i]) - g.IO.MouseDownWasDoubleClick[i] = false; - if (g.IO.MouseClicked[i]) // Clicking any mouse button reactivate mouse hovering which may have been deactivated by gamepad/keyboard navigation + float delta_sqr_click_pos = IsMousePosValid(&io.MousePos) ? ImLengthSqr(io.MousePos - io.MouseClickedPos[i]) : 0.0f; + io.MouseDragMaxDistanceSqr[i] = ImMax(io.MouseDragMaxDistanceSqr[i], delta_sqr_click_pos); + } + + // We provide io.MouseDoubleClicked[] as a legacy service + io.MouseDoubleClicked[i] = (io.MouseClickedCount[i] == 2); + + // Clicking any mouse button reactivate mouse hovering which may have been deactivated by gamepad/keyboard navigation + if (io.MouseClicked[i]) g.NavDisableMouseHover = false; } } -static void StartLockWheelingWindow(ImGuiWindow* window) +static void LockWheelingWindow(ImGuiWindow* window, float wheel_amount) { ImGuiContext& g = *GImGui; + if (window) + g.WheelingWindowReleaseTimer = ImMin(g.WheelingWindowReleaseTimer + ImAbs(wheel_amount) * WINDOWS_MOUSE_WHEEL_SCROLL_LOCK_TIMER, WINDOWS_MOUSE_WHEEL_SCROLL_LOCK_TIMER); + else + g.WheelingWindowReleaseTimer = 0.0f; if (g.WheelingWindow == window) return; + IMGUI_DEBUG_LOG_IO("LockWheelingWindow() \"%s\"\n", window ? window->Name : "NULL"); g.WheelingWindow = window; g.WheelingWindowRefMousePos = g.IO.MousePos; - g.WheelingWindowTimer = WINDOWS_MOUSE_WHEEL_SCROLL_LOCK_TIMER; } void ImGui::UpdateMouseWheel() @@ -3758,31 +4362,30 @@ void ImGui::UpdateMouseWheel() // Reset the locked window if we move the mouse or after the timer elapses if (g.WheelingWindow != NULL) { - g.WheelingWindowTimer -= g.IO.DeltaTime; + g.WheelingWindowReleaseTimer -= g.IO.DeltaTime; if (IsMousePosValid() && ImLengthSqr(g.IO.MousePos - g.WheelingWindowRefMousePos) > g.IO.MouseDragThreshold * g.IO.MouseDragThreshold) - g.WheelingWindowTimer = 0.0f; - if (g.WheelingWindowTimer <= 0.0f) - { - g.WheelingWindow = NULL; - g.WheelingWindowTimer = 0.0f; - } + g.WheelingWindowReleaseTimer = 0.0f; + if (g.WheelingWindowReleaseTimer <= 0.0f) + LockWheelingWindow(NULL, 0.0f); } - if (g.IO.MouseWheel == 0.0f && g.IO.MouseWheelH == 0.0f) - return; - - if ((g.ActiveId != 0 && g.ActiveIdUsingMouseWheel) || (g.HoveredIdPreviousFrame != 0 && g.HoveredIdPreviousFrameUsingMouseWheel)) + ImVec2 wheel; + wheel.x = TestKeyOwner(ImGuiKey_MouseWheelX, ImGuiKeyOwner_None) ? g.IO.MouseWheelH : 0.0f; + wheel.y = TestKeyOwner(ImGuiKey_MouseWheelY, ImGuiKeyOwner_None) ? g.IO.MouseWheel : 0.0f; + if (wheel.x == 0.0f && wheel.y == 0.0f) return; - ImGuiWindow* window = g.WheelingWindow ? g.WheelingWindow : g.HoveredWindow; - if (!window || window->Collapsed) + //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; // 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 (g.IO.MouseWheel != 0.0f && g.IO.KeyCtrl && g.IO.FontAllowUserScaling) + if (wheel.y != 0.0f && g.IO.KeyCtrl && g.IO.FontAllowUserScaling) { - StartLockWheelingWindow(window); + LockWheelingWindow(mouse_window, wheel.y); + ImGuiWindow* window = mouse_window; const float new_font_scale = ImClamp(window->FontWindowScale + g.IO.MouseWheel * 0.10f, 0.50f, 2.50f); const float scale = new_font_scale / window->FontWindowScale; window->FontWindowScale = new_font_scale; @@ -3795,85 +4398,54 @@ void ImGui::UpdateMouseWheel() } return; } - - // Mouse wheel scrolling - // If a child window has the ImGuiWindowFlags_NoScrollWithMouse flag, we give a chance to scroll its parent if (g.IO.KeyCtrl) return; + // Mouse wheel scrolling // As a standard behavior holding SHIFT while using Vertical Mouse Wheel triggers Horizontal scroll instead // (we avoid doing it on OSX as it the OS input layer handles this already) const bool swap_axis = g.IO.KeyShift && !g.IO.ConfigMacOSXBehaviors; - const float wheel_y = swap_axis ? 0.0f : g.IO.MouseWheel; - const float wheel_x = swap_axis ? g.IO.MouseWheel : g.IO.MouseWheelH; + if (swap_axis) + { + wheel.x = wheel.y; + wheel.y = 0.0f; + } // Vertical Mouse Wheel scrolling - if (wheel_y != 0.0f) + // Bubble up into parent window if: + // - a child window doesn't allow any scrolling. + // - a child window doesn't need scrolling because it is already at the edge for the direction we are going in. + // - a child window has the ImGuiWindowFlags_NoScrollWithMouse flag. + if (wheel.y != 0.0f) { - StartLockWheelingWindow(window); + ImGuiWindow* window = mouse_window; while ((window->Flags & ImGuiWindowFlags_ChildWindow) && ((window->ScrollMax.y == 0.0f) || ((window->Flags & ImGuiWindowFlags_NoScrollWithMouse) && !(window->Flags & ImGuiWindowFlags_NoMouseInputs)))) window = window->ParentWindow; if (!(window->Flags & ImGuiWindowFlags_NoScrollWithMouse) && !(window->Flags & ImGuiWindowFlags_NoMouseInputs)) { + LockWheelingWindow(mouse_window, wheel.y); float max_step = window->InnerRect.GetHeight() * 0.67f; float scroll_step = ImFloor(ImMin(5 * window->CalcFontSize(), max_step)); - SetScrollY(window, window->Scroll.y - wheel_y * scroll_step); + SetScrollY(window, window->Scroll.y - wheel.y * scroll_step); } } // Horizontal Mouse Wheel scrolling, or Vertical Mouse Wheel w/ Shift held - if (wheel_x != 0.0f) + if (wheel.x != 0.0f) { - StartLockWheelingWindow(window); + ImGuiWindow* window = mouse_window; while ((window->Flags & ImGuiWindowFlags_ChildWindow) && ((window->ScrollMax.x == 0.0f) || ((window->Flags & ImGuiWindowFlags_NoScrollWithMouse) && !(window->Flags & ImGuiWindowFlags_NoMouseInputs)))) window = window->ParentWindow; if (!(window->Flags & ImGuiWindowFlags_NoScrollWithMouse) && !(window->Flags & ImGuiWindowFlags_NoMouseInputs)) { + LockWheelingWindow(mouse_window, wheel.x); float max_step = window->InnerRect.GetWidth() * 0.67f; float scroll_step = ImFloor(ImMin(2 * window->CalcFontSize(), max_step)); - SetScrollX(window, window->Scroll.x - wheel_x * scroll_step); + SetScrollX(window, window->Scroll.x - wheel.x * scroll_step); } } } -void ImGui::UpdateTabFocus() -{ - ImGuiContext& g = *GImGui; - - // Pressing TAB activate widget focus - g.TabFocusPressed = (g.NavWindow && g.NavWindow->Active && !(g.NavWindow->Flags & ImGuiWindowFlags_NoNavInputs) && !g.IO.KeyCtrl && IsKeyPressedMap(ImGuiKey_Tab)); - if (g.ActiveId == 0 && g.TabFocusPressed) - { - // - This path is only taken when no widget are active/tabbed-into yet. - // Subsequent tabbing will be processed by FocusableItemRegister() - // - Note that SetKeyboardFocusHere() sets the Next fields mid-frame. To be consistent we also - // manipulate the Next fields here even though they will be turned into Curr fields below. - g.TabFocusRequestNextWindow = g.NavWindow; - g.TabFocusRequestNextCounterRegular = INT_MAX; - if (g.NavId != 0 && g.NavIdTabCounter != INT_MAX) - g.TabFocusRequestNextCounterTabStop = g.NavIdTabCounter + (g.IO.KeyShift ? -1 : 0); - else - g.TabFocusRequestNextCounterTabStop = g.IO.KeyShift ? -1 : 0; - } - - // Turn queued focus request into current one - g.TabFocusRequestCurrWindow = NULL; - g.TabFocusRequestCurrCounterRegular = g.TabFocusRequestCurrCounterTabStop = INT_MAX; - if (g.TabFocusRequestNextWindow != NULL) - { - ImGuiWindow* window = g.TabFocusRequestNextWindow; - g.TabFocusRequestCurrWindow = window; - if (g.TabFocusRequestNextCounterRegular != INT_MAX && window->DC.FocusCounterRegular != -1) - g.TabFocusRequestCurrCounterRegular = ImModPositive(g.TabFocusRequestNextCounterRegular, window->DC.FocusCounterRegular + 1); - if (g.TabFocusRequestNextCounterTabStop != INT_MAX && window->DC.FocusCounterTabStop != -1) - g.TabFocusRequestCurrCounterTabStop = ImModPositive(g.TabFocusRequestNextCounterTabStop, window->DC.FocusCounterTabStop + 1); - g.TabFocusRequestNextWindow = NULL; - g.TabFocusRequestNextCounterRegular = g.TabFocusRequestNextCounterTabStop = INT_MAX; - } - - g.NavIdTabCounter = INT_MAX; -} - // The reason this is exposed in imgui_internal.h is: on touch-based system that don't have hovering, we want to dispatch inputs to the right target (imgui vs imgui+app) void ImGui::UpdateHoveredWindowAndCaptureFlags() { @@ -3890,7 +4462,7 @@ void ImGui::UpdateHoveredWindowAndCaptureFlags() // Modal windows prevents mouse from hovering behind them. ImGuiWindow* modal_window = GetTopMostPopupModal(); - if (modal_window && g.HoveredWindow && !IsWindowChildOf(g.HoveredWindow->RootWindow, modal_window, true)) + if (modal_window && g.HoveredWindow && !IsWindowWithinBeginStackOf(g.HoveredWindow->RootWindow, modal_window)) clear_hovered_windows = true; // Disabled mouse? @@ -3951,17 +4523,6 @@ void ImGui::UpdateHoveredWindowAndCaptureFlags() io.WantTextInput = (g.WantTextInputNextFrame != -1) ? (g.WantTextInputNextFrame != 0) : false; } -ImGuiKeyModFlags ImGui::GetMergedKeyModFlags() -{ - ImGuiContext& g = *GImGui; - ImGuiKeyModFlags key_mod_flags = ImGuiKeyModFlags_None; - if (g.IO.KeyCtrl) { key_mod_flags |= ImGuiKeyModFlags_Ctrl; } - if (g.IO.KeyShift) { key_mod_flags |= ImGuiKeyModFlags_Shift; } - if (g.IO.KeyAlt) { key_mod_flags |= ImGuiKeyModFlags_Alt; } - if (g.IO.KeySuper) { key_mod_flags |= ImGuiKeyModFlags_Super; } - return key_mod_flags; -} - void ImGui::NewFrame() { IM_ASSERT(GImGui != NULL && "No current context. Did you call ImGui::CreateContext() and ImGui::SetCurrentContext() ?"); @@ -4038,15 +4599,20 @@ void ImGui::NewFrame() if (g.HoveredId && g.ActiveId != g.HoveredId) g.HoveredIdNotActiveTimer += g.IO.DeltaTime; g.HoveredIdPreviousFrame = g.HoveredId; - g.HoveredIdPreviousFrameUsingMouseWheel = g.HoveredIdUsingMouseWheel; g.HoveredId = 0; g.HoveredIdAllowOverlap = false; - g.HoveredIdUsingMouseWheel = false; g.HoveredIdDisabled = false; - // Update ActiveId data (clear reference to active widget if the widget isn't alive anymore) - if (g.ActiveIdIsAlive != g.ActiveId && g.ActiveIdPreviousFrame == g.ActiveId && g.ActiveId != 0) + // Clear ActiveID if the item is not alive anymore. + // In 1.87, the common most call to KeepAliveID() was moved from GetID() to ItemAdd(). + // As a result, custom widget using ButtonBehavior() _without_ ItemAdd() need to call KeepAliveID() themselves. + if (g.ActiveId != 0 && g.ActiveIdIsAlive != g.ActiveId && g.ActiveIdPreviousFrame == g.ActiveId) + { + IMGUI_DEBUG_LOG_ACTIVEID("NewFrame(): ClearActiveID() because it isn't marked alive anymore!\n"); ClearActiveID(); + } + + // Update ActiveId data (clear reference to active widget if the widget isn't alive anymore) if (g.ActiveId) g.ActiveIdTimer += g.IO.DeltaTime; g.LastActiveIdTimer += g.IO.DeltaTime; @@ -4062,8 +4628,41 @@ void ImGui::NewFrame() if (g.ActiveId == 0) { g.ActiveIdUsingNavDirMask = 0x00; + g.ActiveIdUsingAllKeyboardKeys = false; +#ifndef IMGUI_DISABLE_OBSOLETE_KEYIO g.ActiveIdUsingNavInputMask = 0x00; - g.ActiveIdUsingKeyInputMask = 0x00; +#endif + } + +#ifndef IMGUI_DISABLE_OBSOLETE_KEYIO + if (g.ActiveId == 0) + g.ActiveIdUsingNavInputMask = 0; + else if (g.ActiveIdUsingNavInputMask != 0) + { + // If your custom widget code used: { g.ActiveIdUsingNavInputMask |= (1 << ImGuiNavInput_Cancel); } + // Since IMGUI_VERSION_NUM >= 18804 it should be: { SetKeyOwner(ImGuiKey_Escape, g.ActiveId); SetKeyOwner(ImGuiKey_NavGamepadCancel, g.ActiveId); } + if (g.ActiveIdUsingNavInputMask & (1 << ImGuiNavInput_Cancel)) + SetKeyOwner(ImGuiKey_Escape, g.ActiveId); + if (g.ActiveIdUsingNavInputMask & ~(1 << ImGuiNavInput_Cancel)) + IM_ASSERT(0); // Other values unsupported + } +#endif + + // Update hover delay for IsItemHovered() with delays and tooltips + g.HoverDelayIdPreviousFrame = g.HoverDelayId; + if (g.HoverDelayId != 0) + { + //if (g.IO.MouseDelta.x == 0.0f && g.IO.MouseDelta.y == 0.0f) // Need design/flags + g.HoverDelayTimer += g.IO.DeltaTime; + g.HoverDelayClearTimer = 0.0f; + g.HoverDelayId = 0; + } + else if (g.HoverDelayTimer > 0.0f) + { + // This gives a little bit of leeway before clearing the hover timer, allowing mouse to cross gaps + g.HoverDelayClearTimer += g.IO.DeltaTime; + if (g.HoverDelayClearTimer >= ImMax(0.20f, g.IO.DeltaTime * 2.0f)) // ~6 frames at 30 Hz + allow for low framerate + g.HoverDelayTimer = g.HoverDelayClearTimer = 0.0f; // May want a decaying timer, in which case need to clamp at max first, based on max of caller last requested timer. } // Drag and drop @@ -4078,20 +4677,17 @@ void ImGui::NewFrame() //if (g.IO.AppFocusLost) // ClosePopupsExceptModals(); - // Clear buttons state when focus is lost - // (this is useful so e.g. releasing Alt after focus loss on Alt-Tab doesn't trigger the Alt menu toggle) - if (g.IO.AppFocusLost) - { - g.IO.ClearInputKeys(); - g.IO.AppFocusLost = false; - } + // Process input queue (trickle as many events as possible) + g.InputEventsTrail.resize(0); + UpdateInputEvents(g.IO.ConfigInputTrickleEventQueue); // Update keyboard input state - // Synchronize io.KeyMods with individual modifiers io.KeyXXX bools - g.IO.KeyMods = GetMergedKeyModFlags(); - memcpy(g.IO.KeysDownDurationPrev, g.IO.KeysDownDuration, sizeof(g.IO.KeysDownDuration)); - for (int i = 0; i < IM_ARRAYSIZE(g.IO.KeysDown); i++) - g.IO.KeysDownDuration[i] = g.IO.KeysDown[i] ? (g.IO.KeysDownDuration[i] < 0.0f ? 0.0f : g.IO.KeysDownDuration[i] + g.IO.DeltaTime) : -1.0f; + UpdateKeyboardInputs(); + + //IM_ASSERT(g.IO.KeyCtrl == IsKeyDown(ImGuiKey_LeftCtrl) || IsKeyDown(ImGuiKey_RightCtrl)); + //IM_ASSERT(g.IO.KeyShift == IsKeyDown(ImGuiKey_LeftShift) || IsKeyDown(ImGuiKey_RightShift)); + //IM_ASSERT(g.IO.KeyAlt == IsKeyDown(ImGuiKey_LeftAlt) || IsKeyDown(ImGuiKey_RightAlt)); + //IM_ASSERT(g.IO.KeySuper == IsKeyDown(ImGuiKey_LeftSuper) || IsKeyDown(ImGuiKey_RightSuper)); // Update gamepad/keyboard navigation NavUpdate(); @@ -4114,14 +4710,14 @@ void ImGui::NewFrame() g.MouseCursor = ImGuiMouseCursor_Arrow; g.WantCaptureMouseNextFrame = g.WantCaptureKeyboardNextFrame = g.WantTextInputNextFrame = -1; - g.PlatformImePos = ImVec2(1.0f, 1.0f); // OS Input Method Editor showing on top-left of our window by default + + // Platform IME data: reset for the frame + g.PlatformImeDataPrev = g.PlatformImeData; + g.PlatformImeData.WantVisible = false; // Mouse wheel scrolling, scale UpdateMouseWheel(); - // Update legacy TAB focus - UpdateTabFocus(); - // Mark all windows as not visible and compact unused memory. IM_ASSERT(g.WindowsFocusOrder.Size <= g.Windows.Size); const float memory_compact_start_time = (g.GcCompactAll || g.IO.ConfigMemoryCompactTimer < 0.0f) ? FLT_MAX : (float)g.Time - g.IO.ConfigMemoryCompactTimer; @@ -4129,9 +4725,10 @@ void ImGui::NewFrame() { ImGuiWindow* window = g.Windows[i]; window->WasActive = window->Active; - window->BeginCount = 0; window->Active = false; window->WriteAccessed = false; + window->BeginCountPreviousFrame = window->BeginCount; + window->BeginCount = 0; // Garbage collect transient buffers of recently unused windows if (!window->WasActive && !window->MemoryCompacted && window->LastTimeActive < memory_compact_start_time) @@ -4142,9 +4739,9 @@ void ImGui::NewFrame() for (int i = 0; i < g.TablesLastTimeActive.Size; i++) if (g.TablesLastTimeActive[i] >= 0.0f && g.TablesLastTimeActive[i] < memory_compact_start_time) TableGcCompactTransientBuffers(g.Tables.GetByIndex(i)); - for (int i = 0; i < g.TablesTempDataStack.Size; i++) - if (g.TablesTempDataStack[i].LastTimeActive >= 0.0f && g.TablesTempDataStack[i].LastTimeActive < memory_compact_start_time) - TableGcCompactTransientBuffers(&g.TablesTempDataStack[i]); + for (int i = 0; i < g.TablesTempData.Size; i++) + if (g.TablesTempData[i].LastTimeActive >= 0.0f && g.TablesTempData[i].LastTimeActive < memory_compact_start_time) + TableGcCompactTransientBuffers(&g.TablesTempData[i]); if (g.GcCompactAll) GcCompactTransientMiscBuffers(); g.GcCompactAll = false; @@ -4161,12 +4758,15 @@ void ImGui::NewFrame() g.ItemFlagsStack.push_back(ImGuiItemFlags_None); g.GroupStack.resize(0); - // [DEBUG] Item picker tool - start with DebugStartItemPicker() - useful to visually select an item and break into its call-stack. + // [DEBUG] Update debug features UpdateDebugToolItemPicker(); + UpdateDebugToolStackQueries(); + if (g.DebugLocateFrames > 0 && --g.DebugLocateFrames == 0) + g.DebugLocateId = 0; // Create implicit/fallback window - which we will only render it if the user has added something to it. // We don't use "Debug" to avoid colliding with user trying to create a "Debug" window with custom flags. - // This fallback is particularly important as it avoid ImGui:: calls from crashing. + // This fallback is particularly important as it prevents ImGui:: calls from crashing. g.WithinFrameScopeWithImplicitWindow = true; SetNextWindowSize(ImVec2(400, 400), ImGuiCond_FirstUseEver); Begin("Debug##Default"); @@ -4175,37 +4775,24 @@ void ImGui::NewFrame() CallContextHooks(&g, ImGuiContextHookType_NewFramePost); } -// [DEBUG] Item picker tool - start with DebugStartItemPicker() - useful to visually select an item and break into its call-stack. -void ImGui::UpdateDebugToolItemPicker() +// IMPORTANT: ###xxx suffixes must be same in ALL languages +static const ImGuiLocEntry GLocalizationEntriesEnUS[] = { - ImGuiContext& g = *GImGui; - g.DebugItemPickerBreakId = 0; - if (g.DebugItemPickerActive) - { - const ImGuiID hovered_id = g.HoveredIdPreviousFrame; - SetMouseCursor(ImGuiMouseCursor_Hand); - if (IsKeyPressedMap(ImGuiKey_Escape)) - g.DebugItemPickerActive = false; - if (IsMouseClicked(0) && hovered_id) - { - g.DebugItemPickerBreakId = hovered_id; - g.DebugItemPickerActive = false; - } - SetNextWindowBgAlpha(0.60f); - BeginTooltip(); - Text("HoveredId: 0x%08X", hovered_id); - Text("Press ESC to abort picking."); - TextColored(GetStyleColorVec4(hovered_id ? ImGuiCol_Text : ImGuiCol_TextDisabled), "Click to break in debugger!"); - EndTooltip(); - } -} + { ImGuiLocKey_TableSizeOne, "Size column to fit###SizeOne" }, + { ImGuiLocKey_TableSizeAllFit, "Size all columns to fit###SizeAll" }, + { ImGuiLocKey_TableSizeAllDefault, "Size all columns to default###SizeAll" }, + { ImGuiLocKey_TableResetOrder, "Reset order###ResetOrder" }, + { ImGuiLocKey_WindowingMainMenuBar, "(Main menu bar)" }, + { ImGuiLocKey_WindowingPopup, "(Popup)" }, + { ImGuiLocKey_WindowingUntitled, "(Untitled)" }, +}; -void ImGui::Initialize(ImGuiContext* context) +void ImGui::Initialize() { - ImGuiContext& g = *context; + ImGuiContext& g = *GImGui; IM_ASSERT(!g.Initialized && !g.SettingsLoaded); - // Add .ini handle for ImGuiWindow type + // Add .ini handle for ImGuiWindow and ImGuiTable types { ImGuiSettingsHandler ini_handler; ini_handler.TypeName = "Window"; @@ -4215,15 +4802,17 @@ void ImGui::Initialize(ImGuiContext* context) ini_handler.ReadLineFn = WindowSettingsHandler_ReadLine; ini_handler.ApplyAllFn = WindowSettingsHandler_ApplyAll; ini_handler.WriteAllFn = WindowSettingsHandler_WriteAll; - g.SettingsHandlers.push_back(ini_handler); + AddSettingsHandler(&ini_handler); } + TableSettingsAddSettingsHandler(); - // Add .ini handle for ImGuiTable type - TableSettingsInstallHandler(context); + // Setup default localization table + LocalizeRegisterEntries(GLocalizationEntriesEnUS, IM_ARRAYSIZE(GLocalizationEntriesEnUS)); // Create default viewport ImGuiViewportP* viewport = IM_NEW(ImGuiViewportP)(); g.Viewports.push_back(viewport); + g.TempBuffer.resize(1024 * 3 + 1, 0); #ifdef IMGUI_HAS_DOCK #endif @@ -4232,16 +4821,17 @@ void ImGui::Initialize(ImGuiContext* context) } // This function is merely here to free heap allocations. -void ImGui::Shutdown(ImGuiContext* context) +void ImGui::Shutdown() { // The fonts atlas can be used prior to calling NewFrame(), so we clear it even if g.Initialized is FALSE (which would happen if we never called NewFrame) - ImGuiContext& g = *context; + ImGuiContext& g = *GImGui; if (g.IO.Fonts && g.FontAtlasOwnedByContext) { g.IO.Fonts->Locked = false; IM_DELETE(g.IO.Fonts); } g.IO.Fonts = NULL; + g.DrawListSharedData.TempBuffer.clear(); // Cleanup of other data are conditional on actually having initialized Dear ImGui. if (!g.Initialized) @@ -4249,12 +4839,7 @@ void ImGui::Shutdown(ImGuiContext* context) // Save settings (unless we haven't attempted to load them: CreateContext/DestroyContext without a call to NewFrame shouldn't save an empty file) if (g.SettingsLoaded && g.IO.IniFilename != NULL) - { - ImGuiContext* backup_context = GImGui; - SetCurrentContext(&g); SaveIniSettingsToDisk(g.IO.IniFilename); - SetCurrentContext(backup_context); - } CallContextHooks(&g, ImGuiContextHookType_Shutdown); @@ -4269,6 +4854,9 @@ void ImGui::Shutdown(ImGuiContext* context) g.HoveredWindow = g.HoveredWindowUnderMovingWindow = NULL; g.ActiveIdWindow = g.ActiveIdPreviousFrameWindow = NULL; g.MovingWindow = NULL; + + g.KeysRoutingTable.Clear(); + g.ColorStack.clear(); g.StyleVarStack.clear(); g.FontStack.clear(); @@ -4281,8 +4869,10 @@ void ImGui::Shutdown(ImGuiContext* context) g.CurrentTabBarStack.clear(); g.ShrinkWidthBuffer.clear(); + g.ClipperTempData.clear_destruct(); + g.Tables.Clear(); - g.TablesTempDataStack.clear_destruct(); + g.TablesTempData.clear_destruct(); g.DrawChannelsTempMergeBuffer.clear(); g.ClipboardHandlerData.clear(); @@ -4301,6 +4891,8 @@ void ImGui::Shutdown(ImGuiContext* context) g.LogFile = NULL; } g.LogBuffer.clear(); + g.DebugLogBuf.clear(); + g.DebugLogIndex.clear(); g.Initialized = false; } @@ -4323,8 +4915,7 @@ static void AddWindowToSortBuffer(ImVector* out_sorted_windows, Im if (window->Active) { int count = window->DC.ChildWindows.Size; - if (count > 1) - ImQsort(window->DC.ChildWindows.Data, (size_t)count, sizeof(ImGuiWindow*), ChildWindowComparer); + ImQsort(window->DC.ChildWindows.Data, (size_t)count, sizeof(ImGuiWindow*), ChildWindowComparer); for (int i = 0; i < count; i++) { ImGuiWindow* child = window->DC.ChildWindows[i]; @@ -4336,11 +4927,10 @@ static void AddWindowToSortBuffer(ImVector* out_sorted_windows, Im static void AddDrawListToDrawData(ImVector* out_list, ImDrawList* draw_list) { - // Remove trailing command if unused. - // Technically we could return directly instead of popping, but this make things looks neat in Metrics/Debugger window as well. - draw_list->_PopUnusedDrawCmd(); if (draw_list->CmdBuffer.Size == 0) return; + if (draw_list->CmdBuffer.Size == 1 && draw_list->CmdBuffer[0].ElemCount == 0 && draw_list->CmdBuffer[0].UserCallback == NULL) + return; // Draw list sanity check. Detect mismatch between PrimReserve() calls and incrementing _VtxCurrentIdx, _VtxWritePtr etc. // May trigger for you if you are using PrimXXX functions incorrectly. @@ -4384,11 +4974,15 @@ static void AddWindowToDrawData(ImGuiWindow* window, int layer) } } +static inline int GetWindowDisplayLayer(ImGuiWindow* window) +{ + return (window->Flags & ImGuiWindowFlags_Tooltip) ? 1 : 0; +} + // Layer is locked for the root window, however child windows may use a different viewport (e.g. extruding menu) -static void AddRootWindowToDrawData(ImGuiWindow* window) +static inline void AddRootWindowToDrawData(ImGuiWindow* window) { - int layer = (window->Flags & ImGuiWindowFlags_Tooltip) ? 1 : 0; - AddWindowToDrawData(window, layer); + AddWindowToDrawData(window, GetWindowDisplayLayer(window)); } void ImDrawDataBuilder::FlattenIntoSingleLayer() @@ -4422,8 +5016,10 @@ static void SetupViewportDrawData(ImGuiViewportP* viewport, ImVectorFramebufferScale = io.DisplayFramebufferScale; for (int n = 0; n < draw_lists->Size; n++) { - draw_data->TotalVtxCount += draw_lists->Data[n]->VtxBuffer.Size; - draw_data->TotalIdxCount += draw_lists->Data[n]->IdxBuffer.Size; + ImDrawList* draw_list = draw_lists->Data[n]; + draw_list->_PopUnusedDrawCmd(); + draw_data->TotalVtxCount += draw_list->VtxBuffer.Size; + draw_data->TotalIdxCount += draw_list->IdxBuffer.Size; } } @@ -4447,6 +5043,88 @@ void ImGui::PopClipRect() window->ClipRect = window->DrawList->_ClipRectStack.back(); } +static void ImGui::RenderDimmedBackgroundBehindWindow(ImGuiWindow* window, ImU32 col) +{ + if ((col & IM_COL32_A_MASK) == 0) + return; + + ImGuiViewportP* viewport = (ImGuiViewportP*)GetMainViewport(); + ImRect viewport_rect = viewport->GetMainRect(); + + // Draw behind window by moving the draw command at the FRONT of the draw list + { + // We've already called AddWindowToDrawData() which called DrawList->ChannelsMerge() on DockNodeHost windows, + // and draw list have been trimmed already, hence the explicit recreation of a draw command if missing. + // FIXME: This is creating complication, might be simpler if we could inject a drawlist in drawdata at a given position and not attempt to manipulate ImDrawCmd order. + ImDrawList* draw_list = window->RootWindow->DrawList; + if (draw_list->CmdBuffer.Size == 0) + draw_list->AddDrawCmd(); + draw_list->PushClipRect(viewport_rect.Min - ImVec2(1, 1), viewport_rect.Max + ImVec2(1, 1), false); // Ensure ImDrawCmd are not merged + draw_list->AddRectFilled(viewport_rect.Min, viewport_rect.Max, col); + ImDrawCmd cmd = draw_list->CmdBuffer.back(); + IM_ASSERT(cmd.ElemCount == 6); + draw_list->CmdBuffer.pop_back(); + draw_list->CmdBuffer.push_front(cmd); + draw_list->PopClipRect(); + draw_list->AddDrawCmd(); // We need to create a command as CmdBuffer.back().IdxOffset won't be correct if we append to same command. + } +} + +ImGuiWindow* ImGui::FindBottomMostVisibleWindowWithinBeginStack(ImGuiWindow* parent_window) +{ + ImGuiContext& g = *GImGui; + ImGuiWindow* bottom_most_visible_window = parent_window; + for (int i = FindWindowDisplayIndex(parent_window); i >= 0; i--) + { + ImGuiWindow* window = g.Windows[i]; + if (window->Flags & ImGuiWindowFlags_ChildWindow) + continue; + if (!IsWindowWithinBeginStackOf(window, parent_window)) + break; + if (IsWindowActiveAndVisible(window) && GetWindowDisplayLayer(window) <= GetWindowDisplayLayer(parent_window)) + bottom_most_visible_window = window; + } + return bottom_most_visible_window; +} + +static void ImGui::RenderDimmedBackgrounds() +{ + ImGuiContext& g = *GImGui; + ImGuiWindow* modal_window = GetTopMostAndVisiblePopupModal(); + if (g.DimBgRatio <= 0.0f && g.NavWindowingHighlightAlpha <= 0.0f) + return; + const bool dim_bg_for_modal = (modal_window != NULL); + const bool dim_bg_for_window_list = (g.NavWindowingTargetAnim != NULL && g.NavWindowingTargetAnim->Active); + if (!dim_bg_for_modal && !dim_bg_for_window_list) + return; + + if (dim_bg_for_modal) + { + // Draw dimming behind modal or a begin stack child, whichever comes first in draw order. + ImGuiWindow* dim_behind_window = FindBottomMostVisibleWindowWithinBeginStack(modal_window); + RenderDimmedBackgroundBehindWindow(dim_behind_window, GetColorU32(ImGuiCol_ModalWindowDimBg, g.DimBgRatio)); + } + else if (dim_bg_for_window_list) + { + // Draw dimming behind CTRL+Tab target window + RenderDimmedBackgroundBehindWindow(g.NavWindowingTargetAnim, GetColorU32(ImGuiCol_NavWindowingDimBg, g.DimBgRatio)); + + // Draw border around CTRL+Tab target window + ImGuiWindow* window = g.NavWindowingTargetAnim; + ImGuiViewport* viewport = GetMainViewport(); + float distance = g.FontSize; + ImRect bb = window->Rect(); + bb.Expand(distance); + if (bb.GetWidth() >= viewport->Size.x && bb.GetHeight() >= viewport->Size.y) + bb.Expand(-distance - 1.0f); // If a window fits the entire viewport, adjust its highlight inward + 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); + window->DrawList->PopClipRect(); + } +} + // This is normally called by Render(). You may want to call it directly if you want to avoid calling Render() but the gain will be very minimal. void ImGui::EndFrame() { @@ -4462,12 +5140,9 @@ void ImGui::EndFrame() ErrorCheckEndFrameSanityChecks(); - // Notify OS when our Input Method Editor cursor has moved (e.g. CJK inputs using Microsoft IME) - if (g.IO.ImeSetInputScreenPosFn && (g.PlatformImeLastPos.x == FLT_MAX || ImLengthSqr(g.PlatformImeLastPos - g.PlatformImePos) > 0.0001f)) - { - g.IO.ImeSetInputScreenPosFn((int)g.PlatformImePos.x, (int)g.PlatformImePos.y); - g.PlatformImeLastPos = g.PlatformImePos; - } + // Notify Platform/OS when our Input Method Editor cursor has moved (e.g. CJK inputs using Microsoft IME) + if (g.IO.SetPlatformImeDataFn && memcmp(&g.PlatformImeData, &g.PlatformImeDataPrev, sizeof(ImGuiPlatformImeData)) != 0) + g.IO.SetPlatformImeDataFn(GetMainViewport(), &g.PlatformImeData); // Hide implicit/fallback "Debug" window if it hasn't been used g.WithinFrameScopeWithImplicitWindow = false; @@ -4523,10 +5198,9 @@ void ImGui::EndFrame() g.IO.Fonts->Locked = false; // Clear Input data for next frame + g.IO.AppFocusLost = false; g.IO.MouseWheel = g.IO.MouseWheelH = 0.0f; g.IO.InputQueueCharacters.resize(0); - g.IO.KeyModsPrev = g.IO.KeyMods; // doing it here is better than in NewFrame() as we'll tolerate backend writing to KeyMods. If we want to firmly disallow it we should detect it. - memset(g.IO.NavInputs, 0, sizeof(g.IO.NavInputs)); CallContextHooks(&g, ImGuiContextHookType_EndFramePost); } @@ -4541,6 +5215,7 @@ void ImGui::Render() if (g.FrameCountEnded != g.FrameCount) EndFrame(); + const bool first_render_of_frame = (g.FrameCountRendered != g.FrameCount); g.FrameCountRendered = g.FrameCount; g.IO.MetricsRenderWindows = 0; @@ -4555,6 +5230,10 @@ void ImGui::Render() AddDrawListToDrawData(&viewport->DrawDataBuilder.Layers[0], GetBackgroundDrawList(viewport)); } + // Draw modal/window whitening backgrounds + if (first_render_of_frame) + RenderDimmedBackgrounds(); + // Add ImDrawList to render ImGuiWindow* windows_to_render_top_most[2]; windows_to_render_top_most[0] = (g.NavWindowingTarget && !(g.NavWindowingTarget->Flags & ImGuiWindowFlags_NoBringToFrontOnFocus)) ? g.NavWindowingTarget->RootWindow : NULL; @@ -4570,6 +5249,10 @@ void ImGui::Render() if (windows_to_render_top_most[n] && IsWindowActiveAndVisible(windows_to_render_top_most[n])) // NavWindowingTarget is always temporarily displayed as the top-most window AddRootWindowToDrawData(windows_to_render_top_most[n]); + // Draw software mouse cursor if requested by io.MouseDrawCursor flag + if (g.IO.MouseDrawCursor && first_render_of_frame && g.MouseCursor != ImGuiMouseCursor_None) + RenderMouseCursor(g.IO.MousePos, g.Style.MouseCursorScale, g.MouseCursor, IM_COL32_WHITE, IM_COL32_BLACK, IM_COL32(0, 0, 0, 48)); + // Setup ImDrawData structures for end-user g.IO.MetricsRenderVertices = g.IO.MetricsRenderIndices = 0; for (int n = 0; n < g.Viewports.Size; n++) @@ -4577,10 +5260,6 @@ void ImGui::Render() ImGuiViewportP* viewport = g.Viewports[n]; viewport->DrawDataBuilder.FlattenIntoSingleLayer(); - // Draw software mouse cursor if requested by io.MouseDrawCursor flag - if (g.IO.MouseDrawCursor) - RenderMouseCursor(GetForegroundDrawList(viewport), g.IO.MousePos, g.Style.MouseCursorScale, g.MouseCursor, IM_COL32_WHITE, IM_COL32_BLACK, IM_COL32(0, 0, 0, 48)); - // Add foreground ImDrawList (for each active viewport) if (viewport->DrawLists[1] != NULL) AddDrawListToDrawData(&viewport->DrawDataBuilder.Layers[0], GetForegroundDrawList(viewport)); @@ -4678,269 +5357,44 @@ static void FindHoveredWindow() g.HoveredWindowUnderMovingWindow = hovered_window_ignoring_moving_window; } -// 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) -bool ImGui::IsMouseHoveringRect(const ImVec2& r_min, const ImVec2& r_max, bool clip) +bool ImGui::IsItemActive() { ImGuiContext& g = *GImGui; - - // Clip - ImRect rect_clipped(r_min, r_max); - if (clip) - rect_clipped.ClipWith(g.CurrentWindow->ClipRect); - - // Expand for touch input - const ImRect rect_for_touch(rect_clipped.Min - g.Style.TouchExtraPadding, rect_clipped.Max + g.Style.TouchExtraPadding); - if (!rect_for_touch.Contains(g.IO.MousePos)) - return false; - return true; + if (g.ActiveId) + return g.ActiveId == g.LastItemData.ID; + return false; } -int ImGui::GetKeyIndex(ImGuiKey imgui_key) +bool ImGui::IsItemActivated() { - IM_ASSERT(imgui_key >= 0 && imgui_key < ImGuiKey_COUNT); ImGuiContext& g = *GImGui; - return g.IO.KeyMap[imgui_key]; + if (g.ActiveId) + if (g.ActiveId == g.LastItemData.ID && g.ActiveIdPreviousFrame != g.LastItemData.ID) + return true; + return false; } -// Note that dear imgui doesn't know the semantic of each entry of io.KeysDown[]! -// Use your own indices/enums according to how your backend/engine stored them into io.KeysDown[]! -bool ImGui::IsKeyDown(int user_key_index) +bool ImGui::IsItemDeactivated() { - if (user_key_index < 0) - return false; ImGuiContext& g = *GImGui; - IM_ASSERT(user_key_index >= 0 && user_key_index < IM_ARRAYSIZE(g.IO.KeysDown)); - return g.IO.KeysDown[user_key_index]; -} - -// t0 = previous time (e.g.: g.Time - g.IO.DeltaTime) -// t1 = current time (e.g.: g.Time) -// An event is triggered at: -// t = 0.0f t = repeat_delay, t = repeat_delay + repeat_rate*N -int ImGui::CalcTypematicRepeatAmount(float t0, float t1, float repeat_delay, float repeat_rate) -{ - if (t1 == 0.0f) - return 1; - if (t0 >= t1) - return 0; - if (repeat_rate <= 0.0f) - return (t0 < repeat_delay) && (t1 >= repeat_delay); - const int count_t0 = (t0 < repeat_delay) ? -1 : (int)((t0 - repeat_delay) / repeat_rate); - const int count_t1 = (t1 < repeat_delay) ? -1 : (int)((t1 - repeat_delay) / repeat_rate); - const int count = count_t1 - count_t0; - return count; + if (g.LastItemData.StatusFlags & ImGuiItemStatusFlags_HasDeactivated) + return (g.LastItemData.StatusFlags & ImGuiItemStatusFlags_Deactivated) != 0; + return (g.ActiveIdPreviousFrame == g.LastItemData.ID && g.ActiveIdPreviousFrame != 0 && g.ActiveId != g.LastItemData.ID); } -int ImGui::GetKeyPressedAmount(int key_index, float repeat_delay, float repeat_rate) +bool ImGui::IsItemDeactivatedAfterEdit() { ImGuiContext& g = *GImGui; - if (key_index < 0) - return 0; - IM_ASSERT(key_index >= 0 && key_index < IM_ARRAYSIZE(g.IO.KeysDown)); - const float t = g.IO.KeysDownDuration[key_index]; - return CalcTypematicRepeatAmount(t - g.IO.DeltaTime, t, repeat_delay, repeat_rate); + return IsItemDeactivated() && (g.ActiveIdPreviousFrameHasBeenEditedBefore || (g.ActiveId == 0 && g.ActiveIdHasBeenEditedBefore)); } -bool ImGui::IsKeyPressed(int user_key_index, bool repeat) +// == GetItemID() == GetFocusID() +bool ImGui::IsItemFocused() { ImGuiContext& g = *GImGui; - if (user_key_index < 0) + if (g.NavId != g.LastItemData.ID || g.NavId == 0) return false; - IM_ASSERT(user_key_index >= 0 && user_key_index < IM_ARRAYSIZE(g.IO.KeysDown)); - const float t = g.IO.KeysDownDuration[user_key_index]; - if (t == 0.0f) - return true; - if (repeat && t > g.IO.KeyRepeatDelay) - return GetKeyPressedAmount(user_key_index, g.IO.KeyRepeatDelay, g.IO.KeyRepeatRate) > 0; - return false; -} - -bool ImGui::IsKeyReleased(int user_key_index) -{ - ImGuiContext& g = *GImGui; - if (user_key_index < 0) return false; - IM_ASSERT(user_key_index >= 0 && user_key_index < IM_ARRAYSIZE(g.IO.KeysDown)); - return g.IO.KeysDownDurationPrev[user_key_index] >= 0.0f && !g.IO.KeysDown[user_key_index]; -} - -bool ImGui::IsMouseDown(ImGuiMouseButton button) -{ - ImGuiContext& g = *GImGui; - IM_ASSERT(button >= 0 && button < IM_ARRAYSIZE(g.IO.MouseDown)); - return g.IO.MouseDown[button]; -} - -bool ImGui::IsMouseClicked(ImGuiMouseButton button, bool repeat) -{ - ImGuiContext& g = *GImGui; - IM_ASSERT(button >= 0 && button < IM_ARRAYSIZE(g.IO.MouseDown)); - const float t = g.IO.MouseDownDuration[button]; - if (t == 0.0f) - return true; - - if (repeat && t > g.IO.KeyRepeatDelay) - { - // FIXME: 2019/05/03: Our old repeat code was wrong here and led to doubling the repeat rate, which made it an ok rate for repeat on mouse hold. - int amount = CalcTypematicRepeatAmount(t - g.IO.DeltaTime, t, g.IO.KeyRepeatDelay, g.IO.KeyRepeatRate * 0.50f); - if (amount > 0) - return true; - } - return false; -} - -bool ImGui::IsMouseReleased(ImGuiMouseButton button) -{ - ImGuiContext& g = *GImGui; - IM_ASSERT(button >= 0 && button < IM_ARRAYSIZE(g.IO.MouseDown)); - return g.IO.MouseReleased[button]; -} - -bool ImGui::IsMouseDoubleClicked(ImGuiMouseButton button) -{ - ImGuiContext& g = *GImGui; - IM_ASSERT(button >= 0 && button < IM_ARRAYSIZE(g.IO.MouseDown)); - return g.IO.MouseDoubleClicked[button]; -} - -// Return if a mouse click/drag went past the given threshold. Valid to call during the MouseReleased frame. -// [Internal] This doesn't test if the button is pressed -bool ImGui::IsMouseDragPastThreshold(ImGuiMouseButton button, float lock_threshold) -{ - ImGuiContext& g = *GImGui; - IM_ASSERT(button >= 0 && button < IM_ARRAYSIZE(g.IO.MouseDown)); - if (lock_threshold < 0.0f) - lock_threshold = g.IO.MouseDragThreshold; - return g.IO.MouseDragMaxDistanceSqr[button] >= lock_threshold * lock_threshold; -} - -bool ImGui::IsMouseDragging(ImGuiMouseButton button, float lock_threshold) -{ - ImGuiContext& g = *GImGui; - IM_ASSERT(button >= 0 && button < IM_ARRAYSIZE(g.IO.MouseDown)); - if (!g.IO.MouseDown[button]) - return false; - return IsMouseDragPastThreshold(button, lock_threshold); -} - -ImVec2 ImGui::GetMousePos() -{ - ImGuiContext& g = *GImGui; - return g.IO.MousePos; -} - -// NB: prefer to call right after BeginPopup(). At the time Selectable/MenuItem is activated, the popup is already closed! -ImVec2 ImGui::GetMousePosOnOpeningCurrentPopup() -{ - ImGuiContext& g = *GImGui; - if (g.BeginPopupStack.Size > 0) - return g.OpenPopupStack[g.BeginPopupStack.Size - 1].OpenMousePos; - return g.IO.MousePos; -} - -// We typically use ImVec2(-FLT_MAX,-FLT_MAX) to denote an invalid mouse position. -bool ImGui::IsMousePosValid(const ImVec2* mouse_pos) -{ - // The assert is only to silence a false-positive in XCode Static Analysis. - // Because GImGui is not dereferenced in every code path, the static analyzer assume that it may be NULL (which it doesn't for other functions). - IM_ASSERT(GImGui != NULL); - const float MOUSE_INVALID = -256000.0f; - ImVec2 p = mouse_pos ? *mouse_pos : GImGui->IO.MousePos; - return p.x >= MOUSE_INVALID && p.y >= MOUSE_INVALID; -} - -bool ImGui::IsAnyMouseDown() -{ - ImGuiContext& g = *GImGui; - for (int n = 0; n < IM_ARRAYSIZE(g.IO.MouseDown); n++) - if (g.IO.MouseDown[n]) - return true; - return false; -} - -// Return the delta from the initial clicking position while the mouse button is clicked or was just released. -// This is locked and return 0.0f until the mouse moves past a distance threshold at least once. -// NB: This is only valid if IsMousePosValid(). backends in theory should always keep mouse position valid when dragging even outside the client window. -ImVec2 ImGui::GetMouseDragDelta(ImGuiMouseButton button, float lock_threshold) -{ - ImGuiContext& g = *GImGui; - IM_ASSERT(button >= 0 && button < IM_ARRAYSIZE(g.IO.MouseDown)); - if (lock_threshold < 0.0f) - lock_threshold = g.IO.MouseDragThreshold; - if (g.IO.MouseDown[button] || g.IO.MouseReleased[button]) - if (g.IO.MouseDragMaxDistanceSqr[button] >= lock_threshold * lock_threshold) - if (IsMousePosValid(&g.IO.MousePos) && IsMousePosValid(&g.IO.MouseClickedPos[button])) - return g.IO.MousePos - g.IO.MouseClickedPos[button]; - return ImVec2(0.0f, 0.0f); -} - -void ImGui::ResetMouseDragDelta(ImGuiMouseButton button) -{ - ImGuiContext& g = *GImGui; - IM_ASSERT(button >= 0 && button < IM_ARRAYSIZE(g.IO.MouseDown)); - // NB: We don't need to reset g.IO.MouseDragMaxDistanceSqr - g.IO.MouseClickedPos[button] = g.IO.MousePos; -} - -ImGuiMouseCursor ImGui::GetMouseCursor() -{ - return GImGui->MouseCursor; -} - -void ImGui::SetMouseCursor(ImGuiMouseCursor cursor_type) -{ - GImGui->MouseCursor = cursor_type; -} - -void ImGui::CaptureKeyboardFromApp(bool capture) -{ - GImGui->WantCaptureKeyboardNextFrame = capture ? 1 : 0; -} - -void ImGui::CaptureMouseFromApp(bool capture) -{ - GImGui->WantCaptureMouseNextFrame = capture ? 1 : 0; -} - -bool ImGui::IsItemActive() -{ - ImGuiContext& g = *GImGui; - if (g.ActiveId) - return g.ActiveId == g.LastItemData.ID; - return false; -} - -bool ImGui::IsItemActivated() -{ - ImGuiContext& g = *GImGui; - if (g.ActiveId) - if (g.ActiveId == g.LastItemData.ID && g.ActiveIdPreviousFrame != g.LastItemData.ID) - return true; - return false; -} - -bool ImGui::IsItemDeactivated() -{ - ImGuiContext& g = *GImGui; - if (g.LastItemData.StatusFlags & ImGuiItemStatusFlags_HasDeactivated) - return (g.LastItemData.StatusFlags & ImGuiItemStatusFlags_Deactivated) != 0; - return (g.ActiveIdPreviousFrame == g.LastItemData.ID && g.ActiveIdPreviousFrame != 0 && g.ActiveId != g.LastItemData.ID); -} - -bool ImGui::IsItemDeactivatedAfterEdit() -{ - ImGuiContext& g = *GImGui; - return IsItemDeactivated() && (g.ActiveIdPreviousFrameHasBeenEditedBefore || (g.ActiveId == 0 && g.ActiveIdHasBeenEditedBefore)); -} - -// == GetItemID() == GetFocusID() -bool ImGui::IsItemFocused() -{ - ImGuiContext& g = *GImGui; - if (g.NavId != g.LastItemData.ID || g.NavId == 0) - return false; - return true; + return true; } // Important: this can be useful but it is NOT equivalent to the behavior of e.g.Button()! @@ -4983,7 +5437,7 @@ bool ImGui::IsAnyItemFocused() bool ImGui::IsItemVisible() { ImGuiContext& g = *GImGui; - return g.CurrentWindow->ClipRect.Overlaps(g.LastItemData.Rect); + return (g.LastItemData.StatusFlags & ImGuiItemStatusFlags_Visible) != 0; } bool ImGui::IsItemEdited() @@ -5004,23 +5458,13 @@ void ImGui::SetItemAllowOverlap() g.ActiveIdAllowOverlap = true; } -void ImGui::SetItemUsingMouseWheel() -{ - ImGuiContext& g = *GImGui; - ImGuiID id = g.LastItemData.ID; - if (g.HoveredId == id) - g.HoveredIdUsingMouseWheel = true; - if (g.ActiveId == id) - g.ActiveIdUsingMouseWheel = true; -} - -void ImGui::SetActiveIdUsingNavAndKeys() +// FIXME: It might be undesirable that this will likely disable KeyOwner-aware shortcuts systems. Consider a more fine-tuned version for the two users of this function. +void ImGui::SetActiveIdUsingAllKeyboardKeys() { ImGuiContext& g = *GImGui; IM_ASSERT(g.ActiveId != 0); - g.ActiveIdUsingNavDirMask = ~(ImU32)0; - g.ActiveIdUsingNavInputMask = ~(ImU32)0; - g.ActiveIdUsingKeyInputMask = ~(ImU64)0; + g.ActiveIdUsingNavDirMask = (1 << ImGuiDir_COUNT) - 1; + g.ActiveIdUsingAllKeyboardKeys = true; NavMoveRequestCancel(); } @@ -5055,21 +5499,22 @@ bool ImGui::BeginChildEx(const char* name, ImGuiID id, const ImVec2& size_arg, b ImVec2 size = ImFloor(size_arg); const int auto_fit_axises = ((size.x == 0.0f) ? (1 << ImGuiAxis_X) : 0x00) | ((size.y == 0.0f) ? (1 << ImGuiAxis_Y) : 0x00); if (size.x <= 0.0f) - size.x = ImMax(content_avail.x + size.x, 4.0f); // Arbitrary minimum child size (0.0f causing too much issues) + size.x = ImMax(content_avail.x + size.x, 4.0f); // Arbitrary minimum child size (0.0f causing too many issues) if (size.y <= 0.0f) size.y = ImMax(content_avail.y + size.y, 4.0f); SetNextWindowSize(size); // Build up name. If you need to append to a same child from multiple location in the ID stack, use BeginChild(ImGuiID id) with a stable value. + const char* temp_window_name; if (name) - ImFormatString(g.TempBuffer, IM_ARRAYSIZE(g.TempBuffer), "%s/%s_%08X", parent_window->Name, name, id); + ImFormatStringToTempBuffer(&temp_window_name, NULL, "%s/%s_%08X", parent_window->Name, name, id); else - ImFormatString(g.TempBuffer, IM_ARRAYSIZE(g.TempBuffer), "%s/%08X", parent_window->Name, id); + ImFormatStringToTempBuffer(&temp_window_name, NULL, "%s/%08X", parent_window->Name, id); const float backup_border_size = g.Style.ChildBorderSize; if (!border) g.Style.ChildBorderSize = 0.0f; - bool ret = Begin(g.TempBuffer, NULL, flags); + bool ret = Begin(temp_window_name, NULL, flags); g.Style.ChildBorderSize = backup_border_size; ImGuiWindow* child_window = g.CurrentWindow; @@ -5197,6 +5642,29 @@ static void ApplyWindowSettings(ImGuiWindow* window, ImGuiWindowSettings* settin window->Collapsed = settings->Collapsed; } +static void UpdateWindowInFocusOrderList(ImGuiWindow* window, bool just_created, ImGuiWindowFlags new_flags) +{ + ImGuiContext& g = *GImGui; + + const bool new_is_explicit_child = (new_flags & ImGuiWindowFlags_ChildWindow) != 0 && ((new_flags & ImGuiWindowFlags_Popup) == 0 || (new_flags & ImGuiWindowFlags_ChildMenu) != 0); + const bool child_flag_changed = new_is_explicit_child != window->IsExplicitChild; + if ((just_created || child_flag_changed) && !new_is_explicit_child) + { + IM_ASSERT(!g.WindowsFocusOrder.contains(window)); + g.WindowsFocusOrder.push_back(window); + window->FocusOrder = (short)(g.WindowsFocusOrder.Size - 1); + } + else if (!just_created && child_flag_changed && new_is_explicit_child) + { + IM_ASSERT(g.WindowsFocusOrder[window->FocusOrder] == window); + for (int n = window->FocusOrder + 1; n < g.WindowsFocusOrder.Size; n++) + g.WindowsFocusOrder[n]->FocusOrder--; + g.WindowsFocusOrder.erase(g.WindowsFocusOrder.Data + window->FocusOrder); + window->FocusOrder = -1; + } + window->IsExplicitChild = new_is_explicit_child; +} + static ImGuiWindow* CreateNewWindow(const char* name, ImGuiWindowFlags flags) { ImGuiContext& g = *GImGui; @@ -5220,7 +5688,7 @@ static ImGuiWindow* CreateNewWindow(const char* name, ImGuiWindowFlags flags) SetWindowConditionAllowFlags(window, ImGuiCond_FirstUseEver, false); ApplyWindowSettings(window, settings); } - window->DC.CursorStartPos = window->DC.CursorMaxPos = window->Pos; // So first call to CalcContentSize() 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 ((flags & ImGuiWindowFlags_AlwaysAutoResize) != 0) { @@ -5236,16 +5704,11 @@ static ImGuiWindow* CreateNewWindow(const char* name, ImGuiWindowFlags flags) window->AutoFitOnlyGrows = (window->AutoFitFramesX > 0) || (window->AutoFitFramesY > 0); } - if (!(flags & ImGuiWindowFlags_ChildWindow)) - { - g.WindowsFocusOrder.push_back(window); - window->FocusOrder = (short)(g.WindowsFocusOrder.Size - 1); - } - if (flags & ImGuiWindowFlags_NoBringToFrontOnFocus) g.Windows.push_front(window); // Quite slow but rare and only once else g.Windows.push_back(window); + return window; } @@ -5325,8 +5788,7 @@ static ImVec2 CalcWindowAutoFitSize(ImGuiWindow* window, const ImVec2& size_cont if (is_popup || is_menu) // Popups and menus bypass style.WindowMinSize by default, but we give then a non-zero minimum size to facilitate understanding problematic cases (e.g. empty popups) size_min = ImMin(size_min, ImVec2(4.0f, 4.0f)); - // FIXME-VIEWPORT-WORKAREA: May want to use GetWorkSize() instead of Size depending on the type of windows? - ImVec2 avail_size = ImGui::GetMainViewport()->Size; + ImVec2 avail_size = ImGui::GetMainViewport()->WorkSize; ImVec2 size_auto_fit = ImClamp(size_desired, size_min, ImMax(size_min, avail_size - style.DisplaySafeAreaPadding * 2.0f)); // When the window cannot fit all contents (either because of constraints, either because screen is too small), @@ -5352,11 +5814,11 @@ ImVec2 ImGui::CalcWindowNextAutoFitSize(ImGuiWindow* window) return size_final; } -static ImGuiCol GetWindowBgColorIdxFromFlags(ImGuiWindowFlags flags) +static ImGuiCol GetWindowBgColorIdx(ImGuiWindow* window) { - if (flags & (ImGuiWindowFlags_Tooltip | ImGuiWindowFlags_Popup)) + if (window->Flags & (ImGuiWindowFlags_Tooltip | ImGuiWindowFlags_Popup)) return ImGuiCol_PopupBg; - if (flags & ImGuiWindowFlags_ChildWindow) + if (window->Flags & ImGuiWindowFlags_ChildWindow) return ImGuiCol_ChildBg; return ImGuiCol_WindowBg; } @@ -5440,7 +5902,7 @@ ImGuiID ImGui::GetWindowResizeBorderID(ImGuiWindow* window, ImGuiDir dir) } // Handle resize for: Resize Grips, Borders, Gamepad -// Return true when using auto-fit (double click on resize grip) +// Return true when using auto-fit (double-click on resize grip) static bool ImGui::UpdateWindowManualResize(ImGuiWindow* window, const ImVec2& size_auto_fit, int* border_held, int resize_grip_count, ImU32 resize_grip_col[4], const ImRect& visibility_rect) { ImGuiContext& g = *GImGui; @@ -5448,7 +5910,7 @@ static bool ImGui::UpdateWindowManualResize(ImGuiWindow* window, const ImVec2& s if ((flags & ImGuiWindowFlags_NoResize) || (flags & ImGuiWindowFlags_AlwaysAutoResize) || window->AutoFitFramesX > 0 || window->AutoFitFramesY > 0) return false; - if (window->WasActive == false) // Early out to avoid running this code for e.g. an hidden implicit/fallback Debug window. + if (window->WasActive == false) // Early out to avoid running this code for e.g. a hidden implicit/fallback Debug window. return false; bool ret_auto_fit = false; @@ -5476,12 +5938,13 @@ static bool ImGui::UpdateWindowManualResize(ImGuiWindow* window, const ImVec2& s if (resize_rect.Min.x > resize_rect.Max.x) ImSwap(resize_rect.Min.x, resize_rect.Max.x); if (resize_rect.Min.y > resize_rect.Max.y) ImSwap(resize_rect.Min.y, resize_rect.Max.y); ImGuiID resize_grip_id = window->GetID(resize_grip_n); // == GetWindowResizeCornerID() + ItemAdd(resize_rect, resize_grip_id, NULL, ImGuiItemFlags_NoNav); ButtonBehavior(resize_rect, resize_grip_id, &hovered, &held, ImGuiButtonFlags_FlattenChildren | ImGuiButtonFlags_NoNavFocus); //GetForegroundDrawList(window)->AddRect(resize_rect.Min, resize_rect.Max, IM_COL32(255, 255, 0, 255)); if (hovered || held) g.MouseCursor = (resize_grip_n & 1) ? ImGuiMouseCursor_ResizeNESW : ImGuiMouseCursor_ResizeNWSE; - if (held && g.IO.MouseDoubleClicked[0] && resize_grip_n == 0) + if (held && g.IO.MouseClickedCount[0] == 2 && resize_grip_n == 0) { // Manual auto-fit when double-clicking size_target = CalcWindowSizeAfterConstraint(window, size_auto_fit); @@ -5511,7 +5974,8 @@ static bool ImGui::UpdateWindowManualResize(ImGuiWindow* window, const ImVec2& s bool hovered, held; ImRect border_rect = GetResizeBorderRect(window, border_n, grip_hover_inner_size, WINDOWS_HOVER_PADDING); ImGuiID border_id = window->GetID(border_n + 4); // == GetWindowResizeBorderID() - ButtonBehavior(border_rect, border_id, &hovered, &held, ImGuiButtonFlags_FlattenChildren); + ItemAdd(border_rect, border_id, NULL, ImGuiItemFlags_NoNav); + ButtonBehavior(border_rect, border_id, &hovered, &held, ImGuiButtonFlags_FlattenChildren | ImGuiButtonFlags_NoNavFocus); //GetForegroundDrawLists(window)->AddRect(border_rect.Min, border_rect.Max, IM_COL32(255, 255, 0, 255)); if ((hovered && g.HoveredIdTimer > WINDOWS_RESIZE_FROM_EDGES_FEEDBACK_TIMER) || held) { @@ -5535,23 +5999,31 @@ static bool ImGui::UpdateWindowManualResize(ImGuiWindow* window, const ImVec2& s window->DC.NavLayerCurrent = ImGuiNavLayer_Main; // Navigation resize (keyboard/gamepad) + // FIXME: This cannot be moved to NavUpdateWindowing() because CalcWindowSizeAfterConstraint() need to callback into user. + // Not even sure the callback works here. if (g.NavWindowingTarget && g.NavWindowingTarget->RootWindow == window) { - ImVec2 nav_resize_delta; + ImVec2 nav_resize_dir; if (g.NavInputSource == ImGuiInputSource_Keyboard && g.IO.KeyShift) - nav_resize_delta = GetNavInputAmount2d(ImGuiNavDirSourceFlags_Keyboard, ImGuiInputReadMode_Down); + nav_resize_dir = GetKeyVector2d(ImGuiKey_LeftArrow, ImGuiKey_RightArrow, ImGuiKey_UpArrow, ImGuiKey_DownArrow); if (g.NavInputSource == ImGuiInputSource_Gamepad) - nav_resize_delta = GetNavInputAmount2d(ImGuiNavDirSourceFlags_PadDPad, ImGuiInputReadMode_Down); - if (nav_resize_delta.x != 0.0f || nav_resize_delta.y != 0.0f) + nav_resize_dir = GetKeyVector2d(ImGuiKey_GamepadDpadLeft, ImGuiKey_GamepadDpadRight, ImGuiKey_GamepadDpadUp, ImGuiKey_GamepadDpadDown); + if (nav_resize_dir.x != 0.0f || nav_resize_dir.y != 0.0f) { const float NAV_RESIZE_SPEED = 600.0f; - nav_resize_delta *= ImFloor(NAV_RESIZE_SPEED * g.IO.DeltaTime * ImMin(g.IO.DisplayFramebufferScale.x, g.IO.DisplayFramebufferScale.y)); - nav_resize_delta = ImMax(nav_resize_delta, visibility_rect.Min - window->Pos - window->Size); + const float resize_step = NAV_RESIZE_SPEED * g.IO.DeltaTime * ImMin(g.IO.DisplayFramebufferScale.x, g.IO.DisplayFramebufferScale.y); + g.NavWindowingAccumDeltaSize += nav_resize_dir * resize_step; + g.NavWindowingAccumDeltaSize = ImMax(g.NavWindowingAccumDeltaSize, visibility_rect.Min - window->Pos - window->Size); // We need Pos+Size >= visibility_rect.Min, so Size >= visibility_rect.Min - Pos, so size_delta >= visibility_rect.Min - window->Pos - window->Size g.NavWindowingToggleLayer = false; g.NavDisableMouseHover = true; resize_grip_col[0] = GetColorU32(ImGuiCol_ResizeGripActive); - // FIXME-NAV: Should store and accumulate into a separate size buffer to handle sizing constraints properly, right now a constraint will make us stuck. - size_target = CalcWindowSizeAfterConstraint(window, window->SizeFull + nav_resize_delta); + ImVec2 accum_floored = ImFloor(g.NavWindowingAccumDeltaSize); + if (accum_floored.x != 0.0f || accum_floored.y != 0.0f) + { + // FIXME-NAV: Should store and accumulate into a separate size buffer to handle sizing constraints properly, right now a constraint will make us stuck. + size_target = CalcWindowSizeAfterConstraint(window, window->SizeFull + accum_floored); + g.NavWindowingAccumDeltaSize -= accum_floored; + } } } @@ -5571,7 +6043,7 @@ static bool ImGui::UpdateWindowManualResize(ImGuiWindow* window, const ImVec2& s return ret_auto_fit; } -static inline void ClampWindowRect(ImGuiWindow* window, const ImRect& visibility_rect) +static inline void ClampWindowPos(ImGuiWindow* window, const ImRect& visibility_rect) { ImGuiContext& g = *GImGui; ImVec2 size_for_clamping = window->Size; @@ -5617,7 +6089,7 @@ void ImGui::RenderWindowDecorations(ImGuiWindow* window, const ImRect& title_bar window->SkipItems = false; // Draw window + handle manual resize - // As we highlight the title bar when want_focus is set, multiple reappearing windows will have have their title bar highlighted on their reappearing frame. + // As we highlight the title bar when want_focus is set, multiple reappearing windows will have their title bar highlighted on their reappearing frame. const float window_rounding = window->WindowRounding; const float window_border_size = window->WindowBorderSize; if (window->Collapsed) @@ -5634,7 +6106,7 @@ void ImGui::RenderWindowDecorations(ImGuiWindow* window, const ImRect& title_bar // Window background if (!(flags & ImGuiWindowFlags_NoBackground)) { - ImU32 bg_col = GetColorU32(GetWindowBgColorIdxFromFlags(flags)); + ImU32 bg_col = GetColorU32(GetWindowBgColorIdx(window)); bool override_alpha = false; float alpha = 1.0f; if (g.NextWindowData.Flags & ImGuiNextWindowDataFlags_HasBgAlpha) @@ -5700,6 +6172,7 @@ void ImGui::RenderWindowTitleBarContents(ImGuiWindow* window, const ImRect& titl const bool has_collapse_button = !(flags & ImGuiWindowFlags_NoCollapse) && (style.WindowMenuButtonPosition != ImGuiDir_None); // Close & Collapse button are on the Menu NavLayer and don't default focus (unless there's nothing else on that layer) + // FIXME-NAV: Might want (or not?) to set the equivalent of ImGuiButtonFlags_NoNavFocus so that mouse clicks on standard title bar items don't necessarily set nav/keyboard ref? const ImGuiItemFlags item_flags_backup = g.CurrentItemFlags; g.CurrentItemFlags |= ImGuiItemFlags_NoNavDefaultFocus; window->DC.NavLayerCurrent = ImGuiNavLayer_Menu; @@ -5794,6 +6267,38 @@ void ImGui::UpdateWindowParentAndRootLinks(ImGuiWindow* window, ImGuiWindowFlags } } +// When a modal popup is open, newly created windows that want focus (i.e. are not popups and do not specify ImGuiWindowFlags_NoFocusOnAppearing) +// should be positioned behind that modal window, unless the window was created inside the modal begin-stack. +// In case of multiple stacked modals newly created window honors begin stack order and does not go below its own modal parent. +// - Window // FindBlockingModal() returns Modal1 +// - Window // .. returns Modal1 +// - Modal1 // .. returns Modal2 +// - Window // .. returns Modal2 +// - Window // .. returns Modal2 +// - Modal2 // .. returns Modal2 +static ImGuiWindow* ImGui::FindBlockingModal(ImGuiWindow* window) +{ + ImGuiContext& g = *GImGui; + if (g.OpenPopupStack.Size <= 0) + return NULL; + + // Find a modal that has common parent with specified window. Specified window should be positioned behind that modal. + for (int i = g.OpenPopupStack.Size - 1; i >= 0; i--) + { + ImGuiWindow* popup_window = g.OpenPopupStack.Data[i].Window; + if (popup_window == NULL || !(popup_window->Flags & ImGuiWindowFlags_Modal)) + continue; + if (!popup_window->Active && !popup_window->WasActive) // Check WasActive, because this code may run before popup renders on current frame, also check Active to handle newly created windows. + continue; + if (IsWindowWithinBeginStackOf(window, popup_window)) // Window is rendered over last modal, no render order change needed. + break; + for (ImGuiWindow* parent = popup_window->ParentWindowInBeginStack->RootWindow; parent != NULL; parent = parent->ParentWindowInBeginStack->RootWindow) + if (IsWindowWithinBeginStackOf(window, parent)) + return popup_window; // Place window above its begin stack parent. + } + return NULL; +} + // Push a new Dear ImGui window to add widgets to. // - A default window called "Debug" is automatically stacked at the beginning of every frame so you can use widgets without explicitly calling a Begin/End pair. // - Begin/End can be called multiple times during the frame with the same window name to append content. @@ -5841,6 +6346,7 @@ bool ImGui::Begin(const char* name, bool* p_open, ImGuiWindowFlags flags) // Update Flags, LastFrameActive, BeginOrderXXX fields if (first_begin_of_the_frame) { + UpdateWindowInFocusOrderList(window, window_just_created, flags); window->Flags = (ImGuiWindowFlags)flags; window->LastFrameActive = current_frame; window->LastTimeActive = (float)g.Time; @@ -5869,20 +6375,31 @@ bool ImGui::Begin(const char* name, bool* p_open, ImGuiWindowFlags flags) window_stack_data.ParentLastItemDataBackup = g.LastItemData; window_stack_data.StackSizesOnBegin.SetToCurrentState(); g.CurrentWindowStack.push_back(window_stack_data); + if (flags & ImGuiWindowFlags_ChildMenu) + g.BeginMenuCount++; + + // Update ->RootWindow and others pointers (before any possible call to FocusWindow) + if (first_begin_of_the_frame) + { + UpdateWindowParentAndRootLinks(window, flags, parent_window); + window->ParentWindowInBeginStack = parent_window_in_stack; + } + + // Add to focus scope stack + PushFocusScope(window->ID); + window->NavRootFocusScopeId = g.CurrentFocusScopeId; g.CurrentWindow = NULL; + // Add to popup stack if (flags & ImGuiWindowFlags_Popup) { ImGuiPopupData& popup_ref = g.OpenPopupStack[g.BeginPopupStack.Size]; popup_ref.Window = window; + popup_ref.ParentNavLayer = parent_window_in_stack->DC.NavLayerCurrent; g.BeginPopupStack.push_back(popup_ref); window->PopupId = popup_ref.PopupId; } - // Update ->RootWindow and others pointers (before any possible call to FocusWindow) - if (first_begin_of_the_frame) - UpdateWindowParentAndRootLinks(window, flags, parent_window); - // Process SetNextWindow***() calls // (FIXME: Consider splitting the HasXXX flags into X/Y components bool window_pos_set_by_api = false; @@ -5938,6 +6455,7 @@ bool ImGui::Begin(const char* name, bool* p_open, ImGuiWindowFlags flags) { // Initialize const bool window_is_child_tooltip = (flags & ImGuiWindowFlags_ChildWindow) && (flags & ImGuiWindowFlags_Tooltip); // FIXME-WIP: Undocumented behavior of Child+Tooltip for pinned tooltip (#1345) + const bool window_just_appearing_after_hidden_for_resize = (window->HiddenFramesCannotSkipItems > 0); window->Active = true; window->HasCloseButton = (p_open != NULL); window->ClipRect = ImVec4(-FLT_MAX, -FLT_MAX, +FLT_MAX, +FLT_MAX); @@ -5964,7 +6482,6 @@ bool ImGui::Begin(const char* name, bool* p_open, ImGuiWindowFlags flags) // UPDATE CONTENTS SIZE, UPDATE HIDDEN STATUS // Update contents size from last frame for auto-fitting (or use explicit size) - const bool window_just_appearing_after_hidden_for_resize = (window->HiddenFramesCannotSkipItems > 0); CalcWindowContentSizes(window, &window->ContentSize, &window->ContentSizeIdeal); if (window->HiddenFramesCanSkipItems > 0) window->HiddenFramesCanSkipItems--; @@ -5994,6 +6511,9 @@ bool ImGui::Begin(const char* name, bool* p_open, ImGuiWindowFlags flags) // SELECT VIEWPORT // FIXME-VIEWPORT: In the docking/viewport branch, this is the point where we select the current viewport (which may affect the style) + + ImGuiViewportP* viewport = (ImGuiViewportP*)(void*)GetMainViewport(); + SetWindowViewport(window, viewport); SetCurrentWindow(window); // LOCK BORDER SIZE AND PADDING FOR THE FRAME (so that altering them doesn't cause inconsistencies) @@ -6010,17 +6530,22 @@ bool ImGui::Begin(const char* name, bool* p_open, ImGuiWindowFlags flags) window->DC.MenuBarOffset.x = ImMax(ImMax(window->WindowPadding.x, style.ItemSpacing.x), g.NextWindowData.MenuBarOffsetMinVal.x); window->DC.MenuBarOffset.y = g.NextWindowData.MenuBarOffsetMinVal.y; + bool use_current_size_for_scrollbar_x = window_just_created; + bool use_current_size_for_scrollbar_y = window_just_created; + // Collapse window by double-clicking on title bar // At this point we don't have a clipping rectangle setup yet, so we can use the title bar area for hit detection and drawing if (!(flags & ImGuiWindowFlags_NoTitleBar) && !(flags & ImGuiWindowFlags_NoCollapse)) { // We don't use a regular button+id to test for double-click on title bar (mostly due to legacy reason, could be fixed), so verify that we don't have items over the title bar. ImRect title_bar_rect = window->TitleBarRect(); - if (g.HoveredWindow == window && g.HoveredId == 0 && g.HoveredIdPreviousFrame == 0 && IsMouseHoveringRect(title_bar_rect.Min, title_bar_rect.Max) && g.IO.MouseDoubleClicked[0]) + if (g.HoveredWindow == window && g.HoveredId == 0 && g.HoveredIdPreviousFrame == 0 && IsMouseHoveringRect(title_bar_rect.Min, title_bar_rect.Max) && g.IO.MouseClickedCount[0] == 2) window->WantCollapseToggle = true; if (window->WantCollapseToggle) { window->Collapsed = !window->Collapsed; + if (!window->Collapsed) + use_current_size_for_scrollbar_y = true; MarkIniSettingsDirty(window); } } @@ -6034,8 +6559,6 @@ bool ImGui::Begin(const char* name, bool* p_open, ImGuiWindowFlags flags) // Calculate auto-fit size, handle automatic resize const ImVec2 size_auto_fit = CalcWindowAutoFitSize(window, window->ContentSizeIdeal); - bool use_current_size_for_scrollbar_x = window_just_created; - bool use_current_size_for_scrollbar_y = window_just_created; if ((flags & ImGuiWindowFlags_AlwaysAutoResize) && !window->Collapsed) { // Using SetNextWindowSize() overrides ImGuiWindowFlags_AlwaysAutoResize, so it can be used on tooltips/popups, etc. @@ -6107,7 +6630,6 @@ bool ImGui::Begin(const char* name, bool* p_open, ImGuiWindowFlags flags) // Calculate the range of allowed position for that window (to be movable and visible past safe area padding) // When clamping to stay visible, we will enforce that window->Pos stays inside of visibility_rect. - ImGuiViewportP* viewport = (ImGuiViewportP*)(void*)GetMainViewport(); ImRect viewport_rect(viewport->GetMainRect()); ImRect viewport_work_rect(viewport->GetWorkRect()); ImVec2 visibility_padding = ImMax(style.DisplayWindowPadding, style.DisplaySafeAreaPadding); @@ -6115,9 +6637,9 @@ bool ImGui::Begin(const char* name, bool* p_open, ImGuiWindowFlags flags) // Clamp position/size so window stays visible within its viewport or monitor // Ignore zero-sized display explicitly to avoid losing positions if a window manager reports zero-sized window when initializing or minimizing. - if (!window_pos_set_by_api && !(flags & ImGuiWindowFlags_ChildWindow) && window->AutoFitFramesX <= 0 && window->AutoFitFramesY <= 0) + if (!window_pos_set_by_api && !(flags & ImGuiWindowFlags_ChildWindow)) if (viewport_rect.GetWidth() > 0.0f && viewport_rect.GetHeight() > 0.0f) - ClampWindowRect(window, visibility_rect); + ClampWindowPos(window, visibility_rect); window->Pos = ImFloor(window->Pos); // Lock window rounding for the frame (so that altering them doesn't cause inconsistencies) @@ -6136,8 +6658,36 @@ bool ImGui::Begin(const char* name, bool* p_open, ImGuiWindowFlags flags) want_focus = true; else if ((flags & (ImGuiWindowFlags_ChildWindow | ImGuiWindowFlags_Tooltip)) == 0) want_focus = true; + + ImGuiWindow* modal = GetTopMostPopupModal(); + if (modal != NULL && !IsWindowWithinBeginStackOf(window, modal)) + { + // Avoid focusing a window that is created outside of active modal. This will prevent active modal from being closed. + // Since window is not focused it would reappear at the same display position like the last time it was visible. + // In case of completely new windows it would go to the top (over current modal), but input to such window would still be blocked by modal. + // Position window behind a modal that is not a begin-parent of this window. + want_focus = false; + if (window == window->RootWindow) + { + ImGuiWindow* blocking_modal = FindBlockingModal(window); + IM_ASSERT(blocking_modal != NULL); + BringWindowToDisplayBehind(window, blocking_modal); + } + } } + // [Test Engine] Register whole window in the item system +#ifdef IMGUI_ENABLE_TEST_ENGINE + if (g.TestEngineHookItems) + { + IM_ASSERT(window->IDStack.Size == 1); + window->IDStack.Size = 0; // As window->IDStack[0] == window->ID here, make sure TestEngine doesn't erroneously see window as parent of itself. + IMGUI_TEST_ENGINE_ITEM_ADD(window->Rect(), window->ID); + IMGUI_TEST_ENGINE_ITEM_INFO(window->ID, window->Name, (g.HoveredWindow == window) ? ImGuiItemStatusFlags_HoveredRect : 0); + window->IDStack.Size = 1; + } +#endif + // Handle manual resize: Resize Grips, Borders, Gamepad int border_held = -1; ImU32 resize_grip_col[4] = {}; @@ -6169,7 +6719,7 @@ bool ImGui::Begin(const char* name, bool* p_open, ImGuiWindowFlags flags) } // UPDATE RECTANGLES (1- THOSE NOT AFFECTED BY SCROLLING) - // Update various regions. Variables they depends on should be set above in this function. + // Update various regions. Variables they depend on should be set above in this function. // We set this up after processing the resize grip so that our rectangles doesn't lag by a frame. // Outer rectangle @@ -6186,7 +6736,7 @@ bool ImGui::Begin(const char* name, bool* p_open, ImGuiWindowFlags flags) // Inner rectangle // Not affected by window border size. Used by: // - InnerClipRect - // - ScrollToBringRectIntoView() + // - ScrollToRectEx() // - NavUpdatePageUpPageDown() // - Scrollbar() window->InnerRect.Min.x = window->Pos.x; @@ -6233,24 +6783,6 @@ bool ImGui::Begin(const char* name, bool* p_open, ImGuiWindowFlags flags) window->DrawList->PushTextureID(g.Font->ContainerAtlas->TexID); PushClipRect(host_rect.Min, host_rect.Max, false); - // Draw modal window background (darkens what is behind them, all viewports) - const bool dim_bg_for_modal = (flags & ImGuiWindowFlags_Modal) && window == GetTopMostPopupModal() && window->HiddenFramesCannotSkipItems <= 0; - const bool dim_bg_for_window_list = g.NavWindowingTargetAnim && (window == g.NavWindowingTargetAnim->RootWindow); - if (dim_bg_for_modal || dim_bg_for_window_list) - { - const ImU32 dim_bg_col = GetColorU32(dim_bg_for_modal ? ImGuiCol_ModalWindowDimBg : ImGuiCol_NavWindowingDimBg, g.DimBgRatio); - window->DrawList->AddRectFilled(viewport_rect.Min, viewport_rect.Max, dim_bg_col); - } - - // Draw navigation selection/windowing rectangle background - if (dim_bg_for_window_list && window == g.NavWindowingTargetAnim) - { - ImRect bb = window->Rect(); - bb.Expand(g.FontSize); - if (!bb.Contains(viewport_rect)) // Avoid drawing if the window covers all the viewport anyway - window->DrawList->AddRectFilled(bb.Min, bb.Max, GetColorU32(ImGuiCol_NavWindowingHighlight, g.NavWindowingHighlightAlpha * 0.25f), g.Style.WindowRounding); - } - // Child windows can render their decoration (bg color, border, scrollbars, etc.) within their parent to save a draw call (since 1.71) // When using overlapping child windows, this will break the assumption that child z-order is mapped to submission order. // FIXME: User code may rely on explicit sorting of overlapping child window and would need to disable this somehow. Please get in contact if you are affected (github #4493) @@ -6278,20 +6810,6 @@ bool ImGui::Begin(const char* name, bool* p_open, ImGuiWindowFlags flags) window->DrawList = &window->DrawListInst; } - // Draw navigation selection/windowing rectangle border - if (g.NavWindowingTargetAnim == window) - { - float rounding = ImMax(window->WindowRounding, g.Style.WindowRounding); - ImRect bb = window->Rect(); - bb.Expand(g.FontSize); - if (bb.Contains(viewport_rect)) // If a window fits the entire viewport, adjust its highlight inward - { - bb.Expand(-g.FontSize - 1.0f); - rounding = window->WindowRounding; - } - window->DrawList->AddRect(bb.Min, bb.Max, GetColorU32(ImGuiCol_NavWindowingHighlight, g.NavWindowingHighlightAlpha), rounding, 0, 3.0f); - } - // UPDATE RECTANGLES (2- THOSE AFFECTED BY SCROLLING) // Work rectangle. @@ -6323,13 +6841,20 @@ bool ImGui::Begin(const char* name, bool* p_open, ImGuiWindowFlags flags) window->DC.Indent.x = 0.0f + window->WindowPadding.x - window->Scroll.x; window->DC.GroupOffset.x = 0.0f; window->DC.ColumnsOffset.x = 0.0f; - window->DC.CursorStartPos = window->Pos + ImVec2(window->DC.Indent.x + window->DC.ColumnsOffset.x, decoration_up_height + window->WindowPadding.y - window->Scroll.y); + + // Record the loss of precision of CursorStartPos which can happen due to really large scrolling amount. + // This is used by clipper to compensate and fix the most common use case of large scroll area. Easy and cheap, next best thing compared to switching everything to double or ImU64. + double start_pos_highp_x = (double)window->Pos.x + window->WindowPadding.x - (double)window->Scroll.x + window->DC.ColumnsOffset.x; + double start_pos_highp_y = (double)window->Pos.y + window->WindowPadding.y - (double)window->Scroll.y + decoration_up_height; + window->DC.CursorStartPos = ImVec2((float)start_pos_highp_x, (float)start_pos_highp_y); + window->DC.CursorStartPosLossyness = ImVec2((float)(start_pos_highp_x - window->DC.CursorStartPos.x), (float)(start_pos_highp_y - window->DC.CursorStartPos.y)); window->DC.CursorPos = window->DC.CursorStartPos; window->DC.CursorPosPrevLine = window->DC.CursorPos; window->DC.CursorMaxPos = window->DC.CursorStartPos; window->DC.IdealMaxPos = window->DC.CursorStartPos; window->DC.CurrLineSize = window->DC.PrevLineSize = ImVec2(0.0f, 0.0f); window->DC.CurrLineTextBaseOffset = window->DC.PrevLineTextBaseOffset = 0.0f; + window->DC.IsSameLine = window->DC.IsSetPos = false; window->DC.NavLayerCurrent = ImGuiNavLayer_Main; window->DC.NavLayersActiveMask = window->DC.NavLayersActiveMaskNext; @@ -6346,7 +6871,6 @@ bool ImGui::Begin(const char* name, bool* p_open, ImGuiWindowFlags flags) window->DC.CurrentColumns = NULL; window->DC.LayoutType = ImGuiLayoutType_Vertical; window->DC.ParentLayoutType = parent_window ? parent_window->DC.LayoutType : ImGuiLayoutType_Vertical; - window->DC.FocusCounterRegular = window->DC.FocusCounterTabStop = -1; window->DC.ItemWidth = window->ItemWidthDefault; window->DC.TextWrapPos = -1.0f; // disabled @@ -6378,17 +6902,21 @@ bool ImGui::Begin(const char* name, bool* p_open, ImGuiWindowFlags flags) /* //if (g.NavWindow == window && g.ActiveId == 0) if (g.ActiveId == window->MoveId) - if (g.IO.KeyCtrl && IsKeyPressedMap(ImGuiKey_C)) + if (g.IO.KeyCtrl && IsKeyPressed(ImGuiKey_C)) LogToClipboard(); */ // We fill last item data based on Title Bar/Tab, in order for IsItemHovered() and IsItemActive() to be usable after Begin(). // This is useful to allow creating context menus on title bar only, etc. - g.LastItemData.ID = window->MoveId; - g.LastItemData.InFlags = g.CurrentItemFlags; - g.LastItemData.StatusFlags = IsMouseHoveringRect(title_bar_rect.Min, title_bar_rect.Max, false) ? ImGuiItemStatusFlags_HoveredRect : 0; - g.LastItemData.Rect = title_bar_rect; + SetLastItemData(window->MoveId, g.CurrentItemFlags, IsMouseHoveringRect(title_bar_rect.Min, title_bar_rect.Max, false) ? ImGuiItemStatusFlags_HoveredRect : 0, title_bar_rect); + + // [DEBUG] +#ifndef IMGUI_DISABLE_DEBUG_TOOLS + if (g.DebugLocateId != 0 && (window->ID == g.DebugLocateId || window->MoveId == g.DebugLocateId)) + DebugLocateItemResolveWithLastItem(); +#endif + // [Test Engine] Register title bar / tab #ifdef IMGUI_ENABLE_TEST_ENGINE if (!(window->Flags & ImGuiWindowFlags_NoTitleBar)) IMGUI_TEST_ENGINE_ITEM_ADD(g.LastItemData.Rect, g.LastItemData.ID); @@ -6400,9 +6928,6 @@ bool ImGui::Begin(const char* name, bool* p_open, ImGuiWindowFlags flags) SetCurrentWindow(window); } - // Pull/inherit current state - window->DC.NavFocusScopeIdCurrent = (flags & ImGuiWindowFlags_ChildWindow) ? parent_window->DC.NavFocusScopeIdCurrent : window->GetID("#FOCUSSCOPE"); // Inherit from parent only // -V595 - PushClipRect(window->InnerClipRect.Min, window->InnerClipRect.Max, true); // Clear 'accessed' flag last thing (After PushClipRect which will set the flag. We want the flag to stay false when the default "Debug" window is unused) @@ -6419,9 +6944,12 @@ bool ImGui::Begin(const char* name, bool* p_open, ImGuiWindowFlags flags) // Mark them as collapsed so commands are skipped earlier (we can't manually collapse them because they have no title bar). IM_ASSERT((flags & ImGuiWindowFlags_NoTitleBar) != 0); if (!(flags & ImGuiWindowFlags_AlwaysAutoResize) && window->AutoFitFramesX <= 0 && window->AutoFitFramesY <= 0) // FIXME: Doesn't make sense for ChildWindow?? - if (!g.LogEnabled) + { + const bool nav_request = (flags & ImGuiWindowFlags_NavFlattened) && (g.NavAnyRequest && g.NavWindow && g.NavWindow->RootWindowForNav == window->RootWindowForNav); + if (!g.LogEnabled && !nav_request) if (window->OuterRectClipped.Min.x >= window->OuterRectClipped.Max.x || window->OuterRectClipped.Min.y >= window->OuterRectClipped.Max.y) window->HiddenFramesCanSkipItems = 1; + } // Hide along with parent or if parent is collapsed if (parent_window && (parent_window->Collapsed || parent_window->HiddenFramesCanSkipItems > 0)) @@ -6435,7 +6963,8 @@ bool ImGui::Begin(const char* name, bool* p_open, ImGuiWindowFlags flags) window->HiddenFramesCanSkipItems = 1; // Update the Hidden flag - window->Hidden = (window->HiddenFramesCanSkipItems > 0) || (window->HiddenFramesCannotSkipItems > 0) || (window->HiddenFramesForRenderOnly > 0); + bool hidden_regular = (window->HiddenFramesCanSkipItems > 0) || (window->HiddenFramesCannotSkipItems > 0); + window->Hidden = hidden_regular || (window->HiddenFramesForRenderOnly > 0); // Disable inputs for requested number of frames if (window->DisableInputsFrames > 0) @@ -6446,7 +6975,7 @@ bool ImGui::Begin(const char* name, bool* p_open, ImGuiWindowFlags flags) // Update the SkipItems flag, used to early out of all items functions (no layout required) bool skip_items = false; - if (window->Collapsed || !window->Active || window->Hidden) + if (window->Collapsed || !window->Active || hidden_regular) if (window->AutoFitFramesX <= 0 && window->AutoFitFramesY <= 0 && window->HiddenFramesCannotSkipItems <= 0) skip_items = true; window->SkipItems = skip_items; @@ -6476,13 +7005,19 @@ void ImGui::End() if (window->DC.CurrentColumns) EndColumns(); PopClipRect(); // Inner window clip rectangle + PopFocusScope(); // Stop logging if (!(window->Flags & ImGuiWindowFlags_ChildWindow)) // FIXME: add more options for scope of logging LogFinish(); + if (window->DC.IsSetPos) + ErrorCheckUsingSetCursorPosToExtendParentBoundaries(); + // Pop from window stack g.LastItemData = g.CurrentWindowStack.back().ParentLastItemDataBackup; + if (window->Flags & ImGuiWindowFlags_ChildMenu) + g.BeginMenuCount--; if (window->Flags & ImGuiWindowFlags_Popup) g.BeginPopupStack.pop_back(); g.CurrentWindowStack.back().StackSizesOnBegin.CompareWithCurrentState(); @@ -6540,6 +7075,34 @@ void ImGui::BringWindowToDisplayBack(ImGuiWindow* window) } } +void ImGui::BringWindowToDisplayBehind(ImGuiWindow* window, ImGuiWindow* behind_window) +{ + IM_ASSERT(window != NULL && behind_window != NULL); + ImGuiContext& g = *GImGui; + window = window->RootWindow; + behind_window = behind_window->RootWindow; + int pos_wnd = FindWindowDisplayIndex(window); + int pos_beh = FindWindowDisplayIndex(behind_window); + if (pos_wnd < pos_beh) + { + size_t copy_bytes = (pos_beh - pos_wnd - 1) * sizeof(ImGuiWindow*); + memmove(&g.Windows.Data[pos_wnd], &g.Windows.Data[pos_wnd + 1], copy_bytes); + g.Windows[pos_beh - 1] = window; + } + else + { + size_t copy_bytes = (pos_wnd - pos_beh) * sizeof(ImGuiWindow*); + memmove(&g.Windows.Data[pos_beh + 1], &g.Windows.Data[pos_beh], copy_bytes); + g.Windows[pos_beh] = window; + } +} + +int ImGui::FindWindowDisplayIndex(ImGuiWindow* window) +{ + ImGuiContext& g = *GImGui; + return g.Windows.index_from_ptr(g.Windows.find(window)); +} + // Moving window to front of display and set focus (which happens to be back of our sorted list) void ImGui::FocusWindow(ImGuiWindow* window) { @@ -6547,20 +7110,17 @@ void ImGui::FocusWindow(ImGuiWindow* window) if (g.NavWindow != window) { - g.NavWindow = window; + SetNavWindow(window); if (window && g.NavDisableMouseHover) g.NavMousePosDirty = true; g.NavId = window ? window->NavLastIds[0] : 0; // Restore NavId - g.NavFocusScopeId = 0; - g.NavIdIsAlive = false; g.NavLayer = ImGuiNavLayer_Main; - g.NavInitRequest = g.NavMoveSubmitted = g.NavMoveScoringItems = false; - NavUpdateAnyRequestFlag(); - //IMGUI_DEBUG_LOG("FocusWindow(\"%s\")\n", window ? window->Name : NULL); - } + g.NavFocusScopeId = window ? window->NavRootFocusScopeId : 0; + g.NavIdIsAlive = false; - // Close popups if any - ClosePopupsOverWindow(window, false); + // Close popups if any + ClosePopupsOverWindow(window, false); + } // Move the root window to the top of the pile IM_ASSERT(window == NULL || window->RootWindow != NULL); @@ -6587,8 +7147,18 @@ void ImGui::FocusWindow(ImGuiWindow* window) void ImGui::FocusTopMostWindowUnderOne(ImGuiWindow* under_this_window, ImGuiWindow* ignore_window) { ImGuiContext& g = *GImGui; - - const int start_idx = ((under_this_window != NULL) ? FindWindowFocusIndex(under_this_window) : g.WindowsFocusOrder.Size) - 1; + int start_idx = g.WindowsFocusOrder.Size - 1; + if (under_this_window != NULL) + { + // Aim at root window behind us, if we are in a child window that's our own root (see #4640) + int offset = -1; + while (under_this_window->Flags & ImGuiWindowFlags_ChildWindow) + { + under_this_window = under_this_window->ParentWindow; + offset = 0; + } + start_idx = FindWindowFocusIndex(under_this_window) + offset; + } for (int i = start_idx; i >= 0; i--) { // We may later decide to test for different NoXXXInputs based on the active navigation input (mouse vs nav) but that may feel more confusing to the user. @@ -6732,9 +7302,14 @@ void ImGui::PopTextWrapPos() static ImGuiWindow* GetCombinedRootWindow(ImGuiWindow* window, bool popup_hierarchy) { - window = window->RootWindow; - if (popup_hierarchy) - window = window->RootWindowPopupTree; + ImGuiWindow* last_window = NULL; + while (last_window != window) + { + last_window = window; + window = window->RootWindow; + if (popup_hierarchy) + window = window->RootWindowPopupTree; + } return window; } @@ -6754,9 +7329,28 @@ bool ImGui::IsWindowChildOf(ImGuiWindow* window, ImGuiWindow* potential_parent, return false; } +bool ImGui::IsWindowWithinBeginStackOf(ImGuiWindow* window, ImGuiWindow* potential_parent) +{ + if (window->RootWindow == potential_parent) + return true; + while (window != NULL) + { + if (window == potential_parent) + return true; + window = window->ParentWindowInBeginStack; + } + return false; +} + bool ImGui::IsWindowAbove(ImGuiWindow* potential_above, ImGuiWindow* potential_below) { ImGuiContext& g = *GImGui; + + // It would be saner to ensure that display layer is always reflected in the g.Windows[] order, which would likely requires altering all manipulations of that array + const int display_layer_delta = GetWindowDisplayLayer(potential_above) - GetWindowDisplayLayer(potential_below); + if (display_layer_delta != 0) + return display_layer_delta > 0; + for (int i = g.Windows.Size - 1; i >= 0; i--) { ImGuiWindow* candidate_window = g.Windows[i]; @@ -6770,7 +7364,7 @@ bool ImGui::IsWindowAbove(ImGuiWindow* potential_above, ImGuiWindow* potential_b bool ImGui::IsWindowHovered(ImGuiHoveredFlags flags) { - IM_ASSERT((flags & ImGuiHoveredFlags_AllowWhenOverlapped) == 0); // Flags not supported by this function + IM_ASSERT((flags & (ImGuiHoveredFlags_AllowWhenOverlapped | ImGuiHoveredFlags_AllowWhenDisabled)) == 0); // Flags not supported by this function ImGuiContext& g = *GImGui; ImGuiWindow* ref_window = g.HoveredWindow; ImGuiWindow* cur_window = g.CurrentWindow; @@ -6811,8 +7405,8 @@ bool ImGui::IsWindowFocused(ImGuiFocusedFlags flags) return false; if (flags & ImGuiFocusedFlags_AnyWindow) return true; - IM_ASSERT(cur_window); // Not inside a Begin()/End() + IM_ASSERT(cur_window); // Not inside a Begin()/End() const bool popup_hierarchy = (flags & ImGuiFocusedFlags_NoPopupHierarchy) == 0; if (flags & ImGuiHoveredFlags_RootWindow) cur_window = GetCombinedRootWindow(cur_window, popup_hierarchy); @@ -6864,6 +7458,9 @@ void ImGui::SetWindowPos(ImGuiWindow* window, const ImVec2& pos, ImGuiCond cond) const ImVec2 old_pos = window->Pos; window->Pos = ImFloor(pos); ImVec2 offset = window->Pos - old_pos; + if (offset.x == 0.0f && offset.y == 0.0f) + return; + MarkIniSettingsDirty(window); window->DC.CursorPos += offset; // As we happen to move the window while it is being appended to (which is a bad idea - will smear) let's at least offset the cursor window->DC.CursorMaxPos += offset; // And more importantly we need to offset CursorMaxPos/CursorStartPos this so ContentSize calculation doesn't get affected. window->DC.IdealMaxPos += offset; @@ -6898,26 +7495,19 @@ void ImGui::SetWindowSize(ImGuiWindow* window, const ImVec2& size, ImGuiCond con window->SetWindowSizeAllowFlags &= ~(ImGuiCond_Once | ImGuiCond_FirstUseEver | ImGuiCond_Appearing); // Set - if (size.x > 0.0f) - { - window->AutoFitFramesX = 0; - window->SizeFull.x = IM_FLOOR(size.x); - } - else - { - window->AutoFitFramesX = 2; + ImVec2 old_size = window->SizeFull; + window->AutoFitFramesX = (size.x <= 0.0f) ? 2 : 0; + window->AutoFitFramesY = (size.y <= 0.0f) ? 2 : 0; + if (size.x <= 0.0f) window->AutoFitOnlyGrows = false; - } - if (size.y > 0.0f) - { - window->AutoFitFramesY = 0; - window->SizeFull.y = IM_FLOOR(size.y); - } else - { - window->AutoFitFramesY = 2; + window->SizeFull.x = IM_FLOOR(size.x); + if (size.y <= 0.0f) window->AutoFitOnlyGrows = false; - } + else + window->SizeFull.y = IM_FLOOR(size.y); + if (old_size.x != window->SizeFull.x || old_size.y != window->SizeFull.y) + MarkIniSettingsDirty(window); } void ImGui::SetWindowSize(const ImVec2& size, ImGuiCond cond) @@ -7096,28 +7686,49 @@ void ImGui::ActivateItem(ImGuiID id) void ImGui::PushFocusScope(ImGuiID id) { ImGuiContext& g = *GImGui; - ImGuiWindow* window = g.CurrentWindow; - g.FocusScopeStack.push_back(window->DC.NavFocusScopeIdCurrent); - window->DC.NavFocusScopeIdCurrent = id; + g.FocusScopeStack.push_back(id); + g.CurrentFocusScopeId = id; } void ImGui::PopFocusScope() { ImGuiContext& g = *GImGui; - ImGuiWindow* window = g.CurrentWindow; IM_ASSERT(g.FocusScopeStack.Size > 0); // Too many PopFocusScope() ? - window->DC.NavFocusScopeIdCurrent = g.FocusScopeStack.back(); g.FocusScopeStack.pop_back(); + g.CurrentFocusScopeId = g.FocusScopeStack.Size ? g.FocusScopeStack.back() : 0; } +// Note: this will likely be called ActivateItem() once we rework our Focus/Activation system! void ImGui::SetKeyboardFocusHere(int offset) { - IM_ASSERT(offset >= -1); // -1 is allowed but not below ImGuiContext& g = *GImGui; ImGuiWindow* window = g.CurrentWindow; - g.TabFocusRequestNextWindow = window; - g.TabFocusRequestNextCounterRegular = window->DC.FocusCounterRegular + 1 + offset; - g.TabFocusRequestNextCounterTabStop = INT_MAX; + IM_ASSERT(offset >= -1); // -1 is allowed but not below + IMGUI_DEBUG_LOG_ACTIVEID("SetKeyboardFocusHere(%d) in window \"%s\"\n", offset, window->Name); + + // It makes sense in the vast majority of cases to never interrupt a drag and drop. + // When we refactor this function into ActivateItem() we may want to make this an option. + // MovingWindow is protected from most user inputs using SetActiveIdUsingNavAndKeys(), but + // is also automatically dropped in the event g.ActiveId is stolen. + if (g.DragDropActive || g.MovingWindow != NULL) + { + IMGUI_DEBUG_LOG_ACTIVEID("SetKeyboardFocusHere() ignored while DragDropActive!\n"); + return; + } + + SetNavWindow(window); + + ImGuiScrollFlags scroll_flags = window->Appearing ? ImGuiScrollFlags_KeepVisibleEdgeX | ImGuiScrollFlags_AlwaysCenterY : ImGuiScrollFlags_KeepVisibleEdgeX | ImGuiScrollFlags_KeepVisibleEdgeY; + NavMoveRequestSubmit(ImGuiDir_None, offset < 0 ? ImGuiDir_Up : ImGuiDir_Down, ImGuiNavMoveFlags_Tabbing | ImGuiNavMoveFlags_FocusApi, scroll_flags); // FIXME-NAV: Once we refactor tabbing, add LegacyApi flag to not activate non-inputable. + if (offset == -1) + { + NavMoveRequestResolveWithLastItem(&g.NavMoveResultLocal); + } + else + { + g.NavTabbingDir = 1; + g.NavTabbingCounter = offset + 1; + } } void ImGui::SetItemDefaultFocus() @@ -7126,15 +7737,17 @@ void ImGui::SetItemDefaultFocus() ImGuiWindow* window = g.CurrentWindow; if (!window->Appearing) return; - if (g.NavWindow == window->RootWindowForNav && (g.NavInitRequest || g.NavInitResultId != 0) && g.NavLayer == window->DC.NavLayerCurrent) - { - g.NavInitRequest = false; - g.NavInitResultId = g.LastItemData.ID; - g.NavInitResultRectRel = ImRect(g.LastItemData.Rect.Min - window->Pos, g.LastItemData.Rect.Max - window->Pos); - NavUpdateAnyRequestFlag(); - if (!IsItemVisible()) - SetScrollHereY(); - } + if (g.NavWindow != window->RootWindowForNav || (!g.NavInitRequest && g.NavInitResultId == 0) || g.NavLayer != window->DC.NavLayerCurrent) + return; + + g.NavInitRequest = false; + g.NavInitResultId = g.LastItemData.ID; + g.NavInitResultRectRel = WindowRectAbsToRel(window, g.LastItemData.Rect); + NavUpdateAnyRequestFlag(); + + // Scroll could be done in NavInitRequestApplyResult() via an opt-in flag (we however don't want regular init requests to scroll) + if (!IsItemVisible()) + ScrollToRectEx(window, g.LastItemData.Rect, ImGuiScrollFlags_None); } void ImGui::SetStateStorage(ImGuiStorage* tree) @@ -7153,7 +7766,7 @@ void ImGui::PushID(const char* str_id) { ImGuiContext& g = *GImGui; ImGuiWindow* window = g.CurrentWindow; - ImGuiID id = window->GetIDNoKeepAlive(str_id); + ImGuiID id = window->GetID(str_id); window->IDStack.push_back(id); } @@ -7161,7 +7774,7 @@ void ImGui::PushID(const char* str_id_begin, const char* str_id_end) { ImGuiContext& g = *GImGui; ImGuiWindow* window = g.CurrentWindow; - ImGuiID id = window->GetIDNoKeepAlive(str_id_begin, str_id_end); + ImGuiID id = window->GetID(str_id_begin, str_id_end); window->IDStack.push_back(id); } @@ -7169,7 +7782,7 @@ void ImGui::PushID(const void* ptr_id) { ImGuiContext& g = *GImGui; ImGuiWindow* window = g.CurrentWindow; - ImGuiID id = window->GetIDNoKeepAlive(ptr_id); + ImGuiID id = window->GetID(ptr_id); window->IDStack.push_back(id); } @@ -7177,7 +7790,7 @@ void ImGui::PushID(int int_id) { ImGuiContext& g = *GImGui; ImGuiWindow* window = g.CurrentWindow; - ImGuiID id = window->GetIDNoKeepAlive(int_id); + ImGuiID id = window->GetID(int_id); window->IDStack.push_back(id); } @@ -7186,6 +7799,8 @@ void ImGui::PushOverrideID(ImGuiID id) { ImGuiContext& g = *GImGui; ImGuiWindow* window = g.CurrentWindow; + if (g.DebugHookIdInfo == id) + DebugHookIdInfo(id, ImGuiDataType_ID, NULL, NULL); window->IDStack.push_back(id); } @@ -7195,11 +7810,9 @@ void ImGui::PushOverrideID(ImGuiID id) ImGuiID ImGui::GetIDWithSeed(const char* str, const char* str_end, ImGuiID seed) { ImGuiID id = ImHashStr(str, str_end ? (str_end - str) : 0, seed); - ImGui::KeepAliveID(id); -#ifdef IMGUI_ENABLE_TEST_ENGINE ImGuiContext& g = *GImGui; - IMGUI_TEST_ENGINE_ID_INFO2(id, ImGuiDataType_String, str, str_end); -#endif + if (g.DebugHookIdInfo == id) + DebugHookIdInfo(id, ImGuiDataType_String, str, str_end); return id; } @@ -7234,10 +7847,817 @@ bool ImGui::IsRectVisible(const ImVec2& size) return window->ClipRect.Overlaps(ImRect(window->DC.CursorPos, window->DC.CursorPos + size)); } -bool ImGui::IsRectVisible(const ImVec2& rect_min, const ImVec2& rect_max) +bool ImGui::IsRectVisible(const ImVec2& rect_min, const ImVec2& rect_max) +{ + ImGuiWindow* window = GImGui->CurrentWindow; + return window->ClipRect.Overlaps(ImRect(rect_min, rect_max)); +} + + +//----------------------------------------------------------------------------- +// [SECTION] INPUTS +//----------------------------------------------------------------------------- + +// 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) +bool ImGui::IsMouseHoveringRect(const ImVec2& r_min, const ImVec2& r_max, bool clip) +{ + ImGuiContext& g = *GImGui; + + // Clip + ImRect rect_clipped(r_min, r_max); + if (clip) + rect_clipped.ClipWith(g.CurrentWindow->ClipRect); + + // Expand for touch input + const ImRect rect_for_touch(rect_clipped.Min - g.Style.TouchExtraPadding, rect_clipped.Max + g.Style.TouchExtraPadding); + if (!rect_for_touch.Contains(g.IO.MousePos)) + return false; + return true; +} + +ImGuiKeyData* ImGui::GetKeyData(ImGuiKey key) +{ + ImGuiContext& g = *GImGui; + + // Special storage location for mods + if (key & ImGuiMod_Mask_) + key = ConvertSingleModFlagToKey(key); + + int index; +#ifndef IMGUI_DISABLE_OBSOLETE_KEYIO + IM_ASSERT(key >= ImGuiKey_LegacyNativeKey_BEGIN && key < ImGuiKey_NamedKey_END); + if (IsLegacyKey(key)) + index = (g.IO.KeyMap[key] != -1) ? g.IO.KeyMap[key] : key; // Remap native->imgui or imgui->native + else + index = key; +#else + IM_ASSERT(IsNamedKey(key) && "Support for user key indices was dropped in favor of ImGuiKey. Please update backend & user code."); + index = key - ImGuiKey_NamedKey_BEGIN; +#endif + return &g.IO.KeysData[index]; +} + +#ifndef IMGUI_DISABLE_OBSOLETE_KEYIO +ImGuiKey ImGui::GetKeyIndex(ImGuiKey key) +{ + ImGuiContext& g = *GImGui; + IM_ASSERT(IsNamedKey(key)); + const ImGuiKeyData* key_data = GetKeyData(key); + return (ImGuiKey)(key_data - g.IO.KeysData); +} +#endif + +// Those names a provided for debugging purpose and are not meant to be saved persistently not compared. +static const char* const GKeyNames[] = +{ + "Tab", "LeftArrow", "RightArrow", "UpArrow", "DownArrow", "PageUp", "PageDown", + "Home", "End", "Insert", "Delete", "Backspace", "Space", "Enter", "Escape", + "LeftCtrl", "LeftShift", "LeftAlt", "LeftSuper", "RightCtrl", "RightShift", "RightAlt", "RightSuper", "Menu", + "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "A", "B", "C", "D", "E", "F", "G", "H", + "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", + "F1", "F2", "F3", "F4", "F5", "F6", "F7", "F8", "F9", "F10", "F11", "F12", + "Apostrophe", "Comma", "Minus", "Period", "Slash", "Semicolon", "Equal", "LeftBracket", + "Backslash", "RightBracket", "GraveAccent", "CapsLock", "ScrollLock", "NumLock", "PrintScreen", + "Pause", "Keypad0", "Keypad1", "Keypad2", "Keypad3", "Keypad4", "Keypad5", "Keypad6", + "Keypad7", "Keypad8", "Keypad9", "KeypadDecimal", "KeypadDivide", "KeypadMultiply", + "KeypadSubtract", "KeypadAdd", "KeypadEnter", "KeypadEqual", + "GamepadStart", "GamepadBack", + "GamepadFaceLeft", "GamepadFaceRight", "GamepadFaceUp", "GamepadFaceDown", + "GamepadDpadLeft", "GamepadDpadRight", "GamepadDpadUp", "GamepadDpadDown", + "GamepadL1", "GamepadR1", "GamepadL2", "GamepadR2", "GamepadL3", "GamepadR3", + "GamepadLStickLeft", "GamepadLStickRight", "GamepadLStickUp", "GamepadLStickDown", + "GamepadRStickLeft", "GamepadRStickRight", "GamepadRStickUp", "GamepadRStickDown", + "MouseLeft", "MouseRight", "MouseMiddle", "MouseX1", "MouseX2", "MouseWheelX", "MouseWheelY", + "ModCtrl", "ModShift", "ModAlt", "ModSuper", // ReservedForModXXX are showing the ModXXX names. +}; +IM_STATIC_ASSERT(ImGuiKey_NamedKey_COUNT == IM_ARRAYSIZE(GKeyNames)); + +const char* ImGui::GetKeyName(ImGuiKey key) +{ +#ifdef IMGUI_DISABLE_OBSOLETE_KEYIO + IM_ASSERT((IsNamedKey(key) || key == ImGuiKey_None) && "Support for user key indices was dropped in favor of ImGuiKey. Please update backend and user code."); +#else + if (IsLegacyKey(key)) + { + ImGuiIO& io = GetIO(); + if (io.KeyMap[key] == -1) + return "N/A"; + IM_ASSERT(IsNamedKey((ImGuiKey)io.KeyMap[key])); + key = (ImGuiKey)io.KeyMap[key]; + } +#endif + if (key == ImGuiKey_None) + return "None"; + if (key & ImGuiMod_Mask_) + key = ConvertSingleModFlagToKey(key); + if (!IsNamedKey(key)) + return "Unknown"; + + return GKeyNames[key - ImGuiKey_NamedKey_BEGIN]; +} + +void ImGui::GetKeyChordName(ImGuiKeyChord key_chord, char* out_buf, int out_buf_size) +{ + ImGuiContext& g = *GImGui; + ImFormatString(out_buf, (size_t)out_buf_size, "%s%s%s%s%s", + (key_chord & ImGuiMod_Ctrl) ? "Ctrl+" : "", + (key_chord & ImGuiMod_Shift) ? "Shift+" : "", + (key_chord & ImGuiMod_Alt) ? "Alt+" : "", + (key_chord & ImGuiMod_Super) ? (g.IO.ConfigMacOSXBehaviors ? "Cmd+" : "Super+") : "", + GetKeyName((ImGuiKey)(key_chord & ~ImGuiMod_Mask_))); +} + +// t0 = previous time (e.g.: g.Time - g.IO.DeltaTime) +// t1 = current time (e.g.: g.Time) +// An event is triggered at: +// t = 0.0f t = repeat_delay, t = repeat_delay + repeat_rate*N +int ImGui::CalcTypematicRepeatAmount(float t0, float t1, float repeat_delay, float repeat_rate) +{ + if (t1 == 0.0f) + return 1; + if (t0 >= t1) + return 0; + if (repeat_rate <= 0.0f) + return (t0 < repeat_delay) && (t1 >= repeat_delay); + const int count_t0 = (t0 < repeat_delay) ? -1 : (int)((t0 - repeat_delay) / repeat_rate); + const int count_t1 = (t1 < repeat_delay) ? -1 : (int)((t1 - repeat_delay) / repeat_rate); + const int count = count_t1 - count_t0; + return count; +} + +void ImGui::GetTypematicRepeatRate(ImGuiInputFlags flags, float* repeat_delay, float* repeat_rate) +{ + ImGuiContext& g = *GImGui; + switch (flags & ImGuiInputFlags_RepeatRateMask_) + { + case ImGuiInputFlags_RepeatRateNavMove: *repeat_delay = g.IO.KeyRepeatDelay * 0.72f; *repeat_rate = g.IO.KeyRepeatRate * 0.80f; return; + case ImGuiInputFlags_RepeatRateNavTweak: *repeat_delay = g.IO.KeyRepeatDelay * 0.72f; *repeat_rate = g.IO.KeyRepeatRate * 0.30f; return; + case ImGuiInputFlags_RepeatRateDefault: default: *repeat_delay = g.IO.KeyRepeatDelay * 1.00f; *repeat_rate = g.IO.KeyRepeatRate * 1.00f; return; + } +} + +// Return value representing the number of presses in the last time period, for the given repeat rate +// (most often returns 0 or 1. The result is generally only >1 when RepeatRate is smaller than DeltaTime, aka large DeltaTime or fast RepeatRate) +int ImGui::GetKeyPressedAmount(ImGuiKey key, float repeat_delay, float repeat_rate) +{ + ImGuiContext& g = *GImGui; + const ImGuiKeyData* key_data = GetKeyData(key); + if (!key_data->Down) // In theory this should already be encoded as (DownDuration < 0.0f), but testing this facilitates eating mechanism (until we finish work on key ownership) + return 0; + const float t = key_data->DownDuration; + return CalcTypematicRepeatAmount(t - g.IO.DeltaTime, t, repeat_delay, repeat_rate); +} + +// Return 2D vector representing the combination of four cardinal direction, with analog value support (for e.g. ImGuiKey_GamepadLStick* values). +ImVec2 ImGui::GetKeyVector2d(ImGuiKey key_left, ImGuiKey key_right, ImGuiKey key_up, ImGuiKey key_down) +{ + return ImVec2( + GetKeyData(key_right)->AnalogValue - GetKeyData(key_left)->AnalogValue, + GetKeyData(key_down)->AnalogValue - GetKeyData(key_up)->AnalogValue); +} + +// owner_id may be None/Any, but routing_id needs to be always be set, so we default to GetCurrentFocusScope(). +static inline ImGuiID GetRoutingIdFromOwnerId(ImGuiID owner_id) +{ + ImGuiContext& g = *GImGui; + return (owner_id != ImGuiKeyOwner_None && owner_id != ImGuiKeyOwner_Any) ? owner_id : g.CurrentFocusScopeId; +} + +ImGuiKeyRoutingData* ImGui::GetShortcutRoutingData(ImGuiKeyChord key_chord) +{ + // Majority of shortcuts will be Key + any number of Mods + // We accept _Single_ mod with ImGuiKey_None. + // - Shortcut(ImGuiKey_S | ImGuiMod_Ctrl); // Legal + // - Shortcut(ImGuiKey_S | ImGuiMod_Ctrl | ImGuiMod_Shift); // Legal + // - Shortcut(ImGuiMod_Ctrl); // Legal + // - Shortcut(ImGuiMod_Ctrl | ImGuiMod_Shift); // Not legal + ImGuiContext& g = *GImGui; + ImGuiKeyRoutingTable* rt = &g.KeysRoutingTable; + ImGuiKeyRoutingData* routing_data; + ImGuiKey key = (ImGuiKey)(key_chord & ~ImGuiMod_Mask_); + ImGuiKey mods = (ImGuiKey)(key_chord & ImGuiMod_Mask_); + if (key == ImGuiKey_None) + key = ConvertSingleModFlagToKey(mods); + IM_ASSERT(IsNamedKey(key)); + + // Get (in the majority of case, the linked list will have one element so this should be 2 reads. + // Subsequent elements will be contiguous in memory as list is sorted/rebuilt in NewFrame). + for (ImGuiKeyRoutingIndex idx = rt->Index[key - ImGuiKey_NamedKey_BEGIN]; idx != -1; idx = routing_data->NextEntryIndex) + { + routing_data = &rt->Entries[idx]; + if (routing_data->Mods == mods) + return routing_data; + } + + // Add to linked-list + ImGuiKeyRoutingIndex routing_data_idx = (ImGuiKeyRoutingIndex)rt->Entries.Size; + rt->Entries.push_back(ImGuiKeyRoutingData()); + routing_data = &rt->Entries[routing_data_idx]; + routing_data->Mods = (ImU16)mods; + routing_data->NextEntryIndex = rt->Index[key - ImGuiKey_NamedKey_BEGIN]; // Setup linked list + rt->Index[key - ImGuiKey_NamedKey_BEGIN] = routing_data_idx; + return routing_data; +} + +// Current score encoding (lower is highest priority): +// - 0: ImGuiInputFlags_RouteGlobalHigh +// - 1: ImGuiInputFlags_RouteFocused (if item active) +// - 2: ImGuiInputFlags_RouteGlobal +// - 3+: ImGuiInputFlags_RouteFocused (if window in focus-stack) +// - 254: ImGuiInputFlags_RouteGlobalLow +// - 255: never route +// 'flags' should include an explicit routing policy +static int CalcRoutingScore(ImGuiWindow* location, ImGuiID owner_id, ImGuiInputFlags flags) +{ + if (flags & ImGuiInputFlags_RouteFocused) + { + ImGuiContext& g = *GImGui; + ImGuiWindow* focused = g.NavWindow; + + // ActiveID gets top priority + // (we don't check g.ActiveIdUsingAllKeys here. Routing is applied but if input ownership is tested later it may discard it) + if (owner_id != 0 && g.ActiveId == owner_id) + return 1; + + // Score based on distance to focused window (lower is better) + // Assuming both windows are submitting a routing request, + // - When Window....... is focused -> Window scores 3 (best), Window/ChildB scores 255 (no match) + // - When Window/ChildB is focused -> Window scores 4, Window/ChildB scores 3 (best) + // Assuming only WindowA is submitting a routing request, + // - When Window/ChildB is focused -> Window scores 4 (best), Window/ChildB doesn't have a score. + if (focused != NULL && focused->RootWindow == location->RootWindow) + for (int next_score = 3; focused != NULL; next_score++) + { + if (focused == location) + { + IM_ASSERT(next_score < 255); + return next_score; + } + focused = (focused->RootWindow != focused) ? focused->ParentWindow : NULL; // FIXME: This could be later abstracted as a focus path + } + return 255; + } + + // ImGuiInputFlags_RouteGlobalHigh is default, so calls without flags are not conditional + if (flags & ImGuiInputFlags_RouteGlobal) + return 2; + if (flags & ImGuiInputFlags_RouteGlobalLow) + return 254; + return 0; +} + +// Request a desired route for an input chord (key + mods). +// Return true if the route is available this frame. +// - Routes and key ownership are attributed at the beginning of next frame based on best score and mod state. +// (Conceptually this does a "Submit for next frame" + "Test for current frame". +// As such, it could be called TrySetXXX or SubmitXXX, or the Submit and Test operations should be separate.) +// - Using 'owner_id == ImGuiKeyOwner_Any/0': auto-assign an owner based on current focus scope (each window has its focus scope by default) +// - Using 'owner_id == ImGuiKeyOwner_None': allows disabling/locking a shortcut. +bool ImGui::SetShortcutRouting(ImGuiKeyChord key_chord, ImGuiID owner_id, ImGuiInputFlags flags) +{ + ImGuiContext& g = *GImGui; + if ((flags & ImGuiInputFlags_RouteMask_) == 0) + flags |= ImGuiInputFlags_RouteGlobalHigh; // IMPORTANT: This is the default for SetShortcutRouting() but NOT Shortcut() + else + IM_ASSERT(ImIsPowerOfTwo(flags & ImGuiInputFlags_RouteMask_)); // Check that only 1 routing flag is used + + if (flags & ImGuiInputFlags_RouteUnlessBgFocused) + if (g.NavWindow == NULL) + return false; + if (flags & ImGuiInputFlags_RouteAlways) + return true; + + const int score = CalcRoutingScore(g.CurrentWindow, owner_id, flags); + if (score == 255) + return false; + + // Submit routing for NEXT frame (assuming score is sufficient) + // FIXME: Could expose a way to use a "serve last" policy for same score resolution (using <= instead of <). + ImGuiKeyRoutingData* routing_data = GetShortcutRoutingData(key_chord); + const ImGuiID routing_id = GetRoutingIdFromOwnerId(owner_id); + //const bool set_route = (flags & ImGuiInputFlags_ServeLast) ? (score <= routing_data->RoutingNextScore) : (score < routing_data->RoutingNextScore); + if (score < routing_data->RoutingNextScore) + { + routing_data->RoutingNext = routing_id; + routing_data->RoutingNextScore = (ImU8)score; + } + + // Return routing state for CURRENT frame + return routing_data->RoutingCurr == routing_id; +} + +// Currently unused by core (but used by tests) +// Note: this cannot be turned into GetShortcutRouting() because we do the owner_id->routing_id translation, name would be more misleading. +bool ImGui::TestShortcutRouting(ImGuiKeyChord key_chord, ImGuiID owner_id) +{ + const ImGuiID routing_id = GetRoutingIdFromOwnerId(owner_id); + ImGuiKeyRoutingData* routing_data = GetShortcutRoutingData(key_chord); + return routing_data->RoutingCurr == routing_id; +} + +// Note that Dear ImGui doesn't know the meaning/semantic of ImGuiKey from 0..511: they are legacy native keycodes. +// Consider transitioning from 'IsKeyDown(MY_ENGINE_KEY_A)' (<1.87) to IsKeyDown(ImGuiKey_A) (>= 1.87) +bool ImGui::IsKeyDown(ImGuiKey key) +{ + return IsKeyDown(key, ImGuiKeyOwner_Any); +} + +bool ImGui::IsKeyDown(ImGuiKey key, ImGuiID owner_id) +{ + const ImGuiKeyData* key_data = GetKeyData(key); + if (!key_data->Down) + return false; + if (!TestKeyOwner(key, owner_id)) + return false; + return true; +} + +bool ImGui::IsKeyPressed(ImGuiKey key, bool repeat) +{ + return IsKeyPressed(key, ImGuiKeyOwner_Any, repeat ? ImGuiInputFlags_Repeat : ImGuiInputFlags_None); +} + +// Important: unless legacy IsKeyPressed(ImGuiKey, bool repeat=true) which DEFAULT to repeat, this requires EXPLICIT repeat. +bool ImGui::IsKeyPressed(ImGuiKey key, ImGuiID owner_id, ImGuiInputFlags flags) +{ + const ImGuiKeyData* key_data = GetKeyData(key); + if (!key_data->Down) // In theory this should already be encoded as (DownDuration < 0.0f), but testing this facilitates eating mechanism (until we finish work on key ownership) + return false; + const float t = key_data->DownDuration; + if (t < 0.0f) + return false; + IM_ASSERT((flags & ~ImGuiInputFlags_SupportedByIsKeyPressed) == 0); // Passing flags not supported by this function! + + bool pressed = (t == 0.0f); + if (!pressed && ((flags & ImGuiInputFlags_Repeat) != 0)) + { + float repeat_delay, repeat_rate; + GetTypematicRepeatRate(flags, &repeat_delay, &repeat_rate); + pressed = (t > repeat_delay) && GetKeyPressedAmount(key, repeat_delay, repeat_rate) > 0; + } + if (!pressed) + return false; + if (!TestKeyOwner(key, owner_id)) + return false; + return true; +} + +bool ImGui::IsKeyReleased(ImGuiKey key) +{ + return IsKeyReleased(key, ImGuiKeyOwner_Any); +} + +bool ImGui::IsKeyReleased(ImGuiKey key, ImGuiID owner_id) +{ + const ImGuiKeyData* key_data = GetKeyData(key); + if (key_data->DownDurationPrev < 0.0f || key_data->Down) + return false; + if (!TestKeyOwner(key, owner_id)) + return false; + return true; +} + +bool ImGui::IsMouseDown(ImGuiMouseButton button) +{ + ImGuiContext& g = *GImGui; + IM_ASSERT(button >= 0 && button < IM_ARRAYSIZE(g.IO.MouseDown)); + return g.IO.MouseDown[button] && TestKeyOwner(MouseButtonToKey(button), ImGuiKeyOwner_Any); // should be same as IsKeyDown(MouseButtonToKey(button), ImGuiKeyOwner_Any), but this allows legacy code hijacking the io.Mousedown[] array. +} + +bool ImGui::IsMouseDown(ImGuiMouseButton button, ImGuiID owner_id) +{ + ImGuiContext& g = *GImGui; + IM_ASSERT(button >= 0 && button < IM_ARRAYSIZE(g.IO.MouseDown)); + return g.IO.MouseDown[button] && TestKeyOwner(MouseButtonToKey(button), owner_id); // Should be same as IsKeyDown(MouseButtonToKey(button), owner_id), but this allows legacy code hijacking the io.Mousedown[] array. +} + +bool ImGui::IsMouseClicked(ImGuiMouseButton button, bool repeat) +{ + return IsMouseClicked(button, ImGuiKeyOwner_Any, repeat ? ImGuiInputFlags_Repeat : ImGuiInputFlags_None); +} + +bool ImGui::IsMouseClicked(ImGuiMouseButton button, ImGuiID owner_id, ImGuiInputFlags flags) +{ + ImGuiContext& g = *GImGui; + IM_ASSERT(button >= 0 && button < IM_ARRAYSIZE(g.IO.MouseDown)); + if (!g.IO.MouseDown[button]) // In theory this should already be encoded as (DownDuration < 0.0f), but testing this facilitates eating mechanism (until we finish work on key ownership) + return false; + const float t = g.IO.MouseDownDuration[button]; + if (t < 0.0f) + return false; + IM_ASSERT((flags & ~ImGuiInputFlags_SupportedByIsKeyPressed) == 0); // Passing flags not supported by this function! + + const bool repeat = (flags & ImGuiInputFlags_Repeat) != 0; + const bool pressed = (t == 0.0f) || (repeat && t > g.IO.KeyRepeatDelay && CalcTypematicRepeatAmount(t - g.IO.DeltaTime, t, g.IO.KeyRepeatDelay, g.IO.KeyRepeatRate) > 0); + if (!pressed) + return false; + + if (!TestKeyOwner(MouseButtonToKey(button), owner_id)) + return false; + + return true; +} + +bool ImGui::IsMouseReleased(ImGuiMouseButton button) +{ + ImGuiContext& g = *GImGui; + IM_ASSERT(button >= 0 && button < IM_ARRAYSIZE(g.IO.MouseDown)); + return g.IO.MouseReleased[button] && TestKeyOwner(MouseButtonToKey(button), ImGuiKeyOwner_Any); // Should be same as IsKeyReleased(MouseButtonToKey(button), ImGuiKeyOwner_Any) +} + +bool ImGui::IsMouseReleased(ImGuiMouseButton button, ImGuiID owner_id) +{ + ImGuiContext& g = *GImGui; + IM_ASSERT(button >= 0 && button < IM_ARRAYSIZE(g.IO.MouseDown)); + return g.IO.MouseReleased[button] && TestKeyOwner(MouseButtonToKey(button), owner_id); // Should be same as IsKeyReleased(MouseButtonToKey(button), owner_id) +} + +bool ImGui::IsMouseDoubleClicked(ImGuiMouseButton button) +{ + ImGuiContext& g = *GImGui; + IM_ASSERT(button >= 0 && button < IM_ARRAYSIZE(g.IO.MouseDown)); + return g.IO.MouseClickedCount[button] == 2 && TestKeyOwner(MouseButtonToKey(button), ImGuiKeyOwner_Any); +} + +int ImGui::GetMouseClickedCount(ImGuiMouseButton button) +{ + ImGuiContext& g = *GImGui; + IM_ASSERT(button >= 0 && button < IM_ARRAYSIZE(g.IO.MouseDown)); + return g.IO.MouseClickedCount[button]; +} + +// Return if a mouse click/drag went past the given threshold. Valid to call during the MouseReleased frame. +// [Internal] This doesn't test if the button is pressed +bool ImGui::IsMouseDragPastThreshold(ImGuiMouseButton button, float lock_threshold) +{ + ImGuiContext& g = *GImGui; + IM_ASSERT(button >= 0 && button < IM_ARRAYSIZE(g.IO.MouseDown)); + if (lock_threshold < 0.0f) + lock_threshold = g.IO.MouseDragThreshold; + return g.IO.MouseDragMaxDistanceSqr[button] >= lock_threshold * lock_threshold; +} + +bool ImGui::IsMouseDragging(ImGuiMouseButton button, float lock_threshold) +{ + ImGuiContext& g = *GImGui; + IM_ASSERT(button >= 0 && button < IM_ARRAYSIZE(g.IO.MouseDown)); + if (!g.IO.MouseDown[button]) + return false; + return IsMouseDragPastThreshold(button, lock_threshold); +} + +ImVec2 ImGui::GetMousePos() +{ + ImGuiContext& g = *GImGui; + return g.IO.MousePos; +} + +// NB: prefer to call right after BeginPopup(). At the time Selectable/MenuItem is activated, the popup is already closed! +ImVec2 ImGui::GetMousePosOnOpeningCurrentPopup() +{ + ImGuiContext& g = *GImGui; + if (g.BeginPopupStack.Size > 0) + return g.OpenPopupStack[g.BeginPopupStack.Size - 1].OpenMousePos; + return g.IO.MousePos; +} + +// We typically use ImVec2(-FLT_MAX,-FLT_MAX) to denote an invalid mouse position. +bool ImGui::IsMousePosValid(const ImVec2* mouse_pos) +{ + // The assert is only to silence a false-positive in XCode Static Analysis. + // Because GImGui is not dereferenced in every code path, the static analyzer assume that it may be NULL (which it doesn't for other functions). + IM_ASSERT(GImGui != NULL); + const float MOUSE_INVALID = -256000.0f; + ImVec2 p = mouse_pos ? *mouse_pos : GImGui->IO.MousePos; + return p.x >= MOUSE_INVALID && p.y >= MOUSE_INVALID; +} + +// [WILL OBSOLETE] This was designed for backends, but prefer having backend maintain a mask of held mouse buttons, because upcoming input queue system will make this invalid. +bool ImGui::IsAnyMouseDown() +{ + ImGuiContext& g = *GImGui; + for (int n = 0; n < IM_ARRAYSIZE(g.IO.MouseDown); n++) + if (g.IO.MouseDown[n]) + return true; + return false; +} + +// Return the delta from the initial clicking position while the mouse button is clicked or was just released. +// This is locked and return 0.0f until the mouse moves past a distance threshold at least once. +// NB: This is only valid if IsMousePosValid(). backends in theory should always keep mouse position valid when dragging even outside the client window. +ImVec2 ImGui::GetMouseDragDelta(ImGuiMouseButton button, float lock_threshold) +{ + ImGuiContext& g = *GImGui; + IM_ASSERT(button >= 0 && button < IM_ARRAYSIZE(g.IO.MouseDown)); + if (lock_threshold < 0.0f) + lock_threshold = g.IO.MouseDragThreshold; + if (g.IO.MouseDown[button] || g.IO.MouseReleased[button]) + if (g.IO.MouseDragMaxDistanceSqr[button] >= lock_threshold * lock_threshold) + if (IsMousePosValid(&g.IO.MousePos) && IsMousePosValid(&g.IO.MouseClickedPos[button])) + return g.IO.MousePos - g.IO.MouseClickedPos[button]; + return ImVec2(0.0f, 0.0f); +} + +void ImGui::ResetMouseDragDelta(ImGuiMouseButton button) +{ + ImGuiContext& g = *GImGui; + IM_ASSERT(button >= 0 && button < IM_ARRAYSIZE(g.IO.MouseDown)); + // NB: We don't need to reset g.IO.MouseDragMaxDistanceSqr + g.IO.MouseClickedPos[button] = g.IO.MousePos; +} + +// Get desired mouse cursor shape. +// Important: this is meant to be used by a platform backend, it is reset in ImGui::NewFrame(), +// updated during the frame, and locked in EndFrame()/Render(). +// If you use software rendering by setting io.MouseDrawCursor then Dear ImGui will render those for you +ImGuiMouseCursor ImGui::GetMouseCursor() +{ + ImGuiContext& g = *GImGui; + return g.MouseCursor; +} + +void ImGui::SetMouseCursor(ImGuiMouseCursor cursor_type) +{ + ImGuiContext& g = *GImGui; + g.MouseCursor = cursor_type; +} + +void ImGui::SetNextFrameWantCaptureKeyboard(bool want_capture_keyboard) +{ + ImGuiContext& g = *GImGui; + g.WantCaptureKeyboardNextFrame = want_capture_keyboard ? 1 : 0; +} + +void ImGui::SetNextFrameWantCaptureMouse(bool want_capture_mouse) +{ + ImGuiContext& g = *GImGui; + g.WantCaptureMouseNextFrame = want_capture_mouse ? 1 : 0; +} + +#ifndef IMGUI_DISABLE_DEBUG_TOOLS +static const char* GetInputSourceName(ImGuiInputSource source) +{ + const char* input_source_names[] = { "None", "Mouse", "Keyboard", "Gamepad", "Nav", "Clipboard" }; + IM_ASSERT(IM_ARRAYSIZE(input_source_names) == ImGuiInputSource_COUNT && source >= 0 && source < ImGuiInputSource_COUNT); + return input_source_names[source]; +} +static void DebugPrintInputEvent(const char* prefix, const ImGuiInputEvent* e) +{ + ImGuiContext& g = *GImGui; + if (e->Type == ImGuiInputEventType_MousePos) { if (e->MousePos.PosX == -FLT_MAX && e->MousePos.PosY == -FLT_MAX) IMGUI_DEBUG_LOG_IO("%s: MousePos (-FLT_MAX, -FLT_MAX)\n", prefix); else IMGUI_DEBUG_LOG_IO("%s: MousePos (%.1f, %.1f)\n", prefix, e->MousePos.PosX, e->MousePos.PosY); return; } + if (e->Type == ImGuiInputEventType_MouseButton) { IMGUI_DEBUG_LOG_IO("%s: MouseButton %d %s\n", prefix, e->MouseButton.Button, e->MouseButton.Down ? "Down" : "Up"); return; } + if (e->Type == ImGuiInputEventType_MouseWheel) { IMGUI_DEBUG_LOG_IO("%s: MouseWheel (%.1f, %.1f)\n", prefix, e->MouseWheel.WheelX, e->MouseWheel.WheelY); return; } + if (e->Type == ImGuiInputEventType_Key) { IMGUI_DEBUG_LOG_IO("%s: Key \"%s\" %s\n", prefix, ImGui::GetKeyName(e->Key.Key), e->Key.Down ? "Down" : "Up"); return; } + if (e->Type == ImGuiInputEventType_Text) { IMGUI_DEBUG_LOG_IO("%s: Text: %c (U+%08X)\n", prefix, e->Text.Char, e->Text.Char); return; } + if (e->Type == ImGuiInputEventType_Focus) { IMGUI_DEBUG_LOG_IO("%s: AppFocused %d\n", prefix, e->AppFocused.Focused); return; } +} +#endif + +// Process input queue +// We always call this with the value of 'bool g.IO.ConfigInputTrickleEventQueue'. +// - trickle_fast_inputs = false : process all events, turn into flattened input state (e.g. successive down/up/down/up will be lost) +// - trickle_fast_inputs = true : process as many events as possible (successive down/up/down/up will be trickled over several frames so nothing is lost) (new feature in 1.87) +void ImGui::UpdateInputEvents(bool trickle_fast_inputs) +{ + ImGuiContext& g = *GImGui; + ImGuiIO& io = g.IO; + + // Only trickle chars<>key when working with InputText() + // FIXME: InputText() could parse event trail? + // FIXME: Could specialize chars<>keys trickling rules for control keys (those not typically associated to characters) + const bool trickle_interleaved_keys_and_text = (trickle_fast_inputs && g.WantTextInputNextFrame == 1); + + bool mouse_moved = false, mouse_wheeled = false, key_changed = false, text_inputted = false; + int mouse_button_changed = 0x00; + ImBitArray key_changed_mask; + + int event_n = 0; + for (; event_n < g.InputEventsQueue.Size; event_n++) + { + ImGuiInputEvent* e = &g.InputEventsQueue[event_n]; + if (e->Type == ImGuiInputEventType_MousePos) + { + // Trickling Rule: Stop processing queued events if we already handled a mouse button change + ImVec2 event_pos(e->MousePos.PosX, e->MousePos.PosY); + if (trickle_fast_inputs && (mouse_button_changed != 0 || mouse_wheeled || key_changed || text_inputted)) + break; + io.MousePos = event_pos; + mouse_moved = true; + } + else if (e->Type == ImGuiInputEventType_MouseButton) + { + // Trickling Rule: Stop processing queued events if we got multiple action on the same button + const ImGuiMouseButton button = e->MouseButton.Button; + IM_ASSERT(button >= 0 && button < ImGuiMouseButton_COUNT); + if (trickle_fast_inputs && ((mouse_button_changed & (1 << button)) || mouse_wheeled)) + break; + io.MouseDown[button] = e->MouseButton.Down; + mouse_button_changed |= (1 << button); + } + else if (e->Type == ImGuiInputEventType_MouseWheel) + { + // Trickling Rule: Stop processing queued events if we got multiple action on the event + if (trickle_fast_inputs && (mouse_moved || mouse_button_changed != 0)) + break; + io.MouseWheelH += e->MouseWheel.WheelX; + io.MouseWheel += e->MouseWheel.WheelY; + mouse_wheeled = true; + } + else if (e->Type == ImGuiInputEventType_Key) + { + // Trickling Rule: Stop processing queued events if we got multiple action on the same button + ImGuiKey key = e->Key.Key; + IM_ASSERT(key != ImGuiKey_None); + ImGuiKeyData* key_data = GetKeyData(key); + const int key_data_index = (int)(key_data - g.IO.KeysData); + if (trickle_fast_inputs && key_data->Down != e->Key.Down && (key_changed_mask.TestBit(key_data_index) || text_inputted || mouse_button_changed != 0)) + break; + key_data->Down = e->Key.Down; + key_data->AnalogValue = e->Key.AnalogValue; + key_changed = true; + key_changed_mask.SetBit(key_data_index); + + if (key == ImGuiMod_Ctrl || key == ImGuiMod_Shift || key == ImGuiMod_Alt || key == ImGuiMod_Super) + { + if (key == ImGuiMod_Ctrl) { io.KeyCtrl = key_data->Down; } + if (key == ImGuiMod_Shift) { io.KeyShift = key_data->Down; } + if (key == ImGuiMod_Alt) { io.KeyAlt = key_data->Down; } + if (key == ImGuiMod_Super) { io.KeySuper = key_data->Down; } + io.KeyMods = GetMergedModsFromBools(); + } + + // Allow legacy code using io.KeysDown[GetKeyIndex()] with new backends +#ifndef IMGUI_DISABLE_OBSOLETE_KEYIO + io.KeysDown[key_data_index] = key_data->Down; + if (io.KeyMap[key_data_index] != -1) + io.KeysDown[io.KeyMap[key_data_index]] = key_data->Down; +#endif + } + else if (e->Type == ImGuiInputEventType_Text) + { + // Trickling Rule: Stop processing queued events if keys/mouse have been interacted with + if (trickle_fast_inputs && ((key_changed && trickle_interleaved_keys_and_text) || mouse_button_changed != 0 || mouse_moved || mouse_wheeled)) + break; + unsigned int c = e->Text.Char; + io.InputQueueCharacters.push_back(c <= IM_UNICODE_CODEPOINT_MAX ? (ImWchar)c : IM_UNICODE_CODEPOINT_INVALID); + if (trickle_interleaved_keys_and_text) + text_inputted = true; + } + else if (e->Type == ImGuiInputEventType_Focus) + { + // We intentionally overwrite this and process in NewFrame(), in order to give a chance + // to multi-viewports backends to queue AddFocusEvent(false) + AddFocusEvent(true) in same frame. + const bool focus_lost = !e->AppFocused.Focused; + io.AppFocusLost = focus_lost; + } + else + { + IM_ASSERT(0 && "Unknown event!"); + } + } + + // Record trail (for domain-specific applications wanting to access a precise trail) + //if (event_n != 0) IMGUI_DEBUG_LOG_IO("Processed: %d / Remaining: %d\n", event_n, g.InputEventsQueue.Size - event_n); + for (int n = 0; n < event_n; n++) + g.InputEventsTrail.push_back(g.InputEventsQueue[n]); + + // [DEBUG] +#ifndef IMGUI_DISABLE_DEBUG_TOOLS + if (event_n != 0 && (g.DebugLogFlags & ImGuiDebugLogFlags_EventIO)) + for (int n = 0; n < g.InputEventsQueue.Size; n++) + DebugPrintInputEvent(n < event_n ? "Processed" : "Remaining", &g.InputEventsQueue[n]); +#endif + + // Remaining events will be processed on the next frame + if (event_n == g.InputEventsQueue.Size) + g.InputEventsQueue.resize(0); + else + g.InputEventsQueue.erase(g.InputEventsQueue.Data, g.InputEventsQueue.Data + event_n); + + // Clear buttons state when focus is lost + // - this is useful so e.g. releasing Alt after focus loss on Alt-Tab doesn't trigger the Alt menu toggle. + // - we clear in EndFrame() and not now in order allow application/user code polling this flag + // (e.g. custom backend may want to clear additional data, custom widgets may want to react with a "canceling" event). + if (g.IO.AppFocusLost) + g.IO.ClearInputKeys(); +} + +ImGuiID ImGui::GetKeyOwner(ImGuiKey key) +{ + if (!IsNamedKeyOrModKey(key)) + return ImGuiKeyOwner_None; + + ImGuiContext& g = *GImGui; + ImGuiKeyOwnerData* owner_data = GetKeyOwnerData(key); + ImGuiID owner_id = owner_data->OwnerCurr; + + if (g.ActiveIdUsingAllKeyboardKeys && owner_id != g.ActiveId && owner_id != ImGuiKeyOwner_Any) + if (key >= ImGuiKey_Keyboard_BEGIN && key < ImGuiKey_Keyboard_END) + return ImGuiKeyOwner_None; + + return owner_id; +} + +// TestKeyOwner(..., ID) : (owner == None || owner == ID) +// TestKeyOwner(..., None) : (owner == None) +// TestKeyOwner(..., Any) : no owner test +// All paths are also testing for key not being locked, for the rare cases that key have been locked with using ImGuiInputFlags_LockXXX flags. +bool ImGui::TestKeyOwner(ImGuiKey key, ImGuiID owner_id) +{ + if (!IsNamedKeyOrModKey(key)) + return true; + + ImGuiContext& g = *GImGui; + if (g.ActiveIdUsingAllKeyboardKeys && owner_id != g.ActiveId && owner_id != ImGuiKeyOwner_Any) + if (key >= ImGuiKey_Keyboard_BEGIN && key < ImGuiKey_Keyboard_END) + return false; + + ImGuiKeyOwnerData* owner_data = GetKeyOwnerData(key); + if (owner_id == ImGuiKeyOwner_Any) + return (owner_data->LockThisFrame == false); + + // Note: SetKeyOwner() sets OwnerCurr. It is not strictly required for most mouse routing overlap (because of ActiveId/HoveredId + // are acting as filter before this has a chance to filter), but sane as soon as user tries to look into things. + // Setting OwnerCurr in SetKeyOwner() is more consistent than testing OwnerNext here: would be inconsistent with getter and other functions. + if (owner_data->OwnerCurr != owner_id) + { + if (owner_data->LockThisFrame) + return false; + if (owner_data->OwnerCurr != ImGuiKeyOwner_None) + return false; + } + + return true; +} + +// _LockXXX flags are useful to lock keys away from code which is not input-owner aware. +// When using _LockXXX flags, you can use ImGuiKeyOwner_Any to lock keys from everyone. +// - SetKeyOwner(..., None) : clears owner +// - SetKeyOwner(..., Any, !Lock) : illegal (assert) +// - SetKeyOwner(..., Any or None, Lock) : set lock +void ImGui::SetKeyOwner(ImGuiKey key, ImGuiID owner_id, ImGuiInputFlags flags) +{ + IM_ASSERT(IsNamedKeyOrModKey(key) && (owner_id != ImGuiKeyOwner_Any || (flags & (ImGuiInputFlags_LockThisFrame | ImGuiInputFlags_LockUntilRelease)))); // Can only use _Any with _LockXXX flags (to eat a key away without an ID to retrieve it) + IM_ASSERT((flags & ~ImGuiInputFlags_SupportedBySetKeyOwner) == 0); // Passing flags not supported by this function! + + ImGuiKeyOwnerData* owner_data = GetKeyOwnerData(key); + owner_data->OwnerCurr = owner_data->OwnerNext = owner_id; + + // We cannot lock by default as it would likely break lots of legacy code. + // In the case of using LockUntilRelease while key is not down we still lock during the frame (no key_data->Down test) + owner_data->LockUntilRelease = (flags & ImGuiInputFlags_LockUntilRelease) != 0; + owner_data->LockThisFrame = (flags & ImGuiInputFlags_LockThisFrame) != 0 || (owner_data->LockUntilRelease); +} + +// This is more or less equivalent to: +// 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) +{ + ImGuiContext& g = *GImGui; + ImGuiID id = g.LastItemData.ID; + if (id == 0 || (g.HoveredId != id && g.ActiveId != id)) + return; + 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! + SetKeyOwner(key, id, flags & ~ImGuiInputFlags_CondMask_); + } +} + +// - Need to decide how to handle shortcut translations for Non-Mac <> Mac +// - Ideas: https://github.com/ocornut/imgui/issues/456#issuecomment-264390864 +bool ImGui::Shortcut(ImGuiKeyChord key_chord, ImGuiID owner_id, ImGuiInputFlags flags) { - ImGuiWindow* window = GImGui->CurrentWindow; - return window->ClipRect.Overlaps(ImRect(rect_min, rect_max)); + ImGuiContext& g = *GImGui; + + // When using (owner_id == 0/Any): SetShortcutRouting() will use CurrentFocusScopeId and filter with this, so IsKeyPressed() is fine with he 0/Any. + if ((flags & ImGuiInputFlags_RouteMask_) == 0) + flags |= ImGuiInputFlags_RouteFocused; + if (!SetShortcutRouting(key_chord, owner_id, flags)) + return false; + + ImGuiKey key = (ImGuiKey)(key_chord & ~ImGuiMod_Mask_); + ImGuiKey mods = (ImGuiKey)(key_chord & ImGuiMod_Mask_); + if (g.IO.KeyMods != mods) + return false; + + // Special storage location for mods + if (key == ImGuiKey_None) + key = ConvertSingleModFlagToKey(mods); + + if (!IsKeyPressed(key, owner_id, (flags & (ImGuiInputFlags_Repeat | ImGuiInputFlags_RepeatRateMask_)))) + return false; + IM_ASSERT((flags & ~ImGuiInputFlags_SupportedByShortcut) == 0); // Passing flags not supported by this function! + + return true; } @@ -7247,9 +8667,12 @@ bool ImGui::IsRectVisible(const ImVec2& rect_min, const ImVec2& rect_max) // Helper function to verify ABI compatibility between caller code and compiled version of Dear ImGui. // Verify that the type sizes are matching between the calling file's compilation unit and imgui.cpp's compilation unit -// If the user has inconsistent compilation settings, imgui configuration #define, packing pragma, etc. your user code -// may see different structures than what imgui.cpp sees, which is problematic. -// We usually require settings to be in imconfig.h to make sure that they are accessible to all compilation units involved with Dear ImGui. +// If this triggers you have an issue: +// - Most commonly: mismatched headers and compiled code version. +// - Or: mismatched configuration #define, compilation settings, packing pragma etc. +// The configuration settings mentioned in imconfig.h must be set for all compilation units involved with Dear ImGui, +// which is way it is required you put them in your imconfig file (and not just before including imgui.h). +// Otherwise it is possible that different compilation units would see different structure layout bool ImGui::DebugCheckVersionAndDataLayout(const char* version, size_t sz_io, size_t sz_style, size_t sz_vec2, size_t sz_vec4, size_t sz_vert, size_t sz_idx) { bool error = false; @@ -7263,6 +8686,38 @@ bool ImGui::DebugCheckVersionAndDataLayout(const char* version, size_t sz_io, si return !error; } +// Until 1.89 (IMGUI_VERSION_NUM < 18814) it was legal to use SetCursorPos() to extend the boundary of a parent (e.g. window or table cell) +// This is causing issues and ambiguity and we need to retire that. +// See https://github.com/ocornut/imgui/issues/5548 for more details. +// [Scenario 1] +// Previously this would make the window content size ~200x200: +// Begin(...) + SetCursorScreenPos(GetCursorScreenPos() + ImVec2(200,200)) + End(); // NOT OK +// Instead, please submit an item: +// Begin(...) + SetCursorScreenPos(GetCursorScreenPos() + ImVec2(200,200)) + Dummy(ImVec2(0,0)) + End(); // OK +// Alternative: +// Begin(...) + Dummy(ImVec2(200,200)) + End(); // OK +// [Scenario 2] +// For reference this is one of the issue what we aim to fix with this change: +// BeginGroup() + SomeItem("foobar") + SetCursorScreenPos(GetCursorScreenPos()) + EndGroup() +// The previous logic made SetCursorScreenPos(GetCursorScreenPos()) have a side-effect! It would erroneously incorporate ItemSpacing.y after the item into content size, making the group taller! +// While this code is a little twisted, no-one would expect SetXXX(GetXXX()) to have a side-effect. Using vertical alignment patterns could trigger this issue. +void ImGui::ErrorCheckUsingSetCursorPosToExtendParentBoundaries() +{ + ImGuiContext& g = *GImGui; + ImGuiWindow* window = g.CurrentWindow; + IM_ASSERT(window->DC.IsSetPos); + window->DC.IsSetPos = false; +#ifdef IMGUI_DISABLE_OBSOLETE_FUNCTIONS + if (window->DC.CursorPos.x <= window->DC.CursorMaxPos.x && window->DC.CursorPos.y <= window->DC.CursorMaxPos.y) + return; + if (window->SkipItems) + return; + IM_ASSERT(0 && "Code uses SetCursorPos()/SetCursorScreenPos() to extend window/parent boundaries. Please submit an item e.g. Dummy() to validate extent."); +#else + window->DC.CursorMaxPos = ImMax(window->DC.CursorMaxPos, window->DC.CursorPos); +#endif +} + static void ImGui::ErrorCheckNewFrameSanityChecks() { ImGuiContext& g = *GImGui; @@ -7283,16 +8738,19 @@ static void ImGui::ErrorCheckNewFrameSanityChecks() IM_ASSERT(g.IO.DisplaySize.x >= 0.0f && g.IO.DisplaySize.y >= 0.0f && "Invalid DisplaySize value!"); IM_ASSERT(g.IO.Fonts->IsBuilt() && "Font Atlas not built! Make sure you called ImGui_ImplXXXX_NewFrame() function for renderer backend, which should call io.Fonts->GetTexDataAsRGBA32() / GetTexDataAsAlpha8()"); IM_ASSERT(g.Style.CurveTessellationTol > 0.0f && "Invalid style setting!"); - IM_ASSERT(g.Style.CircleTessellationMaxError > 0.0f && "Invalid style setting!"); + IM_ASSERT(g.Style.CircleTessellationMaxError > 0.0f && "Invalid style setting!"); IM_ASSERT(g.Style.Alpha >= 0.0f && g.Style.Alpha <= 1.0f && "Invalid style setting!"); // Allows us to avoid a few clamps in color computations IM_ASSERT(g.Style.WindowMinSize.x >= 1.0f && g.Style.WindowMinSize.y >= 1.0f && "Invalid style setting."); IM_ASSERT(g.Style.WindowMenuButtonPosition == ImGuiDir_None || g.Style.WindowMenuButtonPosition == ImGuiDir_Left || g.Style.WindowMenuButtonPosition == ImGuiDir_Right); - for (int n = 0; n < ImGuiKey_COUNT; n++) - IM_ASSERT(g.IO.KeyMap[n] >= -1 && g.IO.KeyMap[n] < IM_ARRAYSIZE(g.IO.KeysDown) && "io.KeyMap[] contains an out of bound value (need to be 0..512, or -1 for unmapped key)"); + IM_ASSERT(g.Style.ColorButtonPosition == ImGuiDir_Left || g.Style.ColorButtonPosition == ImGuiDir_Right); +#ifndef IMGUI_DISABLE_OBSOLETE_KEYIO + for (int n = ImGuiKey_NamedKey_BEGIN; n < ImGuiKey_COUNT; n++) + IM_ASSERT(g.IO.KeyMap[n] >= -1 && g.IO.KeyMap[n] < ImGuiKey_LegacyNativeKey_END && "io.KeyMap[] contains an out of bound value (need to be 0..511, or -1 for unmapped key)"); // Check: required key mapping (we intentionally do NOT check all keys to not pressure user into setting up everything, but Space is required and was only added in 1.60 WIP) - if (g.IO.ConfigFlags & ImGuiConfigFlags_NavEnableKeyboard) + if ((g.IO.ConfigFlags & ImGuiConfigFlags_NavEnableKeyboard) && g.IO.BackendUsingLegacyKeyArrays == 1) IM_ASSERT(g.IO.KeyMap[ImGuiKey_Space] != -1 && "ImGuiKey_Space is not mapped, required for keyboard navigation."); +#endif // Check: the io.ConfigWindowsResizeFromEdges option requires backend to honor mouse cursor changes and set the ImGuiBackendFlags_HasMouseCursors flag accordingly. if (g.IO.ConfigWindowsResizeFromEdges && !(g.IO.BackendFlags & ImGuiBackendFlags_HasMouseCursors)) @@ -7309,11 +8767,11 @@ static void ImGui::ErrorCheckEndFrameSanityChecks() // send key release events mid-frame. This would normally trigger this assertion and lead to sheared inputs. // We silently accommodate for this case by ignoring/ the case where all io.KeyXXX modifiers were released (aka key_mod_flags == 0), // while still correctly asserting on mid-frame key press events. - const ImGuiKeyModFlags key_mod_flags = GetMergedKeyModFlags(); - IM_ASSERT((key_mod_flags == 0 || g.IO.KeyMods == key_mod_flags) && "Mismatching io.KeyCtrl/io.KeyShift/io.KeyAlt/io.KeySuper vs io.KeyMods"); - IM_UNUSED(key_mod_flags); + const ImGuiKeyChord key_mods = GetMergedModsFromBools(); + IM_ASSERT((key_mods == 0 || g.IO.KeyMods == key_mods) && "Mismatching io.KeyCtrl/io.KeyShift/io.KeyAlt/io.KeySuper vs io.KeyMods"); + IM_UNUSED(key_mods); - // Recover from errors + // [EXPERIMENTAL] Recover from errors: You may call this yourself before EndFrame(). //ErrorCheckEndFrameRecover(); // Report when there is a mismatch of Begin/BeginChild vs End/EndChild calls. Important: Remember that the Begin/BeginChild API requires you @@ -7353,7 +8811,6 @@ void ImGui::ErrorCheckEndFrameRecover(ImGuiErrorLogCallback log_callback, voi IM_ASSERT(window->IsFallbackWindow); break; } - IM_ASSERT(window == g.CurrentWindow); if (window->Flags & ImGuiWindowFlags_ChildWindow) { if (log_callback) log_callback(user_data, "Recovered from missing EndChild() for '%s'", window->Name); @@ -7420,7 +8877,7 @@ void ImGui::ErrorCheckEndWindowRecover(ImGuiErrorLogCallback log_callback, vo if (log_callback) log_callback(user_data, "Recovered from missing PopStyleVar() in '%s'", window->Name); PopStyleVar(); } - while (g.FocusScopeStack.Size > stack_sizes->SizeOfFocusScopeStack) //-V1044 + while (g.FocusScopeStack.Size > stack_sizes->SizeOfFocusScopeStack + 1) //-V1044 { if (log_callback) log_callback(user_data, "Recovered from missing PopFocusScope() in '%s'", window->Name); PopFocusScope(); @@ -7496,7 +8953,7 @@ void ImGuiStackSizes::CompareWithCurrentState() // - GetWindowContentRegionMin(), GetWindowContentRegionMax() // - BeginGroup() // - EndGroup() -// Also see in imgui_widgets: tab bars, columns. +// Also see in imgui_widgets: tab bars, and in imgui_tables: tables, columns. //----------------------------------------------------------------------------- // Advance cursor given item size for layout. @@ -7513,14 +8970,16 @@ void ImGui::ItemSize(const ImVec2& size, float text_baseline_y) // In theory we should be offsetting the starting position (window->DC.CursorPos), that will be the topic of a larger refactor, // but since ItemSize() is not yet an API that moves the cursor (to handle e.g. wrapping) enlarging the height has the same effect. const float offset_to_match_baseline_y = (text_baseline_y >= 0) ? ImMax(0.0f, window->DC.CurrLineTextBaseOffset - text_baseline_y) : 0.0f; - const float line_height = ImMax(window->DC.CurrLineSize.y, size.y + offset_to_match_baseline_y); + + const float line_y1 = window->DC.IsSameLine ? window->DC.CursorPosPrevLine.y : window->DC.CursorPos.y; + const float line_height = ImMax(window->DC.CurrLineSize.y, /*ImMax(*/window->DC.CursorPos.y - line_y1/*, 0.0f)*/ + size.y + offset_to_match_baseline_y); // Always align ourselves on pixel boundaries //if (g.IO.KeyAlt) window->DrawList->AddRect(window->DC.CursorPos, window->DC.CursorPos + ImVec2(size.x, line_height), IM_COL32(255,0,0,200)); // [DEBUG] window->DC.CursorPosPrevLine.x = window->DC.CursorPos.x + size.x; - window->DC.CursorPosPrevLine.y = window->DC.CursorPos.y; + window->DC.CursorPosPrevLine.y = line_y1; window->DC.CursorPos.x = IM_FLOOR(window->Pos.x + window->DC.Indent.x + window->DC.ColumnsOffset.x); // Next line - window->DC.CursorPos.y = IM_FLOOR(window->DC.CursorPos.y + line_height + g.Style.ItemSpacing.y); // Next line + window->DC.CursorPos.y = IM_FLOOR(line_y1 + line_height + g.Style.ItemSpacing.y); // Next line window->DC.CursorMaxPos.x = ImMax(window->DC.CursorMaxPos.x, window->DC.CursorPosPrevLine.x); window->DC.CursorMaxPos.y = ImMax(window->DC.CursorMaxPos.y, window->DC.CursorPos.y - g.Style.ItemSpacing.y); //if (g.IO.KeyAlt) window->DrawList->AddCircle(window->DC.CursorMaxPos, 3.0f, IM_COL32(255,0,0,255), 4); // [DEBUG] @@ -7529,17 +8988,13 @@ void ImGui::ItemSize(const ImVec2& size, float text_baseline_y) window->DC.CurrLineSize.y = 0.0f; window->DC.PrevLineTextBaseOffset = ImMax(window->DC.CurrLineTextBaseOffset, text_baseline_y); window->DC.CurrLineTextBaseOffset = 0.0f; + window->DC.IsSameLine = window->DC.IsSetPos = false; // Horizontal layout mode if (window->DC.LayoutType == ImGuiLayoutType_Horizontal) SameLine(); } -void ImGui::ItemSize(const ImRect& bb, float text_baseline_y) -{ - ItemSize(bb.GetSize(), text_baseline_y); -} - // Declare item bounding box for clipping and interaction. // Note that the size can be different than the one provided to ItemSize(). Typically, widgets that spread over available surface // declare their minimum size requirement to ItemSize() and provide a larger region to ItemAdd() which is used drawing/interaction. @@ -7559,6 +9014,8 @@ bool ImGui::ItemAdd(const ImRect& bb, ImGuiID id, const ImRect* nav_bb_arg, ImGu // Directional navigation processing if (id != 0) { + KeepAliveID(id); + // Runs prior to clipping early-out // (a) So that NavInitRequest can be honored, for newly opened windows to select a default widget // (b) So that we can scroll up/down past clipped items. This adds a small O(N) cost to regular navigation requests @@ -7568,20 +9025,19 @@ bool ImGui::ItemAdd(const ImRect& bb, ImGuiID id, const ImRect* nav_bb_arg, ImGu // to reach unclipped widgets. This would work if user had explicit scrolling control (e.g. mapped on a stick). // We intentionally don't check if g.NavWindow != NULL because g.NavAnyRequest should only be set when it is non null. // If we crash on a NULL g.NavWindow we need to fix the bug elsewhere. - window->DC.NavLayersActiveMaskNext |= (1 << window->DC.NavLayerCurrent); - if (g.NavId == id || g.NavAnyRequest) - if (g.NavWindow->RootWindowForNav == window->RootWindowForNav) - if (window == g.NavWindow || ((window->Flags | g.NavWindow->Flags) & ImGuiWindowFlags_NavFlattened)) - NavProcessItem(); - - // [DEBUG] Item Picker tool, when enabling the "extended" version we perform the check in ItemAdd() -#ifdef IMGUI_DEBUG_TOOL_ITEM_PICKER_EX - if (id == g.DebugItemPickerBreakId) + if (!(g.LastItemData.InFlags & ImGuiItemFlags_NoNav)) { - IM_DEBUG_BREAK(); - g.DebugItemPickerBreakId = 0; + window->DC.NavLayersActiveMaskNext |= (1 << window->DC.NavLayerCurrent); + if (g.NavId == id || g.NavAnyRequest) + if (g.NavWindow->RootWindowForNav == window->RootWindowForNav) + if (window == g.NavWindow || ((window->Flags | g.NavWindow->Flags) & ImGuiWindowFlags_NavFlattened)) + NavProcessItem(); } -#endif + + // [DEBUG] People keep stumbling on this problem and using "" as identifier in the root of a window instead of "##something". + // Empty identifier are valid and useful in a small amount of cases, but 99.9% of the time you want to use "##something". + // READ THE FAQ: https://dearimgui.org/faq + IM_ASSERT(id != window->ID && "Cannot have an empty ID at the root of a window. If you need an empty label, use ## and read the FAQ about how the ID Stack works!"); } g.NextItemData.Flags = ImGuiNextItemDataFlags_None; @@ -7591,17 +9047,26 @@ bool ImGui::ItemAdd(const ImRect& bb, ImGuiID id, const ImRect* nav_bb_arg, ImGu #endif // Clipping test - const bool is_clipped = IsClippedEx(bb, id); - if (is_clipped) - return false; - //if (g.IO.KeyAlt) window->DrawList->AddRect(bb.Min, bb.Max, IM_COL32(255,255,0,120)); // [DEBUG] + // (FIXME: This is a modified copy of IsClippedEx() so we can reuse the is_rect_visible value) + //const bool is_clipped = IsClippedEx(bb, id); + //if (is_clipped) + // return false; + const bool is_rect_visible = bb.Overlaps(window->ClipRect); + if (!is_rect_visible) + if (id == 0 || (id != g.ActiveId && id != g.NavId)) + if (!g.LogEnabled) + return false; - // [WIP] Tab stop handling (previously was using internal FocusableItemRegister() api) - // FIXME-NAV: We would now want to move this before the clipping test, but this would require being able to scroll and currently this would mean an extra frame. (#4079, #343) - if (extra_flags & ImGuiItemFlags_Inputable) - ItemInputable(window, id); + // [DEBUG] +#ifndef IMGUI_DISABLE_DEBUG_TOOLS + if (id != 0 && id == g.DebugLocateId) + DebugLocateItemResolveWithLastItem(); +#endif + //if (g.IO.KeyAlt) window->DrawList->AddRect(bb.Min, bb.Max, IM_COL32(255,255,0,120)); // [DEBUG] // We need to calculate this now to take account of the current clipping rectangle (as items like Selectable may change them) + if (is_rect_visible) + g.LastItemData.StatusFlags |= ImGuiItemStatusFlags_Visible; if (IsMouseHoveringRect(bb.Min, bb.Max)) g.LastItemData.StatusFlags |= ImGuiItemStatusFlags_HoveredRect; return true; @@ -7614,25 +9079,28 @@ bool ImGui::ItemAdd(const ImRect& bb, ImGuiID id, const ImRect* nav_bb_arg, ImGu // spacing_w >= 0 : enforce spacing amount void ImGui::SameLine(float offset_from_start_x, float spacing_w) { - ImGuiWindow* window = GetCurrentWindow(); + ImGuiContext& g = *GImGui; + ImGuiWindow* window = g.CurrentWindow; if (window->SkipItems) return; - ImGuiContext& g = *GImGui; if (offset_from_start_x != 0.0f) { - if (spacing_w < 0.0f) spacing_w = 0.0f; + if (spacing_w < 0.0f) + spacing_w = 0.0f; window->DC.CursorPos.x = window->Pos.x - window->Scroll.x + offset_from_start_x + spacing_w + window->DC.GroupOffset.x + window->DC.ColumnsOffset.x; window->DC.CursorPos.y = window->DC.CursorPosPrevLine.y; } else { - if (spacing_w < 0.0f) spacing_w = g.Style.ItemSpacing.x; + if (spacing_w < 0.0f) + spacing_w = g.Style.ItemSpacing.x; window->DC.CursorPos.x = window->DC.CursorPosPrevLine.x + spacing_w; window->DC.CursorPos.y = window->DC.CursorPosPrevLine.y; } window->DC.CurrLineSize = window->DC.PrevLineSize; window->DC.CurrLineTextBaseOffset = window->DC.PrevLineTextBaseOffset; + window->DC.IsSameLine = true; } ImVec2 ImGui::GetCursorScreenPos() @@ -7641,11 +9109,15 @@ ImVec2 ImGui::GetCursorScreenPos() return window->DC.CursorPos; } +// 2022/08/05: Setting cursor position also extend boundaries (via modifying CursorMaxPos) used to compute window size, group size etc. +// I believe this was is a judicious choice but it's probably being relied upon (it has been the case since 1.31 and 1.50) +// It would be sane if we requested user to use SetCursorPos() + Dummy(ImVec2(0,0)) to extend CursorMaxPos... void ImGui::SetCursorScreenPos(const ImVec2& pos) { ImGuiWindow* window = GetCurrentWindow(); window->DC.CursorPos = pos; - window->DC.CursorMaxPos = ImMax(window->DC.CursorMaxPos, window->DC.CursorPos); + //window->DC.CursorMaxPos = ImMax(window->DC.CursorMaxPos, window->DC.CursorPos); + window->DC.IsSetPos = true; } // User generally sees positions in window coordinates. Internally we store CursorPos in absolute screen coordinates because it is more convenient. @@ -7672,21 +9144,24 @@ void ImGui::SetCursorPos(const ImVec2& local_pos) { ImGuiWindow* window = GetCurrentWindow(); window->DC.CursorPos = window->Pos - window->Scroll + local_pos; - window->DC.CursorMaxPos = ImMax(window->DC.CursorMaxPos, window->DC.CursorPos); + //window->DC.CursorMaxPos = ImMax(window->DC.CursorMaxPos, window->DC.CursorPos); + window->DC.IsSetPos = true; } void ImGui::SetCursorPosX(float x) { ImGuiWindow* window = GetCurrentWindow(); window->DC.CursorPos.x = window->Pos.x - window->Scroll.x + x; - window->DC.CursorMaxPos.x = ImMax(window->DC.CursorMaxPos.x, window->DC.CursorPos.x); + //window->DC.CursorMaxPos.x = ImMax(window->DC.CursorMaxPos.x, window->DC.CursorPos.x); + window->DC.IsSetPos = true; } void ImGui::SetCursorPosY(float y) { ImGuiWindow* window = GetCurrentWindow(); window->DC.CursorPos.y = window->Pos.y - window->Scroll.y + y; - window->DC.CursorMaxPos.y = ImMax(window->DC.CursorMaxPos.y, window->DC.CursorPos.y); + //window->DC.CursorMaxPos.y = ImMax(window->DC.CursorMaxPos.y, window->DC.CursorPos.y); + window->DC.IsSetPos = true; } ImVec2 ImGui::GetCursorStartPos() @@ -7777,7 +9252,8 @@ float ImGui::CalcItemWidth() // The 4.0f here may be changed to match CalcItemWidth() and/or BeginChild() (right now we have a mismatch which is harmless but undesirable) ImVec2 ImGui::CalcItemSize(ImVec2 size, float default_w, float default_h) { - ImGuiWindow* window = GImGui->CurrentWindow; + ImGuiContext& g = *GImGui; + ImGuiWindow* window = g.CurrentWindow; ImVec2 region_max; if (size.x < 0.0f || size.y < 0.0f) @@ -7902,6 +9378,9 @@ void ImGui::EndGroup() ImGuiGroupData& group_data = g.GroupStack.back(); IM_ASSERT(group_data.WindowID == window->ID); // EndGroup() in wrong window? + if (window->DC.IsSetPos) + ErrorCheckUsingSetCursorPosToExtendParentBoundaries(); + ImRect group_bb(group_data.BackupCursorPos, ImMax(window->DC.CursorMaxPos, group_data.BackupCursorPos)); window->DC.CursorPos = group_data.BackupCursorPos; @@ -7921,10 +9400,10 @@ void ImGui::EndGroup() window->DC.CurrLineTextBaseOffset = ImMax(window->DC.PrevLineTextBaseOffset, group_data.BackupCurrLineTextBaseOffset); // FIXME: Incorrect, we should grab the base offset from the *first line* of the group but it is hard to obtain now. ItemSize(group_bb.GetSize()); - ItemAdd(group_bb, 0); + ItemAdd(group_bb, 0, NULL, ImGuiItemFlags_NoTabStop); // If the current ActiveId was declared within the boundary of our group, we copy it to LastItemId so IsItemActive(), IsItemDeactivated() etc. will be functional on the entire group. - // It would be be neater if we replaced window.DC.LastItemId by e.g. 'bool LastItemIsActive', but would put a little more burden on individual widgets. + // It would be neater if we replaced window.DC.LastItemId by e.g. 'bool LastItemIsActive', but would put a little more burden on individual widgets. // Also if you grep for LastItemId you'll notice it is only used in that context. // (The two tests not the same because ActiveIdIsAlive is an ID itself, in order to be able to handle ActiveId being overwritten during the frame.) const bool group_contains_curr_active_id = (group_data.BackupActiveIdIsAlive != g.ActiveId) && (g.ActiveIdIsAlive == g.ActiveId) && g.ActiveId; @@ -8010,32 +9489,80 @@ static ImVec2 CalcNextScrollFromScrollTargetAndClamp(ImGuiWindow* window) return scroll; } +void ImGui::ScrollToItem(ImGuiScrollFlags flags) +{ + ImGuiContext& g = *GImGui; + ImGuiWindow* window = g.CurrentWindow; + ScrollToRectEx(window, g.LastItemData.NavRect, flags); +} + +void ImGui::ScrollToRect(ImGuiWindow* window, const ImRect& item_rect, ImGuiScrollFlags flags) +{ + ScrollToRectEx(window, item_rect, flags); +} + // Scroll to keep newly navigated item fully into view -ImVec2 ImGui::ScrollToBringRectIntoView(ImGuiWindow* window, const ImRect& item_rect) +ImVec2 ImGui::ScrollToRectEx(ImGuiWindow* window, const ImRect& item_rect, ImGuiScrollFlags flags) { ImGuiContext& g = *GImGui; ImRect window_rect(window->InnerRect.Min - ImVec2(1, 1), window->InnerRect.Max + ImVec2(1, 1)); //GetForegroundDrawList(window)->AddRect(window_rect.Min, window_rect.Max, IM_COL32_WHITE); // [DEBUG] - ImVec2 delta_scroll; - if (!window_rect.Contains(item_rect)) + // Check that only one behavior is selected per axis + IM_ASSERT((flags & ImGuiScrollFlags_MaskX_) == 0 || ImIsPowerOfTwo(flags & ImGuiScrollFlags_MaskX_)); + IM_ASSERT((flags & ImGuiScrollFlags_MaskY_) == 0 || ImIsPowerOfTwo(flags & ImGuiScrollFlags_MaskY_)); + + // Defaults + ImGuiScrollFlags in_flags = flags; + if ((flags & ImGuiScrollFlags_MaskX_) == 0 && window->ScrollbarX) + flags |= ImGuiScrollFlags_KeepVisibleEdgeX; + if ((flags & ImGuiScrollFlags_MaskY_) == 0) + flags |= window->Appearing ? ImGuiScrollFlags_AlwaysCenterY : ImGuiScrollFlags_KeepVisibleEdgeY; + + const bool fully_visible_x = item_rect.Min.x >= window_rect.Min.x && item_rect.Max.x <= window_rect.Max.x; + const bool fully_visible_y = item_rect.Min.y >= window_rect.Min.y && item_rect.Max.y <= window_rect.Max.y; + const bool can_be_fully_visible_x = (item_rect.GetWidth() + g.Style.ItemSpacing.x * 2.0f) <= window_rect.GetWidth(); + const bool can_be_fully_visible_y = (item_rect.GetHeight() + g.Style.ItemSpacing.y * 2.0f) <= window_rect.GetHeight(); + + if ((flags & ImGuiScrollFlags_KeepVisibleEdgeX) && !fully_visible_x) { - if (window->ScrollbarX && item_rect.Min.x < window_rect.Min.x) - SetScrollFromPosX(window, item_rect.Min.x - window->Pos.x - g.Style.ItemSpacing.x, 0.0f); - else if (window->ScrollbarX && item_rect.Max.x >= window_rect.Max.x) - SetScrollFromPosX(window, item_rect.Max.x - window->Pos.x + g.Style.ItemSpacing.x, 1.0f); - if (item_rect.Min.y < window_rect.Min.y) - SetScrollFromPosY(window, item_rect.Min.y - window->Pos.y - g.Style.ItemSpacing.y, 0.0f); - else if (item_rect.Max.y >= window_rect.Max.y) - SetScrollFromPosY(window, item_rect.Max.y - window->Pos.y + g.Style.ItemSpacing.y, 1.0f); + if (item_rect.Min.x < window_rect.Min.x || !can_be_fully_visible_x) + SetScrollFromPosX(window, item_rect.Min.x - g.Style.ItemSpacing.x - window->Pos.x, 0.0f); + else if (item_rect.Max.x >= window_rect.Max.x) + SetScrollFromPosX(window, item_rect.Max.x + g.Style.ItemSpacing.x - window->Pos.x, 1.0f); + } + else if (((flags & ImGuiScrollFlags_KeepVisibleCenterX) && !fully_visible_x) || (flags & ImGuiScrollFlags_AlwaysCenterX)) + { + float target_x = can_be_fully_visible_x ? ImFloor((item_rect.Min.x + item_rect.Max.x - window->InnerRect.GetWidth()) * 0.5f) : item_rect.Min.x; + SetScrollFromPosX(window, target_x - window->Pos.x, 0.0f); + } - ImVec2 next_scroll = CalcNextScrollFromScrollTargetAndClamp(window); - delta_scroll = next_scroll - window->Scroll; + if ((flags & ImGuiScrollFlags_KeepVisibleEdgeY) && !fully_visible_y) + { + if (item_rect.Min.y < window_rect.Min.y || !can_be_fully_visible_y) + SetScrollFromPosY(window, item_rect.Min.y - g.Style.ItemSpacing.y - window->Pos.y, 0.0f); + else if (item_rect.Max.y >= window_rect.Max.y) + SetScrollFromPosY(window, item_rect.Max.y + g.Style.ItemSpacing.y - window->Pos.y, 1.0f); + } + else if (((flags & ImGuiScrollFlags_KeepVisibleCenterY) && !fully_visible_y) || (flags & ImGuiScrollFlags_AlwaysCenterY)) + { + float target_y = can_be_fully_visible_y ? ImFloor((item_rect.Min.y + item_rect.Max.y - window->InnerRect.GetHeight()) * 0.5f) : item_rect.Min.y; + SetScrollFromPosY(window, target_y - window->Pos.y, 0.0f); } + ImVec2 next_scroll = CalcNextScrollFromScrollTargetAndClamp(window); + ImVec2 delta_scroll = next_scroll - window->Scroll; + // Also scroll parent window to keep us into view if necessary - if (window->Flags & ImGuiWindowFlags_ChildWindow) - delta_scroll += ScrollToBringRectIntoView(window->ParentWindow, ImRect(item_rect.Min - delta_scroll, item_rect.Max - delta_scroll)); + if (!(flags & ImGuiScrollFlags_NoScrollParent) && (window->Flags & ImGuiWindowFlags_ChildWindow)) + { + // FIXME-SCROLL: May be an option? + if ((in_flags & (ImGuiScrollFlags_AlwaysCenterX | ImGuiScrollFlags_KeepVisibleCenterX)) != 0) + in_flags = (in_flags & ~ImGuiScrollFlags_MaskX_) | ImGuiScrollFlags_KeepVisibleEdgeX; + if ((in_flags & (ImGuiScrollFlags_AlwaysCenterY | ImGuiScrollFlags_KeepVisibleCenterY)) != 0) + in_flags = (in_flags & ~ImGuiScrollFlags_MaskY_) | ImGuiScrollFlags_KeepVisibleEdgeY; + delta_scroll += ScrollToRectEx(window->ParentWindow, ImRect(item_rect.Min - delta_scroll, item_rect.Max - delta_scroll), in_flags); + } return delta_scroll; } @@ -8095,7 +9622,7 @@ void ImGui::SetScrollY(float scroll_y) // - local_pos = (absolution_pos - window->Pos) // - So local_x/local_y are 0.0f for a position at the upper-left corner of a window, // and generally local_x/local_y are >(padding+decoration) && <(size-padding-decoration) when in the visible area. -// - They mostly exists because of legacy API. +// - They mostly exist because of legacy API. // Following the rules above, when trying to work with scrolling code, consider that: // - SetScrollFromPosY(0.0f) == SetScrollY(0.0f + scroll.y) == has no effect! // - SetScrollFromPosY(-scroll.y) == SetScrollY(-scroll.y + scroll.y) == SetScrollY(0.0f) == reset scroll. Of course writing SetScrollY(0.0f) directly then makes more sense @@ -8162,10 +9689,10 @@ void ImGui::SetScrollHereY(float center_y_ratio) void ImGui::BeginTooltip() { - BeginTooltipEx(ImGuiWindowFlags_None, ImGuiTooltipFlags_None); + BeginTooltipEx(ImGuiTooltipFlags_None, ImGuiWindowFlags_None); } -void ImGui::BeginTooltipEx(ImGuiWindowFlags extra_flags, ImGuiTooltipFlags tooltip_flags) +void ImGui::BeginTooltipEx(ImGuiTooltipFlags tooltip_flags, ImGuiWindowFlags extra_window_flags) { ImGuiContext& g = *GImGui; @@ -8194,7 +9721,7 @@ void ImGui::BeginTooltipEx(ImGuiWindowFlags extra_flags, ImGuiTooltipFlags toolt ImFormatString(window_name, IM_ARRAYSIZE(window_name), "##Tooltip_%02d", ++g.TooltipOverrideCount); } ImGuiWindowFlags flags = ImGuiWindowFlags_Tooltip | ImGuiWindowFlags_NoInputs | ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_NoMove | ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoSavedSettings | ImGuiWindowFlags_AlwaysAutoResize; - Begin(window_name, NULL, flags | extra_flags); + Begin(window_name, NULL, flags | extra_window_flags); } void ImGui::EndTooltip() @@ -8205,7 +9732,7 @@ void ImGui::EndTooltip() void ImGui::SetTooltipV(const char* fmt, va_list args) { - BeginTooltipEx(0, ImGuiTooltipFlags_OverridePreviousTooltip); + BeginTooltipEx(ImGuiTooltipFlags_OverridePreviousTooltip, ImGuiWindowFlags_None); TextV(fmt, args); EndTooltip(); } @@ -8273,10 +9800,22 @@ ImGuiWindow* ImGui::GetTopMostPopupModal() return NULL; } +ImGuiWindow* ImGui::GetTopMostAndVisiblePopupModal() +{ + ImGuiContext& g = *GImGui; + for (int n = g.OpenPopupStack.Size - 1; n >= 0; n--) + if (ImGuiWindow* popup = g.OpenPopupStack.Data[n].Window) + if ((popup->Flags & ImGuiWindowFlags_Modal) && IsWindowActiveAndVisible(popup)) + return popup; + return NULL; +} + void ImGui::OpenPopup(const char* str_id, ImGuiPopupFlags popup_flags) { ImGuiContext& g = *GImGui; - OpenPopupEx(g.CurrentWindow->GetID(str_id), popup_flags); + ImGuiID id = g.CurrentWindow->GetID(str_id); + IMGUI_DEBUG_LOG_POPUP("[popup] OpenPopup(\"%s\" -> 0x%08X\n", str_id, id); + OpenPopupEx(id, popup_flags); } void ImGui::OpenPopup(ImGuiID id, ImGuiPopupFlags popup_flags) @@ -8301,13 +9840,13 @@ void ImGui::OpenPopupEx(ImGuiID id, ImGuiPopupFlags popup_flags) 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; popup_ref.Window = NULL; - popup_ref.SourceWindow = g.NavWindow; + popup_ref.BackupNavWindow = g.NavWindow; // When popup closes focus may be restored to NavWindow (depend on window type). popup_ref.OpenFrameCount = g.FrameCount; popup_ref.OpenParentId = parent_window->IDStack.back(); popup_ref.OpenPopupPos = NavCalcPreferredRefPos(); popup_ref.OpenMousePos = IsMousePosValid(&g.IO.MousePos) ? g.IO.MousePos : popup_ref.OpenPopupPos; - IMGUI_DEBUG_LOG_POPUP("OpenPopupEx(0x%08X)\n", id); + IMGUI_DEBUG_LOG_POPUP("[popup] OpenPopupEx(0x%08X)\n", id); if (g.OpenPopupStack.Size < current_stack_size + 1) { g.OpenPopupStack.push_back(popup_ref); @@ -8365,7 +9904,7 @@ void ImGui::ClosePopupsOverWindow(ImGuiWindow* ref_window, bool restore_focus_to bool ref_window_is_descendent_of_popup = false; for (int n = popup_count_to_keep; n < g.OpenPopupStack.Size; n++) if (ImGuiWindow* popup_window = g.OpenPopupStack[n].Window) - if (popup_window->RootWindow == ref_window->RootWindow) + if (IsWindowWithinBeginStackOf(ref_window, popup_window)) { ref_window_is_descendent_of_popup = true; break; @@ -8376,7 +9915,7 @@ void ImGui::ClosePopupsOverWindow(ImGuiWindow* ref_window, bool restore_focus_to } if (popup_count_to_keep < g.OpenPopupStack.Size) // This test is not required but it allows to set a convenient breakpoint on the statement below { - IMGUI_DEBUG_LOG_POPUP("ClosePopupsOverWindow(\"%s\") -> ClosePopupToLevel(%d)\n", ref_window->Name, popup_count_to_keep); + IMGUI_DEBUG_LOG_POPUP("[popup] ClosePopupsOverWindow(\"%s\")\n", ref_window ? ref_window->Name : ""); ClosePopupToLevel(popup_count_to_keep, restore_focus_to_window_under_popup); } } @@ -8399,16 +9938,17 @@ void ImGui::ClosePopupsExceptModals() void ImGui::ClosePopupToLevel(int remaining, bool restore_focus_to_window_under_popup) { ImGuiContext& g = *GImGui; - IMGUI_DEBUG_LOG_POPUP("ClosePopupToLevel(%d), restore_focus_to_window_under_popup=%d\n", remaining, restore_focus_to_window_under_popup); + IMGUI_DEBUG_LOG_POPUP("[popup] ClosePopupToLevel(%d), restore_focus_to_window_under_popup=%d\n", remaining, restore_focus_to_window_under_popup); IM_ASSERT(remaining >= 0 && remaining < g.OpenPopupStack.Size); // Trim open popup stack - ImGuiWindow* focus_window = g.OpenPopupStack[remaining].SourceWindow; ImGuiWindow* popup_window = g.OpenPopupStack[remaining].Window; + ImGuiWindow* popup_backup_nav_window = g.OpenPopupStack[remaining].BackupNavWindow; g.OpenPopupStack.resize(remaining); if (restore_focus_to_window_under_popup) { + ImGuiWindow* focus_window = (popup_window && popup_window->Flags & ImGuiWindowFlags_ChildMenu) ? popup_window->ParentWindow : popup_backup_nav_window; if (focus_window && !focus_window->WasActive && popup_window) { // Fallback @@ -8438,13 +9978,13 @@ void ImGui::CloseCurrentPopup() ImGuiWindow* parent_popup_window = g.OpenPopupStack[popup_idx - 1].Window; bool close_parent = false; if (popup_window && (popup_window->Flags & ImGuiWindowFlags_ChildMenu)) - if (parent_popup_window == NULL || !(parent_popup_window->Flags & ImGuiWindowFlags_Modal)) + if (parent_popup_window && !(parent_popup_window->Flags & ImGuiWindowFlags_MenuBar)) close_parent = true; if (!close_parent) break; popup_idx--; } - IMGUI_DEBUG_LOG_POPUP("CloseCurrentPopup %d -> %d\n", g.BeginPopupStack.Size - 1, popup_idx); + IMGUI_DEBUG_LOG_POPUP("[popup] CloseCurrentPopup %d -> %d\n", g.BeginPopupStack.Size - 1, popup_idx); ClosePopupToLevel(popup_idx, true); // A common pattern is to close a popup when selecting a menu item/selectable that will open another window. @@ -8466,7 +10006,7 @@ bool ImGui::BeginPopupEx(ImGuiID id, ImGuiWindowFlags flags) char name[20]; if (flags & ImGuiWindowFlags_ChildMenu) - ImFormatString(name, IM_ARRAYSIZE(name), "##Menu_%02d", g.BeginPopupStack.Size); // Recycle windows based on depth + ImFormatString(name, IM_ARRAYSIZE(name), "##Menu_%02d", g.BeginMenuCount); // Recycle windows based on depth else ImFormatString(name, IM_ARRAYSIZE(name), "##Popup_%08x", id); // Not recycling, so we can close/open during the same frame @@ -8487,7 +10027,8 @@ bool ImGui::BeginPopup(const char* str_id, ImGuiWindowFlags flags) return false; } flags |= ImGuiWindowFlags_AlwaysAutoResize | ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_NoSavedSettings; - return BeginPopupEx(g.CurrentWindow->GetID(str_id), flags); + ImGuiID id = g.CurrentWindow->GetID(str_id); + return BeginPopupEx(id, flags); } // If 'p_open' is specified for a modal popup window, the popup will have a regular close button which will close the popup. @@ -8566,7 +10107,7 @@ void ImGui::OpenPopupOnItemClick(const char* str_id, ImGuiPopupFlags popup_flags // - You may want to handle the whole on user side if you have specific needs (e.g. tweaking IsItemHovered() parameters). // This is essentially the same as: // id = str_id ? GetID(str_id) : GetItemID(); -// OpenPopupOnItemClick(str_id); +// OpenPopupOnItemClick(str_id, ImGuiPopupFlags_MouseButtonRight); // return BeginPopup(id); // Which is essentially the same as: // id = str_id ? GetID(str_id) : GetItemID(); @@ -8662,7 +10203,7 @@ ImVec2 ImGui::FindBestWindowPosForPopupEx(const ImVec2& ref_pos, const ImVec2& s const float avail_w = (dir == ImGuiDir_Left ? r_avoid.Min.x : r_outer.Max.x) - (dir == ImGuiDir_Right ? r_avoid.Max.x : r_outer.Min.x); const float avail_h = (dir == ImGuiDir_Up ? r_avoid.Min.y : r_outer.Max.y) - (dir == ImGuiDir_Down ? r_avoid.Max.y : r_outer.Min.y); - // If there not enough room on one axis, there's no point in positioning on a side on this axis (e.g. when not enough width, use a top/bottom position to maximize available width) + // If there's not enough room on one axis, there's no point in positioning on a side on this axis (e.g. when not enough width, use a top/bottom position to maximize available width) if (avail_w < size.x && (dir == ImGuiDir_Left || dir == ImGuiDir_Right)) continue; if (avail_h < size.y && (dir == ImGuiDir_Up || dir == ImGuiDir_Down)) @@ -8727,8 +10268,7 @@ ImVec2 ImGui::FindBestWindowPosForPopup(ImGuiWindow* window) } if (window->Flags & ImGuiWindowFlags_Popup) { - ImRect r_avoid = ImRect(window->Pos.x - 1, window->Pos.y - 1, window->Pos.x + 1, window->Pos.y + 1); - return FindBestWindowPosForPopupEx(window->Pos, window->Size, &window->AutoPosLastDirection, r_outer, r_avoid, ImGuiPopupPositionPolicy_Default); + return FindBestWindowPosForPopupEx(window->Pos, window->Size, &window->AutoPosLastDirection, r_outer, ImRect(window->Pos, window->Pos), ImGuiPopupPositionPolicy_Default); // Ideally we'd disable r_avoid here } if (window->Flags & ImGuiWindowFlags_Tooltip) { @@ -8750,8 +10290,22 @@ ImVec2 ImGui::FindBestWindowPosForPopup(ImGuiWindow* window) // [SECTION] KEYBOARD/GAMEPAD NAVIGATION //----------------------------------------------------------------------------- -// FIXME-NAV: The existence of SetNavID vs SetFocusID properly needs to be clarified/reworked. -// In our terminology those should be interchangeable. Those two functions are merely a legacy artifact, so at minimum naming should be clarified. +// FIXME-NAV: The existence of SetNavID vs SetFocusID vs FocusWindow() needs to be clarified/reworked. +// In our terminology those should be interchangeable, yet right now this is super confusing. +// Those two functions are merely a legacy artifact, so at minimum naming should be clarified. + +void ImGui::SetNavWindow(ImGuiWindow* window) +{ + ImGuiContext& g = *GImGui; + if (g.NavWindow != window) + { + IMGUI_DEBUG_LOG_FOCUS("[focus] SetNavWindow(\"%s\")\n", window ? window->Name : ""); + g.NavWindow = window; + } + g.NavInitRequest = g.NavMoveSubmitted = g.NavMoveScoringItems = false; + NavUpdateAnyRequestFlag(); +} + void ImGui::SetNavID(ImGuiID id, ImGuiNavLayer nav_layer, ImGuiID focus_scope_id, const ImRect& rect_rel) { ImGuiContext& g = *GImGui; @@ -8762,8 +10316,6 @@ void ImGui::SetNavID(ImGuiID id, ImGuiNavLayer nav_layer, ImGuiID focus_scope_id g.NavFocusScopeId = focus_scope_id; g.NavWindow->NavLastIds[nav_layer] = id; g.NavWindow->NavRectRel[nav_layer] = rect_rel; - //g.NavDisableHighlight = false; - //g.NavDisableMouseHover = g.NavMousePosDirty = true; } void ImGui::SetFocusID(ImGuiID id, ImGuiWindow* window) @@ -8771,18 +10323,18 @@ void ImGui::SetFocusID(ImGuiID id, ImGuiWindow* window) ImGuiContext& g = *GImGui; IM_ASSERT(id != 0); - // Assume that SetFocusID() is called in the context where its window->DC.NavLayerCurrent and window->DC.NavFocusScopeIdCurrent are valid. + if (g.NavWindow != window) + SetNavWindow(window); + + // Assume that SetFocusID() is called in the context where its window->DC.NavLayerCurrent and g.CurrentFocusScopeId are valid. // Note that window may be != g.CurrentWindow (e.g. SetFocusID call in InputTextEx for multi-line text) const ImGuiNavLayer nav_layer = window->DC.NavLayerCurrent; - if (g.NavWindow != window) - g.NavInitRequest = false; - g.NavWindow = window; g.NavId = id; g.NavLayer = nav_layer; - g.NavFocusScopeId = window->DC.NavFocusScopeIdCurrent; + g.NavFocusScopeId = g.CurrentFocusScopeId; window->NavLastIds[nav_layer] = id; if (g.LastItemData.ID == id) - window->NavRectRel[nav_layer] = ImRect(g.LastItemData.NavRect.Min - window->Pos, g.LastItemData.NavRect.Max - window->Pos); + window->NavRectRel[nav_layer] = WindowRectAbsToRel(window, g.LastItemData.NavRect); if (g.ActiveIdSource == ImGuiInputSource_Nav) g.NavDisableMouseHover = true; @@ -8843,7 +10395,7 @@ static bool ImGui::NavScoreItem(ImGuiNavItemData* result) } // We perform scoring on items bounding box clipped by the current clipping rectangle on the other axis (clipping on our movement axis would give us equal scores for all clipped items) - // For example, this ensure that items in one column are not reached when moving vertically from items in another column. + // For example, this ensures that items in one column are not reached when moving vertically from items in another column. NavClampRectToVisibleAreaForMoveDir(g.NavMoveClipDir, cand, window->ClipRect); // Compute distance between boxes @@ -8907,7 +10459,7 @@ static bool ImGui::NavScoreItem(ImGuiNavItemData* result) } #endif - // Is it in the quadrant we're interesting in moving to? + // Is it in the quadrant we're interested in moving to? bool new_best = false; const ImGuiDir move_dir = g.NavMoveDir; if (quadrant == move_dir) @@ -8960,8 +10512,9 @@ static void ImGui::NavApplyItemToResult(ImGuiNavItemData* result) ImGuiWindow* window = g.CurrentWindow; result->Window = window; result->ID = g.LastItemData.ID; - result->FocusScopeId = window->DC.NavFocusScopeIdCurrent; - result->RectRel = ImRect(g.LastItemData.NavRect.Min - window->Pos, g.LastItemData.NavRect.Max - window->Pos); + result->FocusScopeId = g.CurrentFocusScopeId; + result->InFlags = g.LastItemData.InFlags; + result->RectRel = WindowRectAbsToRel(window, g.LastItemData.NavRect); } // We get there when either NavId == id, or when g.NavAnyRequest is set (which is updated by NavUpdateAnyRequestFlag above) @@ -8975,14 +10528,14 @@ static void ImGui::NavProcessItem() const ImGuiItemFlags item_flags = g.LastItemData.InFlags; // Process Init Request - if (g.NavInitRequest && g.NavLayer == window->DC.NavLayerCurrent) + if (g.NavInitRequest && g.NavLayer == window->DC.NavLayerCurrent && (item_flags & ImGuiItemFlags_Disabled) == 0) { // Even if 'ImGuiItemFlags_NoNavDefaultFocus' is on (typically collapse/close button) we record the first ResultId so they can be used as a fallback - const bool candidate_for_nav_default_focus = (item_flags & (ImGuiItemFlags_NoNavDefaultFocus | ImGuiItemFlags_Disabled)) == 0; + const bool candidate_for_nav_default_focus = (item_flags & ImGuiItemFlags_NoNavDefaultFocus) == 0; if (candidate_for_nav_default_focus || g.NavInitResultId == 0) { g.NavInitResultId = id; - g.NavInitResultRectRel = ImRect(nav_bb.Min - window->Pos, nav_bb.Max - window->Pos); + g.NavInitResultRectRel = WindowRectAbsToRel(window, nav_bb); } if (candidate_for_nav_default_focus) { @@ -8995,29 +10548,87 @@ static void ImGui::NavProcessItem() // FIXME-NAV: Consider policy for double scoring (scoring from NavScoringRect + scoring from a rect wrapped according to current wrapping policy) if (g.NavMoveScoringItems) { - if ((g.NavId != id || (g.NavMoveFlags & ImGuiNavMoveFlags_AllowCurrentNavId)) && !(item_flags & (ImGuiItemFlags_Disabled | ImGuiItemFlags_NoNav))) + const bool is_tab_stop = (item_flags & ImGuiItemFlags_Inputable) && (item_flags & (ImGuiItemFlags_NoTabStop | ImGuiItemFlags_Disabled)) == 0; + const bool is_tabbing = (g.NavMoveFlags & ImGuiNavMoveFlags_Tabbing) != 0; + if (is_tabbing) + { + if (is_tab_stop || (g.NavMoveFlags & ImGuiNavMoveFlags_FocusApi)) + NavProcessItemForTabbingRequest(id); + } + else if ((g.NavId != id || (g.NavMoveFlags & ImGuiNavMoveFlags_AllowCurrentNavId)) && !(item_flags & ImGuiItemFlags_Disabled)) { ImGuiNavItemData* result = (window == g.NavWindow) ? &g.NavMoveResultLocal : &g.NavMoveResultOther; - if (NavScoreItem(result)) - NavApplyItemToResult(result); - - // Features like PageUp/PageDown need to maintain a separate score for the visible set of items. - const float VISIBLE_RATIO = 0.70f; - if ((g.NavMoveFlags & ImGuiNavMoveFlags_AlsoScoreVisibleSet) && window->ClipRect.Overlaps(nav_bb)) - if (ImClamp(nav_bb.Max.y, window->ClipRect.Min.y, window->ClipRect.Max.y) - ImClamp(nav_bb.Min.y, window->ClipRect.Min.y, window->ClipRect.Max.y) >= (nav_bb.Max.y - nav_bb.Min.y) * VISIBLE_RATIO) - if (NavScoreItem(&g.NavMoveResultLocalVisible)) - NavApplyItemToResult(&g.NavMoveResultLocalVisible); + if (!is_tabbing) + { + if (NavScoreItem(result)) + NavApplyItemToResult(result); + + // Features like PageUp/PageDown need to maintain a separate score for the visible set of items. + const float VISIBLE_RATIO = 0.70f; + if ((g.NavMoveFlags & ImGuiNavMoveFlags_AlsoScoreVisibleSet) && window->ClipRect.Overlaps(nav_bb)) + if (ImClamp(nav_bb.Max.y, window->ClipRect.Min.y, window->ClipRect.Max.y) - ImClamp(nav_bb.Min.y, window->ClipRect.Min.y, window->ClipRect.Max.y) >= (nav_bb.Max.y - nav_bb.Min.y) * VISIBLE_RATIO) + if (NavScoreItem(&g.NavMoveResultLocalVisible)) + NavApplyItemToResult(&g.NavMoveResultLocalVisible); + } } } // Update window-relative bounding box of navigated item if (g.NavId == id) { - g.NavWindow = window; // Always refresh g.NavWindow, because some operations such as FocusItem() don't have a window. + if (g.NavWindow != window) + SetNavWindow(window); // Always refresh g.NavWindow, because some operations such as FocusItem() may not have a window. g.NavLayer = window->DC.NavLayerCurrent; - g.NavFocusScopeId = window->DC.NavFocusScopeIdCurrent; + g.NavFocusScopeId = g.CurrentFocusScopeId; g.NavIdIsAlive = true; - window->NavRectRel[window->DC.NavLayerCurrent] = ImRect(nav_bb.Min - window->Pos, nav_bb.Max - window->Pos); // Store item bounding box (relative to window position) + window->NavRectRel[window->DC.NavLayerCurrent] = WindowRectAbsToRel(window, nav_bb); // Store item bounding box (relative to window position) + } +} + +// Handle "scoring" of an item for a tabbing/focusing request initiated by NavUpdateCreateTabbingRequest(). +// Note that SetKeyboardFocusHere() API calls are considered tabbing requests! +// - Case 1: no nav/active id: set result to first eligible item, stop storing. +// - Case 2: tab forward: on ref id set counter, on counter elapse store result +// - Case 3: tab forward wrap: set result to first eligible item (preemptively), on ref id set counter, on next frame if counter hasn't elapsed store result. // FIXME-TABBING: Could be done as a next-frame forwarded request +// - Case 4: tab backward: store all results, on ref id pick prev, stop storing +// - Case 5: tab backward wrap: store all results, on ref id if no result keep storing until last // FIXME-TABBING: Could be done as next-frame forwarded requested +void ImGui::NavProcessItemForTabbingRequest(ImGuiID id) +{ + ImGuiContext& g = *GImGui; + + // Always store in NavMoveResultLocal (unlike directional request which uses NavMoveResultOther on sibling/flattened windows) + ImGuiNavItemData* result = &g.NavMoveResultLocal; + if (g.NavTabbingDir == +1) + { + // Tab Forward or SetKeyboardFocusHere() with >= 0 + if (g.NavTabbingResultFirst.ID == 0) + NavApplyItemToResult(&g.NavTabbingResultFirst); + if (--g.NavTabbingCounter == 0) + NavMoveRequestResolveWithLastItem(result); + else if (g.NavId == id) + g.NavTabbingCounter = 1; + } + else if (g.NavTabbingDir == -1) + { + // Tab Backward + if (g.NavId == id) + { + if (result->ID) + { + g.NavMoveScoringItems = false; + NavUpdateAnyRequestFlag(); + } + } + else + { + NavApplyItemToResult(result); + } + } + else if (g.NavTabbingDir == 0) + { + // Tab Init + if (g.NavTabbingResultFirst.ID == 0) + NavMoveRequestResolveWithLastItem(&g.NavTabbingResultFirst); } } @@ -9028,20 +10639,35 @@ bool ImGui::NavMoveRequestButNoResultYet() } // FIXME: ScoringRect is not set -void ImGui::NavMoveRequestSubmit(ImGuiDir move_dir, ImGuiDir clip_dir, ImGuiNavMoveFlags move_flags) +void ImGui::NavMoveRequestSubmit(ImGuiDir move_dir, ImGuiDir clip_dir, ImGuiNavMoveFlags move_flags, ImGuiScrollFlags scroll_flags) { ImGuiContext& g = *GImGui; IM_ASSERT(g.NavWindow != NULL); + + if (move_flags & ImGuiNavMoveFlags_Tabbing) + move_flags |= ImGuiNavMoveFlags_AllowCurrentNavId; + g.NavMoveSubmitted = g.NavMoveScoringItems = true; g.NavMoveDir = move_dir; g.NavMoveDirForDebug = move_dir; g.NavMoveClipDir = clip_dir; g.NavMoveFlags = move_flags; + g.NavMoveScrollFlags = scroll_flags; g.NavMoveForwardToNextFrame = false; g.NavMoveKeyMods = g.IO.KeyMods; g.NavMoveResultLocal.Clear(); g.NavMoveResultLocalVisible.Clear(); g.NavMoveResultOther.Clear(); + g.NavTabbingCounter = 0; + g.NavTabbingResultFirst.Clear(); + NavUpdateAnyRequestFlag(); +} + +void ImGui::NavMoveRequestResolveWithLastItem(ImGuiNavItemData* result) +{ + ImGuiContext& g = *GImGui; + g.NavMoveScoringItems = false; // Ensure request doesn't need more processing + NavApplyItemToResult(result); NavUpdateAnyRequestFlag(); } @@ -9053,7 +10679,7 @@ void ImGui::NavMoveRequestCancel() } // Forward will reuse the move request again on the next frame (generally with modifications done to it) -void ImGui::NavMoveRequestForward(ImGuiDir move_dir, ImGuiDir clip_dir, ImGuiNavMoveFlags move_flags) +void ImGui::NavMoveRequestForward(ImGuiDir move_dir, ImGuiDir clip_dir, ImGuiNavMoveFlags move_flags, ImGuiScrollFlags scroll_flags) { ImGuiContext& g = *GImGui; IM_ASSERT(g.NavMoveForwardToNextFrame == false); @@ -9062,6 +10688,7 @@ void ImGui::NavMoveRequestForward(ImGuiDir move_dir, ImGuiDir clip_dir, ImGuiNav g.NavMoveDir = move_dir; g.NavMoveClipDir = clip_dir; g.NavMoveFlags = move_flags | ImGuiNavMoveFlags_Forwarded; + g.NavMoveScrollFlags = scroll_flags; } // Navigation wrap-around logic is delayed to the end of the frame because this operation is only valid after entire @@ -9099,7 +10726,12 @@ void ImGui::NavRestoreLayer(ImGuiNavLayer layer) { ImGuiContext& g = *GImGui; if (layer == ImGuiNavLayer_Main) - g.NavWindow = NavRestoreLastChildNavWindow(g.NavWindow); + { + ImGuiWindow* prev_nav_window = g.NavWindow; + g.NavWindow = NavRestoreLastChildNavWindow(g.NavWindow); // FIXME-NAV: Should clear ongoing nav requests? + if (prev_nav_window) + IMGUI_DEBUG_LOG_FOCUS("[focus] NavRestoreLayer: from \"%s\" to SetNavWindow(\"%s\")\n", prev_nav_window->Name, g.NavWindow->Name); + } ImGuiWindow* window = g.NavWindow; if (window->NavLastIds[layer] != 0) { @@ -9110,6 +10742,11 @@ void ImGui::NavRestoreLayer(ImGuiNavLayer layer) g.NavLayer = layer; NavInitWindow(window, true); } +} + +void ImGui::NavRestoreHighlightAfterMove() +{ + ImGuiContext& g = *GImGui; g.NavDisableHighlight = false; g.NavDisableMouseHover = g.NavMousePosDirty = true; } @@ -9130,7 +10767,8 @@ void ImGui::NavInitWindow(ImGuiWindow* window, bool force_reinit) if (window->Flags & ImGuiWindowFlags_NoNavInputs) { - g.NavId = g.NavFocusScopeId = 0; + g.NavId = 0; + g.NavFocusScopeId = window->NavRootFocusScopeId; return; } @@ -9140,7 +10778,7 @@ void ImGui::NavInitWindow(ImGuiWindow* window, bool force_reinit) IMGUI_DEBUG_LOG_NAV("[nav] NavInitRequest: from NavInitWindow(), init_for_nav=%d, window=\"%s\", layer=%d\n", init_for_nav, window->Name, g.NavLayer); if (init_for_nav) { - SetNavID(0, g.NavLayer, 0, ImRect()); + SetNavID(0, g.NavLayer, window->NavRootFocusScopeId, ImRect()); g.NavInitRequest = true; g.NavInitRequestFromMove = false; g.NavInitResultId = 0; @@ -9150,66 +10788,59 @@ void ImGui::NavInitWindow(ImGuiWindow* window, bool force_reinit) else { g.NavId = window->NavLastIds[0]; - g.NavFocusScopeId = 0; + g.NavFocusScopeId = window->NavRootFocusScopeId; } } static ImVec2 ImGui::NavCalcPreferredRefPos() { ImGuiContext& g = *GImGui; - if (g.NavDisableHighlight || !g.NavDisableMouseHover || !g.NavWindow) + ImGuiWindow* window = g.NavWindow; + if (g.NavDisableHighlight || !g.NavDisableMouseHover || !window) { // Mouse (we need a fallback in case the mouse becomes invalid after being used) - if (IsMousePosValid(&g.IO.MousePos)) - return g.IO.MousePos; - return g.MouseLastValidPos; + // The +1.0f offset when stored by OpenPopupEx() allows reopening this or another popup (same or another mouse button) while not moving the mouse, it is pretty standard. + // In theory we could move that +1.0f offset in OpenPopupEx() + ImVec2 p = IsMousePosValid(&g.IO.MousePos) ? g.IO.MousePos : g.MouseLastValidPos; + return ImVec2(p.x + 1.0f, p.y); } else { - // When navigation is active and mouse is disabled, decide on an arbitrary position around the bottom left of the currently navigated item. - const ImRect& rect_rel = g.NavWindow->NavRectRel[g.NavLayer]; - ImVec2 pos = g.NavWindow->Pos + ImVec2(rect_rel.Min.x + ImMin(g.Style.FramePadding.x * 4, rect_rel.GetWidth()), rect_rel.Max.y - ImMin(g.Style.FramePadding.y, rect_rel.GetHeight())); + // When navigation is active and mouse is disabled, pick a position around the bottom left of the currently navigated item + // Take account of upcoming scrolling (maybe set mouse pos should be done in EndFrame?) + ImRect rect_rel = WindowRectRelToAbs(window, window->NavRectRel[g.NavLayer]); + if (window->LastFrameActive != g.FrameCount && (window->ScrollTarget.x != FLT_MAX || window->ScrollTarget.y != FLT_MAX)) + { + ImVec2 next_scroll = CalcNextScrollFromScrollTargetAndClamp(window); + rect_rel.Translate(window->Scroll - next_scroll); + } + ImVec2 pos = ImVec2(rect_rel.Min.x + ImMin(g.Style.FramePadding.x * 4, rect_rel.GetWidth()), rect_rel.Max.y - ImMin(g.Style.FramePadding.y, rect_rel.GetHeight())); ImGuiViewport* viewport = GetMainViewport(); return ImFloor(ImClamp(pos, viewport->Pos, viewport->Pos + viewport->Size)); // ImFloor() is important because non-integer mouse position application in backend might be lossy and result in undesirable non-zero delta. } } -float ImGui::GetNavInputAmount(ImGuiNavInput n, ImGuiInputReadMode mode) +float ImGui::GetNavTweakPressedAmount(ImGuiAxis axis) { ImGuiContext& g = *GImGui; - if (mode == ImGuiInputReadMode_Down) - return g.IO.NavInputs[n]; // Instant, read analog input (0.0f..1.0f, as provided by user) - - const float t = g.IO.NavInputsDownDuration[n]; - if (t < 0.0f && mode == ImGuiInputReadMode_Released) // Return 1.0f when just released, no repeat, ignore analog input. - return (g.IO.NavInputsDownDurationPrev[n] >= 0.0f ? 1.0f : 0.0f); - if (t < 0.0f) - return 0.0f; - if (mode == ImGuiInputReadMode_Pressed) // Return 1.0f when just pressed, no repeat, ignore analog input. - return (t == 0.0f) ? 1.0f : 0.0f; - if (mode == ImGuiInputReadMode_Repeat) - return (float)CalcTypematicRepeatAmount(t - g.IO.DeltaTime, t, g.IO.KeyRepeatDelay * 0.72f, g.IO.KeyRepeatRate * 0.80f); - if (mode == ImGuiInputReadMode_RepeatSlow) - return (float)CalcTypematicRepeatAmount(t - g.IO.DeltaTime, t, g.IO.KeyRepeatDelay * 1.25f, g.IO.KeyRepeatRate * 2.00f); - if (mode == ImGuiInputReadMode_RepeatFast) - return (float)CalcTypematicRepeatAmount(t - g.IO.DeltaTime, t, g.IO.KeyRepeatDelay * 0.72f, g.IO.KeyRepeatRate * 0.30f); - return 0.0f; -} + float repeat_delay, repeat_rate; + GetTypematicRepeatRate(ImGuiInputFlags_RepeatRateNavTweak, &repeat_delay, &repeat_rate); -ImVec2 ImGui::GetNavInputAmount2d(ImGuiNavDirSourceFlags dir_sources, ImGuiInputReadMode mode, float slow_factor, float fast_factor) -{ - ImVec2 delta(0.0f, 0.0f); - if (dir_sources & ImGuiNavDirSourceFlags_Keyboard) - delta += ImVec2(GetNavInputAmount(ImGuiNavInput_KeyRight_, mode) - GetNavInputAmount(ImGuiNavInput_KeyLeft_, mode), GetNavInputAmount(ImGuiNavInput_KeyDown_, mode) - GetNavInputAmount(ImGuiNavInput_KeyUp_, mode)); - if (dir_sources & ImGuiNavDirSourceFlags_PadDPad) - delta += ImVec2(GetNavInputAmount(ImGuiNavInput_DpadRight, mode) - GetNavInputAmount(ImGuiNavInput_DpadLeft, mode), GetNavInputAmount(ImGuiNavInput_DpadDown, mode) - GetNavInputAmount(ImGuiNavInput_DpadUp, mode)); - if (dir_sources & ImGuiNavDirSourceFlags_PadLStick) - delta += ImVec2(GetNavInputAmount(ImGuiNavInput_LStickRight, mode) - GetNavInputAmount(ImGuiNavInput_LStickLeft, mode), GetNavInputAmount(ImGuiNavInput_LStickDown, mode) - GetNavInputAmount(ImGuiNavInput_LStickUp, mode)); - if (slow_factor != 0.0f && IsNavInputDown(ImGuiNavInput_TweakSlow)) - delta *= slow_factor; - if (fast_factor != 0.0f && IsNavInputDown(ImGuiNavInput_TweakFast)) - delta *= fast_factor; - return delta; + ImGuiKey key_less, key_more; + if (g.NavInputSource == ImGuiInputSource_Gamepad) + { + key_less = (axis == ImGuiAxis_X) ? ImGuiKey_GamepadDpadLeft : ImGuiKey_GamepadDpadUp; + key_more = (axis == ImGuiAxis_X) ? ImGuiKey_GamepadDpadRight : ImGuiKey_GamepadDpadDown; + } + else + { + key_less = (axis == ImGuiAxis_X) ? ImGuiKey_LeftArrow : ImGuiKey_UpArrow; + key_more = (axis == ImGuiAxis_X) ? ImGuiKey_RightArrow : ImGuiKey_DownArrow; + } + float amount = (float)GetKeyPressedAmount(key_more, repeat_delay, repeat_rate) - (float)GetKeyPressedAmount(key_less, repeat_delay, repeat_rate); + if (amount != 0.0f && IsKeyDown(key_less) && IsKeyDown(key_more)) // Cancel when opposite directions are held, regardless of repeat phase + amount = 0.0f; + return amount; } static void ImGui::NavUpdate() @@ -9218,39 +10849,22 @@ static void ImGui::NavUpdate() ImGuiIO& io = g.IO; io.WantSetMousePos = false; - //if (g.NavScoringDebugCount > 0) IMGUI_DEBUG_LOG("NavScoringDebugCount %d for '%s' layer %d (Init:%d, Move:%d)\n", g.NavScoringDebugCount, g.NavWindow ? g.NavWindow->Name : "NULL", g.NavLayer, g.NavInitRequest || g.NavInitResultId != 0, g.NavMoveRequest); + //if (g.NavScoringDebugCount > 0) IMGUI_DEBUG_LOG_NAV("[nav] NavScoringDebugCount %d for '%s' layer %d (Init:%d, Move:%d)\n", g.NavScoringDebugCount, g.NavWindow ? g.NavWindow->Name : "NULL", g.NavLayer, g.NavInitRequest || g.NavInitResultId != 0, g.NavMoveRequest); - // Set input source as Gamepad when buttons are pressed (as some features differs when used with Gamepad vs Keyboard) - // (do it before we map Keyboard input!) - const bool nav_keyboard_active = (io.ConfigFlags & ImGuiConfigFlags_NavEnableKeyboard) != 0; + // Set input source based on which keys are last pressed (as some features differs when used with Gamepad vs Keyboard) + // 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; - if (nav_gamepad_active && g.NavInputSource != ImGuiInputSource_Gamepad) - { - if (io.NavInputs[ImGuiNavInput_Activate] > 0.0f || io.NavInputs[ImGuiNavInput_Input] > 0.0f || io.NavInputs[ImGuiNavInput_Cancel] > 0.0f || io.NavInputs[ImGuiNavInput_Menu] > 0.0f - || io.NavInputs[ImGuiNavInput_DpadLeft] > 0.0f || io.NavInputs[ImGuiNavInput_DpadRight] > 0.0f || io.NavInputs[ImGuiNavInput_DpadUp] > 0.0f || io.NavInputs[ImGuiNavInput_DpadDown] > 0.0f) - g.NavInputSource = ImGuiInputSource_Gamepad; - } - - // Update Keyboard->Nav inputs mapping + 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) + 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) - { - #define NAV_MAP_KEY(_KEY, _NAV_INPUT) do { if (IsKeyDown(io.KeyMap[_KEY])) { io.NavInputs[_NAV_INPUT] = 1.0f; g.NavInputSource = ImGuiInputSource_Keyboard; } } while (0) - NAV_MAP_KEY(ImGuiKey_Space, ImGuiNavInput_Activate ); - NAV_MAP_KEY(ImGuiKey_Enter, ImGuiNavInput_Input ); - NAV_MAP_KEY(ImGuiKey_Escape, ImGuiNavInput_Cancel ); - NAV_MAP_KEY(ImGuiKey_LeftArrow, ImGuiNavInput_KeyLeft_ ); - NAV_MAP_KEY(ImGuiKey_RightArrow,ImGuiNavInput_KeyRight_); - NAV_MAP_KEY(ImGuiKey_UpArrow, ImGuiNavInput_KeyUp_ ); - NAV_MAP_KEY(ImGuiKey_DownArrow, ImGuiNavInput_KeyDown_ ); - if (io.KeyCtrl) - io.NavInputs[ImGuiNavInput_TweakSlow] = 1.0f; - if (io.KeyShift) - io.NavInputs[ImGuiNavInput_TweakFast] = 1.0f; - #undef NAV_MAP_KEY - } - memcpy(io.NavInputsDownDurationPrev, io.NavInputsDownDuration, sizeof(io.NavInputsDownDuration)); - for (int i = 0; i < IM_ARRAYSIZE(io.NavInputs); i++) - io.NavInputsDownDuration[i] = (io.NavInputs[i] > 0.0f) ? (io.NavInputsDownDuration[i] < 0.0f ? 0.0f : io.NavInputsDownDuration[i] + io.DeltaTime) : -1.0f; + for (ImGuiKey key : nav_keyboard_keys_to_change_source) + if (IsKeyDown(key)) + g.NavInputSource = ImGuiInputSource_Keyboard; // Process navigation init request (select first/default focus) if (g.NavInitResultId != 0) @@ -9263,24 +10877,16 @@ static void ImGui::NavUpdate() // Process navigation move request if (g.NavMoveSubmitted) NavMoveRequestApplyResult(); + g.NavTabbingCounter = 0; g.NavMoveSubmitted = g.NavMoveScoringItems = false; - // Apply application mouse position movement, after we had a chance to process move request result. + // Schedule mouse position update (will be done at the bottom of this function, after 1) processing all move requests and 2) updating scrolling) + bool set_mouse_pos = false; if (g.NavMousePosDirty && g.NavIdIsAlive) - { - // Set mouse position given our knowledge of the navigated item position from last frame - if ((io.ConfigFlags & ImGuiConfigFlags_NavEnableSetMousePos) && (io.BackendFlags & ImGuiBackendFlags_HasSetMousePos)) - if (!g.NavDisableHighlight && g.NavDisableMouseHover && g.NavWindow) - { - io.MousePos = io.MousePosPrev = NavCalcPreferredRefPos(); - io.WantSetMousePos = true; - //IMGUI_DEBUG_LOG("SetMousePos: (%.1f,%.1f)\n", io.MousePos.x, io.MousePos.y); - } - g.NavMousePosDirty = false; - } - g.NavIdIsAlive = false; - g.NavJustTabbedId = 0; - IM_ASSERT(g.NavLayer == 0 || g.NavLayer == 1); + if (!g.NavDisableHighlight && g.NavDisableMouseHover && g.NavWindow) + set_mouse_pos = true; + g.NavMousePosDirty = false; + IM_ASSERT(g.NavLayer == ImGuiNavLayer_Main || g.NavLayer == ImGuiNavLayer_Menu); // Store our return window (for returning from Menu Layer to Main Layer) and clear it as soon as we step back in our own Layer 0 if (g.NavWindow) @@ -9303,10 +10909,10 @@ static void ImGui::NavUpdate() g.NavActivateFlags = ImGuiActivateFlags_None; if (g.NavId != 0 && !g.NavDisableHighlight && !g.NavWindowingTarget && g.NavWindow && !(g.NavWindow->Flags & ImGuiWindowFlags_NoNavInputs)) { - bool activate_down = IsNavInputDown(ImGuiNavInput_Activate); - bool input_down = IsNavInputDown(ImGuiNavInput_Input); - bool activate_pressed = activate_down && IsNavInputTest(ImGuiNavInput_Activate, ImGuiInputReadMode_Pressed); - bool input_pressed = input_down && IsNavInputTest(ImGuiNavInput_Input, ImGuiInputReadMode_Pressed); + const bool activate_down = (nav_keyboard_active && IsKeyDown(ImGuiKey_Space)) || (nav_gamepad_active && IsKeyDown(ImGuiKey_NavGamepadActivate)); + const bool activate_pressed = activate_down && ((nav_keyboard_active && IsKeyPressed(ImGuiKey_Space, false)) || (nav_gamepad_active && IsKeyPressed(ImGuiKey_NavGamepadActivate, false))); + const bool input_down = (nav_keyboard_active && IsKeyDown(ImGuiKey_Enter)) || (nav_gamepad_active && IsKeyDown(ImGuiKey_NavGamepadInput)); + const bool input_pressed = input_down && ((nav_keyboard_active && IsKeyPressed(ImGuiKey_Enter, false)) || (nav_gamepad_active && IsKeyPressed(ImGuiKey_NavGamepadInput, false))); if (g.ActiveId == 0 && activate_pressed) { g.NavActivateId = g.NavId; @@ -9341,7 +10947,10 @@ static void ImGui::NavUpdate() // Process move requests NavUpdateCreateMoveRequest(); + if (g.NavMoveDir == ImGuiDir_None) + NavUpdateCreateTabbingRequest(); NavUpdateAnyRequestFlag(); + g.NavIdIsAlive = false; // Scrolling if (g.NavWindow && !(g.NavWindow->Flags & ImGuiWindowFlags_NoNavInputs) && !g.NavWindowingTarget) @@ -9358,20 +10967,33 @@ static void ImGui::NavUpdate() SetScrollY(window, ImFloor(window->Scroll.y + ((move_dir == ImGuiDir_Up) ? -1.0f : +1.0f) * scroll_speed)); } - // *Normal* Manual scroll with NavScrollXXX keys + // *Normal* Manual scroll with LStick // Next movement request will clamp the NavId reference rectangle to the visible area, so navigation will resume within those bounds. - ImVec2 scroll_dir = GetNavInputAmount2d(ImGuiNavDirSourceFlags_PadLStick, ImGuiInputReadMode_Down, 1.0f / 10.0f, 10.0f); - if (scroll_dir.x != 0.0f && window->ScrollbarX) - SetScrollX(window, ImFloor(window->Scroll.x + scroll_dir.x * scroll_speed)); - if (scroll_dir.y != 0.0f) - SetScrollY(window, ImFloor(window->Scroll.y + scroll_dir.y * scroll_speed)); + if (nav_gamepad_active) + { + const ImVec2 scroll_dir = GetKeyVector2d(ImGuiKey_GamepadLStickLeft, ImGuiKey_GamepadLStickRight, ImGuiKey_GamepadLStickUp, ImGuiKey_GamepadLStickDown); + const float tweak_factor = IsKeyDown(ImGuiKey_NavGamepadTweakSlow) ? 1.0f / 10.0f : IsKeyDown(ImGuiKey_NavGamepadTweakFast) ? 10.0f : 1.0f; + if (scroll_dir.x != 0.0f && window->ScrollbarX) + SetScrollX(window, ImFloor(window->Scroll.x + scroll_dir.x * scroll_speed * tweak_factor)); + if (scroll_dir.y != 0.0f) + SetScrollY(window, ImFloor(window->Scroll.y + scroll_dir.y * scroll_speed * tweak_factor)); + } } // Always prioritize mouse highlight if navigation is disabled if (!nav_keyboard_active && !nav_gamepad_active) { g.NavDisableHighlight = true; - g.NavDisableMouseHover = g.NavMousePosDirty = false; + g.NavDisableMouseHover = set_mouse_pos = false; + } + + // Update mouse position if requested + // (This will take into account the possibility that a Scroll was queued in the window to offset our absolute mouse position before scroll has been applied) + if (set_mouse_pos && (io.ConfigFlags & ImGuiConfigFlags_NavEnableSetMousePos) && (io.BackendFlags & ImGuiBackendFlags_HasSetMousePos)) + { + io.MousePos = io.MousePosPrev = NavCalcPreferredRefPos(); + io.WantSetMousePos = true; + //IMGUI_DEBUG_LOG_IO("SetMousePos: (%.1f,%.1f)\n", io.MousePos.x, io.MousePos.y); } // [DEBUG] @@ -9380,7 +11002,7 @@ static void ImGui::NavUpdate() if (g.NavWindow) { ImDrawList* draw_list = GetForegroundDrawList(g.NavWindow); - if (1) { for (int layer = 0; layer < 2; layer++) draw_list->AddRect(g.NavWindow->Pos + g.NavWindow->NavRectRel[layer].Min, g.NavWindow->Pos + g.NavWindow->NavRectRel[layer].Max, IM_COL32(255,200,0,255)); } // [DEBUG] + if (1) { for (int layer = 0; layer < 2; layer++) { ImRect r = WindowRectRelToAbs(g.NavWindow, g.NavWindow->NavRectRel[layer]); draw_list->AddRect(r.Min, r.Max, IM_COL32(255,200,0,255)); } } // [DEBUG] if (1) { ImU32 col = (!g.NavWindow->Hidden) ? IM_COL32(255,0,255,255) : IM_COL32(255,0,0,255); ImVec2 p = NavCalcPreferredRefPos(); char buf[32]; ImFormatString(buf, 32, "%d", g.NavLayer); draw_list->AddCircleFilled(p, 3.0f, col); draw_list->AddText(NULL, 13.0f, p + ImVec2(8,-4), col, buf); } } #endif @@ -9395,14 +11017,11 @@ void ImGui::NavInitRequestApplyResult() // Apply result from previous navigation init request (will typically select the first item, unless SetItemDefaultFocus() has been called) // FIXME-NAV: On _NavFlattened windows, g.NavWindow will only be updated during subsequent frame. Not a problem currently. - IMGUI_DEBUG_LOG_NAV("[nav] NavInitRequest: result NavID 0x%08X in Layer %d Window \"%s\"\n", g.NavInitResultId, g.NavLayer, g.NavWindow->Name); + IMGUI_DEBUG_LOG_NAV("[nav] NavInitRequest: ApplyResult: NavID 0x%08X in Layer %d Window \"%s\"\n", g.NavInitResultId, g.NavLayer, g.NavWindow->Name); SetNavID(g.NavInitResultId, g.NavLayer, 0, g.NavInitResultRectRel); g.NavIdIsAlive = true; // Mark as alive from previous frame as we got a result if (g.NavInitRequestFromMove) - { - g.NavDisableHighlight = false; - g.NavDisableMouseHover = g.NavMousePosDirty = true; - } + NavRestoreHighlightAfterMove(); } void ImGui::NavUpdateCreateMoveRequest() @@ -9410,6 +11029,8 @@ void ImGui::NavUpdateCreateMoveRequest() ImGuiContext& g = *GImGui; ImGuiIO& io = g.IO; ImGuiWindow* window = g.NavWindow; + const bool nav_gamepad_active = (io.ConfigFlags & ImGuiConfigFlags_NavEnableGamepad) != 0 && (io.BackendFlags & ImGuiBackendFlags_HasGamepad) != 0; + const bool nav_keyboard_active = (io.ConfigFlags & ImGuiConfigFlags_NavEnableKeyboard) != 0; if (g.NavMoveForwardToNextFrame && window != NULL) { @@ -9424,27 +11045,33 @@ void ImGui::NavUpdateCreateMoveRequest() // Initiate directional inputs request g.NavMoveDir = ImGuiDir_None; g.NavMoveFlags = ImGuiNavMoveFlags_None; + g.NavMoveScrollFlags = ImGuiScrollFlags_None; if (window && !g.NavWindowingTarget && !(window->Flags & ImGuiWindowFlags_NoNavInputs)) { - const ImGuiInputReadMode read_mode = ImGuiInputReadMode_Repeat; - if (!IsActiveIdUsingNavDir(ImGuiDir_Left) && (IsNavInputTest(ImGuiNavInput_DpadLeft, read_mode) || IsNavInputTest(ImGuiNavInput_KeyLeft_, read_mode))) { g.NavMoveDir = ImGuiDir_Left; } - if (!IsActiveIdUsingNavDir(ImGuiDir_Right) && (IsNavInputTest(ImGuiNavInput_DpadRight, read_mode) || IsNavInputTest(ImGuiNavInput_KeyRight_, read_mode))) { g.NavMoveDir = ImGuiDir_Right; } - if (!IsActiveIdUsingNavDir(ImGuiDir_Up) && (IsNavInputTest(ImGuiNavInput_DpadUp, read_mode) || IsNavInputTest(ImGuiNavInput_KeyUp_, read_mode))) { g.NavMoveDir = ImGuiDir_Up; } - if (!IsActiveIdUsingNavDir(ImGuiDir_Down) && (IsNavInputTest(ImGuiNavInput_DpadDown, read_mode) || IsNavInputTest(ImGuiNavInput_KeyDown_, read_mode))) { g.NavMoveDir = ImGuiDir_Down; } + const ImGuiInputFlags repeat_mode = ImGuiInputFlags_Repeat | ImGuiInputFlags_RepeatRateNavMove; + if (!IsActiveIdUsingNavDir(ImGuiDir_Left) && ((nav_gamepad_active && IsKeyPressed(ImGuiKey_GamepadDpadLeft, ImGuiKeyOwner_None, repeat_mode)) || (nav_keyboard_active && IsKeyPressed(ImGuiKey_LeftArrow, ImGuiKeyOwner_None, repeat_mode)))) { g.NavMoveDir = ImGuiDir_Left; } + if (!IsActiveIdUsingNavDir(ImGuiDir_Right) && ((nav_gamepad_active && IsKeyPressed(ImGuiKey_GamepadDpadRight, ImGuiKeyOwner_None, repeat_mode)) || (nav_keyboard_active && IsKeyPressed(ImGuiKey_RightArrow, ImGuiKeyOwner_None, repeat_mode)))) { g.NavMoveDir = ImGuiDir_Right; } + if (!IsActiveIdUsingNavDir(ImGuiDir_Up) && ((nav_gamepad_active && IsKeyPressed(ImGuiKey_GamepadDpadUp, ImGuiKeyOwner_None, repeat_mode)) || (nav_keyboard_active && IsKeyPressed(ImGuiKey_UpArrow, ImGuiKeyOwner_None, repeat_mode)))) { g.NavMoveDir = ImGuiDir_Up; } + if (!IsActiveIdUsingNavDir(ImGuiDir_Down) && ((nav_gamepad_active && IsKeyPressed(ImGuiKey_GamepadDpadDown, ImGuiKeyOwner_None, repeat_mode)) || (nav_keyboard_active && IsKeyPressed(ImGuiKey_DownArrow, ImGuiKeyOwner_None, repeat_mode)))) { g.NavMoveDir = ImGuiDir_Down; } } g.NavMoveClipDir = g.NavMoveDir; + g.NavScoringNoClipRect = ImRect(+FLT_MAX, +FLT_MAX, -FLT_MAX, -FLT_MAX); } // Update PageUp/PageDown/Home/End scroll // FIXME-NAV: Consider enabling those keys even without the master ImGuiConfigFlags_NavEnableKeyboard flag? - const bool nav_keyboard_active = (io.ConfigFlags & ImGuiConfigFlags_NavEnableKeyboard) != 0; float scoring_rect_offset_y = 0.0f; if (window && g.NavMoveDir == ImGuiDir_None && nav_keyboard_active) scoring_rect_offset_y = NavUpdatePageUpPageDown(); + if (scoring_rect_offset_y != 0.0f) + { + g.NavScoringNoClipRect = window->InnerRect; + g.NavScoringNoClipRect.TranslateY(scoring_rect_offset_y); + } // [DEBUG] Always send a request #if IMGUI_DEBUG_NAV_SCORING - if (io.KeyCtrl && IsKeyPressedMap(ImGuiKey_C)) + if (io.KeyCtrl && IsKeyPressed(ImGuiKey_C)) g.NavMoveDirForDebug = (ImGuiDir)((g.NavMoveDirForDebug + 1) & 3); if (io.KeyCtrl && g.NavMoveDir == ImGuiDir_None) { @@ -9456,30 +11083,36 @@ void ImGui::NavUpdateCreateMoveRequest() // Submit g.NavMoveForwardToNextFrame = false; if (g.NavMoveDir != ImGuiDir_None) - NavMoveRequestSubmit(g.NavMoveDir, g.NavMoveClipDir, g.NavMoveFlags); + NavMoveRequestSubmit(g.NavMoveDir, g.NavMoveClipDir, g.NavMoveFlags, g.NavMoveScrollFlags); - // Moving with no reference triggers a init request (will be used as a fallback if the direction fails to find a match) + // Moving with no reference triggers an init request (will be used as a fallback if the direction fails to find a match) if (g.NavMoveSubmitted && g.NavId == 0) { - IMGUI_DEBUG_LOG_NAV("[nav] NavInitRequest: from move, window \"%s\", layer=%d\n", g.NavWindow->Name, g.NavLayer); + IMGUI_DEBUG_LOG_NAV("[nav] NavInitRequest: from move, window \"%s\", layer=%d\n", window ? window->Name : "", g.NavLayer); g.NavInitRequest = g.NavInitRequestFromMove = true; g.NavInitResultId = 0; g.NavDisableHighlight = false; } // When using gamepad, we project the reference nav bounding box into window visible area. - // This is to allow resuming navigation inside the visible area after doing a large amount of scrolling, since with gamepad every movements are relative + // This is to allow resuming navigation inside the visible area after doing a large amount of scrolling, since with gamepad all movements are relative // (can't focus a visible object like we can with the mouse). - if (g.NavMoveSubmitted && g.NavInputSource == ImGuiInputSource_Gamepad && g.NavLayer == ImGuiNavLayer_Main && window != NULL) + if (g.NavMoveSubmitted && g.NavInputSource == ImGuiInputSource_Gamepad && g.NavLayer == ImGuiNavLayer_Main && window != NULL)// && (g.NavMoveFlags & ImGuiNavMoveFlags_Forwarded)) { - ImRect window_rect_rel(window->InnerRect.Min - window->Pos - ImVec2(1, 1), window->InnerRect.Max - window->Pos + ImVec2(1, 1)); - if (!window_rect_rel.Contains(window->NavRectRel[g.NavLayer])) + bool clamp_x = (g.NavMoveFlags & (ImGuiNavMoveFlags_LoopX | ImGuiNavMoveFlags_WrapX)) == 0; + bool clamp_y = (g.NavMoveFlags & (ImGuiNavMoveFlags_LoopY | ImGuiNavMoveFlags_WrapY)) == 0; + ImRect inner_rect_rel = WindowRectAbsToRel(window, ImRect(window->InnerRect.Min - ImVec2(1, 1), window->InnerRect.Max + ImVec2(1, 1))); + if ((clamp_x || clamp_y) && !inner_rect_rel.Contains(window->NavRectRel[g.NavLayer])) { - IMGUI_DEBUG_LOG_NAV("[nav] NavMoveRequest: clamp NavRectRel\n"); - float pad = window->CalcFontSize() * 0.5f; - window_rect_rel.Expand(ImVec2(-ImMin(window_rect_rel.GetWidth(), pad), -ImMin(window_rect_rel.GetHeight(), pad))); // Terrible approximation for the intent of starting navigation from first fully visible item - window->NavRectRel[g.NavLayer].ClipWithFull(window_rect_rel); - g.NavId = g.NavFocusScopeId = 0; + //IMGUI_DEBUG_LOG_NAV("[nav] NavMoveRequest: clamp NavRectRel for gamepad move\n"); + float pad_x = ImMin(inner_rect_rel.GetWidth(), window->CalcFontSize() * 0.5f); + float pad_y = ImMin(inner_rect_rel.GetHeight(), window->CalcFontSize() * 0.5f); // Terrible approximation for the intent of starting navigation from first fully visible item + inner_rect_rel.Min.x = clamp_x ? (inner_rect_rel.Min.x + pad_x) : -FLT_MAX; + inner_rect_rel.Max.x = clamp_x ? (inner_rect_rel.Max.x - pad_x) : +FLT_MAX; + inner_rect_rel.Min.y = clamp_y ? (inner_rect_rel.Min.y + pad_y) : -FLT_MAX; + inner_rect_rel.Max.y = clamp_y ? (inner_rect_rel.Max.y - pad_y) : +FLT_MAX; + window->NavRectRel[g.NavLayer].ClipWithFull(inner_rect_rel); + g.NavId = 0; } } @@ -9488,14 +11121,40 @@ void ImGui::NavUpdateCreateMoveRequest() if (window != NULL) { ImRect nav_rect_rel = !window->NavRectRel[g.NavLayer].IsInverted() ? window->NavRectRel[g.NavLayer] : ImRect(0, 0, 0, 0); - scoring_rect = ImRect(window->Pos + nav_rect_rel.Min, window->Pos + nav_rect_rel.Max); + scoring_rect = WindowRectRelToAbs(window, nav_rect_rel); scoring_rect.TranslateY(scoring_rect_offset_y); scoring_rect.Min.x = ImMin(scoring_rect.Min.x + 1.0f, scoring_rect.Max.x); scoring_rect.Max.x = scoring_rect.Min.x; - IM_ASSERT(!scoring_rect.IsInverted()); // Ensure if we have a finite, non-inverted bounding box here will allows us to remove extraneous ImFabs() calls in NavScoreItem(). + IM_ASSERT(!scoring_rect.IsInverted()); // Ensure if we have a finite, non-inverted bounding box here will allow us to remove extraneous ImFabs() calls in NavScoreItem(). //GetForegroundDrawList()->AddRect(scoring_rect.Min, scoring_rect.Max, IM_COL32(255,200,0,255)); // [DEBUG] + //if (!g.NavScoringNoClipRect.IsInverted()) { GetForegroundDrawList()->AddRect(g.NavScoringNoClipRect.Min, g.NavScoringNoClipRect.Max, IM_COL32(255, 200, 0, 255)); } // [DEBUG] } g.NavScoringRect = scoring_rect; + g.NavScoringNoClipRect.Add(scoring_rect); +} + +void ImGui::NavUpdateCreateTabbingRequest() +{ + ImGuiContext& g = *GImGui; + ImGuiWindow* window = g.NavWindow; + IM_ASSERT(g.NavMoveDir == ImGuiDir_None); + if (window == NULL || g.NavWindowingTarget != NULL || (window->Flags & ImGuiWindowFlags_NoNavInputs)) + return; + + const bool tab_pressed = IsKeyPressed(ImGuiKey_Tab, ImGuiKeyOwner_None, ImGuiInputFlags_Repeat) && !g.IO.KeyCtrl && !g.IO.KeyAlt; + if (!tab_pressed) + return; + + // Initiate tabbing request + // (this is ALWAYS ENABLED, regardless of ImGuiConfigFlags_NavEnableKeyboard flag!) + // Initially this was designed to use counters and modulo arithmetic, but that could not work with unsubmitted items (list clipper). Instead we use a strategy close to other move requests. + // See NavProcessItemForTabbingRequest() for a description of the various forward/backward tabbing cases with and without wrapping. + //// FIXME: We use (g.ActiveId == 0) but (g.NavDisableHighlight == false) might be righter once we can tab through anything + g.NavTabbingDir = g.IO.KeyShift ? -1 : (g.ActiveId == 0) ? 0 : +1; + ImGuiScrollFlags scroll_flags = window->Appearing ? ImGuiScrollFlags_KeepVisibleEdgeX | ImGuiScrollFlags_AlwaysCenterY : ImGuiScrollFlags_KeepVisibleEdgeX | ImGuiScrollFlags_KeepVisibleEdgeY; + ImGuiDir clip_dir = (g.NavTabbingDir < 0) ? ImGuiDir_Up : ImGuiDir_Down; + NavMoveRequestSubmit(ImGuiDir_None, clip_dir, ImGuiNavMoveFlags_Tabbing, scroll_flags); // FIXME-NAV: Once we refactor tabbing, add LegacyApi flag to not activate non-inputable. + g.NavTabbingCounter = -1; } // Apply result from previous frame navigation directional move request. Always called from NavUpdate() @@ -9510,14 +11169,18 @@ void ImGui::NavMoveRequestApplyResult() // Select which result to use ImGuiNavItemData* result = (g.NavMoveResultLocal.ID != 0) ? &g.NavMoveResultLocal : (g.NavMoveResultOther.ID != 0) ? &g.NavMoveResultOther : NULL; - // In a situation when there is no results but NavId != 0, re-enable the Navigation highlight (because g.NavId is not considered as a possible result) + // Tabbing forward wrap + if (g.NavMoveFlags & ImGuiNavMoveFlags_Tabbing) + if ((g.NavTabbingCounter == 1 || g.NavTabbingDir == 0) && g.NavTabbingResultFirst.ID) + result = &g.NavTabbingResultFirst; + + // In a situation when there are no results but NavId != 0, re-enable the Navigation highlight (because g.NavId is not considered as a possible result) if (result == NULL) { - if (g.NavId != 0) - { - g.NavDisableHighlight = false; - g.NavDisableMouseHover = true; - } + if (g.NavMoveFlags & ImGuiNavMoveFlags_Tabbing) + g.NavMoveFlags |= ImGuiNavMoveFlags_DontSetNavHighlight; + if (g.NavId != 0 && (g.NavMoveFlags & ImGuiNavMoveFlags_DontSetNavHighlight) == 0) + NavRestoreHighlightAfterMove(); return; } @@ -9535,26 +11198,26 @@ void ImGui::NavMoveRequestApplyResult() // Scroll to keep newly navigated item fully into view. if (g.NavLayer == ImGuiNavLayer_Main) { - ImVec2 delta_scroll; - if (g.NavMoveFlags & ImGuiNavMoveFlags_ScrollToEdge) + if (g.NavMoveFlags & ImGuiNavMoveFlags_ScrollToEdgeY) { + // FIXME: Should remove this float scroll_target = (g.NavMoveDir == ImGuiDir_Up) ? result->Window->ScrollMax.y : 0.0f; - delta_scroll.y = result->Window->Scroll.y - scroll_target; SetScrollY(result->Window, scroll_target); } else { - ImRect rect_abs = ImRect(result->RectRel.Min + result->Window->Pos, result->RectRel.Max + result->Window->Pos); - delta_scroll = ScrollToBringRectIntoView(result->Window, rect_abs); + ImRect rect_abs = WindowRectRelToAbs(result->Window, result->RectRel); + ScrollToRectEx(result->Window, rect_abs, g.NavMoveScrollFlags); } - - // Offset our result position so mouse position can be applied immediately after in NavUpdate() - result->RectRel.TranslateX(-delta_scroll.x); - result->RectRel.TranslateY(-delta_scroll.y); } - ClearActiveID(); - g.NavWindow = result->Window; + if (g.NavWindow != result->Window) + { + IMGUI_DEBUG_LOG_FOCUS("[focus] NavMoveRequest: SetNavWindow(\"%s\")\n", result->Window->Name); + g.NavWindow = result->Window; + } + if (g.ActiveId != result->ID) + ClearActiveID(); if (g.NavId != result->ID) { // Don't set NavJustMovedToId if just landed on the same spot (which may happen with ImGuiNavMoveFlags_AllowCurrentNavId) @@ -9567,9 +11230,24 @@ void ImGui::NavMoveRequestApplyResult() IMGUI_DEBUG_LOG_NAV("[nav] NavMoveRequest: result NavID 0x%08X in Layer %d Window \"%s\"\n", result->ID, g.NavLayer, g.NavWindow->Name); SetNavID(result->ID, g.NavLayer, result->FocusScopeId, result->RectRel); + // Tabbing: Activates Inputable or Focus non-Inputable + if ((g.NavMoveFlags & ImGuiNavMoveFlags_Tabbing) && (result->InFlags & ImGuiItemFlags_Inputable)) + { + g.NavNextActivateId = result->ID; + g.NavNextActivateFlags = ImGuiActivateFlags_PreferInput | ImGuiActivateFlags_TryToPreserveState; + g.NavMoveFlags |= ImGuiNavMoveFlags_DontSetNavHighlight; + } + + // Activate + if (g.NavMoveFlags & ImGuiNavMoveFlags_Activate) + { + g.NavNextActivateId = result->ID; + g.NavNextActivateFlags = ImGuiActivateFlags_None; + } + // Enable nav highlight - g.NavDisableHighlight = false; - g.NavDisableMouseHover = g.NavMousePosDirty = true; + if ((g.NavMoveFlags & ImGuiNavMoveFlags_DontSetNavHighlight) == 0) + NavRestoreHighlightAfterMove(); } // Process NavCancel input (to close a popup, get back to parent, clear focus) @@ -9579,19 +11257,21 @@ void ImGui::NavMoveRequestApplyResult() static void ImGui::NavUpdateCancelRequest() { ImGuiContext& g = *GImGui; - if (!IsNavInputTest(ImGuiNavInput_Cancel, ImGuiInputReadMode_Pressed)) + const bool nav_gamepad_active = (g.IO.ConfigFlags & ImGuiConfigFlags_NavEnableGamepad) != 0 && (g.IO.BackendFlags & ImGuiBackendFlags_HasGamepad) != 0; + const bool nav_keyboard_active = (g.IO.ConfigFlags & ImGuiConfigFlags_NavEnableKeyboard) != 0; + if (!(nav_keyboard_active && IsKeyPressed(ImGuiKey_Escape, ImGuiKeyOwner_None)) && !(nav_gamepad_active && IsKeyPressed(ImGuiKey_NavGamepadCancel, ImGuiKeyOwner_None))) return; - IMGUI_DEBUG_LOG_NAV("[nav] ImGuiNavInput_Cancel\n"); + IMGUI_DEBUG_LOG_NAV("[nav] NavUpdateCancelRequest()\n"); if (g.ActiveId != 0) { - if (!IsActiveIdUsingNavInput(ImGuiNavInput_Cancel)) - ClearActiveID(); + ClearActiveID(); } else if (g.NavLayer != ImGuiNavLayer_Main) { // Leave the "menu" layer NavRestoreLayer(ImGuiNavLayer_Main); + NavRestoreHighlightAfterMove(); } else if (g.NavWindow && g.NavWindow != g.NavWindow->RootWindow && !(g.NavWindow->Flags & ImGuiWindowFlags_Popup) && g.NavWindow->ParentWindow) { @@ -9601,20 +11281,20 @@ static void ImGui::NavUpdateCancelRequest() IM_ASSERT(child_window->ChildId != 0); ImRect child_rect = child_window->Rect(); FocusWindow(parent_window); - SetNavID(child_window->ChildId, ImGuiNavLayer_Main, 0, ImRect(child_rect.Min - parent_window->Pos, child_rect.Max - parent_window->Pos)); + SetNavID(child_window->ChildId, ImGuiNavLayer_Main, 0, WindowRectAbsToRel(parent_window, child_rect)); + NavRestoreHighlightAfterMove(); } - else if (g.OpenPopupStack.Size > 0) + else if (g.OpenPopupStack.Size > 0 && g.OpenPopupStack.back().Window != NULL && !(g.OpenPopupStack.back().Window->Flags & ImGuiWindowFlags_Modal)) { // Close open popup/menu - if (!(g.OpenPopupStack.back().Window->Flags & ImGuiWindowFlags_Modal)) - ClosePopupToLevel(g.OpenPopupStack.Size - 1, true); + ClosePopupToLevel(g.OpenPopupStack.Size - 1, true); } else { // Clear NavLastId for popups but keep it for regular child window so we can leave one and come back where we were if (g.NavWindow && ((g.NavWindow->Flags & ImGuiWindowFlags_Popup) || !(g.NavWindow->Flags & ImGuiWindowFlags_ChildWindow))) g.NavWindow->NavLastIds[0] = 0; - g.NavId = g.NavFocusScopeId = 0; + g.NavId = 0; } } @@ -9625,25 +11305,26 @@ static void ImGui::NavUpdateCancelRequest() static float ImGui::NavUpdatePageUpPageDown() { ImGuiContext& g = *GImGui; - ImGuiIO& io = g.IO; - ImGuiWindow* window = g.NavWindow; - if ((window->Flags & ImGuiWindowFlags_NoNavInputs) || g.NavWindowingTarget != NULL || g.NavLayer != ImGuiNavLayer_Main) + if ((window->Flags & ImGuiWindowFlags_NoNavInputs) || g.NavWindowingTarget != NULL) return 0.0f; - const bool page_up_held = IsKeyDown(io.KeyMap[ImGuiKey_PageUp]) && !IsActiveIdUsingKey(ImGuiKey_PageUp); - const bool page_down_held = IsKeyDown(io.KeyMap[ImGuiKey_PageDown]) && !IsActiveIdUsingKey(ImGuiKey_PageDown); - const bool home_pressed = IsKeyPressed(io.KeyMap[ImGuiKey_Home]) && !IsActiveIdUsingKey(ImGuiKey_Home); - const bool end_pressed = IsKeyPressed(io.KeyMap[ImGuiKey_End]) && !IsActiveIdUsingKey(ImGuiKey_End); + const bool page_up_held = IsKeyDown(ImGuiKey_PageUp, ImGuiKeyOwner_None); + const bool page_down_held = IsKeyDown(ImGuiKey_PageDown, ImGuiKeyOwner_None); + const bool home_pressed = IsKeyPressed(ImGuiKey_Home, ImGuiKeyOwner_None, ImGuiInputFlags_Repeat); + const bool end_pressed = IsKeyPressed(ImGuiKey_End, ImGuiKeyOwner_None, ImGuiInputFlags_Repeat); if (page_up_held == page_down_held && home_pressed == end_pressed) // Proceed if either (not both) are pressed, otherwise early out return 0.0f; + if (g.NavLayer != ImGuiNavLayer_Main) + NavRestoreLayer(ImGuiNavLayer_Main); + if (window->DC.NavLayersActiveMask == 0x00 && window->DC.NavHasScroll) { // Fallback manual-scroll when window has no navigable item - if (IsKeyPressed(io.KeyMap[ImGuiKey_PageUp], true)) + if (IsKeyPressed(ImGuiKey_PageUp, ImGuiKeyOwner_None, ImGuiInputFlags_Repeat)) SetScrollY(window, window->Scroll.y - window->InnerRect.GetHeight()); - else if (IsKeyPressed(io.KeyMap[ImGuiKey_PageDown], true)) + else if (IsKeyPressed(ImGuiKey_PageDown, ImGuiKeyOwner_None, ImGuiInputFlags_Repeat)) SetScrollY(window, window->Scroll.y + window->InnerRect.GetHeight()); else if (home_pressed) SetScrollY(window, 0.0f); @@ -9655,14 +11336,14 @@ static float ImGui::NavUpdatePageUpPageDown() ImRect& nav_rect_rel = window->NavRectRel[g.NavLayer]; const float page_offset_y = ImMax(0.0f, window->InnerRect.GetHeight() - window->CalcFontSize() * 1.0f + nav_rect_rel.GetHeight()); float nav_scoring_rect_offset_y = 0.0f; - if (IsKeyPressed(io.KeyMap[ImGuiKey_PageUp], true)) + if (IsKeyPressed(ImGuiKey_PageUp, true)) { nav_scoring_rect_offset_y = -page_offset_y; g.NavMoveDir = ImGuiDir_Down; // Because our scoring rect is offset up, we request the down direction (so we can always land on the last item) g.NavMoveClipDir = ImGuiDir_Up; g.NavMoveFlags = ImGuiNavMoveFlags_AllowCurrentNavId | ImGuiNavMoveFlags_AlsoScoreVisibleSet; } - else if (IsKeyPressed(io.KeyMap[ImGuiKey_PageDown], true)) + else if (IsKeyPressed(ImGuiKey_PageDown, true)) { nav_scoring_rect_offset_y = +page_offset_y; g.NavMoveDir = ImGuiDir_Up; // Because our scoring rect is offset down, we request the up direction (so we can always land on the last item) @@ -9672,22 +11353,22 @@ static float ImGui::NavUpdatePageUpPageDown() else if (home_pressed) { // FIXME-NAV: handling of Home/End is assuming that the top/bottom most item will be visible with Scroll.y == 0/ScrollMax.y - // Scrolling will be handled via the ImGuiNavMoveFlags_ScrollToEdge flag, we don't scroll immediately to avoid scrolling happening before nav result. + // Scrolling will be handled via the ImGuiNavMoveFlags_ScrollToEdgeY flag, we don't scroll immediately to avoid scrolling happening before nav result. // Preserve current horizontal position if we have any. - nav_rect_rel.Min.y = nav_rect_rel.Max.y = -window->Scroll.y; + nav_rect_rel.Min.y = nav_rect_rel.Max.y = 0.0f; if (nav_rect_rel.IsInverted()) nav_rect_rel.Min.x = nav_rect_rel.Max.x = 0.0f; g.NavMoveDir = ImGuiDir_Down; - g.NavMoveFlags = ImGuiNavMoveFlags_AllowCurrentNavId | ImGuiNavMoveFlags_ScrollToEdge; + g.NavMoveFlags = ImGuiNavMoveFlags_AllowCurrentNavId | ImGuiNavMoveFlags_ScrollToEdgeY; // FIXME-NAV: MoveClipDir left to _None, intentional? } else if (end_pressed) { - nav_rect_rel.Min.y = nav_rect_rel.Max.y = window->ScrollMax.y + window->SizeFull.y - window->Scroll.y; + nav_rect_rel.Min.y = nav_rect_rel.Max.y = window->ContentSize.y; if (nav_rect_rel.IsInverted()) nav_rect_rel.Min.x = nav_rect_rel.Max.x = 0.0f; g.NavMoveDir = ImGuiDir_Up; - g.NavMoveFlags = ImGuiNavMoveFlags_AllowCurrentNavId | ImGuiNavMoveFlags_ScrollToEdge; + g.NavMoveFlags = ImGuiNavMoveFlags_AllowCurrentNavId | ImGuiNavMoveFlags_ScrollToEdgeY; // FIXME-NAV: MoveClipDir left to _None, intentional? } return nav_scoring_rect_offset_y; @@ -9704,63 +11385,66 @@ static void ImGui::NavEndFrame() NavUpdateWindowingOverlay(); // Perform wrap-around in menus + // FIXME-NAV: Wrap may need to apply a weight bias on the other axis. e.g. 4x4 grid with 2 last items missing on last item won't handle LoopY/WrapY correctly. // FIXME-NAV: Wrap (not Loop) support could be handled by the scoring function and then WrapX would function without an extra frame. + const ImGuiNavMoveFlags wanted_flags = ImGuiNavMoveFlags_WrapX | ImGuiNavMoveFlags_LoopX | ImGuiNavMoveFlags_WrapY | ImGuiNavMoveFlags_LoopY; + if (g.NavWindow && NavMoveRequestButNoResultYet() && (g.NavMoveFlags & wanted_flags) && (g.NavMoveFlags & ImGuiNavMoveFlags_Forwarded) == 0) + NavUpdateCreateWrappingRequest(); +} + +static void ImGui::NavUpdateCreateWrappingRequest() +{ + ImGuiContext& g = *GImGui; ImGuiWindow* window = g.NavWindow; + + bool do_forward = false; + ImRect bb_rel = window->NavRectRel[g.NavLayer]; + ImGuiDir clip_dir = g.NavMoveDir; const ImGuiNavMoveFlags move_flags = g.NavMoveFlags; - const ImGuiNavMoveFlags wanted_flags = ImGuiNavMoveFlags_WrapX | ImGuiNavMoveFlags_LoopX | ImGuiNavMoveFlags_WrapY | ImGuiNavMoveFlags_LoopY; - if (window && NavMoveRequestButNoResultYet() && (g.NavMoveFlags & wanted_flags) && (g.NavMoveFlags & ImGuiNavMoveFlags_Forwarded) == 0) + if (g.NavMoveDir == ImGuiDir_Left && (move_flags & (ImGuiNavMoveFlags_WrapX | ImGuiNavMoveFlags_LoopX))) { - bool do_forward = false; - ImRect bb_rel = window->NavRectRel[g.NavLayer]; - ImGuiDir clip_dir = g.NavMoveDir; - if (g.NavMoveDir == ImGuiDir_Left && (move_flags & (ImGuiNavMoveFlags_WrapX | ImGuiNavMoveFlags_LoopX))) + bb_rel.Min.x = bb_rel.Max.x = window->ContentSize.x + window->WindowPadding.x; + if (move_flags & ImGuiNavMoveFlags_WrapX) { - bb_rel.Min.x = bb_rel.Max.x = - ImMax(window->SizeFull.x, window->ContentSize.x + window->WindowPadding.x * 2.0f) - window->Scroll.x; - if (move_flags & ImGuiNavMoveFlags_WrapX) - { - bb_rel.TranslateY(-bb_rel.GetHeight()); - clip_dir = ImGuiDir_Up; - } - do_forward = true; - } - if (g.NavMoveDir == ImGuiDir_Right && (move_flags & (ImGuiNavMoveFlags_WrapX | ImGuiNavMoveFlags_LoopX))) - { - bb_rel.Min.x = bb_rel.Max.x = -window->Scroll.x; - if (move_flags & ImGuiNavMoveFlags_WrapX) - { - bb_rel.TranslateY(+bb_rel.GetHeight()); - clip_dir = ImGuiDir_Down; - } - do_forward = true; + bb_rel.TranslateY(-bb_rel.GetHeight()); // Previous row + clip_dir = ImGuiDir_Up; } - if (g.NavMoveDir == ImGuiDir_Up && (move_flags & (ImGuiNavMoveFlags_WrapY | ImGuiNavMoveFlags_LoopY))) + do_forward = true; + } + if (g.NavMoveDir == ImGuiDir_Right && (move_flags & (ImGuiNavMoveFlags_WrapX | ImGuiNavMoveFlags_LoopX))) + { + bb_rel.Min.x = bb_rel.Max.x = -window->WindowPadding.x; + if (move_flags & ImGuiNavMoveFlags_WrapX) { - bb_rel.Min.y = bb_rel.Max.y = - ImMax(window->SizeFull.y, window->ContentSize.y + window->WindowPadding.y * 2.0f) - window->Scroll.y; - if (move_flags & ImGuiNavMoveFlags_WrapY) - { - bb_rel.TranslateX(-bb_rel.GetWidth()); - clip_dir = ImGuiDir_Left; - } - do_forward = true; + bb_rel.TranslateY(+bb_rel.GetHeight()); // Next row + clip_dir = ImGuiDir_Down; } - if (g.NavMoveDir == ImGuiDir_Down && (move_flags & (ImGuiNavMoveFlags_WrapY | ImGuiNavMoveFlags_LoopY))) + do_forward = true; + } + if (g.NavMoveDir == ImGuiDir_Up && (move_flags & (ImGuiNavMoveFlags_WrapY | ImGuiNavMoveFlags_LoopY))) + { + bb_rel.Min.y = bb_rel.Max.y = window->ContentSize.y + window->WindowPadding.y; + if (move_flags & ImGuiNavMoveFlags_WrapY) { - bb_rel.Min.y = bb_rel.Max.y = -window->Scroll.y; - if (move_flags & ImGuiNavMoveFlags_WrapY) - { - bb_rel.TranslateX(+bb_rel.GetWidth()); - clip_dir = ImGuiDir_Right; - } - do_forward = true; + bb_rel.TranslateX(-bb_rel.GetWidth()); // Previous column + clip_dir = ImGuiDir_Left; } - if (do_forward) + do_forward = true; + } + if (g.NavMoveDir == ImGuiDir_Down && (move_flags & (ImGuiNavMoveFlags_WrapY | ImGuiNavMoveFlags_LoopY))) + { + bb_rel.Min.y = bb_rel.Max.y = -window->WindowPadding.y; + if (move_flags & ImGuiNavMoveFlags_WrapY) { - window->NavRectRel[g.NavLayer] = bb_rel; - NavMoveRequestForward(g.NavMoveDir, clip_dir, move_flags); + bb_rel.TranslateX(+bb_rel.GetWidth()); // Next column + clip_dir = ImGuiDir_Right; } + do_forward = true; } + if (!do_forward) + return; + window->NavRectRel[g.NavLayer] = bb_rel; + NavMoveRequestForward(g.NavMoveDir, clip_dir, move_flags, g.NavMoveScrollFlags); } static int ImGui::FindWindowFocusIndex(ImGuiWindow* window) @@ -9768,6 +11452,7 @@ static int ImGui::FindWindowFocusIndex(ImGuiWindow* window) ImGuiContext& g = *GImGui; IM_UNUSED(g); int order = window->FocusOrder; + IM_ASSERT(window->RootWindow == window); // No child window (not testing _ChildWindow because of docking) IM_ASSERT(g.WindowsFocusOrder[order] == window); return order; } @@ -9793,7 +11478,10 @@ static void NavUpdateWindowingHighlightWindow(int focus_change_dir) if (!window_target) window_target = FindWindowNavFocusable((focus_change_dir < 0) ? (g.WindowsFocusOrder.Size - 1) : 0, i_current, focus_change_dir); if (window_target) // Don't reset windowing target if there's a single window in the list + { g.NavWindowingTarget = g.NavWindowingTargetAnim = window_target; + g.NavWindowingAccumDeltaPos = g.NavWindowingAccumDeltaSize = ImVec2(0.0f, 0.0f); + } g.NavWindowingToggleLayer = false; } @@ -9821,15 +11509,19 @@ static void ImGui::NavUpdateWindowing() g.NavWindowingTargetAnim = NULL; } - // Start CTRL-TAB or Square+L/R window selection + // Start CTRL+Tab or Square+L/R window selection + const bool nav_gamepad_active = (io.ConfigFlags & ImGuiConfigFlags_NavEnableGamepad) != 0 && (io.BackendFlags & ImGuiBackendFlags_HasGamepad) != 0; const bool nav_keyboard_active = (io.ConfigFlags & ImGuiConfigFlags_NavEnableKeyboard) != 0; - const bool start_windowing_with_gamepad = allow_windowing && !g.NavWindowingTarget && IsNavInputTest(ImGuiNavInput_Menu, ImGuiInputReadMode_Pressed); - const bool start_windowing_with_keyboard = allow_windowing && !g.NavWindowingTarget && nav_keyboard_active && io.KeyCtrl && IsKeyPressedMap(ImGuiKey_Tab); + const bool keyboard_next_window = allow_windowing && g.ConfigNavWindowingKeyNext && Shortcut(g.ConfigNavWindowingKeyNext, ImGuiKeyOwner_None, ImGuiInputFlags_Repeat | ImGuiInputFlags_RouteAlways); + const bool keyboard_prev_window = allow_windowing && g.ConfigNavWindowingKeyPrev && Shortcut(g.ConfigNavWindowingKeyPrev, ImGuiKeyOwner_None, ImGuiInputFlags_Repeat | ImGuiInputFlags_RouteAlways); + const bool start_windowing_with_gamepad = allow_windowing && nav_gamepad_active && !g.NavWindowingTarget && IsKeyPressed(ImGuiKey_NavGamepadMenu, 0, ImGuiInputFlags_None); + const bool start_windowing_with_keyboard = allow_windowing && !g.NavWindowingTarget && (keyboard_next_window || keyboard_prev_window); // Note: enabled even without NavEnableKeyboard! if (start_windowing_with_gamepad || start_windowing_with_keyboard) if (ImGuiWindow* window = g.NavWindow ? g.NavWindow : FindWindowNavFocusable(g.WindowsFocusOrder.Size - 1, -INT_MAX, -1)) { g.NavWindowingTarget = g.NavWindowingTargetAnim = window->RootWindow; g.NavWindowingTimer = g.NavWindowingHighlightAlpha = 0.0f; + g.NavWindowingAccumDeltaPos = g.NavWindowingAccumDeltaSize = ImVec2(0.0f, 0.0f); g.NavWindowingToggleLayer = start_windowing_with_gamepad ? true : false; // Gamepad starts toggling layer g.NavInputSource = start_windowing_with_keyboard ? ImGuiInputSource_Keyboard : ImGuiInputSource_Gamepad; } @@ -9842,7 +11534,7 @@ static void ImGui::NavUpdateWindowing() g.NavWindowingHighlightAlpha = ImMax(g.NavWindowingHighlightAlpha, ImSaturate((g.NavWindowingTimer - NAV_WINDOWING_HIGHLIGHT_DELAY) / 0.05f)); // Select window to focus - const int focus_change_dir = (int)IsNavInputTest(ImGuiNavInput_FocusPrev, ImGuiInputReadMode_RepeatSlow) - (int)IsNavInputTest(ImGuiNavInput_FocusNext, ImGuiInputReadMode_RepeatSlow); + const int focus_change_dir = (int)IsKeyPressed(ImGuiKey_GamepadL1) - (int)IsKeyPressed(ImGuiKey_GamepadR1); if (focus_change_dir != 0) { NavUpdateWindowingHighlightWindow(focus_change_dir); @@ -9850,7 +11542,7 @@ static void ImGui::NavUpdateWindowing() } // Single press toggles NavLayer, long press with L/R apply actual focus on release (until then the window was merely rendered top-most) - if (!IsNavInputDown(ImGuiNavInput_Menu)) + if (!IsKeyDown(ImGuiKey_NavGamepadMenu)) { g.NavWindowingToggleLayer &= (g.NavWindowingHighlightAlpha < 1.0f); // Once button was held long enough we don't consider it a tap-to-toggle-layer press anymore. if (g.NavWindowingToggleLayer && g.NavWindow) @@ -9865,17 +11557,19 @@ static void ImGui::NavUpdateWindowing() if (g.NavWindowingTarget && g.NavInputSource == ImGuiInputSource_Keyboard) { // Visuals only appears after a brief time after pressing TAB the first time, so that a fast CTRL+TAB doesn't add visual noise + ImGuiKeyChord shared_mods = ((g.ConfigNavWindowingKeyNext ? g.ConfigNavWindowingKeyNext : ImGuiMod_Mask_) & (g.ConfigNavWindowingKeyPrev ? g.ConfigNavWindowingKeyPrev : ImGuiMod_Mask_)) & ImGuiMod_Mask_; + IM_ASSERT(shared_mods != 0); // Next/Prev shortcut currently needs a shared modifier to "hold", otherwise Prev actions would keep cycling between two windows. g.NavWindowingHighlightAlpha = ImMax(g.NavWindowingHighlightAlpha, ImSaturate((g.NavWindowingTimer - NAV_WINDOWING_HIGHLIGHT_DELAY) / 0.05f)); // 1.0f - if (IsKeyPressedMap(ImGuiKey_Tab, true)) - NavUpdateWindowingHighlightWindow(io.KeyShift ? +1 : -1); - if (!io.KeyCtrl) + if (keyboard_next_window || keyboard_prev_window) + NavUpdateWindowingHighlightWindow(keyboard_next_window ? -1 : +1); + else if ((io.KeyMods & shared_mods) != shared_mods) apply_focus_window = g.NavWindowingTarget; } // Keyboard: Press and Release ALT to toggle menu layer // - Testing that only Alt is tested prevents Alt+Shift or AltGR from toggling menu layer. // - AltGR is normally Alt+Ctrl but we can't reliably detect it (not all backends/systems/layout emit it as Alt+Ctrl). But even on keyboards without AltGR we don't want Alt+Ctrl to open menu anyway. - if (nav_keyboard_active && io.KeyMods == ImGuiKeyModFlags_Alt && (io.KeyModsPrev & ImGuiKeyModFlags_Alt) == 0) + if (nav_keyboard_active && IsKeyPressed(ImGuiMod_Alt, ImGuiKeyOwner_None)) { g.NavWindowingToggleLayer = true; g.NavInputSource = ImGuiInputSource_Keyboard; @@ -9884,36 +11578,41 @@ static void ImGui::NavUpdateWindowing() { // We cancel toggling nav layer when any text has been typed (generally while holding Alt). (See #370) // We cancel toggling nav layer when other modifiers are pressed. (See #4439) - if (io.InputQueueCharacters.Size > 0 || io.KeyCtrl || io.KeyShift || io.KeySuper) + // We cancel toggling nav layer if an owner has claimed the key. + if (io.InputQueueCharacters.Size > 0 || io.KeyCtrl || io.KeyShift || io.KeySuper || TestKeyOwner(ImGuiMod_Alt, ImGuiKeyOwner_None) == false) g.NavWindowingToggleLayer = false; // Apply layer toggle on release - // Important: we don't assume that Alt was previously held in order to handle loss of focus when backend calls io.AddFocusEvent(false) // Important: as before version <18314 we lacked an explicit IO event for focus gain/loss, we also compare mouse validity to detect old backends clearing mouse pos on focus loss. - if (!(io.KeyMods & ImGuiKeyModFlags_Alt) && (io.KeyModsPrev & ImGuiKeyModFlags_Alt) && g.NavWindowingToggleLayer) + if (IsKeyReleased(ImGuiMod_Alt) && g.NavWindowingToggleLayer) if (g.ActiveId == 0 || g.ActiveIdAllowOverlap) if (IsMousePosValid(&io.MousePos) == IsMousePosValid(&io.MousePosPrev)) apply_toggle_layer = true; - if (!io.KeyAlt) + if (!IsKeyDown(ImGuiMod_Alt)) g.NavWindowingToggleLayer = false; } // Move window if (g.NavWindowingTarget && !(g.NavWindowingTarget->Flags & ImGuiWindowFlags_NoMove)) { - ImVec2 move_delta; + ImVec2 nav_move_dir; if (g.NavInputSource == ImGuiInputSource_Keyboard && !io.KeyShift) - move_delta = GetNavInputAmount2d(ImGuiNavDirSourceFlags_Keyboard, ImGuiInputReadMode_Down); + nav_move_dir = GetKeyVector2d(ImGuiKey_LeftArrow, ImGuiKey_RightArrow, ImGuiKey_UpArrow, ImGuiKey_DownArrow); if (g.NavInputSource == ImGuiInputSource_Gamepad) - move_delta = GetNavInputAmount2d(ImGuiNavDirSourceFlags_PadLStick, ImGuiInputReadMode_Down); - if (move_delta.x != 0.0f || move_delta.y != 0.0f) + nav_move_dir = GetKeyVector2d(ImGuiKey_GamepadLStickLeft, ImGuiKey_GamepadLStickRight, ImGuiKey_GamepadLStickUp, ImGuiKey_GamepadLStickDown); + if (nav_move_dir.x != 0.0f || nav_move_dir.y != 0.0f) { const float NAV_MOVE_SPEED = 800.0f; - const float move_speed = ImFloor(NAV_MOVE_SPEED * io.DeltaTime * ImMin(io.DisplayFramebufferScale.x, io.DisplayFramebufferScale.y)); // FIXME: Doesn't handle variable framerate very well - ImGuiWindow* moving_window = g.NavWindowingTarget->RootWindow; - SetWindowPos(moving_window, moving_window->Pos + move_delta * move_speed, ImGuiCond_Always); - MarkIniSettingsDirty(moving_window); + const float move_step = NAV_MOVE_SPEED * io.DeltaTime * ImMin(io.DisplayFramebufferScale.x, io.DisplayFramebufferScale.y); + g.NavWindowingAccumDeltaPos += nav_move_dir * move_step; g.NavDisableMouseHover = true; + ImVec2 accum_floored = ImFloor(g.NavWindowingAccumDeltaPos); + if (accum_floored.x != 0.0f || accum_floored.y != 0.0f) + { + ImGuiWindow* moving_window = g.NavWindowingTarget->RootWindow; + SetWindowPos(moving_window, moving_window->Pos + accum_floored, ImGuiCond_Always); + g.NavWindowingAccumDeltaPos -= accum_floored; + } } } @@ -9921,8 +11620,7 @@ static void ImGui::NavUpdateWindowing() if (apply_focus_window && (g.NavWindow == NULL || apply_focus_window != g.NavWindow->RootWindow)) { ClearActiveID(); - g.NavDisableHighlight = false; - g.NavDisableMouseHover = true; + NavRestoreHighlightAfterMove(); apply_focus_window = NavRestoreLastChildNavWindow(apply_focus_window); ClosePopupsOverWindow(apply_focus_window, false); FocusWindow(apply_focus_window); @@ -9969,6 +11667,7 @@ static void ImGui::NavUpdateWindowing() if (new_nav_layer == ImGuiNavLayer_Menu) g.NavWindow->NavLastIds[new_nav_layer] = 0; NavRestoreLayer(new_nav_layer); + NavRestoreHighlightAfterMove(); } } } @@ -9977,10 +11676,10 @@ static void ImGui::NavUpdateWindowing() static const char* GetFallbackWindowNameForWindowingList(ImGuiWindow* window) { if (window->Flags & ImGuiWindowFlags_Popup) - return "(Popup)"; + return ImGui::LocalizeGetMsg(ImGuiLocKey_WindowingPopup); if ((window->Flags & ImGuiWindowFlags_MenuBar) && strcmp(window->Name, "##MainMenuBar") == 0) - return "(Main menu bar)"; - return "(Untitled)"; + return ImGui::LocalizeGetMsg(ImGuiLocKey_WindowingMainMenuBar); + return ImGui::LocalizeGetMsg(ImGuiLocKey_WindowingUntitled); } // Overlay displayed when using CTRL+TAB. Called by EndFrame(). @@ -10019,6 +11718,12 @@ void ImGui::NavUpdateWindowingOverlay() // [SECTION] DRAG AND DROP //----------------------------------------------------------------------------- +bool ImGui::IsDragDropActive() +{ + ImGuiContext& g = *GImGui; + return g.DragDropActive; +} + void ImGui::ClearDragDrop() { ImGuiContext& g = *GImGui; @@ -10075,19 +11780,20 @@ bool ImGui::BeginDragDropSource(ImGuiDragDropFlags flags) return false; // If you want to use BeginDragDropSource() on an item with no unique identifier for interaction, such as Text() or Image(), you need to: - // A) Read the explanation below, B) Use the ImGuiDragDropFlags_SourceAllowNullID flag, C) Swallow your programmer pride. + // A) Read the explanation below, B) Use the ImGuiDragDropFlags_SourceAllowNullID flag. if (!(flags & ImGuiDragDropFlags_SourceAllowNullID)) { IM_ASSERT(0); return false; } - // Magic fallback (=somehow reprehensible) to handle items with no assigned ID, e.g. Text(), Image() + // Magic fallback to handle items with no assigned ID, e.g. Text(), Image() // We build a throwaway ID based on current ID stack + relative AABB of items in window. - // THE IDENTIFIER WON'T SURVIVE ANY REPOSITIONING OF THE WIDGET, so if your widget moves your dragging operation will be canceled. + // THE IDENTIFIER WON'T SURVIVE ANY REPOSITIONING/RESIZINGG OF THE WIDGET, so if your widget moves your dragging operation will be canceled. // We don't need to maintain/call ClearActiveID() as releasing the button will early out this function and trigger !ActiveIdIsAlive. // Rely on keeping other window->LastItemXXX fields intact. source_id = g.LastItemData.ID = window->GetIDFromRectangle(g.LastItemData.Rect); + KeepAliveID(source_id); bool is_hovered = ItemHoverable(g.LastItemData.Rect, source_id); if (is_hovered && g.IO.MouseClicked[mouse_button]) { @@ -10103,7 +11809,7 @@ bool ImGui::BeginDragDropSource(ImGuiDragDropFlags flags) source_drag_active = IsMouseDragging(mouse_button); // Disable navigation and key inputs while dragging + cancel existing request if any - SetActiveIdUsingNavAndKeys(); + SetActiveIdUsingAllKeyboardKeys(); } else { @@ -10207,6 +11913,7 @@ bool ImGui::SetDragDropPayload(const char* type, const void* data, size_t data_s } payload.DataFrameCount = g.FrameCount; + // Return whether the payload has been accepted return (g.DragDropAcceptFrameCount == g.FrameCount) || (g.DragDropAcceptFrameCount == g.FrameCount - 1); } @@ -10234,7 +11941,7 @@ bool ImGui::BeginDragDropTargetCustom(const ImRect& bb, ImGuiID id) } // We don't use BeginDragDropTargetCustom() and duplicate its code because: -// 1) we use LastItemRectHoveredRect which handles items that pushes a temporarily clip rectangle in their code. Calling BeginDragDropTargetCustom(LastItemRect) would not handle them. +// 1) we use LastItemRectHoveredRect which handles items that push a temporarily clip rectangle in their code. Calling BeginDragDropTargetCustom(LastItemRect) would not handle them. // 2) and it's faster. as this code may be very frequently called, we want to early out as fast as we can. // Also note how the HoveredWindow test is positioned differently in both functions (in both functions we optimize for the cheapest early out case) bool ImGui::BeginDragDropTarget() @@ -10253,7 +11960,10 @@ bool ImGui::BeginDragDropTarget() const ImRect& display_rect = (g.LastItemData.StatusFlags & ImGuiItemStatusFlags_HasDisplayRect) ? g.LastItemData.DisplayRect : g.LastItemData.Rect; ImGuiID id = g.LastItemData.ID; if (id == 0) + { id = window->GetIDFromRectangle(display_rect); + KeepAliveID(id); + } if (g.DragDropPayload.SourceId == id) return false; @@ -10293,9 +12003,8 @@ const ImGuiPayload* ImGui::AcceptDragDropPayload(const char* type, ImGuiDragDrop } // Render default drop visuals - // FIXME-DRAGDROP: Settle on a proper default visuals for drop target. payload.Preview = was_accepted_previously; - flags |= (g.DragDropSourceFlags & ImGuiDragDropFlags_AcceptNoDrawDefaultRect); // Source can also inhibit the preview (useful for external sources that lives for 1 frame) + flags |= (g.DragDropSourceFlags & ImGuiDragDropFlags_AcceptNoDrawDefaultRect); // Source can also inhibit the preview (useful for external sources that live for 1 frame) if (!(flags & ImGuiDragDropFlags_AcceptNoDrawDefaultRect) && payload.Preview) window->DrawList->AddRect(r.Min - ImVec2(3.5f,3.5f), r.Max + ImVec2(3.5f, 3.5f), GetColorU32(ImGuiCol_DragDropTarget), 0.0f, 0, 2.0f); @@ -10307,10 +12016,16 @@ const ImGuiPayload* ImGui::AcceptDragDropPayload(const char* type, ImGuiDragDrop return &payload; } +// FIXME-DRAGDROP: Settle on a proper default visuals for drop target. +void ImGui::RenderDragDropTargetRect(const ImRect& bb) +{ + GetWindowDrawList()->AddRect(bb.Min - ImVec2(3.5f, 3.5f), bb.Max + ImVec2(3.5f, 3.5f), GetColorU32(ImGuiCol_DragDropTarget), 0.0f, 0, 2.0f); +} + const ImGuiPayload* ImGui::GetDragDropPayload() { ImGuiContext& g = *GImGui; - return g.DragDropActive ? &g.DragDropPayload : NULL; + return (g.DragDropActive && g.DragDropPayload.DataFrameCount != -1) ? &g.DragDropPayload : NULL; } // We don't really use/need this now, but added it for the sake of consistency and because we might need it later. @@ -10667,6 +12382,20 @@ ImGuiWindowSettings* ImGui::FindOrCreateWindowSettings(const char* name) return CreateNewWindowSettings(name); } +void ImGui::AddSettingsHandler(const ImGuiSettingsHandler* handler) +{ + ImGuiContext& g = *GImGui; + IM_ASSERT(FindSettingsHandler(handler->TypeName) == NULL); + g.SettingsHandlers.push_back(*handler); +} + +void ImGui::RemoveSettingsHandler(const char* type_name) +{ + ImGuiContext& g = *GImGui; + if (ImGuiSettingsHandler* handler = FindSettingsHandler(type_name)) + g.SettingsHandlers.erase(handler); +} + ImGuiSettingsHandler* ImGui::FindSettingsHandler(const char* type_name) { ImGuiContext& g = *GImGui; @@ -10692,7 +12421,8 @@ void ImGui::LoadIniSettingsFromDisk(const char* ini_filename) char* file_data = (char*)ImFileLoadToMemory(ini_filename, "rb", &file_data_size); if (!file_data) return; - LoadIniSettingsFromMemory(file_data, (size_t)file_data_size); + if (file_data_size > 0) + LoadIniSettingsFromMemory(file_data, (size_t)file_data_size); IM_FREE(file_data); } @@ -10879,10 +12609,23 @@ static void WindowSettingsHandler_WriteAll(ImGuiContext* ctx, ImGuiSettingsHandl } +//----------------------------------------------------------------------------- +// [SECTION] LOCALIZATION +//----------------------------------------------------------------------------- + +void ImGui::LocalizeRegisterEntries(const ImGuiLocEntry* entries, int count) +{ + ImGuiContext& g = *GImGui; + for (int n = 0; n < count; n++) + g.LocalizationTable[entries[n].Key] = entries[n].Text; +} + + //----------------------------------------------------------------------------- // [SECTION] VIEWPORTS, PLATFORM WINDOWS //----------------------------------------------------------------------------- // - GetMainViewport() +// - SetWindowViewport() [Internal] // - UpdateViewportsNewFrame() [Internal] // (this section is more complete in the 'docking' branch) //----------------------------------------------------------------------------- @@ -10893,6 +12636,11 @@ ImGuiViewport* ImGui::GetMainViewport() return g.Viewports[0]; } +void ImGui::SetWindowViewport(ImGuiWindow* window, ImGuiViewportP* viewport) +{ + window->Viewport = viewport; +} + // Update viewports and monitor infos static void ImGui::UpdateViewportsNewFrame() { @@ -11063,25 +12811,37 @@ static void SetClipboardTextFn_DefaultImpl(void*, const char* text) #pragma comment(lib, "imm32") #endif -static void ImeSetInputScreenPosFn_DefaultImpl(int x, int y) +static void SetPlatformImeDataFn_DefaultImpl(ImGuiViewport* viewport, ImGuiPlatformImeData* data) { // Notify OS Input Method Editor of text input position - ImGuiIO& io = ImGui::GetIO(); - if (HWND hwnd = (HWND)io.ImeWindowHandle) - if (HIMC himc = ::ImmGetContext(hwnd)) - { - COMPOSITIONFORM cf; - cf.ptCurrentPos.x = x; - cf.ptCurrentPos.y = y; - cf.dwStyle = CFS_FORCE_POSITION; - ::ImmSetCompositionWindow(himc, &cf); - ::ImmReleaseContext(hwnd, himc); - } + HWND hwnd = (HWND)viewport->PlatformHandleRaw; +#ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS + if (hwnd == 0) + hwnd = (HWND)ImGui::GetIO().ImeWindowHandle; +#endif + if (hwnd == 0) + return; + + //::ImmAssociateContextEx(hwnd, NULL, data->WantVisible ? IACE_DEFAULT : 0); + if (HIMC himc = ::ImmGetContext(hwnd)) + { + COMPOSITIONFORM composition_form = {}; + composition_form.ptCurrentPos.x = (LONG)data->InputPos.x; + composition_form.ptCurrentPos.y = (LONG)data->InputPos.y; + composition_form.dwStyle = CFS_FORCE_POSITION; + ::ImmSetCompositionWindow(himc, &composition_form); + CANDIDATEFORM candidate_form = {}; + candidate_form.dwStyle = CFS_CANDIDATEPOS; + candidate_form.ptCurrentPos.x = (LONG)data->InputPos.x; + candidate_form.ptCurrentPos.y = (LONG)data->InputPos.y; + ::ImmSetCandidateWindow(himc, &candidate_form); + ::ImmReleaseContext(hwnd, himc); + } } #else -static void ImeSetInputScreenPosFn_DefaultImpl(int, int) {} +static void SetPlatformImeDataFn_DefaultImpl(ImGuiViewport*, ImGuiPlatformImeData*) {} #endif @@ -11090,20 +12850,25 @@ static void ImeSetInputScreenPosFn_DefaultImpl(int, int) {} //----------------------------------------------------------------------------- // - RenderViewportThumbnail() [Internal] // - RenderViewportsThumbnails() [Internal] +// - DebugTextEncoding() // - MetricsHelpMarker() [Internal] +// - ShowFontAtlas() [Internal] // - ShowMetricsWindow() // - DebugNodeColumns() [Internal] // - DebugNodeDrawList() [Internal] // - DebugNodeDrawCmdShowMeshAndBoundingBox() [Internal] +// - DebugNodeFont() [Internal] +// - DebugNodeFontGlyph() [Internal] // - DebugNodeStorage() [Internal] // - DebugNodeTabBar() [Internal] // - DebugNodeViewport() [Internal] // - DebugNodeWindow() [Internal] // - DebugNodeWindowSettings() [Internal] // - DebugNodeWindowsList() [Internal] +// - DebugNodeWindowsListByBeginStackParent() [Internal] //----------------------------------------------------------------------------- -#ifndef IMGUI_DISABLE_METRICS_WINDOW +#ifndef IMGUI_DISABLE_DEBUG_TOOLS void ImGui::DebugRenderViewportThumbnail(ImDrawList* draw_list, ImGuiViewportP* viewport, const ImRect& bb) { @@ -11156,11 +12921,47 @@ static void RenderViewportsThumbnails() ImGui::Dummy(bb_full.GetSize() * SCALE); } +// Helper tool to diagnose between text encoding issues and font loading issues. Pass your UTF-8 string and verify that there are correct. +void ImGui::DebugTextEncoding(const char* str) +{ + Text("Text: \"%s\"", str); + if (!BeginTable("list", 4, ImGuiTableFlags_Borders | ImGuiTableFlags_RowBg | ImGuiTableFlags_SizingFixedFit)) + return; + TableSetupColumn("Offset"); + TableSetupColumn("UTF-8"); + TableSetupColumn("Glyph"); + TableSetupColumn("Codepoint"); + TableHeadersRow(); + for (const char* p = str; *p != 0; ) + { + unsigned int c; + const int c_utf8_len = ImTextCharFromUtf8(&c, p, NULL); + TableNextColumn(); + Text("%d", (int)(p - str)); + TableNextColumn(); + for (int byte_index = 0; byte_index < c_utf8_len; byte_index++) + { + if (byte_index > 0) + SameLine(); + Text("0x%02X", (int)(unsigned char)p[byte_index]); + } + TableNextColumn(); + if (GetFont()->FindGlyphNoFallback((ImWchar)c)) + TextUnformatted(p, p + c_utf8_len); + else + TextUnformatted((c == IM_UNICODE_CODEPOINT_INVALID) ? "[invalid]" : "[missing]"); + TableNextColumn(); + Text("U+%04X", (int)c); + p += c_utf8_len; + } + EndTable(); +} + // Avoid naming collision with imgui_demo.cpp's HelpMarker() for unity builds. static void MetricsHelpMarker(const char* desc) { ImGui::TextDisabled("(?)"); - if (ImGui::IsItemHovered()) + if (ImGui::IsItemHovered(ImGuiHoveredFlags_DelayShort)) { ImGui::BeginTooltip(); ImGui::PushTextWrapPos(ImGui::GetFontSize() * 35.0f); @@ -11170,28 +12971,46 @@ static void MetricsHelpMarker(const char* desc) } } -#ifndef IMGUI_DISABLE_DEMO_WINDOWS -namespace ImGui { void ShowFontAtlas(ImFontAtlas* atlas); } -#endif - -void ImGui::ShowMetricsWindow(bool* p_open) +// [DEBUG] List fonts in a font atlas and display its texture +void ImGui::ShowFontAtlas(ImFontAtlas* atlas) { - if (!Begin("Dear ImGui Metrics/Debugger", p_open)) + for (int i = 0; i < atlas->Fonts.Size; i++) { - End(); - return; + ImFont* font = atlas->Fonts[i]; + PushID(font); + DebugNodeFont(font); + PopID(); } + if (TreeNode("Atlas texture", "Atlas texture (%dx%d pixels)", atlas->TexWidth, atlas->TexHeight)) + { + ImVec4 tint_col = ImVec4(1.0f, 1.0f, 1.0f, 1.0f); + ImVec4 border_col = ImVec4(1.0f, 1.0f, 1.0f, 0.5f); + Image(atlas->TexID, ImVec2((float)atlas->TexWidth, (float)atlas->TexHeight), ImVec2(0.0f, 0.0f), ImVec2(1.0f, 1.0f), tint_col, border_col); + TreePop(); + } +} +void ImGui::ShowMetricsWindow(bool* p_open) +{ ImGuiContext& g = *GImGui; ImGuiIO& io = g.IO; ImGuiMetricsConfig* cfg = &g.DebugMetricsConfig; + if (cfg->ShowDebugLog) + ShowDebugLogWindow(&cfg->ShowDebugLog); + if (cfg->ShowStackTool) + ShowStackToolWindow(&cfg->ShowStackTool); + + if (!Begin("Dear ImGui Metrics/Debugger", p_open) || GetCurrentWindow()->BeginCount > 1) + { + End(); + return; + } // Basic info Text("Dear ImGui %s", GetVersion()); Text("Application average %.3f ms/frame (%.1f FPS)", 1000.0f / io.Framerate, io.Framerate); Text("%d vertices, %d indices (%d triangles)", io.MetricsRenderVertices, io.MetricsRenderIndices, io.MetricsRenderIndices / 3); - Text("%d active windows (%d visible)", io.MetricsActiveWindows, io.MetricsRenderWindows); - Text("%d active allocations", io.MetricsActiveAllocations); + Text("%d visible windows, %d active allocations", io.MetricsRenderWindows, io.MetricsActiveAllocations); //SameLine(); if (SmallButton("GC")) { g.GcCompactAll = true; } Separator(); @@ -11210,19 +13029,20 @@ void ImGui::ShowMetricsWindow(bool* p_open) { static ImRect GetTableRect(ImGuiTable* table, int rect_type, int n) { + ImGuiTableInstanceData* table_instance = TableGetInstanceData(table, table->InstanceCurrent); // Always using last submitted instance if (rect_type == TRT_OuterRect) { return table->OuterRect; } else if (rect_type == TRT_InnerRect) { return table->InnerRect; } else if (rect_type == TRT_WorkRect) { return table->WorkRect; } else if (rect_type == TRT_HostClipRect) { return table->HostClipRect; } else if (rect_type == TRT_InnerClipRect) { return table->InnerClipRect; } else if (rect_type == TRT_BackgroundClipRect) { return table->BgClipRect; } - else if (rect_type == TRT_ColumnsRect) { ImGuiTableColumn* c = &table->Columns[n]; return ImRect(c->MinX, table->InnerClipRect.Min.y, c->MaxX, table->InnerClipRect.Min.y + table->LastOuterHeight); } + else if (rect_type == TRT_ColumnsRect) { ImGuiTableColumn* c = &table->Columns[n]; return ImRect(c->MinX, table->InnerClipRect.Min.y, c->MaxX, table->InnerClipRect.Min.y + table_instance->LastOuterHeight); } else if (rect_type == TRT_ColumnsWorkRect) { ImGuiTableColumn* c = &table->Columns[n]; return ImRect(c->WorkMinX, table->WorkRect.Min.y, c->WorkMaxX, table->WorkRect.Max.y); } else if (rect_type == TRT_ColumnsClipRect) { ImGuiTableColumn* c = &table->Columns[n]; return c->ClipRect; } - else if (rect_type == TRT_ColumnsContentHeadersUsed){ ImGuiTableColumn* c = &table->Columns[n]; return ImRect(c->WorkMinX, table->InnerClipRect.Min.y, c->ContentMaxXHeadersUsed, table->InnerClipRect.Min.y + table->LastFirstRowHeight); } // Note: y1/y2 not always accurate - else if (rect_type == TRT_ColumnsContentHeadersIdeal){ImGuiTableColumn* c = &table->Columns[n]; return ImRect(c->WorkMinX, table->InnerClipRect.Min.y, c->ContentMaxXHeadersIdeal, table->InnerClipRect.Min.y + table->LastFirstRowHeight); } - else if (rect_type == TRT_ColumnsContentFrozen) { ImGuiTableColumn* c = &table->Columns[n]; return ImRect(c->WorkMinX, table->InnerClipRect.Min.y, c->ContentMaxXFrozen, table->InnerClipRect.Min.y + table->LastFirstRowHeight); } - else if (rect_type == TRT_ColumnsContentUnfrozen) { ImGuiTableColumn* c = &table->Columns[n]; return ImRect(c->WorkMinX, table->InnerClipRect.Min.y + table->LastFirstRowHeight, c->ContentMaxXUnfrozen, table->InnerClipRect.Max.y); } + else if (rect_type == TRT_ColumnsContentHeadersUsed){ ImGuiTableColumn* c = &table->Columns[n]; return ImRect(c->WorkMinX, table->InnerClipRect.Min.y, c->ContentMaxXHeadersUsed, table->InnerClipRect.Min.y + table_instance->LastFirstRowHeight); } // Note: y1/y2 not always accurate + else if (rect_type == TRT_ColumnsContentHeadersIdeal){ImGuiTableColumn* c = &table->Columns[n]; return ImRect(c->WorkMinX, table->InnerClipRect.Min.y, c->ContentMaxXHeadersIdeal, table->InnerClipRect.Min.y + table_instance->LastFirstRowHeight); } + else if (rect_type == TRT_ColumnsContentFrozen) { ImGuiTableColumn* c = &table->Columns[n]; return ImRect(c->WorkMinX, table->InnerClipRect.Min.y, c->ContentMaxXFrozen, table->InnerClipRect.Min.y + table_instance->LastFirstRowHeight); } + else if (rect_type == TRT_ColumnsContentUnfrozen) { ImGuiTableColumn* c = &table->Columns[n]; return ImRect(c->WorkMinX, table->InnerClipRect.Min.y + table_instance->LastFirstRowHeight, c->ContentMaxXUnfrozen, table->InnerClipRect.Max.y); } IM_ASSERT(0); return ImRect(); } @@ -11245,12 +13065,35 @@ void ImGui::ShowMetricsWindow(bool* p_open) // Tools if (TreeNode("Tools")) { + bool show_encoding_viewer = TreeNode("UTF-8 Encoding viewer"); + SameLine(); + MetricsHelpMarker("You can also call ImGui::DebugTextEncoding() from your code with a given string to test that your UTF-8 encoding settings are correct."); + if (show_encoding_viewer) + { + static char buf[100] = ""; + SetNextItemWidth(-FLT_MIN); + InputText("##Text", buf, IM_ARRAYSIZE(buf)); + if (buf[0] != 0) + DebugTextEncoding(buf); + TreePop(); + } + // The Item Picker tool is super useful to visually select an item and break into the call-stack of where it was submitted. - if (Button("Item Picker..")) + if (Checkbox("Show Item Picker", &g.DebugItemPickerActive) && g.DebugItemPickerActive) DebugStartItemPicker(); SameLine(); MetricsHelpMarker("Will call the IM_DEBUG_BREAK() macro to break in debugger.\nWarning: If you don't have a debugger attached, this will probably crash."); + // Stack Tool is your best friend! + Checkbox("Show Debug Log", &cfg->ShowDebugLog); + SameLine(); + MetricsHelpMarker("You can also call ImGui::ShowDebugLogWindow() from your code."); + + // Stack Tool is your best friend! + Checkbox("Show Stack Tool", &cfg->ShowStackTool); + SameLine(); + MetricsHelpMarker("You can also call ImGui::ShowStackToolWindow() from your code."); + Checkbox("Show windows begin order", &cfg->ShowWindowsBeginOrder); Checkbox("Show windows rectangles", &cfg->ShowWindowsRects); SameLine(); @@ -11267,8 +13110,6 @@ void ImGui::ShowMetricsWindow(bool* p_open) } Unindent(); } - Checkbox("Show ImDrawCmd mesh when hovering", &cfg->ShowDrawCmdMesh); - Checkbox("Show ImDrawCmd bounding boxes when hovering", &cfg->ShowDrawCmdBoundingBoxes); Checkbox("Show tables rectangles", &cfg->ShowTablesRects); SameLine(); @@ -11319,8 +13160,27 @@ void ImGui::ShowMetricsWindow(bool* p_open) } // Windows - DebugNodeWindowsList(&g.Windows, "Windows"); - //DebugNodeWindowsList(&g.WindowsFocusOrder, "WindowsFocusOrder"); + if (TreeNode("Windows", "Windows (%d)", g.Windows.Size)) + { + //SetNextItemOpen(true, ImGuiCond_Once); + DebugNodeWindowsList(&g.Windows, "By display order"); + DebugNodeWindowsList(&g.WindowsFocusOrder, "By focus order (root windows)"); + if (TreeNode("By submission order (begin stack)")) + { + // Here we display windows in their submitted order/hierarchy, however note that the Begin stack doesn't constitute a Parent<>Child relationship! + ImVector& temp_buffer = g.WindowsTempSortBuffer; + temp_buffer.resize(0); + for (int i = 0; i < g.Windows.Size; i++) + if (g.Windows[i]->LastFrameActive + 1 >= g.FrameCount) + temp_buffer.push_back(g.Windows[i]); + struct Func { static int IMGUI_CDECL WindowComparerByBeginOrder(const void* lhs, const void* rhs) { return ((int)(*(const ImGuiWindow* const *)lhs)->BeginOrderWithinContext - (*(const ImGuiWindow* const*)rhs)->BeginOrderWithinContext); } }; + ImQsort(temp_buffer.Data, (size_t)temp_buffer.Size, sizeof(ImGuiWindow*), Func::WindowComparerByBeginOrder); + DebugNodeWindowsListByBeginStackParent(temp_buffer.Data, temp_buffer.Size, NULL); + TreePop(); + } + + TreePop(); + } // DrawLists int drawlist_count = 0; @@ -11328,6 +13188,8 @@ void ImGui::ShowMetricsWindow(bool* p_open) drawlist_count += g.Viewports[viewport_i]->DrawDataBuilder.GetDrawListCount(); if (TreeNode("DrawLists", "DrawLists (%d)", drawlist_count)) { + Checkbox("Show ImDrawCmd mesh when hovering", &cfg->ShowDrawCmdMesh); + Checkbox("Show ImDrawCmd bounding boxes when hovering", &cfg->ShowDrawCmdBoundingBoxes); for (int viewport_i = 0; viewport_i < g.Viewports.Size; viewport_i++) { ImGuiViewportP* viewport = g.Viewports[viewport_i]; @@ -11354,8 +13216,12 @@ void ImGui::ShowMetricsWindow(bool* p_open) { for (int i = 0; i < g.OpenPopupStack.Size; i++) { - ImGuiWindow* window = g.OpenPopupStack[i].Window; - BulletText("PopupID: %08x, Window: '%s'%s%s", g.OpenPopupStack[i].PopupId, window ? window->Name : "NULL", window && (window->Flags & ImGuiWindowFlags_ChildWindow) ? " ChildWindow" : "", window && (window->Flags & ImGuiWindowFlags_ChildMenu) ? " ChildMenu" : ""); + // As it's difficult to interact with tree nodes while popups are open, we display everything inline. + const ImGuiPopupData* popup_data = &g.OpenPopupStack[i]; + ImGuiWindow* window = popup_data->Window; + BulletText("PopupID: %08x, Window: '%s' (%s%s), BackupNavWindow '%s', ParentWindow '%s'", + popup_data->PopupId, window ? window->Name : "NULL", window && (window->Flags & ImGuiWindowFlags_ChildWindow) ? "Child;" : "", window && (window->Flags & ImGuiWindowFlags_ChildMenu) ? "Menu;" : "", + popup_data->BackupNavWindow ? popup_data->BackupNavWindow->Name : "NULL", window && window->ParentWindow ? window->ParentWindow->Name : "NULL"); } TreePop(); } @@ -11383,14 +13249,19 @@ void ImGui::ShowMetricsWindow(bool* p_open) } // Details for Fonts -#ifndef IMGUI_DISABLE_DEMO_WINDOWS ImFontAtlas* atlas = g.IO.Fonts; if (TreeNode("Fonts", "Fonts (%d)", atlas->Fonts.Size)) { ShowFontAtlas(atlas); TreePop(); } -#endif + + // Details for InputText + if (TreeNode("InputText")) + { + DebugNodeInputTextState(&g.InputTextState); + TreePop(); + } // Details for Docking #ifdef IMGUI_HAS_DOCK @@ -11448,11 +13319,46 @@ void ImGui::ShowMetricsWindow(bool* p_open) TreePop(); } - // Misc Details - if (TreeNode("Internal state")) + if (TreeNode("Key Owners & Shortcut Routing")) { - const char* input_source_names[] = { "None", "Mouse", "Keyboard", "Gamepad", "Nav", "Clipboard" }; IM_ASSERT(IM_ARRAYSIZE(input_source_names) == ImGuiInputSource_COUNT); + TextUnformatted("Key Owners:"); + if (BeginListBox("##owners", ImVec2(-FLT_MIN, GetTextLineHeightWithSpacing() * 8))) + { + for (ImGuiKey key = ImGuiKey_NamedKey_BEGIN; key < ImGuiKey_NamedKey_END; key = (ImGuiKey)(key + 1)) + { + ImGuiKeyOwnerData* owner_data = GetKeyOwnerData(key); + if (owner_data->OwnerCurr == ImGuiKeyOwner_None) + continue; + Text("%s: 0x%08X%s", GetKeyName(key), owner_data->OwnerCurr, + owner_data->LockUntilRelease ? " LockUntilRelease" : owner_data->LockThisFrame ? " LockThisFrame" : ""); + DebugLocateItemOnHover(owner_data->OwnerCurr); + } + EndListBox(); + } + TextUnformatted("Shortcut Routing:"); + if (BeginListBox("##routes", ImVec2(-FLT_MIN, GetTextLineHeightWithSpacing() * 8))) + { + for (ImGuiKey key = ImGuiKey_NamedKey_BEGIN; key < ImGuiKey_NamedKey_END; key = (ImGuiKey)(key + 1)) + { + ImGuiKeyRoutingTable* rt = &g.KeysRoutingTable; + for (ImGuiKeyRoutingIndex idx = rt->Index[key - ImGuiKey_NamedKey_BEGIN]; idx != -1; ) + { + char key_chord_name[64]; + ImGuiKeyRoutingData* routing_data = &rt->Entries[idx]; + GetKeyChordName(key | routing_data->Mods, key_chord_name, IM_ARRAYSIZE(key_chord_name)); + Text("%s: 0x%08X", key_chord_name, routing_data->RoutingCurr); + DebugLocateItemOnHover(routing_data->RoutingCurr); + idx = routing_data->NextEntryIndex; + } + } + EndListBox(); + } + Text("(ActiveIdUsing: AllKeyboardKeys: %d, NavDirMask: 0x%X)", g.ActiveIdUsingAllKeyboardKeys, g.ActiveIdUsingNavDirMask); + TreePop(); + } + if (TreeNode("Internal state")) + { Text("WINDOWING"); Indent(); Text("HoveredWindow: '%s'", g.HoveredWindow ? g.HoveredWindow->Name : "NULL"); @@ -11463,18 +13369,22 @@ void ImGui::ShowMetricsWindow(bool* p_open) Text("ITEMS"); Indent(); - Text("ActiveId: 0x%08X/0x%08X (%.2f sec), AllowOverlap: %d, Source: %s", g.ActiveId, g.ActiveIdPreviousFrame, g.ActiveIdTimer, g.ActiveIdAllowOverlap, input_source_names[g.ActiveIdSource]); + Text("ActiveId: 0x%08X/0x%08X (%.2f sec), AllowOverlap: %d, Source: %s", g.ActiveId, g.ActiveIdPreviousFrame, g.ActiveIdTimer, g.ActiveIdAllowOverlap, GetInputSourceName(g.ActiveIdSource)); + DebugLocateItemOnHover(g.ActiveId); Text("ActiveIdWindow: '%s'", g.ActiveIdWindow ? g.ActiveIdWindow->Name : "NULL"); - Text("ActiveIdUsing: Wheel: %d, NavDirMask: %X, NavInputMask: %X, KeyInputMask: %llX", g.ActiveIdUsingMouseWheel, g.ActiveIdUsingNavDirMask, g.ActiveIdUsingNavInputMask, g.ActiveIdUsingKeyInputMask); + Text("ActiveIdUsing: AllKeyboardKeys: %d, NavDirMask: %X", g.ActiveIdUsingAllKeyboardKeys, g.ActiveIdUsingNavDirMask); Text("HoveredId: 0x%08X (%.2f sec), AllowOverlap: %d", g.HoveredIdPreviousFrame, g.HoveredIdTimer, g.HoveredIdAllowOverlap); // Not displaying g.HoveredId as it is update mid-frame + Text("HoverDelayId: 0x%08X, Timer: %.2f, ClearTimer: %.2f", g.HoverDelayId, g.HoverDelayTimer, g.HoverDelayClearTimer); Text("DragDrop: %d, SourceId = 0x%08X, Payload \"%s\" (%d bytes)", g.DragDropActive, g.DragDropPayload.SourceId, g.DragDropPayload.DataType, g.DragDropPayload.DataSize); + DebugLocateItemOnHover(g.DragDropPayload.SourceId); Unindent(); Text("NAV,FOCUS"); Indent(); Text("NavWindow: '%s'", g.NavWindow ? g.NavWindow->Name : "NULL"); Text("NavId: 0x%08X, NavLayer: %d", g.NavId, g.NavLayer); - Text("NavInputSource: %s", input_source_names[g.NavInputSource]); + DebugLocateItemOnHover(g.NavId); + Text("NavInputSource: %s", GetInputSourceName(g.NavInputSource)); Text("NavActive: %d, NavVisible: %d", g.IO.NavActive, g.IO.NavVisible); Text("NavActivateId/DownId/PressedId/InputId: %08X/%08X/%08X/%08X", g.NavActivateId, g.NavActivateDownId, g.NavActivatePressedId, g.NavActivateInputId); Text("NavActivateFlags: %04X", g.NavActivateFlags); @@ -11548,25 +13458,6 @@ void ImGui::ShowMetricsWindow(bool* p_open) End(); } -// [DEBUG] List fonts in a font atlas and display its texture -void ImGui::ShowFontAtlas(ImFontAtlas* atlas) -{ - for (int i = 0; i < atlas->Fonts.Size; i++) - { - ImFont* font = atlas->Fonts[i]; - PushID(font); - DebugNodeFont(font); - PopID(); - } - if (TreeNode("Atlas texture", "Atlas texture (%dx%d pixels)", atlas->TexWidth, atlas->TexHeight)) - { - ImVec4 tint_col = ImVec4(1.0f, 1.0f, 1.0f, 1.0f); - ImVec4 border_col = ImVec4(1.0f, 1.0f, 1.0f, 0.5f); - Image(atlas->TexID, ImVec2((float)atlas->TexWidth, (float)atlas->TexHeight), ImVec2(0.0f, 0.0f), ImVec2(1.0f, 1.0f), tint_col, border_col); - TreePop(); - } -} - // [DEBUG] Display contents of Columns void ImGui::DebugNodeColumns(ImGuiOldColumns* columns) { @@ -11597,7 +13488,7 @@ void ImGui::DebugNodeDrawList(ImGuiWindow* window, const ImDrawList* draw_list, } ImDrawList* fg_draw_list = GetForegroundDrawList(window); // Render additional visuals into the top-most draw list - if (window && IsItemHovered()) + if (window && IsItemHovered() && fg_draw_list) fg_draw_list->AddRect(window->Pos, window->Pos + window->Size, IM_COL32(255, 255, 0, 255)); if (!node_open) return; @@ -11776,17 +13667,13 @@ void ImGui::DebugNodeFont(ImFont* font) ImVec2 cell_p2(cell_p1.x + cell_size, cell_p1.y + cell_size); const ImFontGlyph* glyph = font->FindGlyphNoFallback((ImWchar)(base + n)); draw_list->AddRect(cell_p1, cell_p2, glyph ? IM_COL32(255, 255, 255, 100) : IM_COL32(255, 255, 255, 50)); - if (glyph) - font->RenderChar(draw_list, cell_size, cell_p1, glyph_col, (ImWchar)(base + n)); - if (glyph && IsMouseHoveringRect(cell_p1, cell_p2)) + if (!glyph) + continue; + font->RenderChar(draw_list, cell_size, cell_p1, glyph_col, (ImWchar)(base + n)); + if (IsMouseHoveringRect(cell_p1, cell_p2)) { BeginTooltip(); - Text("Codepoint: U+%04X", base + n); - Separator(); - Text("Visible: %d", glyph->Visible); - Text("AdvanceX: %.1f", glyph->AdvanceX); - Text("Pos: (%.2f,%.2f)->(%.2f,%.2f)", glyph->X0, glyph->Y0, glyph->X1, glyph->Y1); - Text("UV: (%.3f,%.3f)->(%.3f,%.3f)", glyph->U0, glyph->V0, glyph->U1, glyph->V1); + DebugNodeFontGlyph(font, glyph); EndTooltip(); } } @@ -11798,6 +13685,16 @@ void ImGui::DebugNodeFont(ImFont* font) TreePop(); } +void ImGui::DebugNodeFontGlyph(ImFont*, const ImFontGlyph* glyph) +{ + Text("Codepoint: U+%04X", glyph->Codepoint); + Separator(); + Text("Visible: %d", glyph->Visible); + Text("AdvanceX: %.1f", glyph->AdvanceX); + Text("Pos: (%.2f,%.2f)->(%.2f,%.2f)", glyph->X0, glyph->Y0, glyph->X1, glyph->Y1); + Text("UV: (%.3f,%.3f)->(%.3f,%.3f)", glyph->U0, glyph->V0, glyph->U1, glyph->V1); +} + // [DEBUG] Display contents of ImGuiStorage void ImGui::DebugNodeStorage(ImGuiStorage* storage, const char* label) { @@ -11846,7 +13743,7 @@ void ImGui::DebugNodeTabBar(ImGuiTabBar* tab_bar, const char* label) PushID(tab); if (SmallButton("<")) { TabBarQueueReorder(tab_bar, tab, -1); } SameLine(0, 2); if (SmallButton(">")) { TabBarQueueReorder(tab_bar, tab, +1); } SameLine(); - Text("%02d%c Tab 0x%08X '%s' Offset: %.1f, Width: %.1f/%.1f", + Text("%02d%c Tab 0x%08X '%s' Offset: %.2f, Width: %.2f/%.2f", tab_n, (tab->ID == tab_bar->SelectedTabId) ? '*' : ' ', tab->ID, (tab->NameOffset != -1) ? tab_bar->GetTabName(tab) : "???", tab->Offset, tab->Width, tab->ContentWidth); PopID(); } @@ -11910,13 +13807,10 @@ void ImGui::DebugNodeWindow(ImGuiWindow* window, const char* label) { ImRect r = window->NavRectRel[layer]; if (r.Min.x >= r.Max.y && r.Min.y >= r.Max.y) - { BulletText("NavLastIds[%d]: 0x%08X", layer, window->NavLastIds[layer]); - continue; - } - BulletText("NavLastIds[%d]: 0x%08X at +(%.1f,%.1f)(%.1f,%.1f)", layer, window->NavLastIds[layer], r.Min.x, r.Min.y, r.Max.x, r.Max.y); - if (IsItemHovered()) - GetForegroundDrawList(window)->AddRect(r.Min + window->Pos, r.Max + window->Pos, IM_COL32(255, 255, 0, 255)); + else + BulletText("NavLastIds[%d]: 0x%08X at +(%.1f,%.1f)(%.1f,%.1f)", layer, window->NavLastIds[layer], r.Min.x, r.Min.y, r.Max.x, r.Max.y); + DebugLocateItemOnHover(window->NavLastIds[layer]); } BulletText("NavLayersActiveMask: %X, NavLastChildNavWindow: %s", window->DC.NavLayersActiveMask, window->NavLastChildNavWindow ? window->NavLastChildNavWindow->Name : "NULL"); if (window->RootWindow != window) { DebugNodeWindow(window->RootWindow, "RootWindow"); } @@ -11942,7 +13836,6 @@ void ImGui::DebugNodeWindowsList(ImVector* windows, const char* la { if (!TreeNode(label, "%s (%d)", label, windows->Size)) return; - Text("(In front-to-back order:)"); for (int i = windows->Size - 1; i >= 0; i--) // Iterate front to back { PushID((*windows)[i]); @@ -11952,6 +13845,359 @@ void ImGui::DebugNodeWindowsList(ImVector* windows, const char* la TreePop(); } +// FIXME-OPT: This is technically suboptimal, but it is simpler this way. +void ImGui::DebugNodeWindowsListByBeginStackParent(ImGuiWindow** windows, int windows_size, ImGuiWindow* parent_in_begin_stack) +{ + for (int i = 0; i < windows_size; i++) + { + ImGuiWindow* window = windows[i]; + if (window->ParentWindowInBeginStack != parent_in_begin_stack) + continue; + char buf[20]; + ImFormatString(buf, IM_ARRAYSIZE(buf), "[%04d] Window", window->BeginOrderWithinContext); + //BulletText("[%04d] Window '%s'", window->BeginOrderWithinContext, window->Name); + DebugNodeWindow(window, buf); + Indent(); + DebugNodeWindowsListByBeginStackParent(windows + i + 1, windows_size - i - 1, window); + Unindent(); + } +} + +//----------------------------------------------------------------------------- +// [SECTION] DEBUG LOG WINDOW +//----------------------------------------------------------------------------- + +void ImGui::DebugLog(const char* fmt, ...) +{ + va_list args; + va_start(args, fmt); + DebugLogV(fmt, args); + va_end(args); +} + +void ImGui::DebugLogV(const char* fmt, va_list args) +{ + ImGuiContext& g = *GImGui; + const int old_size = g.DebugLogBuf.size(); + g.DebugLogBuf.appendf("[%05d] ", g.FrameCount); + g.DebugLogBuf.appendfv(fmt, args); + if (g.DebugLogFlags & ImGuiDebugLogFlags_OutputToTTY) + IMGUI_DEBUG_PRINTF("%s", g.DebugLogBuf.begin() + old_size); + g.DebugLogIndex.append(g.DebugLogBuf.c_str(), old_size, g.DebugLogBuf.size()); +} + +void ImGui::ShowDebugLogWindow(bool* p_open) +{ + ImGuiContext& g = *GImGui; + if (!(g.NextWindowData.Flags & ImGuiNextWindowDataFlags_HasSize)) + SetNextWindowSize(ImVec2(0.0f, GetFontSize() * 12.0f), ImGuiCond_FirstUseEver); + if (!Begin("Dear ImGui Debug Log", p_open) || GetCurrentWindow()->BeginCount > 1) + { + End(); + return; + } + + AlignTextToFramePadding(); + Text("Log events:"); + SameLine(); CheckboxFlags("All", &g.DebugLogFlags, ImGuiDebugLogFlags_EventMask_); + SameLine(); CheckboxFlags("ActiveId", &g.DebugLogFlags, ImGuiDebugLogFlags_EventActiveId); + SameLine(); CheckboxFlags("Focus", &g.DebugLogFlags, ImGuiDebugLogFlags_EventFocus); + SameLine(); CheckboxFlags("Popup", &g.DebugLogFlags, ImGuiDebugLogFlags_EventPopup); + SameLine(); CheckboxFlags("Nav", &g.DebugLogFlags, ImGuiDebugLogFlags_EventNav); + SameLine(); CheckboxFlags("Clipper", &g.DebugLogFlags, ImGuiDebugLogFlags_EventClipper); + SameLine(); CheckboxFlags("IO", &g.DebugLogFlags, ImGuiDebugLogFlags_EventIO); + + if (SmallButton("Clear")) + { + g.DebugLogBuf.clear(); + g.DebugLogIndex.clear(); + } + SameLine(); + if (SmallButton("Copy")) + SetClipboardText(g.DebugLogBuf.c_str()); + BeginChild("##log", ImVec2(0.0f, 0.0f), true, ImGuiWindowFlags_AlwaysVerticalScrollbar | ImGuiWindowFlags_AlwaysHorizontalScrollbar); + + ImGuiListClipper clipper; + clipper.Begin(g.DebugLogIndex.size()); + while (clipper.Step()) + for (int line_no = clipper.DisplayStart; line_no < clipper.DisplayEnd; line_no++) + { + const char* line_begin = g.DebugLogIndex.get_line_begin(g.DebugLogBuf.c_str(), line_no); + const char* line_end = g.DebugLogIndex.get_line_end(g.DebugLogBuf.c_str(), line_no); + TextUnformatted(line_begin, line_end); + ImRect text_rect = g.LastItemData.Rect; + if (IsItemHovered()) + for (const char* p = line_begin; p < line_end - 10; p++) + { + ImGuiID id = 0; + if (p[0] != '0' || (p[1] != 'x' && p[1] != 'X') || sscanf(p + 2, "%X", &id) != 1) + continue; + ImVec2 p0 = CalcTextSize(line_begin, p); + ImVec2 p1 = CalcTextSize(p, p + 10); + g.LastItemData.Rect = ImRect(text_rect.Min + ImVec2(p0.x, 0.0f), text_rect.Min + ImVec2(p0.x + p1.x, p1.y)); + if (IsMouseHoveringRect(g.LastItemData.Rect.Min, g.LastItemData.Rect.Max, true)) + DebugLocateItemOnHover(id); + p += 10; + } + } + if (GetScrollY() >= GetScrollMaxY()) + SetScrollHereY(1.0f); + EndChild(); + + End(); +} + +//----------------------------------------------------------------------------- +// [SECTION] OTHER DEBUG TOOLS (ITEM PICKER, STACK TOOL) +//----------------------------------------------------------------------------- + +static const ImU32 DEBUG_LOCATE_ITEM_COLOR = IM_COL32(0, 255, 0, 255); // Green + +void ImGui::DebugLocateItem(ImGuiID target_id) +{ + ImGuiContext& g = *GImGui; + g.DebugLocateId = target_id; + g.DebugLocateFrames = 2; +} + +void ImGui::DebugLocateItemOnHover(ImGuiID target_id) +{ + if (target_id == 0 || !IsItemHovered(ImGuiHoveredFlags_AllowWhenBlockedByActiveItem | ImGuiHoveredFlags_AllowWhenBlockedByPopup)) + return; + ImGuiContext& g = *GImGui; + DebugLocateItem(target_id); + GetForegroundDrawList(g.CurrentWindow)->AddRect(g.LastItemData.Rect.Min - ImVec2(3.0f, 3.0f), g.LastItemData.Rect.Max + ImVec2(3.0f, 3.0f), DEBUG_LOCATE_ITEM_COLOR); +} + +void ImGui::DebugLocateItemResolveWithLastItem() +{ + ImGuiContext& g = *GImGui; + ImGuiLastItemData item_data = g.LastItemData; + g.DebugLocateId = 0; + ImDrawList* draw_list = GetForegroundDrawList(g.CurrentWindow); + ImRect r = item_data.Rect; + r.Expand(3.0f); + ImVec2 p1 = g.IO.MousePos; + ImVec2 p2 = ImVec2((p1.x < r.Min.x) ? r.Min.x : (p1.x > r.Max.x) ? r.Max.x : p1.x, (p1.y < r.Min.y) ? r.Min.y : (p1.y > r.Max.y) ? r.Max.y : p1.y); + draw_list->AddRect(r.Min, r.Max, DEBUG_LOCATE_ITEM_COLOR); + draw_list->AddLine(p1, p2, DEBUG_LOCATE_ITEM_COLOR); +} + +// [DEBUG] Item picker tool - start with DebugStartItemPicker() - useful to visually select an item and break into its call-stack. +void ImGui::UpdateDebugToolItemPicker() +{ + ImGuiContext& g = *GImGui; + g.DebugItemPickerBreakId = 0; + if (!g.DebugItemPickerActive) + return; + + const ImGuiID hovered_id = g.HoveredIdPreviousFrame; + SetMouseCursor(ImGuiMouseCursor_Hand); + if (IsKeyPressed(ImGuiKey_Escape)) + g.DebugItemPickerActive = false; + const bool change_mapping = g.IO.KeyMods == (ImGuiMod_Ctrl | ImGuiMod_Shift); + if (!change_mapping && IsMouseClicked(g.DebugItemPickerMouseButton) && hovered_id) + { + g.DebugItemPickerBreakId = hovered_id; + g.DebugItemPickerActive = false; + } + for (int mouse_button = 0; mouse_button < 3; mouse_button++) + if (change_mapping && IsMouseClicked(mouse_button)) + g.DebugItemPickerMouseButton = (ImU8)mouse_button; + SetNextWindowBgAlpha(0.70f); + BeginTooltip(); + Text("HoveredId: 0x%08X", hovered_id); + Text("Press ESC to abort picking."); + const char* mouse_button_names[] = { "Left", "Right", "Middle" }; + if (change_mapping) + Text("Remap w/ Ctrl+Shift: click anywhere to select new mouse button."); + else + TextColored(GetStyleColorVec4(hovered_id ? ImGuiCol_Text : ImGuiCol_TextDisabled), "Click %s Button to break in debugger! (remap w/ Ctrl+Shift)", mouse_button_names[g.DebugItemPickerMouseButton]); + EndTooltip(); +} + +// [DEBUG] Stack Tool: update queries. Called by NewFrame() +void ImGui::UpdateDebugToolStackQueries() +{ + ImGuiContext& g = *GImGui; + ImGuiStackTool* tool = &g.DebugStackTool; + + // Clear hook when stack tool is not visible + g.DebugHookIdInfo = 0; + if (g.FrameCount != tool->LastActiveFrame + 1) + return; + + // Update queries. The steps are: -1: query Stack, >= 0: query each stack item + // We can only perform 1 ID Info query every frame. This is designed so the GetID() tests are cheap and constant-time + const ImGuiID query_id = g.HoveredIdPreviousFrame ? g.HoveredIdPreviousFrame : g.ActiveId; + if (tool->QueryId != query_id) + { + tool->QueryId = query_id; + tool->StackLevel = -1; + tool->Results.resize(0); + } + if (query_id == 0) + return; + + // Advance to next stack level when we got our result, or after 2 frames (in case we never get a result) + int stack_level = tool->StackLevel; + if (stack_level >= 0 && stack_level < tool->Results.Size) + if (tool->Results[stack_level].QuerySuccess || tool->Results[stack_level].QueryFrameCount > 2) + tool->StackLevel++; + + // Update hook + stack_level = tool->StackLevel; + if (stack_level == -1) + g.DebugHookIdInfo = query_id; + if (stack_level >= 0 && stack_level < tool->Results.Size) + { + g.DebugHookIdInfo = tool->Results[stack_level].ID; + tool->Results[stack_level].QueryFrameCount++; + } +} + +// [DEBUG] Stack tool: hooks called by GetID() family functions +void ImGui::DebugHookIdInfo(ImGuiID id, ImGuiDataType data_type, const void* data_id, const void* data_id_end) +{ + ImGuiContext& g = *GImGui; + ImGuiWindow* window = g.CurrentWindow; + ImGuiStackTool* tool = &g.DebugStackTool; + + // Step 0: stack query + // This assumes that the ID was computed with the current ID stack, which tends to be the case for our widget. + if (tool->StackLevel == -1) + { + tool->StackLevel++; + tool->Results.resize(window->IDStack.Size + 1, ImGuiStackLevelInfo()); + for (int n = 0; n < window->IDStack.Size + 1; n++) + tool->Results[n].ID = (n < window->IDStack.Size) ? window->IDStack[n] : id; + return; + } + + // Step 1+: query for individual level + IM_ASSERT(tool->StackLevel >= 0); + if (tool->StackLevel != window->IDStack.Size) + return; + ImGuiStackLevelInfo* info = &tool->Results[tool->StackLevel]; + IM_ASSERT(info->ID == id && info->QueryFrameCount > 0); + + switch (data_type) + { + case ImGuiDataType_S32: + ImFormatString(info->Desc, IM_ARRAYSIZE(info->Desc), "%d", (int)(intptr_t)data_id); + break; + case ImGuiDataType_String: + ImFormatString(info->Desc, IM_ARRAYSIZE(info->Desc), "%.*s", data_id_end ? (int)((const char*)data_id_end - (const char*)data_id) : (int)strlen((const char*)data_id), (const char*)data_id); + break; + case ImGuiDataType_Pointer: + ImFormatString(info->Desc, IM_ARRAYSIZE(info->Desc), "(void*)0x%p", data_id); + break; + case ImGuiDataType_ID: + if (info->Desc[0] != 0) // PushOverrideID() is often used to avoid hashing twice, which would lead to 2 calls to DebugHookIdInfo(). We prioritize the first one. + return; + ImFormatString(info->Desc, IM_ARRAYSIZE(info->Desc), "0x%08X [override]", id); + break; + default: + IM_ASSERT(0); + } + info->QuerySuccess = true; + info->DataType = data_type; +} + +static int StackToolFormatLevelInfo(ImGuiStackTool* tool, int n, bool format_for_ui, char* buf, size_t buf_size) +{ + ImGuiStackLevelInfo* info = &tool->Results[n]; + ImGuiWindow* window = (info->Desc[0] == 0 && n == 0) ? ImGui::FindWindowByID(info->ID) : NULL; + if (window) // Source: window name (because the root ID don't call GetID() and so doesn't get hooked) + return ImFormatString(buf, buf_size, format_for_ui ? "\"%s\" [window]" : "%s", window->Name); + if (info->QuerySuccess) // Source: GetID() hooks (prioritize over ItemInfo() because we frequently use patterns like: PushID(str), Button("") where they both have same id) + return ImFormatString(buf, buf_size, (format_for_ui && info->DataType == ImGuiDataType_String) ? "\"%s\"" : "%s", info->Desc); + if (tool->StackLevel < tool->Results.Size) // Only start using fallback below when all queries are done, so during queries we don't flickering ??? markers. + return (*buf = 0); +#ifdef IMGUI_ENABLE_TEST_ENGINE + if (const char* label = ImGuiTestEngine_FindItemDebugLabel(GImGui, info->ID)) // Source: ImGuiTestEngine's ItemInfo() + return ImFormatString(buf, buf_size, format_for_ui ? "??? \"%s\"" : "%s", label); +#endif + return ImFormatString(buf, buf_size, "???"); +} + +// Stack Tool: Display UI +void ImGui::ShowStackToolWindow(bool* p_open) +{ + ImGuiContext& g = *GImGui; + if (!(g.NextWindowData.Flags & ImGuiNextWindowDataFlags_HasSize)) + SetNextWindowSize(ImVec2(0.0f, GetFontSize() * 8.0f), ImGuiCond_FirstUseEver); + if (!Begin("Dear ImGui Stack Tool", p_open) || GetCurrentWindow()->BeginCount > 1) + { + End(); + return; + } + + // Display hovered/active status + ImGuiStackTool* tool = &g.DebugStackTool; + const ImGuiID hovered_id = g.HoveredIdPreviousFrame; + const ImGuiID active_id = g.ActiveId; +#ifdef IMGUI_ENABLE_TEST_ENGINE + Text("HoveredId: 0x%08X (\"%s\"), ActiveId: 0x%08X (\"%s\")", hovered_id, hovered_id ? ImGuiTestEngine_FindItemDebugLabel(&g, hovered_id) : "", active_id, active_id ? ImGuiTestEngine_FindItemDebugLabel(&g, active_id) : ""); +#else + Text("HoveredId: 0x%08X, ActiveId: 0x%08X", hovered_id, active_id); +#endif + SameLine(); + MetricsHelpMarker("Hover an item with the mouse to display elements of the ID Stack leading to the item's final ID.\nEach level of the stack correspond to a PushID() call.\nAll levels of the stack are hashed together to make the final ID of a widget (ID displayed at the bottom level of the stack).\nRead FAQ entry about the ID stack for details."); + + // CTRL+C to copy path + const float time_since_copy = (float)g.Time - tool->CopyToClipboardLastTime; + Checkbox("Ctrl+C: copy path to clipboard", &tool->CopyToClipboardOnCtrlC); + 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*"); + if (tool->CopyToClipboardOnCtrlC && IsKeyDown(ImGuiMod_Ctrl) && IsKeyPressed(ImGuiKey_C)) + { + tool->CopyToClipboardLastTime = (float)g.Time; + char* p = g.TempBuffer.Data; + char* p_end = p + g.TempBuffer.Size; + for (int stack_n = 0; stack_n < tool->Results.Size && p + 3 < p_end; stack_n++) + { + *p++ = '/'; + char level_desc[256]; + StackToolFormatLevelInfo(tool, stack_n, false, level_desc, IM_ARRAYSIZE(level_desc)); + for (int n = 0; level_desc[n] && p + 2 < p_end; n++) + { + if (level_desc[n] == '/') + *p++ = '\\'; + *p++ = level_desc[n]; + } + } + *p = '\0'; + SetClipboardText(g.TempBuffer.Data); + } + + // Display decorated stack + tool->LastActiveFrame = g.FrameCount; + if (tool->Results.Size > 0 && BeginTable("##table", 3, ImGuiTableFlags_Borders)) + { + const float id_width = CalcTextSize("0xDDDDDDDD").x; + TableSetupColumn("Seed", ImGuiTableColumnFlags_WidthFixed, id_width); + TableSetupColumn("PushID", ImGuiTableColumnFlags_WidthStretch); + TableSetupColumn("Result", ImGuiTableColumnFlags_WidthFixed, id_width); + TableHeadersRow(); + for (int n = 0; n < tool->Results.Size; n++) + { + ImGuiStackLevelInfo* info = &tool->Results[n]; + TableNextColumn(); + Text("0x%08X", (n > 0) ? tool->Results[n - 1].ID : 0); + TableNextColumn(); + StackToolFormatLevelInfo(tool, n, true, g.TempBuffer.Data, g.TempBuffer.Size); + TextUnformatted(g.TempBuffer.Data); + TableNextColumn(); + Text("0x%08X", info->ID); + if (n == tool->Results.Size - 1) + TableSetBgColor(ImGuiTableBgTarget_CellBg, GetColorU32(ImGuiCol_Header)); + } + EndTable(); + } + End(); +} + #else void ImGui::ShowMetricsWindow(bool*) {} @@ -11967,7 +14213,15 @@ void ImGui::DebugNodeWindowSettings(ImGuiWindowSettings*) {} void ImGui::DebugNodeWindowsList(ImVector*, const char*) {} void ImGui::DebugNodeViewport(ImGuiViewportP*) {} -#endif +void ImGui::DebugLog(const char*, ...) {} +void ImGui::DebugLogV(const char*, va_list) {} +void ImGui::ShowDebugLogWindow(bool*) {} +void ImGui::ShowStackToolWindow(bool*) {} +void ImGui::DebugHookIdInfo(ImGuiID, ImGuiDataType, const void*, const void*) {} +void ImGui::UpdateDebugToolItemPicker() {} +void ImGui::UpdateDebugToolStackQueries() {} + +#endif // #ifndef IMGUI_DISABLE_DEBUG_TOOLS //----------------------------------------------------------------------------- diff --git a/3rdparty/bgfx/3rdparty/dear-imgui/imgui.h b/3rdparty/bgfx/3rdparty/dear-imgui/imgui.h index f679762e5ae..a626c79f4b0 100644 --- a/3rdparty/bgfx/3rdparty/dear-imgui/imgui.h +++ b/3rdparty/bgfx/3rdparty/dear-imgui/imgui.h @@ -1,4 +1,4 @@ -// dear imgui, v1.85 WIP +// dear imgui, v1.89.1 WIP // (headers) // Help: @@ -11,7 +11,7 @@ // - FAQ http://dearimgui.org/faq // - Homepage & latest https://github.com/ocornut/imgui // - Releases & changelog https://github.com/ocornut/imgui/releases -// - Gallery https://github.com/ocornut/imgui/issues/4451 (please post your screenshots/video there!) +// - Gallery https://github.com/ocornut/imgui/issues/5243 (please post your screenshots/video there!) // - Wiki https://github.com/ocornut/imgui/wiki (lots of good stuff there) // - Glossary https://github.com/ocornut/imgui/wiki/Glossary // - Issues & support https://github.com/ocornut/imgui/issues @@ -20,6 +20,12 @@ // - For first-time users having issues compiling/linking/running or issues loading fonts: // please post in https://github.com/ocornut/imgui/discussions if you cannot find a solution in resources above. +// Library Version +// (Integer encoded as XYYZZ for use in #if preprocessor conditionals, e.g. '#if IMGUI_VERSION_NUM > 12345') +#define IMGUI_VERSION "1.89.1 WIP" +#define IMGUI_VERSION_NUM 18903 +#define IMGUI_HAS_TABLE + /* Index of this file: @@ -35,19 +41,19 @@ Index of this file: // [SECTION] Drawing API (ImDrawCallback, ImDrawCmd, ImDrawIdx, ImDrawVert, ImDrawChannel, ImDrawListSplitter, ImDrawFlags, ImDrawListFlags, ImDrawList, ImDrawData) // [SECTION] Font API (ImFontConfig, ImFontGlyph, ImFontGlyphRangesBuilder, ImFontAtlasFlags, ImFontAtlas, ImFont) // [SECTION] Viewports (ImGuiViewportFlags, ImGuiViewport) +// [SECTION] Platform Dependent Interfaces (ImGuiPlatformImeData) // [SECTION] Obsolete functions and types */ #pragma once -// Configuration file with compile-time options (edit imconfig.h or '#define IMGUI_USER_CONFIG "myfilename.h" from your build system') +// Configuration file with compile-time options +// (edit imconfig.h or '#define IMGUI_USER_CONFIG "myfilename.h" from your build system') #ifdef IMGUI_USER_CONFIG #include IMGUI_USER_CONFIG #endif -#if !defined(IMGUI_DISABLE_INCLUDE_IMCONFIG_H) || defined(IMGUI_INCLUDE_IMCONFIG_H) #include "imconfig.h" -#endif #ifndef IMGUI_DISABLE @@ -61,13 +67,6 @@ Index of this file: #include // ptrdiff_t, NULL #include // memset, memmove, memcpy, strlen, strchr, strcpy, strcmp -// Version -// (Integer encoded as XYYZZ for use in #if preprocessor conditionals. Work in progress versions typically starts at XYY99 then bounce up to XYY00, XYY01 etc. when release tagging happens) -#define IMGUI_VERSION "1.85 WIP" -#define IMGUI_VERSION_NUM 18417 -#define IMGUI_CHECKVERSION() ImGui::DebugCheckVersionAndDataLayout(IMGUI_VERSION, sizeof(ImGuiIO), sizeof(ImGuiStyle), sizeof(ImVec2), sizeof(ImVec4), sizeof(ImDrawVert), sizeof(ImDrawIdx)) -#define IMGUI_HAS_TABLE - // Define attributes of all API symbols declarations (e.g. for DLL under Windows) // IMGUI_API is used for core imgui functions, IMGUI_IMPL_API is used for the default backends files (imgui_impl_xxx.h) // Using dear imgui via a shared library is not recommended, because we don't guarantee backward nor forward ABI compatibility (also function call overhead, as dear imgui is a call-heavy API) @@ -85,14 +84,11 @@ Index of this file: #endif #define IM_ARRAYSIZE(_ARR) ((int)(sizeof(_ARR) / sizeof(*(_ARR)))) // Size of a static C-style array. Don't use on pointers! #define IM_UNUSED(_VAR) ((void)(_VAR)) // Used to silence "unused variable warnings". Often useful as asserts may be stripped out from final builds. -#if (__cplusplus >= 201100) || (defined(_MSVC_LANG) && _MSVC_LANG >= 201100) #define IM_OFFSETOF(_TYPE,_MEMBER) offsetof(_TYPE, _MEMBER) // Offset of _MEMBER within _TYPE. Standardized as offsetof() in C++11 -#else -#define IM_OFFSETOF(_TYPE,_MEMBER) ((size_t)&(((_TYPE*)0)->_MEMBER)) // Offset of _MEMBER within _TYPE. Old style macro. -#endif +#define IMGUI_CHECKVERSION() ImGui::DebugCheckVersionAndDataLayout(IMGUI_VERSION, sizeof(ImGuiIO), sizeof(ImGuiStyle), sizeof(ImVec2), sizeof(ImVec4), sizeof(ImDrawVert), sizeof(ImDrawIdx)) // Helper Macros - IM_FMTARGS, IM_FMTLIST: Apply printf-style warnings to our formatting functions. -#if !defined(IMGUI_USE_STB_SPRINTF) && defined(__MINGW32__) +#if !defined(IMGUI_USE_STB_SPRINTF) && defined(__MINGW32__) && !defined(__clang__) #define IM_FMTARGS(FMT) __attribute__((format(gnu_printf, FMT, FMT+1))) #define IM_FMTLIST(FMT) __attribute__((format(gnu_printf, FMT, 0))) #elif !defined(IMGUI_USE_STB_SPRINTF) && (defined(__clang__) || defined(__GNUC__)) @@ -104,7 +100,7 @@ Index of this file: #endif // Disable some of MSVC most aggressive Debug runtime checks in function header/footer (used in some simple/low-level functions) -#if defined(_MSC_VER) && !defined(__clang__) && !defined(IMGUI_DEBUG_PARANOID) +#if defined(_MSC_VER) && !defined(__clang__) && !defined(__INTEL_COMPILER) && !defined(IMGUI_DEBUG_PARANOID) #define IM_MSVC_RUNTIME_CHECKS_OFF __pragma(runtime_checks("",off)) __pragma(check_stack(off)) __pragma(strict_gs_check(push,off)) #define IM_MSVC_RUNTIME_CHECKS_RESTORE __pragma(runtime_checks("",restore)) __pragma(check_stack()) __pragma(strict_gs_check(pop)) #else @@ -151,9 +147,11 @@ struct ImColor; // Helper functions to create a color that c struct ImGuiContext; // Dear ImGui context (opaque structure, unless including imgui_internal.h) struct ImGuiIO; // Main configuration and I/O between your application and ImGui struct ImGuiInputTextCallbackData; // Shared state of InputText() when using custom ImGuiInputTextCallback (rare/advanced use) +struct ImGuiKeyData; // Storage for ImGuiIO and IsKeyDown(), IsKeyPressed() etc functions. struct ImGuiListClipper; // Helper to manually clip large list of items -struct ImGuiOnceUponAFrame; // Helper for running a block of code not more than once a frame, used by IMGUI_ONCE_UPON_A_FRAME macro +struct ImGuiOnceUponAFrame; // Helper for running a block of code not more than once a frame struct ImGuiPayload; // User data payload for drag and drop operations +struct ImGuiPlatformImeData; // Platform IME data for io.SetPlatformImeDataFn() function. struct ImGuiSizeCallbackData; // Callback data when using SetNextWindowSizeConstraints() (rare/advanced use) struct ImGuiStorage; // Helper for key->value storage struct ImGuiStyle; // Runtime data for styling/colors @@ -163,21 +161,26 @@ struct ImGuiTextBuffer; // Helper to hold and append into a text buf struct ImGuiTextFilter; // Helper to parse and apply text filters (e.g. "aaaaa[,bbbbb][,ccccc]") struct ImGuiViewport; // A Platform Window (always only one in 'master' branch), in the future may represent Platform Monitor -// Enums/Flags (declared as int for compatibility with old C++, to allow using as flags without overhead, and to not pollute the top of this file) +// Enumerations +// - We don't use strongly typed enums much because they add constraints (can't extend in private code, can't store typed in bit fields, extra casting on iteration) // - Tip: Use your programming IDE navigation facilities on the names in the _central column_ below to find the actual flags/enum lists! -// In Visual Studio IDE: CTRL+comma ("Edit.NavigateTo") can follow symbols in comments, whereas CTRL+F12 ("Edit.GoToImplementation") cannot. +// In Visual Studio IDE: CTRL+comma ("Edit.GoToAll") can follow symbols in comments, whereas CTRL+F12 ("Edit.GoToImplementation") cannot. // With Visual Assist installed: ALT+G ("VAssistX.GoToImplementation") can also follow symbols in comments. +enum ImGuiKey : int; // -> enum ImGuiKey // Enum: A key identifier (ImGuiKey_XXX or ImGuiMod_XXX value) typedef int ImGuiCol; // -> enum ImGuiCol_ // Enum: A color identifier for styling typedef int ImGuiCond; // -> enum ImGuiCond_ // Enum: A condition for many Set*() functions typedef int ImGuiDataType; // -> enum ImGuiDataType_ // Enum: A primary data type typedef int ImGuiDir; // -> enum ImGuiDir_ // Enum: A cardinal direction -typedef int ImGuiKey; // -> enum ImGuiKey_ // Enum: A key identifier (ImGui-side enum) -typedef int ImGuiNavInput; // -> enum ImGuiNavInput_ // Enum: An input identifier for navigation typedef int ImGuiMouseButton; // -> enum ImGuiMouseButton_ // Enum: A mouse button identifier (0=left, 1=right, 2=middle) -typedef int ImGuiMouseCursor; // -> enum ImGuiMouseCursor_ // Enum: A mouse cursor identifier +typedef int ImGuiMouseCursor; // -> enum ImGuiMouseCursor_ // Enum: A mouse cursor shape typedef int ImGuiSortDirection; // -> enum ImGuiSortDirection_ // Enum: A sorting direction (ascending or descending) typedef int ImGuiStyleVar; // -> enum ImGuiStyleVar_ // Enum: A variable identifier for styling typedef int ImGuiTableBgTarget; // -> enum ImGuiTableBgTarget_ // Enum: A color target for TableSetBgColor() + +// Flags (declared as int for compatibility with old C++, to allow using as flags without overhead, and to not pollute the top of this file) +// - Tip: Use your programming IDE navigation facilities on the names in the _central column_ below to find the actual flags/enum lists! +// In Visual Studio IDE: CTRL+comma ("Edit.GoToAll") can follow symbols in comments, whereas CTRL+F12 ("Edit.GoToImplementation") cannot. +// With Visual Assist installed: ALT+G ("VAssistX.GoToImplementation") can also follow symbols in comments. typedef int ImDrawFlags; // -> enum ImDrawFlags_ // Flags: for ImDrawList functions typedef int ImDrawListFlags; // -> enum ImDrawListFlags_ // Flags: for ImDrawList instance typedef int ImFontAtlasFlags; // -> enum ImFontAtlasFlags_ // Flags: for ImFontAtlas build @@ -190,7 +193,7 @@ typedef int ImGuiDragDropFlags; // -> enum ImGuiDragDropFlags_ // Flags: f typedef int ImGuiFocusedFlags; // -> enum ImGuiFocusedFlags_ // Flags: for IsWindowFocused() typedef int ImGuiHoveredFlags; // -> enum ImGuiHoveredFlags_ // Flags: for IsItemHovered(), IsWindowHovered() etc. typedef int ImGuiInputTextFlags; // -> enum ImGuiInputTextFlags_ // Flags: for InputText(), InputTextMultiline() -typedef int ImGuiKeyModFlags; // -> enum ImGuiKeyModFlags_ // Flags: for io.KeyMods (Ctrl/Shift/Alt/Super) +typedef int ImGuiKeyChord; // -> ImGuiKey | ImGuiMod_XXX // Flags: for storage only for now: an ImGuiKey optionally OR-ed with one or more ImGuiMod_XXX values. typedef int ImGuiPopupFlags; // -> enum ImGuiPopupFlags_ // Flags: for OpenPopup*(), BeginPopupContext*(), IsPopupOpen() typedef int ImGuiSelectableFlags; // -> enum ImGuiSelectableFlags_ // Flags: for Selectable() typedef int ImGuiSliderFlags; // -> enum ImGuiSliderFlags_ // Flags: for DragFloat(), DragInt(), SliderFloat(), SliderInt() etc. @@ -225,17 +228,8 @@ typedef signed short ImS16; // 16-bit signed integer typedef unsigned short ImU16; // 16-bit unsigned integer typedef signed int ImS32; // 32-bit signed integer == int typedef unsigned int ImU32; // 32-bit unsigned integer (often used to store packed colors) -#if defined(_MSC_VER) && !defined(__clang__) -typedef signed __int64 ImS64; // 64-bit signed integer (pre and post C++11 with Visual Studio) -typedef unsigned __int64 ImU64; // 64-bit unsigned integer (pre and post C++11 with Visual Studio) -#elif (defined(__clang__) || defined(__GNUC__)) && (__cplusplus < 201100) -#include -typedef int64_t ImS64; // 64-bit signed integer (pre C++11) -typedef uint64_t ImU64; // 64-bit unsigned integer (pre C++11) -#else -typedef signed long long ImS64; // 64-bit signed integer (post C++11) -typedef unsigned long long ImU64; // 64-bit unsigned integer (post C++11) -#endif +typedef signed long long ImS64; // 64-bit signed integer +typedef unsigned long long ImU64; // 64-bit unsigned integer // Character types // (we generally use UTF-8 encoded string in the API. This is storage specifically for a decoded character used for keyboard input and display) @@ -259,8 +253,8 @@ IM_MSVC_RUNTIME_CHECKS_OFF struct ImVec2 { float x, y; - ImVec2() { x = y = 0.0f; } - ImVec2(float _x, float _y) { x = _x; y = _y; } + constexpr ImVec2() : x(0.0f), y(0.0f) { } + constexpr ImVec2(float _x, float _y) : x(_x), y(_y) { } float operator[] (size_t idx) const { IM_ASSERT(idx <= 1); return (&x)[idx]; } // We very rarely use this [] operator, the assert overhead is fine. float& operator[] (size_t idx) { IM_ASSERT(idx <= 1); return (&x)[idx]; } // We very rarely use this [] operator, the assert overhead is fine. #ifdef IM_VEC2_CLASS_EXTRA @@ -271,9 +265,9 @@ struct ImVec2 // ImVec4: 4D vector used to store clipping rectangles, colors etc. [Compile-time configurable type] struct ImVec4 { - float x, y, z, w; - ImVec4() { x = y = z = w = 0.0f; } - ImVec4(float _x, float _y, float _z, float _w) { x = _x; y = _y; z = _z; w = _w; } + float x, y, z, w; + constexpr ImVec4() : x(0.0f), y(0.0f), z(0.0f), w(0.0f) { } + constexpr ImVec4(float _x, float _y, float _z, float _w) : x(_x), y(_y), z(_z), w(_w) { } #ifdef IM_VEC4_CLASS_EXTRA IM_VEC4_CLASS_EXTRA // Define additional constructors and implicit cast operators in imconfig.h to convert back and forth between your math types and ImVec4. #endif @@ -307,11 +301,13 @@ namespace ImGui // Demo, Debug, Information IMGUI_API void ShowDemoWindow(bool* p_open = NULL); // create Demo window. demonstrate most ImGui features. call this to learn about the library! try to make it always available in your application! IMGUI_API void ShowMetricsWindow(bool* p_open = NULL); // create Metrics/Debugger window. display Dear ImGui internals: windows, draw commands, various internal state, etc. + IMGUI_API void ShowDebugLogWindow(bool* p_open = NULL); // create Debug Log window. display a simplified log of important dear imgui events. + IMGUI_API void ShowStackToolWindow(bool* p_open = NULL); // create Stack Tool window. hover items with mouse to query information about the source of their unique ID. IMGUI_API void ShowAboutWindow(bool* p_open = NULL); // create About window. display Dear ImGui version, credits and build/system information. IMGUI_API void ShowStyleEditor(ImGuiStyle* ref = NULL); // add style editor block (not a window). you can pass in a reference ImGuiStyle structure to compare to, revert to and save to (else it uses the default style) IMGUI_API bool ShowStyleSelector(const char* label); // add style selector block (not a window), essentially a combo listing the default styles. IMGUI_API void ShowFontSelector(const char* label); // add font selector block (not a window), essentially a combo listing the loaded fonts. - IMGUI_API void ShowUserGuide(); // add basic help/info block (not a window): how to manipulate ImGui as a end-user (mouse/keyboard controls). + IMGUI_API void ShowUserGuide(); // add basic help/info block (not a window): how to manipulate ImGui as an end-user (mouse/keyboard controls). IMGUI_API const char* GetVersion(); // get the compiled version string e.g. "1.80 WIP" (essentially the value for IMGUI_VERSION from the compiled version of imgui.cpp) // Styles @@ -366,6 +362,7 @@ namespace ImGui IMGUI_API void SetNextWindowContentSize(const ImVec2& size); // set next window content size (~ scrollable client area, which enforce the range of scrollbars). Not including window decorations (title bar, menu bar, etc.) nor WindowPadding. set an axis to 0.0f to leave it automatic. call before Begin() IMGUI_API void SetNextWindowCollapsed(bool collapsed, ImGuiCond cond = 0); // set next window collapsed state. call before Begin() IMGUI_API void SetNextWindowFocus(); // set next window to be focused / top-most. call before Begin() + IMGUI_API void SetNextWindowScroll(const ImVec2& scroll); // set next window scrolling value (use < 0.0f to not affect a given axis). IMGUI_API void SetNextWindowBgAlpha(float alpha); // set next window background color alpha. helper to easily override the Alpha component of ImGuiCol_WindowBg/ChildBg/PopupBg. you may also use ImGuiWindowFlags_NoBackground. IMGUI_API void SetWindowPos(const ImVec2& pos, ImGuiCond cond = 0); // (not recommended) set current window position - call within Begin()/End(). prefer using SetNextWindowPos(), as this may incur tearing and side-effects. IMGUI_API void SetWindowSize(const ImVec2& size, ImGuiCond cond = 0); // (not recommended) set current window size - call within Begin()/End(). set to ImVec2(0, 0) to force an auto-fit. prefer using SetNextWindowSize(), as this may incur tearing and minor side-effects. @@ -383,9 +380,11 @@ namespace ImGui IMGUI_API ImVec2 GetContentRegionAvail(); // == GetContentRegionMax() - GetCursorPos() IMGUI_API ImVec2 GetContentRegionMax(); // current content boundaries (typically window boundaries including scrolling, or current column boundaries), in windows coordinates IMGUI_API ImVec2 GetWindowContentRegionMin(); // content boundaries min for the full window (roughly (0,0)-Scroll), in window coordinates - IMGUI_API ImVec2 GetWindowContentRegionMax(); // content boundaries max for the full window (roughly (0,0)+Size-Scroll) where Size can be override with SetNextWindowContentSize(), in window coordinates + IMGUI_API ImVec2 GetWindowContentRegionMax(); // content boundaries max for the full window (roughly (0,0)+Size-Scroll) where Size can be overridden with SetNextWindowContentSize(), in window coordinates // Windows Scrolling + // - Any change of Scroll will be applied at the beginning of next frame in the first call to Begin(). + // - You may instead use SetNextWindowScroll() prior to calling Begin() to avoid this delay, as an alternative to using SetScrollX()/SetScrollY(). IMGUI_API float GetScrollX(); // get scrolling amount [0 .. GetScrollMaxX()] IMGUI_API float GetScrollY(); // get scrolling amount [0 .. GetScrollMaxY()] IMGUI_API void SetScrollX(float scroll_x); // set scrolling amount [0 .. GetScrollMaxX()] @@ -438,7 +437,7 @@ namespace ImGui // Absolute coordinate: GetCursorScreenPos(), SetCursorScreenPos(), all ImDrawList:: functions. IMGUI_API void Separator(); // separator, generally horizontal. inside a menu bar or in horizontal layout mode, this becomes a vertical separator. IMGUI_API void SameLine(float offset_from_start_x=0.0f, float spacing=-1.0f); // call between widgets or groups to layout them horizontally. X position given in window coordinates. - IMGUI_API void NewLine(); // undo a SameLine() or force a new line when in an horizontal-layout context. + IMGUI_API void NewLine(); // undo a SameLine() or force a new line when in a horizontal-layout context. IMGUI_API void Spacing(); // add vertical spacing. IMGUI_API void Dummy(const ImVec2& size); // add a dummy item of given size. unlike InvisibleButton(), Dummy() won't take the mouse click or be navigable into. IMGUI_API void Indent(float indent_w = 0.0f); // move content position toward the right, by indent_w, or style.IndentSpacing if indent_w <= 0 @@ -502,8 +501,6 @@ namespace ImGui IMGUI_API bool SmallButton(const char* label); // button with FramePadding=(0,0) to easily embed within text IMGUI_API bool InvisibleButton(const char* str_id, const ImVec2& size, ImGuiButtonFlags flags = 0); // flexible button behavior without the visuals, frequently useful to build custom behaviors using the public api (along with IsItemActive, IsItemHovered, etc.) IMGUI_API bool ArrowButton(const char* str_id, ImGuiDir dir); // square button with an arrow shape - IMGUI_API void Image(ImTextureID user_texture_id, const ImVec2& size, const ImVec2& uv0 = ImVec2(0, 0), const ImVec2& uv1 = ImVec2(1,1), const ImVec4& tint_col = ImVec4(1,1,1,1), const ImVec4& border_col = ImVec4(0,0,0,0)); - IMGUI_API bool ImageButton(ImTextureID user_texture_id, const ImVec2& size, const ImVec2& uv0 = ImVec2(0, 0), const ImVec2& uv1 = ImVec2(1,1), int frame_padding = -1, const ImVec4& bg_col = ImVec4(0,0,0,0), const ImVec4& tint_col = ImVec4(1,1,1,1)); // <0 frame_padding uses default frame padding settings. 0 for no padding IMGUI_API bool Checkbox(const char* label, bool* v); IMGUI_API bool CheckboxFlags(const char* label, int* flags, int flags_value); IMGUI_API bool CheckboxFlags(const char* label, unsigned int* flags, unsigned int flags_value); @@ -512,7 +509,12 @@ namespace ImGui IMGUI_API void ProgressBar(float fraction, const ImVec2& size_arg = ImVec2(-FLT_MIN, 0), const char* overlay = NULL); IMGUI_API void Bullet(); // draw a small circle + keep the cursor on the same line. advance cursor x position by GetTreeNodeToLabelSpacing(), same distance that TreeNode() uses - // Widgets: Combo Box + // Widgets: Images + // - Read about ImTextureID here: https://github.com/ocornut/imgui/wiki/Image-Loading-and-Displaying-Examples + IMGUI_API void Image(ImTextureID user_texture_id, const ImVec2& size, const ImVec2& uv0 = ImVec2(0, 0), const ImVec2& uv1 = ImVec2(1, 1), const ImVec4& tint_col = ImVec4(1, 1, 1, 1), const ImVec4& border_col = ImVec4(0, 0, 0, 0)); + IMGUI_API bool ImageButton(const char* str_id, ImTextureID user_texture_id, const ImVec2& size, const ImVec2& uv0 = ImVec2(0, 0), const ImVec2& uv1 = ImVec2(1, 1), const ImVec4& bg_col = ImVec4(0, 0, 0, 0), const ImVec4& tint_col = ImVec4(1, 1, 1, 1)); + + // Widgets: Combo Box (Dropdown) // - The BeginCombo()/EndCombo() api allows you to manage your contents and selection state however you want it, by creating e.g. Selectable() items. // - The old Combo() api are helpers over BeginCombo()/EndCombo() which are kept available for convenience purpose. This is analogous to how ListBox are created. IMGUI_API bool BeginCombo(const char* label, const char* preview_value, ImGuiComboFlags flags = 0); @@ -523,14 +525,15 @@ namespace ImGui // Widgets: Drag Sliders // - CTRL+Click on any drag box to turn them into an input box. Manually input values aren't clamped by default and can go off-bounds. Use ImGuiSliderFlags_AlwaysClamp to always clamp. - // - For all the Float2/Float3/Float4/Int2/Int3/Int4 versions of every functions, note that a 'float v[X]' function argument is the same as 'float* v', the array syntax is just a way to document the number of elements that are expected to be accessible. You can pass address of your first element out of a contiguous set, e.g. &myvector.x + // - For all the Float2/Float3/Float4/Int2/Int3/Int4 versions of every function, note that a 'float v[X]' function argument is the same as 'float* v', + // the array syntax is just a way to document the number of elements that are expected to be accessible. You can pass address of your first element out of a contiguous set, e.g. &myvector.x // - Adjust format string to decorate the value with a prefix, a suffix, or adapt the editing and display precision e.g. "%.3f" -> 1.234; "%5.2f secs" -> 01.23 secs; "Biscuit: %.0f" -> Biscuit: 1; etc. // - Format string may also be set to NULL or use the default format ("%f" or "%d"). // - Speed are per-pixel of mouse movement (v_speed=0.2f: mouse needs to move by 5 pixels to increase value by 1). For gamepad/keyboard navigation, minimum speed is Max(v_speed, minimum_step_at_given_precision). // - Use v_min < v_max to clamp edits to given limits. Note that CTRL+Click manual input can override those limits if ImGuiSliderFlags_AlwaysClamp is not used. // - Use v_max = FLT_MAX / INT_MAX etc to avoid clamping to a maximum, same with v_min = -FLT_MAX / INT_MIN to avoid clamping to a minimum. // - We use the same sets of flags for DragXXX() and SliderXXX() functions as the features are the same and it makes it easier to swap them. - // - Legacy: Pre-1.78 there are DragXXX() function signatures that takes a final `float power=1.0f' argument instead of the `ImGuiSliderFlags flags=0' argument. + // - Legacy: Pre-1.78 there are DragXXX() function signatures that take a final `float power=1.0f' argument instead of the `ImGuiSliderFlags flags=0' argument. // If you get a warning converting a float to ImGuiSliderFlags, read https://github.com/ocornut/imgui/issues/3361 IMGUI_API bool DragFloat(const char* label, float* v, float v_speed = 1.0f, float v_min = 0.0f, float v_max = 0.0f, const char* format = "%.3f", ImGuiSliderFlags flags = 0); // If v_min >= v_max we have no bound IMGUI_API bool DragFloat2(const char* label, float v[2], float v_speed = 1.0f, float v_min = 0.0f, float v_max = 0.0f, const char* format = "%.3f", ImGuiSliderFlags flags = 0); @@ -549,7 +552,7 @@ namespace ImGui // - CTRL+Click on any slider to turn them into an input box. Manually input values aren't clamped by default and can go off-bounds. Use ImGuiSliderFlags_AlwaysClamp to always clamp. // - Adjust format string to decorate the value with a prefix, a suffix, or adapt the editing and display precision e.g. "%.3f" -> 1.234; "%5.2f secs" -> 01.23 secs; "Biscuit: %.0f" -> Biscuit: 1; etc. // - Format string may also be set to NULL or use the default format ("%f" or "%d"). - // - Legacy: Pre-1.78 there are SliderXXX() function signatures that takes a final `float power=1.0f' argument instead of the `ImGuiSliderFlags flags=0' argument. + // - Legacy: Pre-1.78 there are SliderXXX() function signatures that take a final `float power=1.0f' argument instead of the `ImGuiSliderFlags flags=0' argument. // If you get a warning converting a float to ImGuiSliderFlags, read https://github.com/ocornut/imgui/issues/3361 IMGUI_API bool SliderFloat(const char* label, float* v, float v_min, float v_max, const char* format = "%.3f", ImGuiSliderFlags flags = 0); // adjust format to decorate the value with a prefix or a suffix for in-slider labels or unit display. IMGUI_API bool SliderFloat2(const char* label, float v[2], float v_min, float v_max, const char* format = "%.3f", ImGuiSliderFlags flags = 0); @@ -591,7 +594,7 @@ namespace ImGui IMGUI_API bool ColorEdit4(const char* label, float col[4], ImGuiColorEditFlags flags = 0); 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, ImVec2 size = ImVec2(0, 0)); // display a color square/button, hover for details, return true when pressed. + 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 @@ -607,7 +610,7 @@ namespace ImGui IMGUI_API bool TreeNodeExV(const char* str_id, ImGuiTreeNodeFlags flags, const char* fmt, va_list args) IM_FMTLIST(3); IMGUI_API bool TreeNodeExV(const void* ptr_id, ImGuiTreeNodeFlags flags, const char* fmt, va_list args) IM_FMTLIST(3); IMGUI_API void TreePush(const char* str_id); // ~ Indent()+PushId(). Already called by TreeNode() when returning true, but you can call TreePush/TreePop yourself if desired. - IMGUI_API void TreePush(const void* ptr_id = NULL); // " + IMGUI_API void TreePush(const void* ptr_id); // " IMGUI_API void TreePop(); // ~ Unindent()+PopId() IMGUI_API float GetTreeNodeToLabelSpacing(); // horizontal distance preceding label when using TreeNode*() or Bullet() == (g.FontSize + style.FramePadding.x*2) for a regular unframed TreeNode IMGUI_API bool CollapsingHeader(const char* label, ImGuiTreeNodeFlags flags = 0); // if returning 'true' the header is open. doesn't indent nor push on ID stack. user doesn't have to call TreePop(). @@ -677,7 +680,7 @@ namespace ImGui // Popups: begin/end functions // - BeginPopup(): query popup state, if open start appending into the window. Call EndPopup() afterwards. ImGuiWindowFlags are forwarded to the window. - // - BeginPopupModal(): block every interactions behind the window, cannot be closed by user, add a dimming background, has a title bar. + // - BeginPopupModal(): block every interaction behind the window, cannot be closed by user, add a dimming background, has a title bar. IMGUI_API bool BeginPopup(const char* str_id, ImGuiWindowFlags flags = 0); // return true if the popup is open, and you can start outputting to it. IMGUI_API bool BeginPopupModal(const char* name, bool* p_open = NULL, ImGuiWindowFlags flags = 0); // return true if the modal is open, and you can start outputting to it. IMGUI_API void EndPopup(); // only call EndPopup() if BeginPopupXXX() returns true! @@ -689,6 +692,7 @@ namespace ImGui // - 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. + // - IMPORTANT: Notice that for OpenPopupOnItemClick() we exceptionally default flags to 1 (== ImGuiPopupFlags_MouseButtonRight) for backward compatibility with older API taking 'int mouse_button = 1' parameter 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 = 1); // 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) @@ -698,7 +702,7 @@ namespace ImGui // - Helpers to do OpenPopup+BeginPopup where the Open action is triggered by e.g. hovering an item and right-clicking. // - They are convenient to easily create context menus, hence the name. // - IMPORTANT: Notice that BeginPopupContextXXX takes ImGuiPopupFlags just like OpenPopup() and unlike BeginPopup(). For full consistency, we may add ImGuiWindowFlags to the BeginPopupContextXXX functions in the future. - // - IMPORTANT: we exceptionally default their flags to 1 (== ImGuiPopupFlags_MouseButtonRight) for backward compatibility with older API taking 'int mouse_button = 1' parameter, so if you add other flags remember to re-add the ImGuiPopupFlags_MouseButtonRight. + // - IMPORTANT: Notice that we exceptionally default their flags to 1 (== ImGuiPopupFlags_MouseButtonRight) for backward compatibility with older API taking 'int mouse_button = 1' parameter, so if you add other flags remember to re-add the ImGuiPopupFlags_MouseButtonRight. IMGUI_API bool BeginPopupContextItem(const char* str_id = NULL, ImGuiPopupFlags popup_flags = 1); // open+begin popup when clicked on last item. Use str_id==NULL to associate the popup to previous item. If you want to use that on a non-interactive item such as Text() you need to pass in an explicit ID here. read comments in .cpp! IMGUI_API bool BeginPopupContextWindow(const char* str_id = NULL, ImGuiPopupFlags popup_flags = 1);// open+begin popup when clicked on current window. IMGUI_API bool BeginPopupContextVoid(const char* str_id = NULL, ImGuiPopupFlags popup_flags = 1); // open+begin popup when clicked in void (where there are no windows). @@ -710,19 +714,17 @@ namespace ImGui IMGUI_API bool IsPopupOpen(const char* str_id, ImGuiPopupFlags flags = 0); // return true if the popup is open. // Tables - // [BETA API] API may evolve slightly! If you use this, please update to the next version when it comes out! // - Full-featured replacement for old Columns API. - // - See Demo->Tables for demo code. - // - See top of imgui_tables.cpp for general commentary. + // - See Demo->Tables for demo code. See top of imgui_tables.cpp for general commentary. // - See ImGuiTableFlags_ and ImGuiTableColumnFlags_ enums for a description of available flags. // The typical call flow is: - // - 1. Call BeginTable(). + // - 1. Call BeginTable(), early out if returning false. // - 2. Optionally call TableSetupColumn() to submit column name/flags/defaults. // - 3. Optionally call TableSetupScrollFreeze() to request scroll freezing of columns/rows. // - 4. Optionally call TableHeadersRow() to submit a header row. Names are pulled from TableSetupColumn() data. // - 5. Populate contents: // - In most situations you can use TableNextRow() + TableSetColumnIndex(N) to start appending into a column. - // - If you are using tables as a sort of grid, where every columns is holding the same type of contents, + // - If you are using tables as a sort of grid, where every column is holding the same type of contents, // you may prefer using TableNextColumn() instead of TableNextRow() + TableSetColumnIndex(). // TableNextColumn() will automatically wrap-around into the next row if needed. // - IMPORTANT: Comparatively to the old Columns() API, we need to call TableNextColumn() for the first column! @@ -735,10 +737,10 @@ namespace ImGui // -------------------------------------------------------------------------------------------------------- // - 5. Call EndTable() IMGUI_API bool BeginTable(const char* str_id, int column, ImGuiTableFlags flags = 0, const ImVec2& outer_size = ImVec2(0.0f, 0.0f), float inner_width = 0.0f); - IMGUI_API void EndTable(); // only call EndTable() if BeginTable() returns true! + IMGUI_API void EndTable(); // only call EndTable() if BeginTable() returns true! IMGUI_API void TableNextRow(ImGuiTableRowFlags row_flags = 0, float min_row_height = 0.0f); // append into the first cell of a new row. - IMGUI_API bool TableNextColumn(); // append into the next column (or first column of next row if currently in last column). Return true when column is visible. - IMGUI_API bool TableSetColumnIndex(int column_n); // append into the specified column. Return true when column is visible. + IMGUI_API bool TableNextColumn(); // append into the next column (or first column of next row if currently in last column). Return true when column is visible. + 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. @@ -749,20 +751,17 @@ namespace ImGui // some advanced use cases (e.g. adding custom widgets in header row). // - Use TableSetupScrollFreeze() to lock columns/rows so they stay visible when scrolled. IMGUI_API void TableSetupColumn(const char* label, ImGuiTableColumnFlags flags = 0, float init_width_or_weight = 0.0f, ImGuiID user_id = 0); - IMGUI_API void TableSetupScrollFreeze(int cols, int rows); // lock columns/rows so they stay visible when scrolled. - IMGUI_API void TableHeadersRow(); // submit all headers cells based on data provided to TableSetupColumn() + submit context menu - IMGUI_API void TableHeader(const char* label); // submit one header cell manually (rarely used) - - // Tables: Sorting - // - Call TableGetSortSpecs() to retrieve latest sort specs for the table. NULL when not sorting. - // - When 'SpecsDirty == true' you should sort your data. It will be true when sorting specs have changed - // since last call, or the first time. Make sure to set 'SpecsDirty = false' after sorting, else you may - // wastefully sort your data every frame! - // - Lifetime: don't hold on this pointer over multiple frames or past any subsequent call to BeginTable(). - IMGUI_API ImGuiTableSortSpecs* TableGetSortSpecs(); // get latest sort specs for the table (NULL if not sorting). - - // Tables: Miscellaneous functions + IMGUI_API void TableSetupScrollFreeze(int cols, int rows); // lock columns/rows so they stay visible when scrolled. + IMGUI_API void TableHeadersRow(); // submit all headers cells based on data provided to TableSetupColumn() + submit context menu + IMGUI_API void TableHeader(const char* label); // submit one header cell manually (rarely used) + + // Tables: Sorting & Miscellaneous functions + // - Sorting: call TableGetSortSpecs() to retrieve latest sort specs for the table. NULL when not sorting. + // When 'sort_specs->SpecsDirty == true' you should sort your data. It will be true when sorting specs have + // changed since last call, or the first time. Make sure to set 'SpecsDirty = false' after sorting, + // else you may wastefully sort your data every frame! // - Functions args 'int column_n' treat the default value of -1 as the same as passing the current column index. + IMGUI_API ImGuiTableSortSpecs* TableGetSortSpecs(); // get latest sort specs for the table (NULL if not sorting). Lifetime: don't hold on this pointer over multiple frames or past any subsequent call to BeginTable(). IMGUI_API int TableGetColumnCount(); // return number of columns (value passed to BeginTable) IMGUI_API int TableGetColumnIndex(); // return current column index. IMGUI_API int TableGetRowIndex(); // return current row index. @@ -806,7 +805,7 @@ namespace ImGui // - If you stop calling BeginDragDropSource() the payload is preserved however it won't have a preview tooltip (we currently display a fallback "..." tooltip, see #1725) // - An item can be both drag source and drop target. IMGUI_API bool BeginDragDropSource(ImGuiDragDropFlags flags = 0); // call after submitting an item which may be dragged. when this return true, you can call SetDragDropPayload() + EndDragDropSource() - IMGUI_API bool SetDragDropPayload(const char* type, const void* data, size_t sz, ImGuiCond cond = 0); // type is a user defined string of maximum 32 characters. Strings starting with '_' are reserved for dear imgui internal types. Data is copied and held by imgui. + IMGUI_API bool SetDragDropPayload(const char* type, const void* data, size_t sz, ImGuiCond cond = 0); // type is a user defined string of maximum 32 characters. Strings starting with '_' are reserved for dear imgui internal types. Data is copied and held by imgui. Return true when payload has been accepted. IMGUI_API void EndDragDropSource(); // only call EndDragDropSource() if BeginDragDropSource() returns true! IMGUI_API bool BeginDragDropTarget(); // call after submitting an item that may receive a payload. If this returns true, you can call AcceptDragDropPayload() + EndDragDropTarget() IMGUI_API const ImGuiPayload* AcceptDragDropPayload(const char* type, ImGuiDragDropFlags flags = 0); // accept contents of a given type. If ImGuiDragDropFlags_AcceptBeforeDelivery is set you can peek into the payload before the mouse button is released. @@ -836,12 +835,12 @@ namespace ImGui IMGUI_API bool IsItemHovered(ImGuiHoveredFlags flags = 0); // is the last item hovered? (and usable, aka not blocked by a popup, etc.). See ImGuiHoveredFlags for more options. IMGUI_API bool IsItemActive(); // is the last item active? (e.g. button being held, text field being edited. This will continuously return true while holding mouse button on an item. Items that don't interact will always return false) IMGUI_API bool IsItemFocused(); // is the last item focused for keyboard/gamepad navigation? - IMGUI_API bool IsItemClicked(ImGuiMouseButton mouse_button = 0); // is the last item hovered and mouse clicked on? (**) == IsMouseClicked(mouse_button) && IsItemHovered()Important. (**) this it NOT equivalent to the behavior of e.g. Button(). Read comments in function definition. + IMGUI_API bool IsItemClicked(ImGuiMouseButton mouse_button = 0); // is the last item hovered and mouse clicked on? (**) == IsMouseClicked(mouse_button) && IsItemHovered()Important. (**) this is NOT equivalent to the behavior of e.g. Button(). Read comments in function definition. IMGUI_API bool IsItemVisible(); // is the last item visible? (items may be out of sight because of clipping/scrolling) IMGUI_API bool IsItemEdited(); // did the last item modify its underlying value this frame? or was pressed? This is generally the same as the "bool" return value of many widgets. IMGUI_API bool IsItemActivated(); // was the last item just made active (item was previously inactive). - IMGUI_API bool IsItemDeactivated(); // was the last item just made inactive (item was previously active). Useful for Undo/Redo patterns with widgets that requires continuous editing. - IMGUI_API bool IsItemDeactivatedAfterEdit(); // was the last item just made inactive and made a value change when it was active? (e.g. Slider/Drag moved). Useful for Undo/Redo patterns with widgets that requires continuous editing. Note that you may get false positives (some widgets such as Combo()/ListBox()/Selectable() will return true even when clicking an already selected item). + IMGUI_API bool IsItemDeactivated(); // was the last item just made inactive (item was previously active). Useful for Undo/Redo patterns with widgets that require continuous editing. + IMGUI_API bool IsItemDeactivatedAfterEdit(); // was the last item just made inactive and made a value change when it was active? (e.g. Slider/Drag moved). Useful for Undo/Redo patterns with widgets that require continuous editing. Note that you may get false positives (some widgets such as Combo()/ListBox()/Selectable() will return true even when clicking an already selected item). IMGUI_API bool IsItemToggledOpen(); // was the last item open state toggled? set by TreeNode(). IMGUI_API bool IsAnyItemHovered(); // is any item hovered? IMGUI_API bool IsAnyItemActive(); // is any item active? @@ -857,18 +856,19 @@ namespace ImGui // - In the future we will extend this concept further to also represent Platform Monitor and support a "no main platform window" operation mode. IMGUI_API ImGuiViewport* GetMainViewport(); // return primary/default viewport. This can never be NULL. + // Background/Foreground Draw Lists + IMGUI_API ImDrawList* GetBackgroundDrawList(); // this draw list will be the first rendered one. Useful to quickly draw shapes/text behind dear imgui contents. + IMGUI_API ImDrawList* GetForegroundDrawList(); // this draw list will be the last rendered one. Useful to quickly draw shapes/text over dear imgui contents. + // Miscellaneous Utilities IMGUI_API bool IsRectVisible(const ImVec2& size); // test if rectangle (of given size, starting from cursor position) is visible / not clipped. IMGUI_API bool IsRectVisible(const ImVec2& rect_min, const ImVec2& rect_max); // test if rectangle (in screen space) is visible / not clipped. to perform coarse clipping on user's side. IMGUI_API double GetTime(); // get global imgui time. incremented by io.DeltaTime every frame. IMGUI_API int GetFrameCount(); // get global imgui frame count. incremented by 1 every frame. - IMGUI_API ImDrawList* GetBackgroundDrawList(); // this draw list will be the first rendering one. Useful to quickly draw shapes/text behind dear imgui contents. - IMGUI_API ImDrawList* GetForegroundDrawList(); // this draw list will be the last rendered one. Useful to quickly draw shapes/text over dear imgui contents. IMGUI_API ImDrawListSharedData* GetDrawListSharedData(); // you may use this when creating your own ImDrawList instances. IMGUI_API const char* GetStyleColorName(ImGuiCol idx); // get a string corresponding to the enum value (for display, saving, etc.). IMGUI_API void SetStateStorage(ImGuiStorage* storage); // replace current window storage with our own (if you want to manipulate it yourself, typically clear subsection of it) IMGUI_API ImGuiStorage* GetStateStorage(); - IMGUI_API void CalcListClipping(int items_count, float items_height, int* out_items_display_start, int* out_items_display_end); // calculate coarse clipping for large list of evenly sized items. Prefer using the ImGuiListClipper higher-level helper if you can. IMGUI_API bool BeginChildFrame(ImGuiID id, const ImVec2& size, ImGuiWindowFlags flags = 0); // helper to create a child window / scrolling region that looks like a normal widget frame IMGUI_API void EndChildFrame(); // always call EndChildFrame() regardless of BeginChildFrame() return values (which indicates a collapsed/clipped window) @@ -882,34 +882,38 @@ namespace ImGui IMGUI_API void ColorConvertHSVtoRGB(float h, float s, float v, float& out_r, float& out_g, float& out_b); // Inputs Utilities: Keyboard - // - For 'int user_key_index' you can use your own indices/enums according to how your backend/engine stored them in io.KeysDown[]. - // - We don't know the meaning of those value. You can use GetKeyIndex() to map a ImGuiKey_ value into the user index. - IMGUI_API int GetKeyIndex(ImGuiKey imgui_key); // map ImGuiKey_* values into user's key index. == io.KeyMap[key] - IMGUI_API bool IsKeyDown(int user_key_index); // is key being held. == io.KeysDown[user_key_index]. - IMGUI_API bool IsKeyPressed(int user_key_index, bool repeat = true); // was key pressed (went from !Down to Down)? if repeat=true, uses io.KeyRepeatDelay / KeyRepeatRate - IMGUI_API bool IsKeyReleased(int user_key_index); // was key released (went from Down to !Down)? - IMGUI_API int GetKeyPressedAmount(int key_index, float repeat_delay, float rate); // uses provided repeat rate/delay. return a count, most often 0 or 1 but might be >1 if RepeatRate is small enough that DeltaTime > RepeatRate - IMGUI_API void CaptureKeyboardFromApp(bool want_capture_keyboard_value = true); // attention: misleading name! manually override io.WantCaptureKeyboard flag next frame (said flag is entirely left for your application to handle). e.g. force capture keyboard when your widget is being hovered. This is equivalent to setting "io.WantCaptureKeyboard = want_capture_keyboard_value"; after the next NewFrame() call. + // Without IMGUI_DISABLE_OBSOLETE_KEYIO: (legacy support) + // - For 'ImGuiKey key' you can still use your legacy native/user indices according to how your backend/engine stored them in io.KeysDown[]. + // With IMGUI_DISABLE_OBSOLETE_KEYIO: (this is the way forward) + // - Any use of 'ImGuiKey' will assert when key < 512 will be passed, previously reserved as native/user keys indices + // - GetKeyIndex() is pass-through and therefore deprecated (gone if IMGUI_DISABLE_OBSOLETE_KEYIO is defined) + IMGUI_API bool IsKeyDown(ImGuiKey key); // is key being held. + IMGUI_API bool IsKeyPressed(ImGuiKey key, bool repeat = true); // was key pressed (went from !Down to Down)? if repeat=true, uses io.KeyRepeatDelay / KeyRepeatRate + IMGUI_API bool IsKeyReleased(ImGuiKey key); // was key released (went from Down to !Down)? + IMGUI_API int GetKeyPressedAmount(ImGuiKey key, float repeat_delay, float rate); // uses provided repeat rate/delay. return a count, most often 0 or 1 but might be >1 if RepeatRate is small enough that DeltaTime > RepeatRate + IMGUI_API const char* GetKeyName(ImGuiKey key); // [DEBUG] returns English name of the key. Those names a provided for debugging purpose and are not meant to be saved persistently not compared. + IMGUI_API void SetNextFrameWantCaptureKeyboard(bool want_capture_keyboard); // Override io.WantCaptureKeyboard flag next frame (said flag is left for your application to handle, typically when true it instructs your app to ignore inputs). e.g. force capture keyboard when your widget is being hovered. This is equivalent to setting "io.WantCaptureKeyboard = want_capture_keyboard"; after the next NewFrame() call. // Inputs Utilities: Mouse // - To refer to a mouse button, you may use named enums in your code e.g. ImGuiMouseButton_Left, ImGuiMouseButton_Right. // - You can also use regular integer: it is forever guaranteed that 0=Left, 1=Right, 2=Middle. // - Dragging operations are only reported after mouse has moved a certain distance away from the initial clicking position (see 'lock_threshold' and 'io.MouseDraggingThreshold') IMGUI_API bool IsMouseDown(ImGuiMouseButton button); // is mouse button held? - IMGUI_API bool IsMouseClicked(ImGuiMouseButton button, bool repeat = false); // did mouse button clicked? (went from !Down to Down) + 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? (note that a double-click will also report IsMouseClicked() == true) + 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 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 - IMGUI_API bool IsAnyMouseDown(); // is any mouse button held? + IMGUI_API bool IsAnyMouseDown(); // [WILL OBSOLETE] is any mouse button held? This was designed for backends, but prefer having backend maintain a mask of held mouse buttons, because upcoming input queue system will make this invalid. IMGUI_API ImVec2 GetMousePos(); // shortcut to ImGui::GetIO().MousePos provided by user, to be consistent with other calls IMGUI_API ImVec2 GetMousePosOnOpeningCurrentPopup(); // retrieve mouse position at the time of opening popup we have BeginPopup() into (helper to avoid user backing that value themselves) IMGUI_API bool IsMouseDragging(ImGuiMouseButton button, float lock_threshold = -1.0f); // is mouse dragging? (if lock_threshold < -1.0f, uses io.MouseDraggingThreshold) IMGUI_API ImVec2 GetMouseDragDelta(ImGuiMouseButton button = 0, float lock_threshold = -1.0f); // return the delta from the initial clicking position while the mouse button is pressed or was just released. This is locked and return 0.0f until the mouse moves past a distance threshold at least once (if lock_threshold < -1.0f, uses io.MouseDraggingThreshold) IMGUI_API void ResetMouseDragDelta(ImGuiMouseButton button = 0); // - IMGUI_API ImGuiMouseCursor GetMouseCursor(); // get desired cursor type, reset in ImGui::NewFrame(), this is updated during the frame. valid before Render(). If you use software rendering by setting io.MouseDrawCursor ImGui will render those for you - IMGUI_API void SetMouseCursor(ImGuiMouseCursor cursor_type); // set desired cursor type - IMGUI_API void CaptureMouseFromApp(bool want_capture_mouse_value = true); // attention: misleading name! manually override io.WantCaptureMouse flag next frame (said flag is entirely left for your application to handle). This is equivalent to setting "io.WantCaptureMouse = want_capture_mouse_value;" after the next NewFrame() call. + IMGUI_API ImGuiMouseCursor GetMouseCursor(); // get desired mouse cursor shape. Important: reset in ImGui::NewFrame(), this is updated during the frame. valid before Render(). If you use software rendering by setting io.MouseDrawCursor ImGui will render those for you + IMGUI_API void SetMouseCursor(ImGuiMouseCursor cursor_type); // set desired mouse cursor shape + IMGUI_API void SetNextFrameWantCaptureMouse(bool want_capture_mouse); // Override io.WantCaptureMouse flag next frame (said flag is left for your application to handle, typical when true it instucts your app to ignore inputs). This is equivalent to setting "io.WantCaptureMouse = want_capture_mouse;" after the next NewFrame() call. // Clipboard Utilities // - Also see the LogToClipboard() function to capture GUI into clipboard, or easily output text data to the clipboard. @@ -926,7 +930,7 @@ namespace ImGui IMGUI_API const char* SaveIniSettingsToMemory(size_t* out_ini_size = NULL); // return a zero-terminated string with the .ini data which you can save by your own mean. call when io.WantSaveIniSettings is set, then save data by your own mean and clear io.WantSaveIniSettings. // Debug Utilities - // - This is used by the IMGUI_CHECKVERSION() macro. + IMGUI_API void DebugTextEncoding(const char* text); IMGUI_API bool DebugCheckVersionAndDataLayout(const char* version_str, size_t sz_io, size_t sz_style, size_t sz_vec2, size_t sz_vec4, size_t sz_drawvert, size_t sz_drawidx); // This is called by IMGUI_CHECKVERSION() macro. // Memory Allocators @@ -945,6 +949,7 @@ namespace ImGui //----------------------------------------------------------------------------- // Flags for ImGui::Begin() +// (Those are per-window flags. There are shared flags in ImGuiIO: io.ConfigWindowsResizeFromEdges and io.ConfigWindowsMoveFromTitleBarOnly) enum ImGuiWindowFlags_ { ImGuiWindowFlags_None = 0, @@ -953,7 +958,7 @@ enum ImGuiWindowFlags_ ImGuiWindowFlags_NoMove = 1 << 2, // Disable user moving the window ImGuiWindowFlags_NoScrollbar = 1 << 3, // Disable scrollbars (window can still scroll with mouse or programmatically) ImGuiWindowFlags_NoScrollWithMouse = 1 << 4, // Disable user vertically scrolling with mouse wheel. On child window, mouse wheel will be forwarded to the parent unless NoScrollbar is also set. - ImGuiWindowFlags_NoCollapse = 1 << 5, // Disable user collapsing window by double-clicking on it + ImGuiWindowFlags_NoCollapse = 1 << 5, // Disable user collapsing window by double-clicking on it. Also referred to as Window Menu Button (e.g. within a docking node). ImGuiWindowFlags_AlwaysAutoResize = 1 << 6, // Resize every window to its content every frame ImGuiWindowFlags_NoBackground = 1 << 7, // Disable drawing background color (WindowBg, etc.) and outside border. Similar as using SetNextWindowBgAlpha(0.0f). ImGuiWindowFlags_NoSavedSettings = 1 << 8, // Never load/save settings in .ini file @@ -973,18 +978,16 @@ enum ImGuiWindowFlags_ ImGuiWindowFlags_NoInputs = ImGuiWindowFlags_NoMouseInputs | ImGuiWindowFlags_NoNavInputs | ImGuiWindowFlags_NoNavFocus, // [Internal] - ImGuiWindowFlags_NavFlattened = 1 << 23, // [BETA] Allow gamepad/keyboard navigation to cross over parent border to this child (only use on child that have no scrolling!) + ImGuiWindowFlags_NavFlattened = 1 << 23, // [BETA] On child window: allow gamepad/keyboard navigation to cross over parent border to this child or between sibling child windows. ImGuiWindowFlags_ChildWindow = 1 << 24, // Don't use! For internal use by BeginChild() ImGuiWindowFlags_Tooltip = 1 << 25, // Don't use! For internal use by BeginTooltip() ImGuiWindowFlags_Popup = 1 << 26, // Don't use! For internal use by BeginPopup() ImGuiWindowFlags_Modal = 1 << 27, // Don't use! For internal use by BeginPopupModal() - ImGuiWindowFlags_ChildMenu = 1 << 28 // Don't use! For internal use by BeginMenu() - - // [Obsolete] - //ImGuiWindowFlags_ResizeFromAnySide = 1 << 17, // --> Set io.ConfigWindowsResizeFromEdges=true and make sure mouse cursors are supported by backend (io.BackendFlags & ImGuiBackendFlags_HasMouseCursors) + ImGuiWindowFlags_ChildMenu = 1 << 28, // Don't use! For internal use by BeginMenu() }; // Flags for ImGui::InputText() +// (Those are per-item flags. There are shared flags in ImGuiIO: io.ConfigInputTextCursorBlink and io.ConfigInputTextEnterKeepActive) enum ImGuiInputTextFlags_ { ImGuiInputTextFlags_None = 0, @@ -1007,11 +1010,12 @@ enum ImGuiInputTextFlags_ 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_CharsScientific = 1 << 17, // Allow 0123456789.+-*/eE (Scientific notation input) ImGuiInputTextFlags_CallbackResize = 1 << 18, // Callback on buffer capacity changes request (beyond 'buf_size' parameter value), allowing the string to grow. Notify when the string wants to be resized (for string types which hold a cache of their Size). You will be provided a new BufSize in the callback and NEED to honor it. (see misc/cpp/imgui_stdlib.h for an example of using this) - ImGuiInputTextFlags_CallbackEdit = 1 << 19 // Callback on any edit (note that InputText() already returns true on edit, the callback is useful mainly to manipulate the underlying buffer while focus is active) + ImGuiInputTextFlags_CallbackEdit = 1 << 19, // Callback on any edit (note that InputText() already returns true on edit, the callback is useful mainly to manipulate the underlying buffer while focus is active) + ImGuiInputTextFlags_EscapeClearsAll = 1 << 20, // Escape key clears content if not empty, and deactivate otherwise (constrast to default behavior of Escape to revert) // Obsolete names (will be removed soon) #ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS - , ImGuiInputTextFlags_AlwaysInsertMode = ImGuiInputTextFlags_AlwaysOverwrite // [renamed in 1.82] name was not matching behavior + ImGuiInputTextFlags_AlwaysInsertMode = ImGuiInputTextFlags_AlwaysOverwrite // [renamed in 1.82] name was not matching behavior #endif }; @@ -1034,7 +1038,7 @@ enum ImGuiTreeNodeFlags_ ImGuiTreeNodeFlags_SpanFullWidth = 1 << 12, // Extend hit box to the left-most and right-most edges (bypass the indented area). ImGuiTreeNodeFlags_NavLeftJumpsBackHere = 1 << 13, // (WIP) Nav: left direction may move to this TreeNode() from any of its child (items submitted between TreeNode and TreePop) //ImGuiTreeNodeFlags_NoScrollOnOpen = 1 << 14, // FIXME: TODO: Disable automatic scroll on TreePop() if node got just open and contents is not visible - ImGuiTreeNodeFlags_CollapsingHeader = ImGuiTreeNodeFlags_Framed | ImGuiTreeNodeFlags_NoTreePushOnOpen | ImGuiTreeNodeFlags_NoAutoOpenOnLog + ImGuiTreeNodeFlags_CollapsingHeader = ImGuiTreeNodeFlags_Framed | ImGuiTreeNodeFlags_NoTreePushOnOpen | ImGuiTreeNodeFlags_NoAutoOpenOnLog, }; // Flags for OpenPopup*(), BeginPopupContext*(), IsPopupOpen() functions. @@ -1043,7 +1047,7 @@ enum ImGuiTreeNodeFlags_ // It is therefore guaranteed to be legal to pass a mouse button index in ImGuiPopupFlags. // - For the same reason, we exceptionally default the ImGuiPopupFlags argument of BeginPopupContextXXX functions to 1 instead of 0. // IMPORTANT: because the default parameter is 1 (==ImGuiPopupFlags_MouseButtonRight), if you rely on the default parameter -// and want to another another flag, you need to pass in the ImGuiPopupFlags_MouseButtonRight flag. +// and want to use another flag, you need to pass in the ImGuiPopupFlags_MouseButtonRight flag explicitly. // - Multiple buttons currently cannot be combined/or-ed in those functions (we could allow it later). enum ImGuiPopupFlags_ { @@ -1057,18 +1061,18 @@ enum ImGuiPopupFlags_ ImGuiPopupFlags_NoOpenOverItems = 1 << 6, // For BeginPopupContextWindow(): don't return true when hovering items, only when hovering empty space ImGuiPopupFlags_AnyPopupId = 1 << 7, // For IsPopupOpen(): ignore the ImGuiID parameter and test for any popup. ImGuiPopupFlags_AnyPopupLevel = 1 << 8, // For IsPopupOpen(): search/test at any level of the popup stack (default test in the current level) - ImGuiPopupFlags_AnyPopup = ImGuiPopupFlags_AnyPopupId | ImGuiPopupFlags_AnyPopupLevel + ImGuiPopupFlags_AnyPopup = ImGuiPopupFlags_AnyPopupId | ImGuiPopupFlags_AnyPopupLevel, }; // Flags for ImGui::Selectable() enum ImGuiSelectableFlags_ { ImGuiSelectableFlags_None = 0, - ImGuiSelectableFlags_DontClosePopups = 1 << 0, // Clicking this don't close parent popup window + ImGuiSelectableFlags_DontClosePopups = 1 << 0, // Clicking this doesn't close parent popup window ImGuiSelectableFlags_SpanAllColumns = 1 << 1, // Selectable frame can span all columns (text will still fit in current column) ImGuiSelectableFlags_AllowDoubleClick = 1 << 2, // Generate press events on double clicks too ImGuiSelectableFlags_Disabled = 1 << 3, // Cannot be selected, display grayed out text - ImGuiSelectableFlags_AllowItemOverlap = 1 << 4 // (WIP) Hit testing to allow subsequent widgets to overlap this one + ImGuiSelectableFlags_AllowItemOverlap = 1 << 4, // (WIP) Hit testing to allow subsequent widgets to overlap this one }; // Flags for ImGui::BeginCombo() @@ -1082,7 +1086,7 @@ enum ImGuiComboFlags_ ImGuiComboFlags_HeightLargest = 1 << 4, // As many fitting items as possible ImGuiComboFlags_NoArrowButton = 1 << 5, // Display on the preview box without the square arrow button ImGuiComboFlags_NoPreview = 1 << 6, // Display only a square arrow button - ImGuiComboFlags_HeightMask_ = ImGuiComboFlags_HeightSmall | ImGuiComboFlags_HeightRegular | ImGuiComboFlags_HeightLarge | ImGuiComboFlags_HeightLargest + ImGuiComboFlags_HeightMask_ = ImGuiComboFlags_HeightSmall | ImGuiComboFlags_HeightRegular | ImGuiComboFlags_HeightLarge | ImGuiComboFlags_HeightLargest, }; // Flags for ImGui::BeginTabBar() @@ -1098,7 +1102,7 @@ enum ImGuiTabBarFlags_ ImGuiTabBarFlags_FittingPolicyResizeDown = 1 << 6, // Resize tabs when they don't fit ImGuiTabBarFlags_FittingPolicyScroll = 1 << 7, // Add scroll buttons when tabs don't fit ImGuiTabBarFlags_FittingPolicyMask_ = ImGuiTabBarFlags_FittingPolicyResizeDown | ImGuiTabBarFlags_FittingPolicyScroll, - ImGuiTabBarFlags_FittingPolicyDefault_ = ImGuiTabBarFlags_FittingPolicyResizeDown + ImGuiTabBarFlags_FittingPolicyDefault_ = ImGuiTabBarFlags_FittingPolicyResizeDown, }; // Flags for ImGui::BeginTabItem() @@ -1112,12 +1116,11 @@ enum ImGuiTabItemFlags_ ImGuiTabItemFlags_NoTooltip = 1 << 4, // Disable tooltip for the given tab ImGuiTabItemFlags_NoReorder = 1 << 5, // Disable reordering this tab or having another tab cross over this tab ImGuiTabItemFlags_Leading = 1 << 6, // Enforce the tab position to the left of the tab bar (after the tab list popup button) - ImGuiTabItemFlags_Trailing = 1 << 7 // Enforce the tab position to the right of the tab bar (before the scrolling buttons) + ImGuiTabItemFlags_Trailing = 1 << 7, // Enforce the tab position to the right of the tab bar (before the scrolling buttons) }; // Flags for ImGui::BeginTable() -// [BETA API] API may evolve slightly! If you use this, please update to the next version when it comes out! -// - Important! Sizing policies have complex and subtle side effects, more so than you would expect. +// - Important! Sizing policies have complex and subtle side effects, much more so than you would expect. // Read comments/demos carefully + experiment with live demos to get acquainted with them. // - The DEFAULT sizing policies are: // - Default to ImGuiTableFlags_SizingFixedFit if ScrollX is on, or if host window has ImGuiWindowFlags_AlwaysAutoResize. @@ -1125,15 +1128,15 @@ enum ImGuiTabItemFlags_ // - When ScrollX is off: // - Table defaults to ImGuiTableFlags_SizingStretchSame -> all Columns defaults to ImGuiTableColumnFlags_WidthStretch with same weight. // - Columns sizing policy allowed: Stretch (default), Fixed/Auto. -// - Fixed Columns will generally obtain their requested width (unless the table cannot fit them all). -// - Stretch Columns will share the remaining width. +// - Fixed Columns (if any) will generally obtain their requested width (unless the table cannot fit them all). +// - Stretch Columns will share the remaining width according to their respective weight. // - Mixed Fixed/Stretch columns is possible but has various side-effects on resizing behaviors. // The typical use of mixing sizing policies is: any number of LEADING Fixed columns, followed by one or two TRAILING Stretch columns. // (this is because the visible order of columns have subtle but necessary effects on how they react to manual resizing). // - When ScrollX is on: // - Table defaults to ImGuiTableFlags_SizingFixedFit -> all Columns defaults to ImGuiTableColumnFlags_WidthFixed // - Columns sizing policy allowed: Fixed/Auto mostly. -// - Fixed Columns can be enlarged as needed. Table will show an horizontal scrollbar if needed. +// - Fixed Columns can be enlarged as needed. Table will show a horizontal scrollbar if needed. // - When using auto-resizing (non-resizable) fixed columns, querying the content width to use item right-alignment e.g. SetNextItemWidth(-FLT_MIN) doesn't make sense, would create a feedback loop. // - Using Stretch columns OFTEN DOES NOT MAKE SENSE if ScrollX is on, UNLESS you have specified a value for 'inner_width' in BeginTable(). // If you specify a value for 'inner_width' then effectively the scrolling space is known and Stretch or mixed Fixed/Stretch columns become meaningful again. @@ -1159,8 +1162,8 @@ enum ImGuiTableFlags_ ImGuiTableFlags_BordersInner = ImGuiTableFlags_BordersInnerV | ImGuiTableFlags_BordersInnerH, // Draw inner borders. ImGuiTableFlags_BordersOuter = ImGuiTableFlags_BordersOuterV | ImGuiTableFlags_BordersOuterH, // Draw outer borders. ImGuiTableFlags_Borders = ImGuiTableFlags_BordersInner | ImGuiTableFlags_BordersOuter, // Draw all borders. - ImGuiTableFlags_NoBordersInBody = 1 << 11, // [ALPHA] Disable vertical borders in columns Body (borders will always appears in Headers). -> May move to style - ImGuiTableFlags_NoBordersInBodyUntilResize = 1 << 12, // [ALPHA] Disable vertical borders in columns Body until hovered for resize (borders will always appears in Headers). -> May move to style + ImGuiTableFlags_NoBordersInBody = 1 << 11, // [ALPHA] Disable vertical borders in columns Body (borders will always appear in Headers). -> May move to style + ImGuiTableFlags_NoBordersInBodyUntilResize = 1 << 12, // [ALPHA] Disable vertical borders in columns Body until hovered for resize (borders will always appear in Headers). -> May move to style // Sizing Policy (read above for defaults) ImGuiTableFlags_SizingFixedFit = 1 << 13, // Columns default to _WidthFixed or _WidthAuto (if resizable or not resizable), matching contents width. ImGuiTableFlags_SizingFixedSame = 2 << 13, // Columns default to _WidthFixed or _WidthAuto (if resizable or not resizable), matching the maximum contents width of all columns. Implicitly enable ImGuiTableFlags_NoKeepColumnsVisible. @@ -1174,24 +1177,18 @@ enum ImGuiTableFlags_ // Clipping ImGuiTableFlags_NoClip = 1 << 20, // Disable clipping rectangle for every individual columns (reduce draw command count, items will be able to overflow into other columns). Generally incompatible with TableSetupScrollFreeze(). // Padding - ImGuiTableFlags_PadOuterX = 1 << 21, // Default if BordersOuterV is on. Enable outer-most padding. Generally desirable if you have headers. - ImGuiTableFlags_NoPadOuterX = 1 << 22, // Default if BordersOuterV is off. Disable outer-most padding. + ImGuiTableFlags_PadOuterX = 1 << 21, // Default if BordersOuterV is on. Enable outermost padding. Generally desirable if you have headers. + ImGuiTableFlags_NoPadOuterX = 1 << 22, // Default if BordersOuterV is off. Disable outermost padding. ImGuiTableFlags_NoPadInnerX = 1 << 23, // Disable inner padding between columns (double inner padding if BordersOuterV is on, single inner padding if BordersOuterV is off). // Scrolling - ImGuiTableFlags_ScrollX = 1 << 24, // Enable horizontal scrolling. Require 'outer_size' parameter of BeginTable() to specify the container size. Changes default sizing policy. Because this create a child window, ScrollY is currently generally recommended when using ScrollX. + ImGuiTableFlags_ScrollX = 1 << 24, // Enable horizontal scrolling. Require 'outer_size' parameter of BeginTable() to specify the container size. Changes default sizing policy. Because this creates a child window, ScrollY is currently generally recommended when using ScrollX. ImGuiTableFlags_ScrollY = 1 << 25, // Enable vertical scrolling. Require 'outer_size' parameter of BeginTable() to specify the container size. // Sorting ImGuiTableFlags_SortMulti = 1 << 26, // Hold shift when clicking headers to sort on multiple column. TableGetSortSpecs() may return specs where (SpecsCount > 1). ImGuiTableFlags_SortTristate = 1 << 27, // Allow no sorting, disable default sorting. TableGetSortSpecs() may return specs where (SpecsCount == 0). // [Internal] Combinations and masks - ImGuiTableFlags_SizingMask_ = ImGuiTableFlags_SizingFixedFit | ImGuiTableFlags_SizingFixedSame | ImGuiTableFlags_SizingStretchProp | ImGuiTableFlags_SizingStretchSame - - // Obsolete names (will be removed soon) -#ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS - //, ImGuiTableFlags_ColumnsWidthFixed = ImGuiTableFlags_SizingFixedFit, ImGuiTableFlags_ColumnsWidthStretch = ImGuiTableFlags_SizingStretchSame // WIP Tables 2020/12 - //, ImGuiTableFlags_SizingPolicyFixed = ImGuiTableFlags_SizingFixedFit, ImGuiTableFlags_SizingPolicyStretch = ImGuiTableFlags_SizingStretchSame // WIP Tables 2021/01 -#endif + ImGuiTableFlags_SizingMask_ = ImGuiTableFlags_SizingFixedFit | ImGuiTableFlags_SizingFixedSame | ImGuiTableFlags_SizingStretchProp | ImGuiTableFlags_SizingStretchSame, }; // Flags for ImGui::TableSetupColumn() @@ -1228,19 +1225,14 @@ enum ImGuiTableColumnFlags_ ImGuiTableColumnFlags_WidthMask_ = ImGuiTableColumnFlags_WidthStretch | ImGuiTableColumnFlags_WidthFixed, ImGuiTableColumnFlags_IndentMask_ = ImGuiTableColumnFlags_IndentEnable | ImGuiTableColumnFlags_IndentDisable, ImGuiTableColumnFlags_StatusMask_ = ImGuiTableColumnFlags_IsEnabled | ImGuiTableColumnFlags_IsVisible | ImGuiTableColumnFlags_IsSorted | ImGuiTableColumnFlags_IsHovered, - ImGuiTableColumnFlags_NoDirectResize_ = 1 << 30 // [Internal] Disable user resizing this column directly (it may however we resized indirectly from its left edge) - - // Obsolete names (will be removed soon) -#ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS - //ImGuiTableColumnFlags_WidthAuto = ImGuiTableColumnFlags_WidthFixed | ImGuiTableColumnFlags_NoResize, // Column will not stretch and keep resizing based on submitted contents. -#endif + ImGuiTableColumnFlags_NoDirectResize_ = 1 << 30, // [Internal] Disable user resizing this column directly (it may however we resized indirectly from its left edge) }; // Flags for ImGui::TableNextRow() enum ImGuiTableRowFlags_ { - ImGuiTableRowFlags_None = 0, - ImGuiTableRowFlags_Headers = 1 << 0 // Identify header row (set default background color + width of its contents accounted different for auto column width) + ImGuiTableRowFlags_None = 0, + ImGuiTableRowFlags_Headers = 1 << 0, // Identify header row (set default background color + width of its contents accounted differently for auto column width) }; // Enum for ImGui::TableSetBgColor() @@ -1248,16 +1240,16 @@ enum ImGuiTableRowFlags_ // - Layer 0: draw with RowBg0 color if set, otherwise draw with ColumnBg0 if set. // - Layer 1: draw with RowBg1 color if set, otherwise draw with ColumnBg1 if set. // - Layer 2: draw with CellBg color if set. -// The purpose of the two row/columns layers is to let you decide if a background color changes should override or blend with the existing color. +// The purpose of the two row/columns layers is to let you decide if a background color change should override or blend with the existing color. // When using ImGuiTableFlags_RowBg on the table, each row has the RowBg0 color automatically set for odd/even rows. // If you set the color of RowBg0 target, your color will override the existing RowBg0 color. // If you set the color of RowBg1 or ColumnBg1 target, your color will blend over the RowBg0 color. enum ImGuiTableBgTarget_ { - ImGuiTableBgTarget_None = 0, - ImGuiTableBgTarget_RowBg0 = 1, // Set row background color 0 (generally used for background, automatically set when ImGuiTableFlags_RowBg is used) - ImGuiTableBgTarget_RowBg1 = 2, // Set row background color 1 (generally used for selection marking) - ImGuiTableBgTarget_CellBg = 3 // Set cell background color (top-most color) + ImGuiTableBgTarget_None = 0, + ImGuiTableBgTarget_RowBg0 = 1, // Set row background color 0 (generally used for background, automatically set when ImGuiTableFlags_RowBg is used) + ImGuiTableBgTarget_RowBg1 = 2, // Set row background color 1 (generally used for selection marking) + ImGuiTableBgTarget_CellBg = 3, // Set cell background color (top-most color) }; // Flags for ImGui::IsWindowFocused() @@ -1269,7 +1261,7 @@ enum ImGuiFocusedFlags_ ImGuiFocusedFlags_AnyWindow = 1 << 2, // Return true if any window is focused. Important: If you are trying to tell how to dispatch your low-level inputs, do NOT use this. Use 'io.WantCaptureMouse' instead! Please read the FAQ! ImGuiFocusedFlags_NoPopupHierarchy = 1 << 3, // Do not consider popup hierarchy (do not treat popup emitter as parent of popup) (when used with _ChildWindows or _RootWindow) //ImGuiFocusedFlags_DockHierarchy = 1 << 4, // Consider docking hierarchy (treat dockspace host as parent of docked window) (when used with _ChildWindows or _RootWindow) - ImGuiFocusedFlags_RootAndChildWindows = ImGuiFocusedFlags_RootWindow | ImGuiFocusedFlags_ChildWindows + ImGuiFocusedFlags_RootAndChildWindows = ImGuiFocusedFlags_RootWindow | ImGuiFocusedFlags_ChildWindows, }; // Flags for ImGui::IsItemHovered(), ImGui::IsWindowHovered() @@ -1286,10 +1278,16 @@ enum ImGuiHoveredFlags_ ImGuiHoveredFlags_AllowWhenBlockedByPopup = 1 << 5, // Return true even if a popup window is normally blocking access to this item/window //ImGuiHoveredFlags_AllowWhenBlockedByModal = 1 << 6, // Return true even if a modal popup window is normally blocking access to this item/window. FIXME-TODO: Unavailable yet. ImGuiHoveredFlags_AllowWhenBlockedByActiveItem = 1 << 7, // Return true even if an active item is blocking access to this item/window. Useful for Drag and Drop patterns. - ImGuiHoveredFlags_AllowWhenOverlapped = 1 << 8, // Return true even if the position is obstructed or overlapped by another window - ImGuiHoveredFlags_AllowWhenDisabled = 1 << 9, // Return true even if the item is disabled + ImGuiHoveredFlags_AllowWhenOverlapped = 1 << 8, // IsItemHovered() only: Return true even if the position is obstructed or overlapped by another window + ImGuiHoveredFlags_AllowWhenDisabled = 1 << 9, // IsItemHovered() only: Return true even if the item is disabled + ImGuiHoveredFlags_NoNavOverride = 1 << 10, // Disable using gamepad/keyboard navigation state when active, always query mouse. ImGuiHoveredFlags_RectOnly = ImGuiHoveredFlags_AllowWhenBlockedByPopup | ImGuiHoveredFlags_AllowWhenBlockedByActiveItem | ImGuiHoveredFlags_AllowWhenOverlapped, - ImGuiHoveredFlags_RootAndChildWindows = ImGuiHoveredFlags_RootWindow | ImGuiHoveredFlags_ChildWindows + ImGuiHoveredFlags_RootAndChildWindows = ImGuiHoveredFlags_RootWindow | ImGuiHoveredFlags_ChildWindows, + + // Hovering delays (for tooltips) + ImGuiHoveredFlags_DelayNormal = 1 << 11, // Return true after io.HoverDelayNormal elapsed (~0.30 sec) + ImGuiHoveredFlags_DelayShort = 1 << 12, // Return true after io.HoverDelayShort elapsed (~0.10 sec) + ImGuiHoveredFlags_NoSharedDelay = 1 << 13, // Disable shared delay system where moving from one item to the next keeps the previous timer for a short time (standard for tooltips with long delays) }; // Flags for ImGui::BeginDragDropSource(), ImGui::AcceptDragDropPayload() @@ -1297,8 +1295,8 @@ enum ImGuiDragDropFlags_ { ImGuiDragDropFlags_None = 0, // BeginDragDropSource() flags - ImGuiDragDropFlags_SourceNoPreviewTooltip = 1 << 0, // By default, a successful call to BeginDragDropSource opens a tooltip so you can display a preview or description of the source contents. This flag disable this behavior. - ImGuiDragDropFlags_SourceNoDisableHover = 1 << 1, // By default, when dragging we clear data so that IsItemHovered() will return false, to avoid subsequent user code submitting tooltips. This flag disable this behavior so you can still call IsItemHovered() on the source item. + ImGuiDragDropFlags_SourceNoPreviewTooltip = 1 << 0, // By default, a successful call to BeginDragDropSource opens a tooltip so you can display a preview or description of the source contents. This flag disables this behavior. + ImGuiDragDropFlags_SourceNoDisableHover = 1 << 1, // By default, when dragging we clear data so that IsItemHovered() will return false, to avoid subsequent user code submitting tooltips. This flag disables this behavior so you can still call IsItemHovered() on the source item. ImGuiDragDropFlags_SourceNoHoldToOpenOthers = 1 << 2, // Disable the behavior that allows to open tree nodes and collapsing header by holding over them while dragging a source item. ImGuiDragDropFlags_SourceAllowNullID = 1 << 3, // Allow items such as Text(), Image() that have no unique identifier to be used as drag source, by manufacturing a temporary identifier based on their window-relative position. This is extremely unusual within the dear imgui ecosystem and so we made it explicit. ImGuiDragDropFlags_SourceExtern = 1 << 4, // External source (from outside of dear imgui), won't attempt to read current item/window info. Will always return true. Only one Extern source can be active simultaneously. @@ -1307,7 +1305,7 @@ enum ImGuiDragDropFlags_ ImGuiDragDropFlags_AcceptBeforeDelivery = 1 << 10, // AcceptDragDropPayload() will returns true even before the mouse button is released. You can then call IsDelivery() to test if the payload needs to be delivered. ImGuiDragDropFlags_AcceptNoDrawDefaultRect = 1 << 11, // Do not draw the default highlight rectangle when hovering over target. ImGuiDragDropFlags_AcceptNoPreviewTooltip = 1 << 12, // Request hiding the BeginDragDropSource tooltip from the BeginDragDropTarget site. - ImGuiDragDropFlags_AcceptPeekOnly = ImGuiDragDropFlags_AcceptBeforeDelivery | ImGuiDragDropFlags_AcceptNoDrawDefaultRect // For peeking ahead and inspecting the payload before delivery. + ImGuiDragDropFlags_AcceptPeekOnly = ImGuiDragDropFlags_AcceptBeforeDelivery | ImGuiDragDropFlags_AcceptNoDrawDefaultRect, // For peeking ahead and inspecting the payload before delivery. }; // Standard Drag and Drop payload types. You can define you own payload types using short strings. Types starting with '_' are defined by Dear ImGui. @@ -1349,10 +1347,14 @@ enum ImGuiSortDirection_ ImGuiSortDirection_Descending = 2 // Descending = 9->0, Z->A etc. }; -// User fill ImGuiIO.KeyMap[] array with indices into the ImGuiIO.KeysDown[512] array -enum ImGuiKey_ +// A key identifier (ImGuiKey_XXX or ImGuiMod_XXX value) +// All our named keys are >= 512. Keys value 0 to 511 are left unused as legacy native/opaque key values (< 1.87) +// Since >= 1.89 we increased typing (went from int to enum), some legacy code may need a cast to ImGuiKey. +enum ImGuiKey : int { - ImGuiKey_Tab, + // Keyboard + ImGuiKey_None = 0, + ImGuiKey_Tab = 512, // == ImGuiKey_NamedKey_BEGIN ImGuiKey_LeftArrow, ImGuiKey_RightArrow, ImGuiKey_UpArrow, @@ -1367,74 +1369,141 @@ enum ImGuiKey_ ImGuiKey_Space, ImGuiKey_Enter, ImGuiKey_Escape, - ImGuiKey_KeyPadEnter, - ImGuiKey_A, // for text edit CTRL+A: select all - ImGuiKey_C, // for text edit CTRL+C: copy - ImGuiKey_V, // for text edit CTRL+V: paste - ImGuiKey_X, // for text edit CTRL+X: cut - ImGuiKey_Y, // for text edit CTRL+Y: redo - ImGuiKey_Z, // for text edit CTRL+Z: undo - ImGuiKey_COUNT -}; - -// To test io.KeyMods (which is a combination of individual fields io.KeyCtrl, io.KeyShift, io.KeyAlt set by user/backend) -enum ImGuiKeyModFlags_ -{ - ImGuiKeyModFlags_None = 0, - ImGuiKeyModFlags_Ctrl = 1 << 0, - ImGuiKeyModFlags_Shift = 1 << 1, - ImGuiKeyModFlags_Alt = 1 << 2, - ImGuiKeyModFlags_Super = 1 << 3 -}; - -// Gamepad/Keyboard navigation -// Keyboard: Set io.ConfigFlags |= ImGuiConfigFlags_NavEnableKeyboard to enable. NewFrame() will automatically fill io.NavInputs[] based on your io.KeysDown[] + io.KeyMap[] arrays. -// Gamepad: Set io.ConfigFlags |= ImGuiConfigFlags_NavEnableGamepad to enable. Backend: set ImGuiBackendFlags_HasGamepad and fill the io.NavInputs[] fields before calling NewFrame(). Note that io.NavInputs[] is cleared by EndFrame(). -// Read instructions in imgui.cpp for more details. Download PNG/PSD at http://dearimgui.org/controls_sheets. -enum ImGuiNavInput_ -{ - // Gamepad Mapping - ImGuiNavInput_Activate, // activate / open / toggle / tweak value // e.g. Cross (PS4), A (Xbox), A (Switch), Space (Keyboard) - ImGuiNavInput_Cancel, // cancel / close / exit // e.g. Circle (PS4), B (Xbox), B (Switch), Escape (Keyboard) - ImGuiNavInput_Input, // text input / on-screen keyboard // e.g. Triang.(PS4), Y (Xbox), X (Switch), Return (Keyboard) - ImGuiNavInput_Menu, // tap: toggle menu / hold: focus, move, resize // e.g. Square (PS4), X (Xbox), Y (Switch), Alt (Keyboard) - ImGuiNavInput_DpadLeft, // move / tweak / resize window (w/ PadMenu) // e.g. D-pad Left/Right/Up/Down (Gamepads), Arrow keys (Keyboard) - ImGuiNavInput_DpadRight, // - ImGuiNavInput_DpadUp, // - ImGuiNavInput_DpadDown, // - ImGuiNavInput_LStickLeft, // scroll / move window (w/ PadMenu) // e.g. Left Analog Stick Left/Right/Up/Down - ImGuiNavInput_LStickRight, // - ImGuiNavInput_LStickUp, // - ImGuiNavInput_LStickDown, // - ImGuiNavInput_FocusPrev, // next window (w/ PadMenu) // e.g. L1 or L2 (PS4), LB or LT (Xbox), L or ZL (Switch) - ImGuiNavInput_FocusNext, // prev window (w/ PadMenu) // e.g. R1 or R2 (PS4), RB or RT (Xbox), R or ZL (Switch) - ImGuiNavInput_TweakSlow, // slower tweaks // e.g. L1 or L2 (PS4), LB or LT (Xbox), L or ZL (Switch) - ImGuiNavInput_TweakFast, // faster tweaks // e.g. R1 or R2 (PS4), RB or RT (Xbox), R or ZL (Switch) - - // [Internal] Don't use directly! This is used internally to differentiate keyboard from gamepad inputs for behaviors that require to differentiate them. - // Keyboard behavior that have no corresponding gamepad mapping (e.g. CTRL+TAB) will be directly reading from io.KeysDown[] instead of io.NavInputs[]. - ImGuiNavInput_KeyLeft_, // move left // = Arrow keys - ImGuiNavInput_KeyRight_, // move right - ImGuiNavInput_KeyUp_, // move up - ImGuiNavInput_KeyDown_, // move down + ImGuiKey_LeftCtrl, ImGuiKey_LeftShift, ImGuiKey_LeftAlt, ImGuiKey_LeftSuper, + ImGuiKey_RightCtrl, ImGuiKey_RightShift, ImGuiKey_RightAlt, ImGuiKey_RightSuper, + ImGuiKey_Menu, + ImGuiKey_0, ImGuiKey_1, ImGuiKey_2, ImGuiKey_3, ImGuiKey_4, ImGuiKey_5, ImGuiKey_6, ImGuiKey_7, ImGuiKey_8, ImGuiKey_9, + ImGuiKey_A, ImGuiKey_B, ImGuiKey_C, ImGuiKey_D, ImGuiKey_E, ImGuiKey_F, ImGuiKey_G, ImGuiKey_H, ImGuiKey_I, ImGuiKey_J, + ImGuiKey_K, ImGuiKey_L, ImGuiKey_M, ImGuiKey_N, ImGuiKey_O, ImGuiKey_P, ImGuiKey_Q, ImGuiKey_R, ImGuiKey_S, ImGuiKey_T, + ImGuiKey_U, ImGuiKey_V, ImGuiKey_W, ImGuiKey_X, ImGuiKey_Y, ImGuiKey_Z, + ImGuiKey_F1, ImGuiKey_F2, ImGuiKey_F3, ImGuiKey_F4, ImGuiKey_F5, ImGuiKey_F6, + ImGuiKey_F7, ImGuiKey_F8, ImGuiKey_F9, ImGuiKey_F10, ImGuiKey_F11, ImGuiKey_F12, + ImGuiKey_Apostrophe, // ' + ImGuiKey_Comma, // , + ImGuiKey_Minus, // - + ImGuiKey_Period, // . + ImGuiKey_Slash, // / + ImGuiKey_Semicolon, // ; + ImGuiKey_Equal, // = + ImGuiKey_LeftBracket, // [ + ImGuiKey_Backslash, // \ (this text inhibit multiline comment caused by backslash) + ImGuiKey_RightBracket, // ] + ImGuiKey_GraveAccent, // ` + ImGuiKey_CapsLock, + ImGuiKey_ScrollLock, + ImGuiKey_NumLock, + ImGuiKey_PrintScreen, + ImGuiKey_Pause, + ImGuiKey_Keypad0, ImGuiKey_Keypad1, ImGuiKey_Keypad2, ImGuiKey_Keypad3, ImGuiKey_Keypad4, + ImGuiKey_Keypad5, ImGuiKey_Keypad6, ImGuiKey_Keypad7, ImGuiKey_Keypad8, ImGuiKey_Keypad9, + ImGuiKey_KeypadDecimal, + ImGuiKey_KeypadDivide, + ImGuiKey_KeypadMultiply, + ImGuiKey_KeypadSubtract, + ImGuiKey_KeypadAdd, + ImGuiKey_KeypadEnter, + ImGuiKey_KeypadEqual, + + // Gamepad (some of those are analog values, 0.0f to 1.0f) // GAME NAVIGATION ACTION + // (download controller mapping PNG/PSD at http://dearimgui.org/controls_sheets) + ImGuiKey_GamepadStart, // Menu (Xbox) + (Switch) Start/Options (PS) + ImGuiKey_GamepadBack, // View (Xbox) - (Switch) Share (PS) + ImGuiKey_GamepadFaceLeft, // X (Xbox) Y (Switch) Square (PS) // Tap: Toggle Menu. Hold: Windowing mode (Focus/Move/Resize windows) + ImGuiKey_GamepadFaceRight, // B (Xbox) A (Switch) Circle (PS) // Cancel / Close / Exit + ImGuiKey_GamepadFaceUp, // Y (Xbox) X (Switch) Triangle (PS) // Text Input / On-screen Keyboard + ImGuiKey_GamepadFaceDown, // A (Xbox) B (Switch) Cross (PS) // Activate / Open / Toggle / Tweak + ImGuiKey_GamepadDpadLeft, // D-pad Left // Move / Tweak / Resize Window (in Windowing mode) + ImGuiKey_GamepadDpadRight, // D-pad Right // Move / Tweak / Resize Window (in Windowing mode) + ImGuiKey_GamepadDpadUp, // D-pad Up // Move / Tweak / Resize Window (in Windowing mode) + ImGuiKey_GamepadDpadDown, // D-pad Down // Move / Tweak / Resize Window (in Windowing mode) + ImGuiKey_GamepadL1, // L Bumper (Xbox) L (Switch) L1 (PS) // Tweak Slower / Focus Previous (in Windowing mode) + ImGuiKey_GamepadR1, // R Bumper (Xbox) R (Switch) R1 (PS) // Tweak Faster / Focus Next (in Windowing mode) + ImGuiKey_GamepadL2, // L Trig. (Xbox) ZL (Switch) L2 (PS) [Analog] + ImGuiKey_GamepadR2, // R Trig. (Xbox) ZR (Switch) R2 (PS) [Analog] + ImGuiKey_GamepadL3, // L Stick (Xbox) L3 (Switch) L3 (PS) + ImGuiKey_GamepadR3, // R Stick (Xbox) R3 (Switch) R3 (PS) + ImGuiKey_GamepadLStickLeft, // [Analog] // Move Window (in Windowing mode) + ImGuiKey_GamepadLStickRight, // [Analog] // Move Window (in Windowing mode) + ImGuiKey_GamepadLStickUp, // [Analog] // Move Window (in Windowing mode) + ImGuiKey_GamepadLStickDown, // [Analog] // Move Window (in Windowing mode) + ImGuiKey_GamepadRStickLeft, // [Analog] + ImGuiKey_GamepadRStickRight, // [Analog] + ImGuiKey_GamepadRStickUp, // [Analog] + ImGuiKey_GamepadRStickDown, // [Analog] + + // Mouse Buttons (auto-submitted from AddMouseButtonEvent() calls) + // - This is mirroring the data also written to io.MouseDown[], io.MouseWheel, in a format allowing them to be accessed via standard key API. + ImGuiKey_MouseLeft, ImGuiKey_MouseRight, ImGuiKey_MouseMiddle, ImGuiKey_MouseX1, ImGuiKey_MouseX2, ImGuiKey_MouseWheelX, ImGuiKey_MouseWheelY, + + // [Internal] Reserved for mod storage + ImGuiKey_ReservedForModCtrl, ImGuiKey_ReservedForModShift, ImGuiKey_ReservedForModAlt, ImGuiKey_ReservedForModSuper, + ImGuiKey_COUNT, + + // Keyboard Modifiers (explicitly submitted by backend via AddKeyEvent() calls) + // - This is mirroring the data also written to io.KeyCtrl, io.KeyShift, io.KeyAlt, io.KeySuper, in a format allowing + // them to be accessed via standard key API, allowing calls such as IsKeyPressed(), IsKeyReleased(), querying duration etc. + // - Code polling every key (e.g. an interface to detect a key press for input mapping) might want to ignore those + // and prefer using the real keys (e.g. ImGuiKey_LeftCtrl, ImGuiKey_RightCtrl instead of ImGuiMod_Ctrl). + // - In theory the value of keyboard modifiers should be roughly equivalent to a logical or of the equivalent left/right keys. + // In practice: it's complicated; mods are often provided from different sources. Keyboard layout, IME, sticky keys and + // backends tend to interfere and break that equivalence. The safer decision is to relay that ambiguity down to the end-user... + ImGuiMod_None = 0, + ImGuiMod_Ctrl = 1 << 12, + ImGuiMod_Shift = 1 << 13, + ImGuiMod_Alt = 1 << 14, // Option/Menu + ImGuiMod_Super = 1 << 15, // Cmd/Super/Windows + ImGuiMod_Mask_ = 0xF000, +#if defined(__APPLE__) + ImGuiMod_Shortcut = ImGuiMod_Super, +#else + ImGuiMod_Shortcut = ImGuiMod_Ctrl, +#endif + + // [Internal] Prior to 1.87 we required user to fill io.KeysDown[512] using their own native index + the io.KeyMap[] array. + // We are ditching this method but keeping a legacy path for user code doing e.g. IsKeyPressed(MY_NATIVE_KEY_CODE) + ImGuiKey_NamedKey_BEGIN = 512, + ImGuiKey_NamedKey_END = ImGuiKey_COUNT, + ImGuiKey_NamedKey_COUNT = ImGuiKey_NamedKey_END - ImGuiKey_NamedKey_BEGIN, +#ifdef IMGUI_DISABLE_OBSOLETE_KEYIO + ImGuiKey_KeysData_SIZE = ImGuiKey_NamedKey_COUNT, // Size of KeysData[]: only hold named keys + ImGuiKey_KeysData_OFFSET = ImGuiKey_NamedKey_BEGIN, // First key stored in io.KeysData[0]. Accesses to io.KeysData[] must use (key - ImGuiKey_KeysData_OFFSET). +#else + ImGuiKey_KeysData_SIZE = ImGuiKey_COUNT, // Size of KeysData[]: hold legacy 0..512 keycodes + named keys + ImGuiKey_KeysData_OFFSET = 0, // First key stored in io.KeysData[0]. Accesses to io.KeysData[] must use (key - ImGuiKey_KeysData_OFFSET). +#endif + +#ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS + ImGuiKey_ModCtrl = ImGuiMod_Ctrl, ImGuiKey_ModShift = ImGuiMod_Shift, ImGuiKey_ModAlt = ImGuiMod_Alt, ImGuiKey_ModSuper = ImGuiMod_Super, // Renamed in 1.89 + ImGuiKey_KeyPadEnter = ImGuiKey_KeypadEnter, // Renamed in 1.87 +#endif +}; + +#ifndef IMGUI_DISABLE_OBSOLETE_KEYIO +// OBSOLETED in 1.88 (from July 2022): ImGuiNavInput and io.NavInputs[]. +// Official backends between 1.60 and 1.86: will keep working and feed gamepad inputs as long as IMGUI_DISABLE_OBSOLETE_KEYIO is not set. +// Custom backends: feed gamepad inputs via io.AddKeyEvent() and ImGuiKey_GamepadXXX enums. +enum ImGuiNavInput +{ + ImGuiNavInput_Activate, ImGuiNavInput_Cancel, ImGuiNavInput_Input, ImGuiNavInput_Menu, ImGuiNavInput_DpadLeft, ImGuiNavInput_DpadRight, ImGuiNavInput_DpadUp, ImGuiNavInput_DpadDown, + ImGuiNavInput_LStickLeft, ImGuiNavInput_LStickRight, ImGuiNavInput_LStickUp, ImGuiNavInput_LStickDown, ImGuiNavInput_FocusPrev, ImGuiNavInput_FocusNext, ImGuiNavInput_TweakSlow, ImGuiNavInput_TweakFast, ImGuiNavInput_COUNT, - ImGuiNavInput_InternalStart_ = ImGuiNavInput_KeyLeft_ }; +#endif // Configuration flags stored in io.ConfigFlags. Set by user/application. enum ImGuiConfigFlags_ { ImGuiConfigFlags_None = 0, - ImGuiConfigFlags_NavEnableKeyboard = 1 << 0, // Master keyboard navigation enable flag. NewFrame() will automatically fill io.NavInputs[] based on io.KeysDown[]. - ImGuiConfigFlags_NavEnableGamepad = 1 << 1, // Master gamepad navigation enable flag. This is mostly to instruct your imgui backend to fill io.NavInputs[]. Backend also needs to set ImGuiBackendFlags_HasGamepad. + ImGuiConfigFlags_NavEnableKeyboard = 1 << 0, // Master keyboard navigation enable flag. + ImGuiConfigFlags_NavEnableGamepad = 1 << 1, // Master gamepad navigation enable flag. Backend also needs to set ImGuiBackendFlags_HasGamepad. ImGuiConfigFlags_NavEnableSetMousePos = 1 << 2, // Instruct navigation to move the mouse cursor. May be useful on TV/console systems where moving a virtual mouse is awkward. Will update io.MousePos and set io.WantSetMousePos=true. If enabled you MUST honor io.WantSetMousePos requests in your backend, otherwise ImGui will react as if the mouse is jumping around back and forth. ImGuiConfigFlags_NavNoCaptureKeyboard = 1 << 3, // Instruct navigation to not set the io.WantCaptureKeyboard flag when io.NavActive is set. ImGuiConfigFlags_NoMouse = 1 << 4, // Instruct imgui to clear mouse position/buttons in NewFrame(). This allows ignoring the mouse information set by the backend. ImGuiConfigFlags_NoMouseCursorChange = 1 << 5, // Instruct backend to not alter mouse cursor shape and visibility. Use if the backend cursor changes are interfering with yours and you don't want to use SetMouseCursor() to change mouse cursor. You may want to honor requests from imgui by reading GetMouseCursor() yourself instead. - // User storage (to allow your backend/engine to communicate to code that may be shared between multiple projects. Those flags are not used by core Dear ImGui) + // User storage (to allow your backend/engine to communicate to code that may be shared between multiple projects. Those flags are NOT used by core Dear ImGui) ImGuiConfigFlags_IsSRGB = 1 << 20, // Application is SRGB-aware. - ImGuiConfigFlags_IsTouchScreen = 1 << 21 // Application is using a touch screen instead of a mouse. + ImGuiConfigFlags_IsTouchScreen = 1 << 21, // Application is using a touch screen instead of a mouse. }; // Backend capabilities flags stored in io.BackendFlags. Set by imgui_impl_xxx or custom backend. @@ -1444,7 +1513,7 @@ enum ImGuiBackendFlags_ ImGuiBackendFlags_HasGamepad = 1 << 0, // Backend Platform supports gamepad and currently has one connected. ImGuiBackendFlags_HasMouseCursors = 1 << 1, // Backend Platform supports honoring GetMouseCursor() value to change the OS cursor shape. ImGuiBackendFlags_HasSetMousePos = 1 << 2, // Backend Platform supports io.WantSetMousePos requests to reposition the OS mouse position (only used if ImGuiConfigFlags_NavEnableSetMousePos is set). - ImGuiBackendFlags_RendererHasVtxOffset = 1 << 3 // Backend Renderer supports ImDrawCmd::VtxOffset. This enables output of large meshes (64K+ vertices) while still using 16-bit indices. + ImGuiBackendFlags_RendererHasVtxOffset = 1 << 3, // Backend Renderer supports ImDrawCmd::VtxOffset. This enables output of large meshes (64K+ vertices) while still using 16-bit indices. }; // Enumeration for PushStyleColor() / PopStyleColor() @@ -1480,10 +1549,10 @@ enum ImGuiCol_ ImGuiCol_Separator, ImGuiCol_SeparatorHovered, ImGuiCol_SeparatorActive, - ImGuiCol_ResizeGrip, + ImGuiCol_ResizeGrip, // Resize grip in lower-right and lower-left corners of windows. ImGuiCol_ResizeGripHovered, ImGuiCol_ResizeGripActive, - ImGuiCol_Tab, + ImGuiCol_Tab, // TabItem in a TabBar ImGuiCol_TabHovered, ImGuiCol_TabActive, ImGuiCol_TabUnfocused, @@ -1498,7 +1567,7 @@ enum ImGuiCol_ ImGuiCol_TableRowBg, // Table row background (even rows) ImGuiCol_TableRowBgAlt, // Table row background (odd rows) ImGuiCol_TextSelectedBg, - ImGuiCol_DragDropTarget, + ImGuiCol_DragDropTarget, // Rectangle highlighting a drop target ImGuiCol_NavHighlight, // Gamepad/keyboard: current highlighted item ImGuiCol_NavWindowingHighlight, // Highlight window when using CTRL+TAB ImGuiCol_NavWindowingDimBg, // Darken/colorize entire screen behind the CTRL+TAB window list, when active @@ -1510,7 +1579,7 @@ enum ImGuiCol_ // - The enum only refers to fields of ImGuiStyle which makes sense to be pushed/popped inside UI code. // During initialization or between frames, feel free to just poke into ImGuiStyle directly. // - Tip: Use your programming IDE navigation facilities on the names in the _second column_ below to find the actual members and their description. -// In Visual Studio IDE: CTRL+comma ("Edit.NavigateTo") can follow symbols in comments, whereas CTRL+F12 ("Edit.GoToImplementation") cannot. +// In Visual Studio IDE: CTRL+comma ("Edit.GoToAll") can follow symbols in comments, whereas CTRL+F12 ("Edit.GoToImplementation") cannot. // With Visual Assist installed: ALT+G ("VAssistX.GoToImplementation") can also follow symbols in comments. // - When changing this enum, you need to update the associated internal table GStyleVarInfo[] accordingly. This is where we link enum values to members offset/type. enum ImGuiStyleVar_ @@ -1554,7 +1623,7 @@ enum ImGuiButtonFlags_ // [Internal] ImGuiButtonFlags_MouseButtonMask_ = ImGuiButtonFlags_MouseButtonLeft | ImGuiButtonFlags_MouseButtonRight | ImGuiButtonFlags_MouseButtonMiddle, - ImGuiButtonFlags_MouseButtonDefault_ = ImGuiButtonFlags_MouseButtonLeft + ImGuiButtonFlags_MouseButtonDefault_ = ImGuiButtonFlags_MouseButtonLeft, }; // Flags for ColorEdit3() / ColorEdit4() / ColorPicker3() / ColorPicker4() / ColorButton() @@ -1595,16 +1664,15 @@ enum ImGuiColorEditFlags_ ImGuiColorEditFlags_DisplayMask_ = ImGuiColorEditFlags_DisplayRGB | ImGuiColorEditFlags_DisplayHSV | ImGuiColorEditFlags_DisplayHex, ImGuiColorEditFlags_DataTypeMask_ = ImGuiColorEditFlags_Uint8 | ImGuiColorEditFlags_Float, ImGuiColorEditFlags_PickerMask_ = ImGuiColorEditFlags_PickerHueWheel | ImGuiColorEditFlags_PickerHueBar, - ImGuiColorEditFlags_InputMask_ = ImGuiColorEditFlags_InputRGB | ImGuiColorEditFlags_InputHSV + ImGuiColorEditFlags_InputMask_ = ImGuiColorEditFlags_InputRGB | ImGuiColorEditFlags_InputHSV, // Obsolete names (will be removed) -#ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS - , ImGuiColorEditFlags_RGB = ImGuiColorEditFlags_DisplayRGB, ImGuiColorEditFlags_HSV = ImGuiColorEditFlags_DisplayHSV, ImGuiColorEditFlags_HEX = ImGuiColorEditFlags_DisplayHex // [renamed in 1.69] -#endif + // ImGuiColorEditFlags_RGB = ImGuiColorEditFlags_DisplayRGB, ImGuiColorEditFlags_HSV = ImGuiColorEditFlags_DisplayHSV, ImGuiColorEditFlags_HEX = ImGuiColorEditFlags_DisplayHex // [renamed in 1.69] }; // Flags for DragFloat(), DragInt(), SliderFloat(), SliderInt() etc. // We use the same sets of flags for DragXXX() and SliderXXX() functions as the features are the same and it makes it easier to swap them. +// (Those are per-item flags. There are shared flags in ImGuiIO: io.ConfigDragClickToInputText) enum ImGuiSliderFlags_ { ImGuiSliderFlags_None = 0, @@ -1612,11 +1680,11 @@ enum ImGuiSliderFlags_ ImGuiSliderFlags_Logarithmic = 1 << 5, // Make the widget logarithmic (linear otherwise). Consider using ImGuiSliderFlags_NoRoundToFormat with this if using a format-string with small amount of digits. ImGuiSliderFlags_NoRoundToFormat = 1 << 6, // Disable rounding underlying value to match precision of the display format string (e.g. %.3f values are rounded to those 3 digits) ImGuiSliderFlags_NoInput = 1 << 7, // Disable CTRL+Click or Enter key allowing to input text directly into the widget - ImGuiSliderFlags_InvalidMask_ = 0x7000000F // [Internal] We treat using those bits as being potentially a 'float power' argument from the previous API that has got miscast to this enum, and will trigger an assert if needed. + ImGuiSliderFlags_InvalidMask_ = 0x7000000F, // [Internal] We treat using those bits as being potentially a 'float power' argument from the previous API that has got miscast to this enum, and will trigger an assert if needed. // Obsolete names (will be removed) #ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS - , ImGuiSliderFlags_ClampOnInput = ImGuiSliderFlags_AlwaysClamp // [renamed in 1.79] + ImGuiSliderFlags_ClampOnInput = ImGuiSliderFlags_AlwaysClamp, // [renamed in 1.79] #endif }; @@ -1638,7 +1706,7 @@ enum ImGuiMouseCursor_ ImGuiMouseCursor_Arrow = 0, ImGuiMouseCursor_TextInput, // When hovering over InputText, etc. ImGuiMouseCursor_ResizeAll, // (Unused by Dear ImGui functions) - ImGuiMouseCursor_ResizeNS, // When hovering over an horizontal border + ImGuiMouseCursor_ResizeNS, // When hovering over a horizontal border ImGuiMouseCursor_ResizeEW, // When hovering over a vertical border or a column ImGuiMouseCursor_ResizeNESW, // When hovering over the bottom-left corner of a window ImGuiMouseCursor_ResizeNWSE, // When hovering over the bottom-right corner of a window @@ -1653,10 +1721,10 @@ enum ImGuiMouseCursor_ enum ImGuiCond_ { ImGuiCond_None = 0, // No condition (always set the variable), same as _Always - ImGuiCond_Always = 1 << 0, // No condition (always set the variable) + ImGuiCond_Always = 1 << 0, // No condition (always set the variable), same as _None ImGuiCond_Once = 1 << 1, // Set the variable once per runtime session (only the first call will succeed) ImGuiCond_FirstUseEver = 1 << 2, // Set the variable if the object/window has no persistently saved data (no entry in .ini file) - ImGuiCond_Appearing = 1 << 3 // Set the variable if the object/window is appearing after being hidden/inactive (or the first time) + ImGuiCond_Appearing = 1 << 3, // Set the variable if the object/window is appearing after being hidden/inactive (or the first time) }; //----------------------------------------------------------------------------- @@ -1705,7 +1773,7 @@ struct ImVector // Constructors, destructor inline ImVector() { Size = Capacity = 0; Data = NULL; } inline ImVector(const ImVector& src) { Size = Capacity = 0; Data = NULL; operator=(src); } - inline ImVector& operator=(const ImVector& src) { clear(); resize(src.Size); memcpy(Data, src.Data, (size_t)Size * sizeof(T)); return *this; } + inline ImVector& operator=(const ImVector& src) { clear(); resize(src.Size); if (src.Data) memcpy(Data, src.Data, (size_t)Size * sizeof(T)); return *this; } inline ~ImVector() { if (Data) IM_FREE(Data); } // Important: does not destruct anything inline void clear() { if (Data) { Size = Capacity = 0; IM_FREE(Data); Data = NULL; } } // Important: does not destruct anything @@ -1735,13 +1803,14 @@ struct ImVector inline void resize(int new_size, const T& v) { if (new_size > Capacity) reserve(_grow_capacity(new_size)); if (new_size > Size) for (int n = Size; n < new_size; n++) memcpy(&Data[n], &v, sizeof(v)); Size = new_size; } inline void shrink(int new_size) { IM_ASSERT(new_size <= Size); Size = new_size; } // Resize a vector to a smaller size, guaranteed not to cause a reallocation inline void reserve(int new_capacity) { if (new_capacity <= Capacity) return; T* new_data = (T*)IM_ALLOC((size_t)new_capacity * sizeof(T)); if (Data) { memcpy(new_data, Data, (size_t)Size * sizeof(T)); IM_FREE(Data); } Data = new_data; Capacity = new_capacity; } + inline void reserve_discard(int new_capacity) { if (new_capacity <= Capacity) return; if (Data) IM_FREE(Data); Data = (T*)IM_ALLOC((size_t)new_capacity * sizeof(T)); Capacity = new_capacity; } // NB: It is illegal to call push_back/push_front/insert with a reference pointing inside the ImVector data itself! e.g. v.push_back(v[10]) is forbidden. inline void push_back(const T& v) { if (Size == Capacity) reserve(_grow_capacity(Size + 1)); memcpy(&Data[Size], &v, sizeof(v)); Size++; } inline void pop_back() { IM_ASSERT(Size > 0); Size--; } inline void push_front(const T& v) { if (Size == 0) push_back(v); else insert(Data, v); } inline T* erase(const T* it) { IM_ASSERT(it >= Data && it < Data + Size); const ptrdiff_t off = it - Data; memmove(Data + off, Data + off + 1, ((size_t)Size - (size_t)off - 1) * sizeof(T)); Size--; return Data + off; } - inline T* erase(const T* it, const T* it_last){ IM_ASSERT(it >= Data && it < Data + Size && it_last > it && it_last <= Data + Size); const ptrdiff_t count = it_last - it; const ptrdiff_t off = it - Data; memmove(Data + off, Data + off + count, ((size_t)Size - (size_t)off - count) * sizeof(T)); Size -= (int)count; return Data + off; } + inline T* erase(const T* it, const T* it_last){ IM_ASSERT(it >= Data && it < Data + Size && it_last >= it && it_last <= Data + Size); const ptrdiff_t count = it_last - it; const ptrdiff_t off = it - Data; memmove(Data + off, Data + off + count, ((size_t)Size - (size_t)off - (size_t)count) * sizeof(T)); Size -= (int)count; return Data + off; } inline T* erase_unsorted(const T* it) { IM_ASSERT(it >= Data && it < Data + Size); const ptrdiff_t off = it - Data; if (it < Data + Size - 1) memcpy(Data + off, Data + Size - 1, sizeof(T)); Size--; return Data + off; } inline T* insert(const T* it, const T& v) { IM_ASSERT(it >= Data && it <= Data + Size); const ptrdiff_t off = it - Data; if (Size == Capacity) reserve(_grow_capacity(Size + 1)); if (off < (int)Size) memmove(Data + off + 1, Data + off, ((size_t)Size - (size_t)off) * sizeof(T)); memcpy(&Data[off], &v, sizeof(v)); Size++; return Data + off; } inline bool contains(const T& v) const { const T* data = Data; const T* data_end = Data + Size; while (data < data_end) if (*data++ == v) return true; return false; } @@ -1768,7 +1837,7 @@ struct ImGuiStyle ImVec2 WindowPadding; // Padding within a window. float WindowRounding; // Radius of window corners rounding. Set to 0.0f to have rectangular windows. Large values tend to lead to variety of artifacts and are not recommended. float WindowBorderSize; // Thickness of border around windows. Generally set to 0.0f or 1.0f. (Other values are not well tested and more CPU/GPU costly). - ImVec2 WindowMinSize; // Minimum window size. This is a global setting. If you want to constraint individual windows, use SetNextWindowSizeConstraints(). + ImVec2 WindowMinSize; // Minimum window size. This is a global setting. If you want to constrain individual windows, use SetNextWindowSizeConstraints(). ImVec2 WindowTitleAlign; // Alignment for title bar text. Defaults to (0.0f,0.5f) for left-aligned,vertically centered. ImGuiDir WindowMenuButtonPosition; // Side of the collapsing/docking button in the title bar (None/Left/Right). Defaults to ImGuiDir_Left. float ChildRounding; // Radius of child window corners rounding. Set to 0.0f to have rectangular windows. @@ -1791,7 +1860,7 @@ struct ImGuiStyle float LogSliderDeadzone; // The size in pixels of the dead-zone around zero on logarithmic sliders that cross zero. float TabRounding; // Radius of upper corners of a tab. Set to 0.0f to have rectangular tabs. float TabBorderSize; // Thickness of border around tabs. - float TabMinWidthForCloseButton; // Minimum width for close button to appears on an unselected tab when hovered. Set to 0.0f to always show when hovering, set to FLT_MAX to never show close button unless selected. + float TabMinWidthForCloseButton; // Minimum width for close button to appear on an unselected tab when hovered. Set to 0.0f to always show when hovering, set to FLT_MAX to never show close button unless selected. 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. @@ -1799,7 +1868,7 @@ struct ImGuiStyle ImVec2 DisplaySafeAreaPadding; // If you cannot see the edges of your screen (e.g. on a TV) increase the safe area padding. Apply to popups/tooltips as well regular windows. NB: Prefer configuring your TV sets correctly! float MouseCursorScale; // Scale software rendered mouse cursor (when io.MouseDrawCursor is enabled). May be removed later. bool AntiAliasedLines; // Enable anti-aliased lines/borders. Disable if you are really tight on CPU/GPU. Latched at the beginning of the frame (copied to ImDrawList). - bool AntiAliasedLinesUseTex; // Enable anti-aliased lines/borders using textures where possible. Require backend to render with bilinear filtering. Latched at the beginning of the frame (copied to ImDrawList). + bool AntiAliasedLinesUseTex; // Enable anti-aliased lines/borders using textures where possible. Require backend to render with bilinear filtering (NOT point/nearest filtering). Latched at the beginning of the frame (copied to ImDrawList). bool AntiAliasedFill; // Enable anti-aliased edges around filled shapes (rounded rectangles, circles, etc.). Disable if you are really tight on CPU/GPU. Latched at the beginning of the frame (copied to ImDrawList). float CurveTessellationTol; // Tessellation tolerance when using PathBezierCurveTo() without a specific number of segments. Decrease for highly tessellated curves (higher quality, more polygons), increase to reduce quality. float CircleTessellationMaxError; // Maximum error (in pixels) allowed when using AddCircle()/AddCircleFilled() or drawing rounded corner rectangles with no explicit segment count specified. Decrease for higher quality but more geometry. @@ -1816,25 +1885,36 @@ struct ImGuiStyle // Access via ImGui::GetIO(). Read 'Programmer guide' section in .cpp file for general usage. //----------------------------------------------------------------------------- +// [Internal] Storage used by IsKeyDown(), IsKeyPressed() etc functions. +// If prior to 1.87 you used io.KeysDownDuration[] (which was marked as internal), you should use GetKeyData(key)->DownDuration and *NOT* io.KeysData[key]->DownDuration. +struct ImGuiKeyData +{ + bool Down; // True for if key is down + float DownDuration; // Duration the key has been down (<0.0f: not pressed, 0.0f: just pressed, >0.0f: time held) + float DownDurationPrev; // Last frame duration the key has been down + float AnalogValue; // 0.0f..1.0f for gamepad values +}; + struct ImGuiIO { //------------------------------------------------------------------ - // Configuration (fill once) // Default value + // Configuration // Default value //------------------------------------------------------------------ ImGuiConfigFlags ConfigFlags; // = 0 // See ImGuiConfigFlags_ enum. Set by user/application. Gamepad/keyboard navigation options, etc. ImGuiBackendFlags BackendFlags; // = 0 // See ImGuiBackendFlags_ enum. Set by backend (imgui_impl_xxx files or custom backend) to communicate features supported by the backend. - ImVec2 DisplaySize; // // Main display size, in pixels (generally == GetMainViewport()->Size) - float DeltaTime; // = 1.0f/60.0f // Time elapsed since last frame, in seconds. + ImVec2 DisplaySize; // // Main display size, in pixels (generally == GetMainViewport()->Size). May change every frame. + float DeltaTime; // = 1.0f/60.0f // Time elapsed since last frame, in seconds. May change every frame. float IniSavingRate; // = 5.0f // Minimum time between saving positions/sizes to .ini file, in seconds. const char* IniFilename; // = "imgui.ini" // Path to .ini file (important: default "imgui.ini" is relative to current working dir!). Set NULL to disable automatic .ini loading/saving or if you want to manually call LoadIniSettingsXXX() / SaveIniSettingsXXX() functions. const char* LogFilename; // = "imgui_log.txt"// Path to .log file (default parameter to ImGui::LogToFile when no file is specified). 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 MouseDragThreshold; // = 6.0f // Distance threshold before considering we are dragging. - int KeyMap[ImGuiKey_COUNT]; // // Map of indices into the KeysDown[512] entries array which represent your "native" keyboard state. - float KeyRepeatDelay; // = 0.250f // When holding a key/button, time before it starts repeating, in seconds (for buttons in Repeat mode, etc.). + 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. + float HoverDelayNormal; // = 0.30 sec // Delay on hovering before IsItemHovered(ImGuiHoveredFlags_DelayNormal) returns true. + float HoverDelayShort; // = 0.10 sec // Delay on hovering before IsItemHovered(ImGuiHoveredFlags_DelayShort) returns true. void* UserData; // = NULL // Store your own data for retrieval by callbacks. ImFontAtlas*Fonts; // // Font atlas: load, rasterize and pack one or more fonts into a single texture. @@ -1846,7 +1926,9 @@ struct ImGuiIO // Miscellaneous options 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. bool ConfigMacOSXBehaviors; // = defined(__APPLE__) // 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 keep item active and select contents (single-line only). 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 (io.BackendFlags & ImGuiBackendFlags_HasMouseCursors) because it needs 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. @@ -1872,31 +1954,32 @@ struct ImGuiIO // Optional: Notify OS Input Method Editor of the screen position of your cursor for text input position (e.g. when using Japanese/Chinese IME on Windows) // (default to use native imm32 api on Windows) - void (*ImeSetInputScreenPosFn)(int x, int y); - void* ImeWindowHandle; // = NULL // (Windows) Set this to your HWND to get automatic IME cursor positioning. + void (*SetPlatformImeDataFn)(ImGuiViewport* viewport, ImGuiPlatformImeData* data); +#ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS + void* ImeWindowHandle; // = NULL // [Obsolete] Set ImGuiViewport::PlatformHandleRaw instead. Set this to your HWND to get automatic IME cursor positioning. +#else + void* _UnusedPadding; // Unused field to keep data structure the same size. +#endif //------------------------------------------------------------------ - // Input - Fill before calling NewFrame() + // Input - Call before calling NewFrame() //------------------------------------------------------------------ - ImVec2 MousePos; // Mouse position, in pixels. Set to ImVec2(-FLT_MAX, -FLT_MAX) if mouse is unavailable (on another screen, etc.) - bool MouseDown[5]; // Mouse buttons: 0=left, 1=right, 2=middle + extras (ImGuiMouseButton_COUNT == 5). Dear ImGui mostly uses left and right buttons. Others buttons allows us to track if the mouse is being used by your application + available to user as a convenience via IsMouse** API. - float MouseWheel; // Mouse wheel Vertical: 1 unit scrolls about 5 lines text. - float MouseWheelH; // Mouse wheel Horizontal. Most users don't have a mouse with an horizontal wheel, may not be filled by all backends. - bool KeyCtrl; // Keyboard modifier pressed: Control - bool KeyShift; // Keyboard modifier pressed: Shift - b