Skip to content

A Rust Crate for Sprite Rendering (WIP)

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT
Notifications You must be signed in to change notification settings

Rodrigodd/sprite-render-rs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

83 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Sprite Render

A rust crate for rendering textured rects, with multiple backends (only two flavors of OpenGL for now).

Backends

  • A noop implementation
  • OpenGL >2.0 (Including ES)
  • WebGl
  • Directx11? Directx12? (I have windows at least)
  • Vulkan? (My only device with Vulkan support is an Android)
  • Metal? (I don't have an Apple device)
  • Wgpu? (I have written this to avoid the bloat of gfx-hal)

Run an example

Preview of the example running

You need to enable the feature of a backend to run an example:
cargo run --example main --features=opengl

Run example on Web

cargo build --example main --target=wasm32-unknown-unknown --features=webgl
wasm-bindgen ./target/wasm32-unknown-unknown/debug/examples/main.wasm --target web --no-typescript --out-dir ./dist
wasm-opt ./dist/main_bg.wasm -o ./dist/main_bg.wasm -O # (optional)

cargo build --example main --target=wasm32-unknown-unknown --features=webgl && wasm-bindgen ./target/wasm32-unknown-unknown/debug/examples/main.wasm --target web --no-typescript --out-dir ./dist && wasm-opt ./dist/main_bg.wasm -o ./dist/main_bg.wasm -O # (optional)

Run example on Android

This library makes use of the ndk-rs crates, refer to that repo for more documentation.

Make an example compile to a library:

// add to Cargo.toml
[[example]]
name = "main"
crate-type = ["cdylib"]
path = "examples/main.rs"

And then run the example by executing cargo apk run --example main --features=opengl. Use adb logcat sprite-render:I *:S RustStdoutStderr:D to get the logs.

License

Licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

About

A Rust Crate for Sprite Rendering (WIP)

Resources

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages