17cupsofcoffee / tetra

🎮 A simple 2D game framework written in Rust
MIT License
907 stars 63 forks source link

Tetra 0.7 #297

Closed 17cupsofcoffee closed 2 years ago

17cupsofcoffee commented 2 years ago

Some breaking changes are starting to pile up, so I think it's time to start thinking about Tetra 0.7!

I don't expect there to be any huge API changes - this is just an opportunity to clean a few things up.

Work so far: https://github.com/17cupsofcoffee/tetra/compare/0.7 Changelog: https://github.com/17cupsofcoffee/tetra/blob/0.7/CHANGELOG.md

Current roadmap (subject to change):

Note: I've crossed out a few items that I don't think I have the bandwidth to do at the moment.

tesselode commented 2 years ago

My thoughts:

17cupsofcoffee commented 2 years ago

Find a way to make graphics settings not rely on global state (blend mode, stencil state, etc.)

Good call - I had a go at trying to implement something like Love2D's state stack before and trying to do it in a non-breaking way seemed like it'd be an absolute nightmare. Can't guarentee I'll find a nice solution for 0.7, but I'll give it some thought (if you have any ideas of what this API could look like, I'm all ears!)

Rename functions like get_window_size to just window_size (more idiomatic naming in the Rust community)

This is definitely idiomatic for field getter methods on a struct, but I'm less sure what the consensus is for free functions? I'll have a look at what other libraries do there.

Change API to use mint instead of vek

I'm open to this if it doesn't make the API more awkward to use - I've never really tried mint so I don't know how it works in practice!

tesselode commented 2 years ago

I've never really tried mint so I don't know how it works in practice!

In ggez, functions that take vectors or other math types are generic and they let you pass in anything that implements Into<mint::Vec2> (or the appropriate mint type). That way you can pass in types from any library that has mint support.

17cupsofcoffee commented 2 years ago

I think taking mint types as parameters would be okay, the bit I'm less keen on is the cases where we return stuff like Vec2 - could be a bit gross to have to convert the return value back to your own type every time. But might be worth it for the improvements elsewhere, I'll give it a go and see how I feel about it :)