Skip to content

vendor/box3d: add a fallback platform clock hook - #7286

Draft
nic-vdwalt wants to merge 1 commit into
odin-lang:masterfrom
nic-vdwalt:box3d-clock-hook
Draft

vendor/box3d: add a fallback platform clock hook#7286
nic-vdwalt wants to merge 1 commit into
odin-lang:masterfrom
nic-vdwalt:box3d-clock-hook

Conversation

@nic-vdwalt

@nic-vdwalt nic-vdwalt commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Summary

  • let freestanding hosts override Box3D's generic timer with a monotonic microsecond clock
  • preserve the existing zero-timing fallback when no host hook is supplied
  • make elapsed/reset calculations handle non-advancing ticks safely

This is intentionally limited to the timer hook. Broader raw-WASM support belongs upstream in Box3D.

Related: erincatto/box3d#127

Testing

  • ./odin build vendor/box3d -target:js_wasm32 -build-mode:obj

@nic-vdwalt
nic-vdwalt force-pushed the box3d-clock-hook branch 2 times, most recently from 6e15839 to 3134735 Compare August 13, 2026 10:10
@nic-vdwalt nic-vdwalt changed the title vendor/box3d: add a fallback platform clock hook vendor/box3d: support freestanding WASM without libc-shim Aug 14, 2026
@nic-vdwalt
nic-vdwalt force-pushed the box3d-clock-hook branch 2 times, most recently from 68067a9 to b7c89f2 Compare August 14, 2026 07:00
b3GetTicks and friends return zero on the generic branch, so World_GetProfile
reports all zeroes on freestanding wasm32. Add a weak b3PlatformTicks that a
host can override with a strong definition (monotonic microseconds); the weak
default preserves the existing zero behaviour.

Holding branch. Separate upstream concern from the mutex fix in box3d#124;
no issue filed yet.
@nic-vdwalt nic-vdwalt changed the title vendor/box3d: support freestanding WASM without libc-shim vendor/box3d: add a fallback platform clock hook Aug 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant