Skip to content

Commit

Permalink
Adding docs and test workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
ecton committed Jul 11, 2023
1 parent 936a65d commit b5279fe
Show file tree
Hide file tree
Showing 4 changed files with 87 additions and 4 deletions.
34 changes: 34 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -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: [email protected]
target-folder: /main/
clean: true
26 changes: 26 additions & 0 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
@@ -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
26 changes: 24 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -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
5 changes: 3 additions & 2 deletions examples/basic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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::<Lp>::new(
Expand All @@ -21,14 +22,14 @@ fn main() {
),
Color::RED,
),
Point::<Lp>::new(RED_SQUARE_SIZE / 2, RED_SQUARE_SIZE / 2),
shape_center,
Some(angle),
None,
);
renderer.draw_text(
"Hello, World!",
TextOrigin::Center,
Point::<Lp>::new(RED_SQUARE_SIZE / 2, RED_SQUARE_SIZE / 2),
shape_center,
Some(angle),
None,
);
Expand Down

0 comments on commit b5279fe

Please sign in to comment.