Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/awwsmm/hello-rust-sdl2-wasm
/ functions
Functions
5 in github.com/awwsmm/hello-rust-sdl2-wasm
⨍
Functions
5
◇
Types & classes
0
↓ 2 callers
Function
main_loop
(ctx: Rc<RefCell<Sdl>>, rect: Rc<RefCell<Rect>>, canvas: Rc<RefCell<WindowCanvas>>)
src/lib.rs:18
↓ 1 callers
Function
set_main_loop_callback
Schedules the given callback to be run over and over in a loop until it returns MainLoopEvent::Terminate. Retains ownership of the passed callback
src/emscripten.rs:42
Function
cancel_main_loop
This is used to de-schedule the main loop function and destroy the kept closure object
src/emscripten.rs:66
Function
main
To build for the web: rustup target add asmjs-unknown-emscripten export EMCC_CFLAGS="-s USE_SDL=2" cargo build --target asmjs-unknown-emscripten && op
src/main.rs:19
Function
wrapper
Define a wrapper function that is compatible with the emscripten_set_main_loop function. This function will take care of extracting and executing our
src/emscripten.rs:50