Releases: jeremyletang/rust-sfml
Releases · jeremyletang/rust-sfml
v0.25.0
0.25.0
This is the final SFML 2.x release.
There might be some bugfix releases if needed though.
Added
- Option to dynamically link FLAC and ogg
- Some conversion functions between arrays, tuples, and
Vector2/Vector3 - Make
VideoModeconstructible from arrays - Geometry shader example
Changed
- Now requires Rust edition 2024, Rust 1.86
- Implement
SendandSyncfor more types
Fixed
- Potentially fix some crashes on OS X
Texture::update_from_pixelsbounds check being too conservative
0.24.0
Added
- Add
cpp::CppStringandcpp::CppVectorto deal with C++ strings and vectors returned by SFML - Add provided method
Shape::pointsto get an iterator over the points of a shape - Add
From<T> for Vector2<T>. This allows things likemy_sprite.set_scale(2.0),
to scale to2.0in both axes. - Add
Image::new_solidto create an image filled with a solid color - Add
Font::newto create an empty font - Add
Window::newto create a closed window - Add
RenderTexture::recreateto recreate aRenderTexturewith new settings
Changed
- Rust requirement increased to 1.82
- Rename
SfBoxtoFBoxto emphasize the fact it doesn't only deal with SFML objects, but
multiple kinds of foreign objects. (F stands for "foreign") - All methods on
system::Timeare nowconst fn - Rename
Transform::get_matrixtoTransform::matrix - Make
Transform::{new, matrix, inverse}const fn Image::newnow creates an empty image. SeeImage::new_solid- Old
Window::newis nowWindow::new_open SoundRecordernow requiresSend- Make
RcFont::texturereturnRefrather than "leak" a borrow - Make all fields on
RenderStatespublic Texture::upate_from_pixelsis now a safe, checked function
Fixed
- Fix building on Mac OS X
- Fix
Music::from_memoryhaving unbounded lifetime on the memory
Removed
ConvexShape::pointsin favor ofShape::pointsRenderStates::{new, set_texture, set_shader}in favor of public fields
Documentation and examples
- Remove awkward
example_res!macro from examples in favor of calling
example_ensure_right_working_dir()at the beginning of main. - Improve some examples, showcase more API usages in them
- Leverage "scrape examples" functionality of rustdoc in docs.rs generated documentation
- Add "positional audio" example
Internal improvements
- Added continuous integration for Windows MSVC, and Mac OS X
0.23.0 - Vendored SFML
This release removes the need for having to have SFML installed on your system.
SFML is vendored and built from source using CMake, so you need to have CMake and a C++ toolchain installed.
Changed
⚠️ Changed build process to statically link as much of SFML as possible. If you get a build error, open an issue!- Rework
LoadResulttoSfResultas a more generic error type. - Use
SfResultin a lot of APIs that previously returnedOption,bool, or panicked on error. - Fixed some methods on
Image,RenderWindow,RenderTextureandWindowto properly take&mut selfinstead of&self. - Examples now use
?for error handling rather than.unwrap(). SoundStream::get_datanow returns an immutable slice, as it should.SoundStreamnow requiresSendbound, as the samples are polled from a different thread.- Renamed
Image::create_from_pixelstoImage::from_pixels
Removed
- Remove
SfResourcetrait. It's not required anymore. - Remove
Defaultimpl for clock becauseClock::startcan fail.
Added
Texture::from_imageconvenience method.- Clock example. Mostly just to have an example that only links against the system submodule.
Improved
- Improve
Debugimpl forSfBoxand opaque SFML types
Fixed
- Fixed docs.rs build failing due to linking shenanigans. The new static linking model fixes this.
- Fixed potential unsoundness of
SoundStreamPlayerholding a&mut SoundStreamsimultaneously with SFML
using it from another thread.
Documentation
- Experiment with splitting up methods into different
implblocks, for better organization.
SeeRenderWindow's documentation for example. - Various minor doc fixes.
0.22.0
Added
- Added
is_rgbmethod forTexture,RenderWindow, andRenderTexture - Add
RcTexture::raw_textureto get the underlyingTextureof anRcTexture - Add direction arrow cursors from SFML 2.6 to
CursorType - Add
ScancodeAPI from SFML 2.6. - Add tip about environment variables to README
Changed
Image::set_pixelandImage::pixel_atare now safe, checked functions. Added unsafe unchecked variants.- Renamed
SetPixelErrortoPixelAccessError - Rust requirement bumped to 1.81
- Made
Context::get_functiona safe function
Fixed
- Minor doc fixes, including typos
- Fixed compilation error on Windows MinGW
SFML 2.6 compatibility
SFML 2.6 update
rust-sfml 0.21 requires SFML 2.6. It will not work with 2.5.
Added
- Added
RcFontandRcTextfor reference counted text (seeexamples/rc-resources.rs) - pub const DEFAULT for
Vertex is_smoothandset_smoothmethods forFontRenderWindow::recreatemethod to recreate a window with new parameters
Changed
- Update
RcSpriteandRcTexturedocumentation.
Fixed
- Missing
#includes in CSFML - Too restrictive lifetime for Music
v0.20.0
Added
Defaultimpl forColor(transparent)- Help on using
LD_LIBRARY_PATHfor finding SFML shared libraries on *nix. RcTextureandRcSpritefor reference counted textures (seeexamples/rc-resources.rs)
Changed
- Removed
Sprite::disable_texture, due to being an unsound API - Methods that used to take
&Rectnow takeRectby value listener::set_up_vectornow TakesVector3finstead of&Vector3f- Use
usizeinstead ofu32forCustomShapePoints - Use
usizeinstead ofu32forShapemethods - Use
usizeinstead ofu32inCircleShapeandConvexShapemethods
Internal improvements
- Remove needless raw conversion methods for Rect
- Remove needless raw conversion methods for Vector2/Vector3
0.19.0
Added
- Basic support for statically linking SFML
Fixed
- Wrong doc comment for RenderTexture::new
- Joystick axis was inacessible in the JoystickMoved event
Changed
joystick::Axisis now a proper enum
v0.18.0
Added
- Examples for Vector3
- Examples for Vector2
- Examples for Rect
- Examples for RenderWindow
- Examples for Font
- Info about
SFML_INCLUDE_DIRandSFML_LIBS_DIRenvironment variables
Changed
window::clipboard::get_string()now returnsStringinstead of&'static SfStrColornow has public fields, removed the unnecessary getter/setter methods.
Fixed
- Update requirements in the crate documentation
- Make
set_mouse_cursorunsafe, as the cursor must stay alive while in use. - Fix wrong
Vector3::{AddAssign, SubAssign}impls - Add
Hashimpl forCursorType
v0.17.0
Changelog
- Replaced CSFML dependency with a vendored CSFML fork, which is built by rust-sfml and linked statically.
Now there is no dependency on CSFML anymore.
However, a C++ compiler is now required to build-rust SFML, as we are building our own CSFML-like binding. - Added spritemark example to show off the rendering speed that can be achieved with vertex arrays.
- Fixed unsoundness in
InputStream - Added
RectangleShape::from_rect - Removed
VertexArrayin favor ofRenderTarget::draw_primitives, which takes a slice of vertices. - Added
graphics::vertex_array_boundsto replaceVertexArray::get_bounds - Enabled null pointer optimization to a bunch of types that are never null
- Added Rust version of the SFML OpenGL example
- Made
Shaderconstructors only allow valid combinations of vertex/fragment/geometry - Made pong example more exciting. It speeds up as the game goes on.
- Derived a bunch more traits like
Hashfor some types - Made a bunch of previously wrongly-safe functions unsafe
- Added a bunch of conversion functions for conversion between different
Vector2/Vector3types - Added optional support for serde for a few types, like
Rect - Removed
SfBoolcompletely. Now you can just usebooleverywhere. - Once again, a bunch of other various (breaking) changes. Sorry.
v0.16.0
New features
- Implement VertexBuffer
- Add a few previously missing derives to a few types
- Add
system_handlemethod toWindowandRenderWindow.
Soundness fixes
- Add some thread safety checks for the window module. See #227.
- CircleShape::set_radius now takes &mut self
API improvements
- Add
#[must_use]attribute to APIs that return things that should not be ignored. - Make a bunch of APIs
const fn - Allow SfBox to be used in generic contexts, using the
SfResourcetrait.
Refactorings/Breaking changes
- Transition various enums that were previously transmuted to associated consts. This avoids unnecessary unsafe code and maps more cleanly to the underlying C API of CSFML. This means a bunch of names are now
UPPER_CASEinstead ofCamelCase. For exampleKey::EqualbecomesKey::EQUAL, because it's an associated const. - Remove a few API elements that are deprecated in SFML, like
Key::Return. UseKey::ENTERinstead. - Network module is removed entirely. It has been broken and unmaintained for a long time, and there are much better alternatives when using Rust, including the standard library.
SfBoxnow lives in the crate root, notsystem.- Due to the thread safety fixes,
Window/RenderWindowcan only be used on the main thread. They can't be accessed from different threads. - Various minor refactorings/improvements