Skip to content

v0.7.0

Choose a tag to compare

@apotema apotema released this 14 Apr 17:26
· 324 commits to main since this release
a5486b7

Highlights

Sokol backend correctness, lifecycle, and parity with raylib. Verified end-to-end with the new examples/sokol_imgui/ smoke test.

Bug fixes

  • #37run() and makeDesc() in backends/sokol/src/window.zig each took an anonymous struct parameter, and Zig treats those as distinct types. sapp.run(makeDesc(desc)) failed to compile, blocking every sokol-backend project. Fixed by forwarding fields explicitly into the makeDesc call.
  • #34Shape.rectangle with fill = .outline rendered as a filled block on sokol because the backend never defined drawRectangleLinesEx and the labelle-gfx fallback routed it to drawRectangleRec. Implemented as sgl.beginLineStrip over the four corners. Declarative gizmos/*.zon outlined rects now render correctly on sokol.
  • #35 — Sokol cleared the framebuffer to near-white (0.95, 0.95, 0.95). Raylib clears to (30, 30, 35) dark blue-gray. Same project ported between backends produced wildly different backdrops and broke alpha compositing visuals. Sokol now matches raylib.
  • #36 — Two sokol input/lifecycle bugs:
    1. frame() never polled g.isRunning(), so game.quit() had no effect on sokol — only window-manager close worked. Now polls and calls a new window.requestQuit() (forwarding to sapp.requestQuit()).
    2. newFrame() cleared keys_pressed[] at the top of the frame callback, before scripts ran. Sokol_app dispatched KEY_DOWN events into pressed[] before invoking frame_cb, so the script's isKeyPressed(.escape) always saw false. Moved newFrame() to the end of frame() so scripts see one-shot edges as expected.
  • #38sokolEvent only forwarded events to backend_input.handleEvent. ImGui (via the labelle-imgui sokol bridge) never saw mouse/keyboard, so simgui's IO state stayed empty and ImGui buttons/sliders were dead. Added gui_event_extern and gui_event_forward template scalars that emit an extern declaration for imgui_bridge_handle_event and forward each sapp event to it when the project has a GUI configured. No-op for projects without a GUI.

New examples

  • #32 (merged externally) — Android-ready sokol example with WASD camera, jump animation, gizmo outlines.
  • #39examples/sokol_imgui/ end-to-end smoke test for sokol + Dear ImGui via the labelle-imgui bridge. Click counter and slider widgets exercise the full event-IO path.

Compatibility

  • Raylib backend: unchanged. Verified that raylib + imgui still works with no changes against this release.
  • Sokol non-GUI projects: unaffected — the new event-forwarding template scalars expand to empty strings when no GUI is configured.
  • iOS/Android sokol targets: not yet validated against the event-forwarding hook in #38; if you hit unresolved imgui_bridge_handle_event symbols on those platforms, please file an issue.

Commits

a5486b7 Merge pull request #39 from labelle-toolkit/examples/sokol-imgui-smoke
a0a7d0b feat(examples): sokol + imgui smoke test example
74316bc Merge pull request #38 from labelle-toolkit/fix/sokol-forward-events-to-gui
9d5bdc6 fix(sokol): forward sapp events to the GUI bridge so ImGui IO works
a68fd51 feat(sokol): Android-ready example with WASD/animation/gizmos (#32)
5d5c9b2 Merge pull request #37 from labelle-toolkit/fix/sokol-rundesc-compile-error
e49b25c fix(sokol): forward run() fields explicitly into makeDesc() call
4ed2c11 Merge pull request #36 from labelle-toolkit/fix/sokol-input-lifecycle
465e070 fix(sokol): route game.quit() through frame loop and fix isKeyPressed timing
aca4e47 Merge pull request #35 from labelle-toolkit/fix/sokol-clear-color-parity
ecba9c4 fix(sokol): match raylib clear color (30, 30, 35)
a2a2c97 Merge pull request #34 from labelle-toolkit/fix/sokol-rect-outline

What's Changed

  • fix(sokol): remove HiDPI camera offset double-scaling by @apotema in #29
  • fix(sokol): implement drawRectangleLinesEx so Shape.fill=outline renders as outline by @apotema in #34
  • fix(sokol): match raylib clear color (30, 30, 35) by @apotema in #35
  • fix(sokol): route game.quit() through frame loop and fix isKeyPressed timing by @apotema in #36
  • fix(sokol): forward run() fields explicitly into makeDesc() call by @apotema in #37
  • feat(sokol): Android-ready example with WASD/animation/gizmos by @apotema in #32
  • fix(sokol): forward sapp events to the GUI bridge so ImGui IO works by @apotema in #38
  • feat(examples): sokol + imgui smoke test example by @apotema in #39

Full Changelog: v0.6.0...v0.7.0