1287 Commits

Author SHA1 Message Date
xuk3r
7074c4e7df
Merge 552986072abeb867ea95d3694c821d0e2741521a into 8c131021b0680fbfa22610737033d2fe6c54277f 2026-07-29 22:02:14 +08:00
ocornut
d94d0f3649 Examples: SDL+WebGPU: removed stray glfw from cmakefiles. (#9387, #9428) 2026-07-23 18:56:53 +02:00
Jonathan Hoffstadt
62399b5bfe Examples: Apple + Metal4: add example (#9466, #9451)
+ Amend edit to EXAMPLES.md, comment build.xml
2026-07-08 18:04:30 +02:00
ocornut
776bf2ab0d Examples: OpenGL3+Win32: rework OpenGL initialization to allow Wine compatibility. Fix. (#9427, #6577)
Fixed commented out test code.
2026-07-03 18:59:37 +02:00
ocornut
4f1ea369ea Examples: OpenGL3+Win32: rework OpenGL initialization to allow Wine compatibility. (#9427, #6577) 2026-07-03 18:57:14 +02:00
ocornut
a977144955 Examples: OpenGL3+GLFW,SDL2,SDL3: improve Wine compatibility by passing empty GLSL version to ImGui_ImplOpenGL3_Init(). (#9427, #6577) 2026-07-03 18:57:10 +02:00
ocornut
e616ace74d CI, Backends: Metal4: fixed CI, added comments. (#9458) 2026-07-03 17:48:11 +02:00
ocornut
6824e2c2e4 Examples: Android: update to AGP 9.2.0 to support Gradle 9.6.0. 2026-07-02 14:26:46 +02:00
ocornut
caddd26fb9 Backends: Metal4: minor tweaks/comments. (#9458, #9451) 2026-07-02 12:09:06 +02:00
Amélie Heinrich
fc6395365d Backends: Metal4: Added Metal 4 backend. Added SDL3+Metal4 example. (#9458, #9451) 2026-07-02 12:00:10 +02:00
ocornut
c66d9a8190 Examples, SDL2/SDL3: use SDL_GetWindowSizeInPixels() to create framebuffers. (#8761, #9124)
+ cc #7433
2026-06-29 11:50:42 +02:00
xuk
552986072a i18n: fix ImplicitRefSize assertion by passing 0.0f size to merged CJK font
AddFontDefault() uses implicit ref size. Passing an explicit size (13.0f) to
AddFontFromFileTTF() in MergeMode triggers the assertion because the two fonts
use different ref size conventions. Pass 0.0f instead so both fonts share the
same implicit ref size and scale together with style.FontSizeBase.
2026-06-10 17:55:10 +08:00
xuk
e9cd46672a i18n: simplify RebuildFonts() — remove glyph ranges and ref size workaround
In v1.92+ with an updated backend, glyph ranges are handled dynamically
and do not need to be specified. Remove GetGlyphRangesChineseSimplifiedCommon(),
the zh_label_ranges English stub, and the explicit SizePixels on AddFontDefault()
that was added to work around the ImplicitRefSize assertion. Use plain
MergeMode instead.
2026-06-10 16:59:39 +08:00
xuk
08f82c56de i18n: move i18n/ to misc/i18n/ to align with misc/ optional module convention
misc/ already hosts optional supplemental modules (cpp/imgui_stdlib,
freetype/, fonts/). i18n fits the same pattern: opt-in, not part of
the core library. Update all include paths, Makefile, Xcode project
and README accordingly.
2026-06-10 14:27:16 +08:00
xuk
5f45f05f68 i18n: fix translation quality per localization standards
- Do not translate 'Hello, world!' (universally recognized programming example)
- Do not translate 'This is some useful text.' (standard example boilerplate)
- Do not translate 'float' / 'counter = %d' (C++ type/variable labels)
- Keep 'blah blah blah' as-is (intentional nonsense filler, not real content)
- Keep 'dear imgui' brand name untranslated in greeting message
- Fix 'Another bullet point' -> 正确翻译为项目符号而非叶节点
- Fix 'Metrics/Debugger' -> 指标/调试器 (Metrics = indicators, not performance)
- Remove redundant identity entries for API function names (IsItemXxx etc.)
2026-06-10 13:55:53 +08:00
xuk
d497a70fca i18n: guard i18n code in main.mm with IMGUI_DEMO_ENABLE_I18N; iOS target opt-out
- Wrap RebuildFonts(), g_need_font_rebuild, and font rebuild calls in
  #ifdef IMGUI_DEMO_ENABLE_I18N so main.mm compiles cleanly without i18n
- Include imgui_i18n.h unconditionally (provides no-op Tr() stub when
  IMGUI_DEMO_ENABLE_I18N is not defined, enabling Tr() in the demo window)
- Remove IMGUI_DEMO_ENABLE_I18N and i18n sources from iOS Xcode target
  (untested on iOS; macOS-only system font paths would not work on device)
2026-06-08 11:36:46 +08:00
xuk
86e272318f i18n: update Xcode project to include i18n sources and IMGUI_DEMO_ENABLE_I18N
Add imgui_i18n.cpp and locale/zh_CN.cpp to both iOS and macOS targets.
Set IMGUI_DEMO_ENABLE_I18N=1 in GCC_PREPROCESSOR_DEFINITIONS for all
four build configurations (iOS/macOS × Debug/Release).
2026-06-08 11:27:01 +08:00
xuk
0576c0e3a1 i18n: add Simplified Chinese translation for imgui_demo + Apple Metal example
- imgui_demo.cpp: wrap all user-visible string literals with Tr(); add
  Language menu in DemoWindowMenuBar (guarded by IMGUI_DEMO_ENABLE_I18N);
  guard extern g_need_font_rebuild with IMGUI_DEMO_ENABLE_I18N + __APPLE__
- examples/example_apple_metal/main.mm: CJK font loading via RebuildFonts()
  (always loads 2-glyph stub in English, full range in zh_CN); Language menu
  triggers font atlas rebuild before next NewFrame(); wrap demo window strings
  with Tr(); fix v1.92 ImplicitRefSize assertion by passing explicit SizePixels
  to AddFontDefault()
- examples/example_apple_metal/Makefile: add i18n sources and
  -DIMGUI_DEMO_ENABLE_I18N flag
2026-06-08 11:22:24 +08:00
Oliver Dixon
5220a3f48d
Examples: WebGPU: Require C++20 to build Dawn examples (#9433, #9432) 2026-06-07 09:58:58 +02:00
ocornut
fc5e2f28fe Examples: WGPU: fixed typo for wvgk cloning. (#9428, #9387) 2026-06-03 19:24:06 +02:00
manuel
2b31f65167 Examples: WebGPU+GLFW/SDL2/SDL3: wire up the IMGUI_WGVK_DIR path. (#9387)
The block was a stub - find Vulkan, detect Wayland/X11, set the SUPPORT_*_SURFACE defines that wgvk.c needs.
2026-05-11 15:42:16 +02:00
ocornut
e3033c3975 Examples: moving example_win32_directx11 on top of the .sln makes it the default selected project. 2026-04-24 17:38:51 +02:00
ocornut
4739af2d51 Update VS toolset in all .vcxproj from VS2015 (v140) to VS2017 (v141).
It supports vcpkg.
2026-04-23 15:58:04 +02:00
ocornut
fb308c14ce Remove noise from 0453ae9 + amend comments. (#914) 2026-04-22 14:50:15 +02:00
ocornut
ac261203a5 (Breaking) Backends: Vulkan: redesigned to use separate ImageView + Sampler instead of Combined Image Sampler. (fixes, amends) (#914) 2026-04-22 14:43:44 +02:00
yaz0r
0453ae96e8 (Breaking) Backends: Vulkan: redesigned to use separate ImageView + Sampler instead of Combined Image Sampler. (WIP) (#914) 2026-04-22 14:43:44 +02:00
ocornut
ed2e5dd0f0 Examples+WebGPU: added support for WGVK in cmakefiles. (#9316, #9246, #9257) 2026-03-25 16:16:15 +01:00
r-lyeh
59780020f6 Backends, Examples: WebGPU: added support for WGVK. (#9316, #9246, #9257)
Squashed: minified SPIRV binaries by stripping strings + emitting in binary_to_compressed_c.
2026-03-25 15:31:35 +01:00
ocornut
79411a0405 Backends, Examples: WebGPU: fixed warnings + scale initial surface height for native. 2026-03-23 16:21:50 +01:00
Yan Pujante
4a2e3cce69 Examples: SDL2+WebGPU: fixes hi-dpi handling. (#9300) 2026-03-13 17:07:47 +01:00
Yan Pujante
512982d0d2 Examples: Emscripten: fixes minor rendering issues (#9281)
- in Firefox, scrollbar would appear => adding overflow: hidden fixes this issue
- when the canvas has the focus, Chrome draws a very small blue outline, setting it to none fixes this issue
2026-03-09 16:54:21 +01:00
ocornut
9e6b888626 Examples: reorder builds items to favor main.cpp and backend failing earlier. 2026-03-09 16:19:22 +01:00
ocornut
83fa0ae263 Backends, Examples: removed Emscripten < 4.0.10 support. Removed IMGUI_IMPL_WEBGPU_BACKEND_WGPU. Amends. (#9281, #8381) 2026-03-09 16:18:59 +01:00
Yan Pujante
e92820db2a Backends, Examples: removed Emscripten < 4.0.10 support. Removed IMGUI_IMPL_WEBGPU_BACKEND_WGPU. (#9281, #8381)
- This commit removes the option of using -sUSE_WEBGPU=1 from CMake and make
- Compiling with a version of Emscripten >= 4.0.10 will work the same way as it was before
- Compiling with a version of Emscripten < 4.0.10 will print an error message and abort the build (in the case of CMake)
- Since there can only be 1 implementation for the backend in the case of Emscripten, this commit cleans the code accordingly
2026-03-09 15:45:34 +01:00
Pascal Thomet
2000008b47 Examples: Emscripten: add tabindex=-1 to canvas in shell_minimal.html. (#9259)
Without tabindex, the canvas element is not focusable in the DOM, so pongasoft/emscripten-glfw's focus/blur listeners on the canvas
never fire. This means glfwSetWindowFocusCallback is never called etc.
Ref: https://github.com/pongasoft/emscripten-glfw/issues/29
2026-02-23 13:35:18 +01:00
r-lyeh
b5ccee78b6 Examples: WGPU: fixed undefined behaviors in example init code. (#9246, #9256) [@r-lyeh] 2026-02-20 16:23:08 +01:00
Adem Budak
3fecb234c8 Examples: SDL3+WGPU: fixed build warning. (#9255) 2026-02-19 11:38:41 +01:00
ocornut
ff673d31df Backends: WebGPU: minor build fix for Emscripten 5.0.0 (note: our examples currently don't build with 5.0.1).
Getting 'warning: unused function 'CreateWGPUSurface' [-Wunused-function]' in some build paths.
cc #9246
2026-02-16 18:04:20 +01:00
ocornut
9c33672e5c Examples: reword a comment to not mention AddFontDefault() explicitly. 2026-02-12 18:37:31 +01:00
tanksdude
5fe48b6a0e
Docs: fixed some typos (#9217) 2026-02-10 16:40:52 +01:00
ocornut
66bb8add73 Docs: better document Shortcut() related stuff. (#9188) Better document io.ConfigDpiScaleFonts. (#9179) 2026-01-22 14:35:16 +01:00
ocornut
8c0b410371 Docs: tweaks. 2026-01-20 18:25:18 +01:00
ocornut
14dfd5bf6b Examples: DX12: update to VS2019 so it supports WIndows SDK 10.0 simplified versioning. 2026-01-19 11:42:08 +01:00
ocornut
9a6eb0ab25 Backends: Vulkan: ImGui_ImplVulkanH_DestroyWindow() oes not call vkDestroySurfaceKHR(): because surface is created by caller. (#9163)
# Conflicts:
#	backends/imgui_impl_vulkan.cpp
2026-01-14 19:37:05 +01:00
ocornut
9ce41a92c3 Misc/shallow merges from docking branch to reduce small drift. 2026-01-08 14:31:25 +01:00
ocornut
b7b8f52437 Examples: Android: update for consistency (untested). 2025-12-23 18:16:33 +01:00
ocornut
05581da183 AddFontDefault() now automatically selects an embedded font between AddFontDefaultVector() and AddFontDefaultBitmap). 2025-12-23 18:16:33 +01:00
ocornut
4e7c05504a Renamed IM_ARRAYSIZE() -> IM_COUNTOF(). Kept legacy name for now. 2025-12-17 14:30:01 +01:00
ocornut
ae873b1e0d Misc: rename extraneous parenthesizes from return statements. 2025-11-27 15:01:24 +01:00
Rémy Tassoux
f0699effed Examples: Win32+DirectX12: Disable breaking on the D3D12_MESSAGE_ID_FENCE_ZERO_WAIT warning. (#9093, #9084) 2025-11-26 15:39:37 +01:00