Port engine_handle_cmd() to Rust.
Switch from 0 as ... to ptr::null().
Port main event loop to Rust.