Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WebAssembly support #28

Merged
merged 127 commits into from Dec 4, 2022
Merged

WebAssembly support #28

merged 127 commits into from Dec 4, 2022

Conversation

jjant
Copy link
Owner

@jjant jjant commented Nov 23, 2022

Description

Split original runty8 crate into many different ones:

  • runty8: Main entry point for games created with Runty8.
    Most Runty8 users should probably only depend on this crate.
  • runty8-core: Core types needed by every Runty8 related crate
  • runty8-runtime: Run standalone Runty8 games in native or wasm targets
  • runty8-editor: Run game inside editor
  • runty8-winit: Integration layer for winit
  • runty8-event-loop: Thin layer over winit/glow/glutin to have a cross-platform OpenGL/WebGL-powered event loop

Move examples to top-level examples directory.

TODO

  • Web: Figure out how to get the event loop running at a consistent frame rate.
    It seems that in native we can use ControlFlow::WaitUntil(instant::Instant::now() + instant::Duration::from_millis(33)) , but that's very slow in web, leading to frame times of 34-40ms.
    It looks like we want to use Poll, and handle accumulated times manually. Poll uses requestAnimationFrame.

Edit: Used ControlFlow::Poll everywhere, and fixed my timestep. See d89b7a2.

  • Fix mouse move in editor
  • Implement setting title functionality inrunty8-event-loop
    Done in 4dfe853.
  • Make load_assets! be project-root-based (use CARGO_MANIFEST_DIR)

Not in scope for this PR

@jjant jjant merged commit 425efff into master Dec 4, 2022
@jjant jjant deleted the wasm-game branch December 4, 2022 19:39
@jjant jjant mentioned this pull request Dec 9, 2022
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.

None yet

1 participant