-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updated to bevy 0.4 and added webgl/wasm support.
- Loading branch information
Showing
17 changed files
with
585 additions
and
344 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# NOTE: For maximum performance, build using a nightly compiler | ||
# If you are using rust stable, remove the "-Zshare-generics=y" below. | ||
|
||
[target.x86_64-unknown-linux-gnu] | ||
linker = "/usr/bin/clang" | ||
rustflags = ["-Clink-arg=-fuse-ld=lld", "-Zshare-generics=y"] | ||
|
||
# NOTE: you must manually install https://github.com/michaeleisel/zld on mac. you can easily do this with the "brew" package manager: | ||
# `brew install michaeleisel/zld/zld` | ||
[target.x86_64-apple-darwin] | ||
rustflags = ["-C", "link-arg=-fuse-ld=/usr/local/bin/zld", "-Zshare-generics=y", "-Zrun-dsymutil=no"] | ||
|
||
[target.x86_64-pc-windows-msvc] | ||
linker = "rust-lld.exe" | ||
rustflags = ["-Zshare-generics=y"] | ||
|
||
# Optional: Uncommenting the following improves compile times, but reduces the amount of debug info to 'line number tables only' | ||
# In most cases the gains are negligible, but if you are on macos and have slow compile times you should see significant gains. | ||
#[profile.dev] | ||
#debug = 1 |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"cSpell.words": [ | ||
"Boid", | ||
"Inconsolata", | ||
"bidimensional", | ||
"boids", | ||
"spacefield", | ||
"vsync", | ||
"wasm", | ||
"webgl" | ||
] | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,25 @@ | ||
[package] | ||
name = "bevy_test" | ||
version = "0.1.0" | ||
version = "0.1.1" | ||
authors = ["John Peel <[email protected]>"] | ||
edition = "2018" | ||
|
||
[features] | ||
default = [ | ||
"bevy/bevy_winit", | ||
"bevy/render", | ||
"bevy/png", | ||
] | ||
|
||
native = [ | ||
"bevy/bevy_wgpu", | ||
] | ||
|
||
web = [ | ||
"bevy_webgl2" | ||
] | ||
|
||
[dependencies] | ||
bevy = "0.1.3" | ||
rand = "0.7" | ||
bevy = { version = "0.4", default-features = false } | ||
bevy_webgl2 = { version = "0.4", optional = true } | ||
rand = "0.8" |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
[env] | ||
ENV_DIR = {source="${CARGO_MAKE_PROFILE}", default_value = "debug", mapping = {release = "release"}} | ||
CARGO_TARGET_DIR = {value = "target", condition = {env_not_set = ["CARGO_TARGET_DIR"]}} | ||
CARGO_WASM_PATH = "${CARGO_TARGET_DIR}/wasm32-unknown-unknown/${ENV_DIR}/${CARGO_MAKE_CRATE_NAME}.wasm" | ||
CARGO_PROFILE = "dev" | ||
TARGET_DIR = "target" | ||
CARGO_MANIFEST_DIR = "${CARGO_MAKE_WORKING_DIRECTORY}" | ||
|
||
[env.release] | ||
CARGO_RELEASE_ARGS = "--release" | ||
|
||
[tasks.show-env] | ||
command = "env" | ||
|
||
[tasks.basic-http-server] | ||
install_crate = {crate_name = "basic-http-server", binary = "basic-http-server", test_arg="--help"} | ||
|
||
[tasks.wasm-bindgen-cli] | ||
install_crate = {crate_name = "wasm-bindgen-cli", binary = "wasm-bindgen", test_arg="--help"} | ||
|
||
[tasks.cargo-build-web] | ||
args = ["build", "--target", "wasm32-unknown-unknown", "--features", "web", "@@split(CARGO_RELEASE_ARGS, )"] | ||
command = "cargo" | ||
|
||
[tasks.build-web] | ||
args = ["--out-dir", "${TARGET_DIR}", "--out-name", "wasm", "--target", "web", "--no-typescript", "${CARGO_WASM_PATH}"] | ||
command = "wasm-bindgen" | ||
dependencies = ["cargo-build-web", "wasm-bindgen-cli"] | ||
|
||
[tasks.build-native] | ||
args = ["build", "--features", "native", "@@split(CARGO_RELEASE_ARGS, )"] | ||
command = "cargo" | ||
|
||
[tasks.run] | ||
command = "${CARGO_TARGET_DIR}/${ENV_DIR}/${CARGO_MAKE_BINARY_EXECUTABLE_NAME}" | ||
dependencies = ["build-native"] | ||
|
||
[tasks.serve] | ||
command = "basic-http-server" | ||
args = ["-x"] | ||
dependencies = ["build-web", "basic-http-server"] | ||
|
||
[tasks.test] | ||
disabled = true |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,9 @@ | ||
Steering behaviors flocking example using bevy & Rust. | ||
|
||
This repo is setup for Fast Compiles with bevy. See: https://bevyengine.org/learn/book/getting-started/setup/#enable-fast-compiles-optional | ||
This repo is setup for Fast Compiles with bevy. See: https://bevyengine.org/learn/book/getting-started/setup/#enable-fast-compiles-optional | ||
|
||
You will need cargo-make to run any of the following commands. | ||
It can be installed with `cargo install cargo-make` | ||
|
||
Run native with: `cargo make run` | ||
Run wasm/webgl with: `cargo make serve` |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<html lang="en"> | ||
<head> | ||
<meta charset="utf-8" /> | ||
<title>Flocking Example</title> | ||
</head> | ||
<body> | ||
<script type="module"> | ||
import init from "./target/wasm.js"; | ||
init(); | ||
</script> | ||
</body> | ||
</html> |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.