oakmound / oak

A pure Go game engine
Apache License 2.0
1.53k stars 83 forks source link

Browser support via go WASM #167

Closed 200sc closed 2 years ago

200sc commented 2 years ago

Example status: working

broken

codecov-commenter commented 2 years ago

Codecov Report

Merging #167 (e1fa12b) into master (7d343c4) will decrease coverage by 0.23%. The diff coverage is 73.80%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #167      +/-   ##
==========================================
- Coverage   92.87%   92.63%   -0.24%     
==========================================
  Files         140      141       +1     
  Lines        6298     6313      +15     
==========================================
- Hits         5849     5848       -1     
- Misses        390      407      +17     
+ Partials       59       58       -1     
Impacted Files Coverage Δ
drawLoop.go 53.84% <0.00%> (-21.77%) :arrow_down:
window.go 67.52% <ø> (-0.28%) :arrow_down:
init.go 76.19% <100.00%> (+3.96%) :arrow_up:
init_override_other.go 100.00% <100.00%> (ø)
loading.go 100.00% <100.00%> (ø)
render/drawHeap.go 98.09% <100.00%> (ø)
event/handler.go 96.66% <0.00%> (-3.34%) :arrow_down:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 7d343c4...e1fa12b. Read the comment docs.

200sc commented 2 years ago

I think I've found the (a?) reason examples hang: if rendering takes too long, by the time the render loop is finished it will already be time for the next draw frame to be rendered, and wasm's scheduler is less able to optimize thread / goroutine switching to ensure that the thread / goroutine keeping the window / javascript interactable keeps getting scheduled.

Implausiblyfun commented 2 years ago

Super cool to see this in action!