Skip to content

ImGui upgrade + full EzyCad GUI integration, Lua/TextEditor console, optional embedded Python console (native), and wasm HiDPI/font fixes #57

@trailcode

Description

@trailcode

High-level themes

  1. Dear ImGui upgrade — Substantial update across third_party/imgui/* (version file, backends, core). Review risk: API/behavior changes, font/layout, input.
  2. EzyCad + ImGui integrationmain.cpp drives full GUI flow (init, render, settings save on exit, GLFW callback chaining, wasm vs native font paths).
  3. HiDPI / Emscripten — Content scale, font loading without double-scaling, imgui_impl_glfw canvas/DPR-related behavior; web/EzyCad.html tweaks.
  4. Lua script console — ImGuiColorTextEdit for .lua tabs; monospace console font (Cousine) where applied; menu/shortcuts for script console visibility.
  5. Python console (native) — Optional embedded CPython via pybind11, Python_console, cmake/EzyCadPython.cmake, res/scripts/python/basic.py, CMake copy of Python DLL on Windows.
  6. Settings / UX — GUI pane persistence includes Python console visibility; log messages for settings load/save (see gui.cpp history in diff).
  7. Miscocct_view.cpp small wasm-related tweak; main_orig.cpp stub; .gitignore entries.

Files changed (excluding vendored ImGui)

These are the application / build files that typically matter most in review:

Path Role
CMakeLists.txt Python optional embed, pybind11 FetchContent, font/preload/copy steps, link targets
cmake/EzyCadPython.cmake Windows-friendly Python dev lib / DLL resolution for embedding
src/main.cpp Window creation, scaling, fonts (DroidSans + Cousine), ImGui backends, GUI lifecycle, input chaining
src/gui.cpp, src/gui.h Menus, panes, script/Python console toggles, settings JSON fields
src/lua_console.cpp, src/lua_console.h Lua REPL + script tabs (TextEditor), monospace font usage
src/python_console.cpp, src/python_console.h Python REPL + ezycad_native bindings + script tabs
res/scripts/python/basic.py Sample Python script shipped under res/scripts/python
web/EzyCad.html Wasm shell / layout
src/occt_view.cpp Minor platform-specific rendering note
src/main_orig.cpp Stub / pointer to history
.gitignore Ignore rules

Vendored subtree (large diff): third_party/imgui/** — treat as upstream ImGui import; validate against your expected ImGui version in third_party/imgui/IMGUI_VERSION.txt.

Python console (build & runtime)

  • CMake option: EZYCAD_ENABLE_PYTHON (ON by default for non-Emscripten builds in this branch).
  • Requires: Python 3 development headers/libs discoverable by find_package(Python3 COMPONENTS Development).
  • Not for wasm: Embedding CPython like this is native-only; Emscripten path should still build without Python.
  • Windows: Post-build can copy python3xx.dll next to EzyCad.exe when resolved (see EzyCadPython.cmake).

Suggested review checklist

  • ImGui regression pass — docking-free layout, fonts, widgets, file dialogs, log window.
  • Native — Debug/Release, Python ON/OFF (-DEZYCAD_ENABLE_PYTHON=OFF), missing Python dev kit → clean disable message.
  • Wasm — Canvas size, mouse/keyboard, fonts, Lua console (no Python).
  • Settingsezycad_settings.json round-trip; new keys (show_python_console, etc.) don’t break older files.
  • Consoles — Lua + Python bindings (ezy, view, shape wrappers), script tab save/load paths under res/scripts/*.

Follow-ups (optional)

  • Squash commits and replace “WIP” messages with a single conventional summary.
  • Document Python embedding prerequisites in README.md (if you want users to build with Python by default).
  • Add CI matrix: build with EZYCAD_ENABLE_PYTHON=OFF to avoid hard dependency on Python dev packages.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions