jeremyletang / rust-sfml

SFML bindings for Rust
Other
638 stars 88 forks source link

Added simple type conversions for rect, vector2, and vector3. #263

Closed dogunbound closed 2 years ago

dogunbound commented 2 years ago

I feel that a simple type conversion is needed between: IntRect and FloatRect Vector2i, Vector2f, and Vector2u Vector3i, and Vector3f

Also, simply warn the user in documentation that conversions that don't "fit" (i.e. f32::MAX doesn't convert nicely into i32) will silently fail with no warning. Let the user worry about what datatype fit into where.

dogunbound commented 2 years ago

Gonna rewrite it with macros instead. Didn't know I about them.