CI/releases: drop the nodemo bundles (--no-demo build flag kept); remove examples/example_shared; Roblox backend RenderRate defaults to 60 (0 = every frame); README + TODO.txt updated
This commit is contained in:
+3
-5
@@ -151,7 +151,7 @@ Backend options:
|
||||
| --- | --- |
|
||||
| `ImGui_ImplRoblox.Init(parent, render_scale)` | `render_scale` = your OS display scale renders at physical-pixel resolution (crisper, same size as desktop imgui). |
|
||||
| `ImGui_ImplRoblox.SetRenderScale(scale)` | Change it at runtime. |
|
||||
| `ImGui_ImplRoblox.SetRenderRate(hz)` | Max tile redraws per second (default `0` = every frame). Your code still runs every frame. |
|
||||
| `ImGui_ImplRoblox.SetRenderRate(hz)` | Max tile redraws per second (default `60`; `0` = every frame). Your code still runs every frame. |
|
||||
| `ImGui_ImplRoblox.SetRedrawBudget(ms)` | Max milliseconds per frame spent redrawing changed tiles (opt-in; default `0` = no limit, every change is drawn the same frame). With a budget, tiles over it keep their old pixels for a few frames, so big changes are spread over frames instead of one long frame (parts of the UI may update a frame or two apart). |
|
||||
| `ImGui_ImplRoblox.SetBusyRenderRate(hz)` | Optional lower redraw rate while scrolling, resizing or moving windows (default off). |
|
||||
| `ImGui_ImplRoblox.SetProfiling(true)` | MicroProfiler (Ctrl+F6) labels for every backend stage. |
|
||||
@@ -179,7 +179,7 @@ The cost is CPU time in Luau, so the backend is built around **not drawing**:
|
||||
3. **Scrolling reuses pixels.** Window content is a separate layer inside a `ClipsDescendants` frame sized to the window's visible area, positioned at the scroll offset. Scrolling moves it like dragging moves a window; only rows entering view are drawn. Decorations (title bar, borders, scrollbar) stay in their own layers.
|
||||
4. **Skipping unchanged windows.** Vertices are stored in a flat Luau `buffer` (36 bytes each) instead of tables. Before any per-tile work, a window's raw vertex/index bytes are compared with last frame's; if identical, its layers are just restacked.
|
||||
5. **Fast rasterizer.** `@native` functions; axis-aligned quads (most rects and every glyph) take a span-fill path, flat rows are copied instead of re-blended, gradient rects (color pickers) are filled per row, and only real triangles (anti-aliased edges, curves) use the generic edge-function rasterizer.
|
||||
6. **Redraw budget.** Changed tiles are redrawn in the frame they change. Optionally, `SetRedrawBudget(ms)` caps the redraw time per frame; tiles over it keep their old pixels and follow on the next frames. Optionally capped with `SetRenderRate(hz)` / `SetBusyRenderRate(hz)`. Your UI code and Dear ImGui's logic still run every frame, so input is never dropped.
|
||||
6. **Redraw budget.** Changed tiles are redrawn in the frame they change. Optionally, `SetRedrawBudget(ms)` caps the redraw time per frame; tiles over it keep their old pixels and follow on the next frames. Redraws are capped at 60 per second by default (`SetRenderRate(hz)`, `0` = uncapped), optionally lower while busy with `SetBusyRenderRate(hz)`. Your UI code and Dear ImGui's logic still run every frame, so input is never dropped.
|
||||
|
||||
**Input.** Mouse and keys come from `UserInputService`. While the mouse is over Dear ImGui (`io.WantCaptureMouse`), the tiles are `Active`, so clicks and the wheel don't reach the game (camera zoom). Typing comes from key codes by default (printable ASCII). Call `ImGui_ImplRoblox.SetTextProxy(true)` to opt in to a hidden `TextBox` that holds focus while a text field is active: the OS then delivers typing (any layout), paste and copy/cut through it, and its text mirrors Dear ImGui's current selection. Fonts are TTFs rasterized by the ported stb_truetype into the font atlas, which becomes a backend texture like any image (`CreateTexture` works for your own pixels too).
|
||||
|
||||
@@ -205,12 +205,10 @@ love examples/example_love
|
||||
|
||||
Roblox stays the primary target: the Roblox build is untouched by this (no shims, `@native` kept); the LÖVE build strips `@native` and adds small `bit32`/`buffer`/`utf8`/`table` shims (the COMPAT section of [backends/imgui_impl_love.lua](/backends/imgui_impl_love.lua)). `tools/test/love/run.sh` checks that LuaJIT produces exactly the same draw data as Luau.
|
||||
|
||||
[examples/example_shared/app.lua](/examples/example_shared/app.lua) is one UI that runs unchanged on both: `roblox.client.luau` (Rojo: `examples/example_shared/default.project.json`) and `main.lua` (`love examples/example_shared`) are the only platform code. Write shared UI code in plain Lua 5.1 syntax (no `+=`, `//`, `continue`).
|
||||
|
||||
#### Prebuilt releases
|
||||
|
||||
Every push to `master` publishes a rolling `latest` release, and every `v*` tag a versioned release ([.github/workflows/release.yml](/.github/workflows/release.yml)), with:
|
||||
`ImGui.luau` / `ImGui-nodemo.luau` (Roblox ModuleScript), `imgui_love.lua` / `imgui_love-nodemo.lua` (LÖVE), and `imgui-luau-roblox-*.zip` / `imgui-luau-love-*.zip` (bundle + examples).
|
||||
`ImGui.luau` (Roblox ModuleScript), `imgui_love.lua` (LÖVE), their minified `.min` variants, and `imgui-luau-roblox-*.zip` / `imgui-luau-love-*.zip` (bundle + examples). For a library-only build without the demo, build it yourself with `--no-demo`.
|
||||
|
||||
### Differences from C++ Dear ImGui
|
||||
|
||||
|
||||
@@ -35,28 +35,20 @@ jobs:
|
||||
run: |
|
||||
mkdir -p dist
|
||||
python3 tools/bundle.py dist/roblox # ImGui.luau (library + demo)
|
||||
python3 tools/bundle.py --no-demo dist/roblox-nodemo # ImGui.luau (library only)
|
||||
python3 tools/bundle.py --target love dist/love # imgui_love.lua (library + demo)
|
||||
python3 tools/bundle.py --target love --no-demo dist/love-nodemo
|
||||
# minified variants (comments/whitespace stripped, same code): tools/minify.py
|
||||
python3 tools/minify.py dist/roblox/ImGui.luau dist/ImGui.min.luau
|
||||
python3 tools/minify.py dist/roblox-nodemo/ImGui.luau dist/ImGui-nodemo.min.luau
|
||||
python3 tools/minify.py dist/love/imgui_love.lua dist/imgui_love.min.lua
|
||||
python3 tools/minify.py dist/love-nodemo/imgui_love.lua dist/imgui_love-nodemo.min.lua
|
||||
|
||||
- name: Check
|
||||
run: |
|
||||
python3 tools/sync_github_readme.py --check
|
||||
luau-compile --null dist/roblox/ImGui.luau
|
||||
luau-compile --null dist/roblox-nodemo/ImGui.luau
|
||||
sed 's|require(script:WaitForChild("Impl"))|nil|' dist/roblox/ImGuiTyped.luau > /tmp/ImGuiTyped.luau && luau-analyze /tmp/ImGuiTyped.luau
|
||||
luajit -bl dist/love/imgui_love.lua > /dev/null
|
||||
luajit -bl dist/love-nodemo/imgui_love.lua > /dev/null
|
||||
python3 tools/minify.py --test
|
||||
luau-compile --null dist/ImGui.min.luau
|
||||
luau-compile --null dist/ImGui-nodemo.min.luau
|
||||
luajit -bl dist/imgui_love.min.lua > /dev/null
|
||||
luajit -bl dist/imgui_love-nodemo.min.lua > /dev/null
|
||||
python3 tools/test/run.py --main tools/test/scripts/t_readme.luau --frames 30 --quiet --roblox --timeout 300 | tee /tmp/r.txt
|
||||
grep -q "README OK" /tmp/r.txt
|
||||
python3 tools/test/run.py --main tools/test/scripts/t_cached_window.luau --frames 130 --quiet --roblox --timeout 300 | tee /tmp/c.txt
|
||||
@@ -78,16 +70,14 @@ jobs:
|
||||
V="${GITHUB_REF_NAME}"
|
||||
cd dist
|
||||
cp roblox/ImGui.luau ImGui.luau
|
||||
cp roblox-nodemo/ImGui.luau ImGui-nodemo.luau
|
||||
cp love/imgui_love.lua imgui_love.lua
|
||||
cp love-nodemo/imgui_love.lua imgui_love-nodemo.lua
|
||||
# Roblox: module + example LocalScript + Rojo project
|
||||
mkdir -p pkg-roblox/build && cp ImGui.luau roblox/ImGuiTyped.luau pkg-roblox/build/ && cp ../default.project.json pkg-roblox/
|
||||
mkdir -p pkg-roblox/examples && cp -r ../examples/example_roblox ../examples/example_shared pkg-roblox/examples/
|
||||
mkdir -p pkg-roblox/examples && cp -r ../examples/example_roblox pkg-roblox/examples/
|
||||
(cd pkg-roblox && zip -qr ../imgui-luau-roblox-$V.zip .)
|
||||
# LÖVE: bundle + fonts + examples (run: love examples/example_love)
|
||||
mkdir -p pkg-love/build && cp imgui_love.lua pkg-love/build/ && cp -r ../fonts pkg-love/ && rm -f pkg-love/fonts/*.lua
|
||||
mkdir -p pkg-love/examples && cp -r ../examples/example_love ../examples/example_shared pkg-love/examples/
|
||||
mkdir -p pkg-love/examples && cp -r ../examples/example_love pkg-love/examples/
|
||||
(cd pkg-love && zip -qr ../imgui-luau-love-$V.zip .)
|
||||
ls -la
|
||||
|
||||
@@ -97,9 +87,7 @@ jobs:
|
||||
with:
|
||||
files: |
|
||||
dist/ImGui.luau
|
||||
dist/ImGui-nodemo.luau
|
||||
dist/imgui_love.lua
|
||||
dist/imgui_love-nodemo.lua
|
||||
dist/*.min.luau
|
||||
dist/*.min.lua
|
||||
dist/*.zip
|
||||
@@ -127,4 +115,4 @@ jobs:
|
||||
gh release delete latest --yes --cleanup-tag || true
|
||||
gh release create latest --latest --title "Latest build (${GITHUB_SHA::7})" \
|
||||
--notes "Automatic build of ${GITHUB_SHA} on ${GITHUB_REF_NAME}. Tag a commit v* for a versioned release." \
|
||||
dist/ImGui.luau dist/ImGui-nodemo.luau dist/imgui_love.lua dist/imgui_love-nodemo.lua dist/*.min.luau dist/*.min.lua dist/*.zip
|
||||
dist/ImGui.luau dist/imgui_love.lua dist/*.min.luau dist/*.min.lua dist/*.zip
|
||||
|
||||
Reference in New Issue
Block a user