Add SFML example (#133)
* Add SFML example
Adds a rough demo using SFML for rendering.
* Simplifications to SFML example
* Rely on sfml 0.16 rather than a git revision
* Avoid allocating temporary Path
* Take into account margin and spacing
* Directly produce a FloatRect, since it is what SFML needs
* Renamed VertexMesh to QuadMesh
* Use Vertex::with_pos_coords since we always passed Color::WHITE
* Removed TileLayer wrapper, since it added no value
* Removed handling of gid == 0 in Tilesheet::tile_rect
* Update contributors list
* Apply formatting
* Avoid the need to inverse the camera matrix
* De-hardcode the tile size
Also fixes the example a bit, because the map was drawn too small.
* Update workflow
* Try fixing CI issue by removing rust-cache
* Fix CI
* Fix map asset path
* Merge SFML and Rust workflow
* Misc changes
* Merge upstream/master
* Update example to master
* Fix line endings
* Fixed comment
Co-authored-by:
Thorbjørn Lindeijer <bjorn@lindeijer.nl>
Showing
- .github/workflows/rust.yml 5 additions, 3 deletions.github/workflows/rust.yml
- CONTRIBUTORS.md 2 additions, 1 deletionCONTRIBUTORS.md
- Cargo.toml 10 additions, 2 deletionsCargo.toml
- examples/sfml/main.rs 184 additions, 0 deletionsexamples/sfml/main.rs
- examples/sfml/mesh.rs 43 additions, 0 deletionsexamples/sfml/mesh.rs
- examples/sfml/tilesheet.rs 51 additions, 0 deletionsexamples/sfml/tilesheet.rs
... | ... | @@ -22,8 +22,16 @@ path = "src/lib.rs" |
name = "example" | ||
path = "examples/main.rs" | ||
[[example]] | ||
name = "sfml" | ||
path = "examples/sfml/main.rs" | ||
[dependencies] | ||
base64 = "0.13.0" | ||
xml-rs = "0.8.4" | ||
base64 = "0.13.0" | ||
xml-rs = "0.8.4" | ||
libflate = "1.1.2" | ||
zstd = { version = "0.10.0", optional = true } | ||
[dev-dependencies.sfml] | ||
version = "0.16" | ||
features = ["graphics"] |
examples/sfml/main.rs
0 → 100644
examples/sfml/mesh.rs
0 → 100644
examples/sfml/tilesheet.rs
0 → 100644
Please register or sign in to comment