jeremyletang / rust-sfml

SFML bindings for Rust
Other
631 stars 88 forks source link

Added RcText and RcFont. They follow the SAME exact principles as sprites #300

Closed dogunbound closed 1 year ago

dogunbound commented 1 year ago

The functions that do not have checks on whether the font exists or not have been pre-checked by me. You can look through https://github.com/SFML/SFML/blob/master/src/SFML/Graphics/Text.cpp to view which methods are safe to perform while the font is dead. They follow the same principle. They set a boolean, m_geometryNeedUpdate, to true and perform the transformations later on (for instance during draw). This PR shouldn't have any reason for UB.