-
-
Save heavyrain266/824593ae4a961f1c1cf712e1cfc1ffb7 to your computer and use it in GitHub Desktop.
Reference for running rust on consoles
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// rust.h | |
extern void rust_main(); | |
// main.c | |
#import "rust.h" | |
void main() | |
{ | |
rust_main(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use bevy::prelude::*; | |
fn main() { | |
App::new() | |
.add_system(hello_world_system) | |
.run(); | |
} | |
fn hello_world_system() { | |
println!("hello world"); | |
} | |
#[no_mangle] | |
extern "C" fn rust_main() { | |
main(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment