diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml new file mode 100644 index 000000000..de2e2cb4c --- /dev/null +++ b/.github/workflows/docs.yml @@ -0,0 +1,34 @@ +name: Docs + +on: [push] + +jobs: + docs: + runs-on: ubuntu-latest + if: github.ref == 'refs/heads/main' + steps: + - uses: actions/checkout@v3 + + - name: Install x11 dependencies for Kludgine + run: | + sudo apt-get update -y -qq + sudo add-apt-repository ppa:oibaf/graphics-drivers -y + sudo apt-get update + sudo apt-get install -y \ + libegl1-mesa libgl1-mesa-dri libxcb-xfixes0-dev mesa-vulkan-drivers + + - uses: dtolnay/rust-toolchain@stable + + - name: Generate Docs + run: | + cargo doc --no-deps --all-features + + - name: Deploy Docs + uses: JamesIves/github-pages-deploy-action@releases/v4 + with: + branch: gh-pages + folder: target/doc/ + git-config-name: kl-botsu + git-config-email: botsu@khonsulabs.com + target-folder: /main/ + clean: true \ No newline at end of file diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml new file mode 100644 index 000000000..e3ed58bdd --- /dev/null +++ b/.github/workflows/rust.yml @@ -0,0 +1,26 @@ +name: Tests + +on: [push] + +jobs: + test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - name: Install x11 dependencies for Kludgine + run: | + sudo apt-get update -y -qq + sudo add-apt-repository ppa:oibaf/graphics-drivers -y + sudo apt-get update + sudo apt-get install -y \ + libegl1-mesa libgl1-mesa-dri libxcb-xfixes0-dev mesa-vulkan-drivers + - uses: dtolnay/rust-toolchain@stable + + - name: Run clippy + run: | + cargo clippy + + - name: Run default features unit tests + run: | + cargo test diff --git a/README.md b/README.md index d6b9100cc..e9412f57d 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,26 @@ # Kludgine (Redux) -This branch is a rewrite of Kludgine, aiming to be a lightweight, efficient 2d -rendering option for `wgpu`-based applications. +This branch is a rewrite of Kludgine. See the [v0.5.0 tag][v0.5] for the +currently released source. + +Kludgine aims to be a lightweight, efficient 2d rendering framework powered by +[wgpu][wgpu]. Its name Kludgine is named in a way to hopefully be ironic in +nature, but it's being designed and written by a developer that is fairly new to +modern graphics programming and rust. Thus, it is probably a [kludge][kludge]. + +Without the `app` feature enabled, Kludgine provides an API inspired by wgpu's +[Encapsulating Graphics Work][encapsulating] article. + +TODO create an embedded wgpu example + +With the `app` feature enabled, Kludgine provides an easy-to-use API for running +multi-window applications. + +The API is still a work in progress. The [`examples`][examples] folder contains many +examples that highlight a specific feature. + +[v0.5]: https://github.com/khonsulabs/kludgine/tree/v0.5.0 +[wgpu]: https://github.com/gfx-rs/wgpu +[kludge]: https://en.wikipedia.org/wiki/Kludge +[encapsulating]: https://github.com/gfx-rs/wgpu/wiki/Encapsulating-Graphics-Work +[examples]: https://github.com/khonsulabs/kludgine/tree/main/examples diff --git a/examples/basic.rs b/examples/basic.rs index c54962849..a8d852070 100644 --- a/examples/basic.rs +++ b/examples/basic.rs @@ -13,6 +13,7 @@ fn main() { kludgine::app::run(move |mut renderer, mut window| { window.redraw_in(Duration::from_millis(16)); angle += Angle::degrees(180) * window.elapsed().as_secs_f32(); + let shape_center = Point::new(RED_SQUARE_SIZE / 2, RED_SQUARE_SIZE / 2); renderer.draw_shape( &Shape::filled_rect( Rect::::new( @@ -21,14 +22,14 @@ fn main() { ), Color::RED, ), - Point::::new(RED_SQUARE_SIZE / 2, RED_SQUARE_SIZE / 2), + shape_center, Some(angle), None, ); renderer.draw_text( "Hello, World!", TextOrigin::Center, - Point::::new(RED_SQUARE_SIZE / 2, RED_SQUARE_SIZE / 2), + shape_center, Some(angle), None, );