Skip to content

Commit

Permalink
Merge pull request #29 from johanhelsing/bevy-0.12
Browse files Browse the repository at this point in the history
Bevy 0.12
  • Loading branch information
johanhelsing committed Nov 19, 2023
2 parents 5df3bd5 + 6830522 commit 66d9249
Show file tree
Hide file tree
Showing 19 changed files with 426 additions and 441 deletions.
57 changes: 13 additions & 44 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,59 +8,28 @@ name: ci

jobs:
check:
name: Check
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v2

- name: Install stable toolchain
uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable

- name: Rust Cache
uses: Swatinem/rust-cache@v2

- name: Run cargo check
run: cargo check
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- run: cargo check

test:
name: Test Suite
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v2

- name: Install stable toolchain
uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable

- name: Rust Cache
uses: Swatinem/rust-cache@v2

- name: Run cargo test
run: cargo test
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- run: cargo test

lints:
name: Lints
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v2

- name: Install stable toolchain
uses: dtolnay/rust-toolchain@stable
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
components: rustfmt, clippy

- name: Rust Cache
uses: Swatinem/rust-cache@v2

- name: Run cargo fmt
run: cargo fmt --all -- --check

- name: Run cargo clippy
run: cargo clippy -- -D warnings
- uses: Swatinem/rust-cache@v2
- run: cargo fmt --all -- --check
- run: cargo clippy -- -D warnings
17 changes: 9 additions & 8 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,27 +7,28 @@ keywords = ["gamedev", "bevy", "sdf"]
license = "MIT OR Apache-2.0"
name = "bevy_smud"
repository = "https://github.com/johanhelsing/bevy_smud"
version = "0.6.0"
version = "0.7.0"

[dependencies]
bevy = { version = "0.11", default-features = false, features = [
bevy = { version = "0.12", default-features = false, features = [
"bevy_core_pipeline",
"bevy_render",
"bevy_asset", # needed for handle ids
]}
bytemuck = { version = "1.7", features = ["derive"] }
copyless = "0.1"
bitflags = "2.4"
fixedbitset = "0.4"

[dev-dependencies]
bevy = {version = "0.11", default-features = false, features = [
bevy = { version = "0.12", default-features = false, features = [
"bevy_winit",
"x11", # github actions runners don't have libxkbcommon installed, so can't use wayland
"filesystem_watcher",
]}
bevy_asset_loader = "0.17"
bevy_lospec = "0.5"
bevy_pancam = "0.9"
"file_watcher",
] }
bevy_asset_loader = "0.18"
bevy_lospec = "0.6"
bevy_pancam = "0.10"
rand = "0.8"

[profile.dev]
Expand Down
10 changes: 4 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,8 @@ use bevy_smud::prelude::*;

fn main() {
App::new()
.add_plugins(DefaultPlugins)
.add_plugin(SmudPlugin)
.add_startup_system(setup)
.add_plugins((DefaultPlugins, SmudPlugin))
.add_systems(Startup, setup)
.run();
}

Expand Down Expand Up @@ -87,11 +86,10 @@ If you want something more finished, you should probably check out [bevy_prototy

The `main` branch targets the latest bevy release.

I intend to support the `main` branch of Bevy in the `bevy-main` branch.

|bevy|bevy_smud|
|----|---------|
|0.11|0.6, main|
|0.12|0.7, main|
|0.11|0.6 |
|0.10|0.5 |
|0.9 |0.4 |
|0.8 |0.3 |
Expand Down
4 changes: 2 additions & 2 deletions assets/bevy.wgsl
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ fn bevy_head(p: vec2<f32>) -> f32 {
return min(skull, beak);
}

fn sdf(p: vec2<f32>) -> f32 {
fn sdf(p_in: vec2<f32>) -> f32 {
let scale = 300.0;
var p = p / scale;
var p = p_in / scale;

let p_upper_wing = p - vec2<f32>(-0.3, -0.25);
let upper_wing = max(
Expand Down
4 changes: 2 additions & 2 deletions assets/fragment.wgsl
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#define_import_path smud::fragment

#import smud::sdf as sdf
#import smud::fill as fill
#import smud::sdf
#import smud::fill

struct FragmentInput {
@location(0) color: vec4<f32>,
Expand Down
4 changes: 2 additions & 2 deletions assets/gallery/stairs.wgsl
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

#import smud

fn sdf(p: vec2<f32>) -> f32 {
fn sdf(p_in: vec2<f32>) -> f32 {
let s = 5.;
let p = p - vec2<f32>(-20.);
let p = p_in - vec2<f32>(-20.);
return smud::sd_stairs(p / s, vec2<f32>(1.), 8.) * s;
}
Loading

0 comments on commit 66d9249

Please sign in to comment.