mirror of
https://github.com/lisk77/comet.git
synced 2025-10-23 21:38:50 +00:00
update README
This commit is contained in:
parent
e5f5c2976f
commit
82d112b9d5
1 changed files with 27 additions and 0 deletions
27
README.md
27
README.md
|
@ -15,6 +15,7 @@ The project structure should look like this:
|
|||
```
|
||||
project
|
||||
│ Cargo.toml
|
||||
│ build.rs
|
||||
│ src
|
||||
│ └── main.rs
|
||||
│ resources
|
||||
|
@ -50,6 +51,32 @@ fn main() {
|
|||
}
|
||||
```
|
||||
|
||||
```rust
|
||||
// build.rs
|
||||
|
||||
use anyhow::*;
|
||||
use fs_extra::copy_items;
|
||||
use fs_extra::dir::CopyOptions;
|
||||
use std::env;
|
||||
|
||||
fn main() -> Result<()> {
|
||||
// This tells cargo to rerun this script if something in /resources/ changes.
|
||||
println!("cargo:rerun-if-changed=resources/textures/*");
|
||||
println!("cargo:rerun-if-changed=resources/shaders/*");
|
||||
|
||||
let out_dir = env::var("OUT_DIR")?;
|
||||
let mut copy_options = CopyOptions::new();
|
||||
copy_options.overwrite = true;
|
||||
let mut paths_to_copy = Vec::new();
|
||||
paths_to_copy.push("resources/textures/");
|
||||
paths_to_copy.push("resources/shaders/");
|
||||
|
||||
copy_items(&paths_to_copy, out_dir, ©_options)?;
|
||||
|
||||
Ok(())
|
||||
}
|
||||
```
|
||||
|
||||
## Todo
|
||||
(not ordered by importance)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue