- Add
cpp::CppString
andcpp::CppVector
to deal with C++ strings and vectors returned by SFML - Add provided method
Shape::points
to 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.0
in both axes. - Add
Image::new_solid
to create an image filled with a solid color - Add
Font::new
to create an empty font - Add
Window::new
to create a closed window - Add
RenderTexture::recreate
to recreate aRenderTexture
with new settings
- Rust requirement increased to 1.82
- Rename
SfBox
toFBox
to 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::Time
are nowconst fn
- Rename
Transform::get_matrix
toTransform::matrix
- Make
Transform::{new, matrix, inverse}
const fn
Image::new
now creates an empty image. SeeImage::new_solid
- Old
Window::new
is nowWindow::new_open
SoundRecorder
now requiresSend
- Make
RcFont::texture
returnRef
rather than "leak" a borrow - Make all fields on
RenderStates
public Texture::upate_from_pixels
is now a safe, checked function
- Fix building on Mac OS X
- Fix
Music::from_memory
having unbounded lifetime on the memory
ConvexShape::points
in favor ofShape::points
RenderStates::{new, set_texture, set_shader}
in favor of public fields
- Remove awkward
example_res!
macro from examples in favor of callingexample_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
- Added continuous integration for Windows MSVC, and Mac OS X
⚠️ Changed build process to statically link as much of SFML as possible. If you get a build error, open an issue!- Rework
LoadResult
toSfResult
as a more generic error type. - Use
SfResult
in a lot of APIs that previously returnedOption
,bool
, or panicked on error. - Fixed some methods on
Image
,RenderWindow
,RenderTexture
andWindow
to properly take&mut self
instead of&self
. - Examples now use
?
for error handling rather than.unwrap()
. SoundStream::get_data
now returns an immutable slice, as it should.SoundStream
now requiresSend
bound, as the samples are polled from a different thread.- Renamed
Image::create_from_pixels
toImage::from_pixels
- Remove
SfResource
trait. It's not required anymore. - Remove
Default
impl for clock becauseClock::start
can fail.
Texture::from_image
convenience method.- Clock example. Mostly just to have an example that only links against the system submodule.
- Improve
Debug
impl forSfBox
and opaque SFML types
- Fixed docs.rs build failing due to linking shenanigans. The new static linking model fixes this.
- Fixed potential unsoundness of
SoundStreamPlayer
holding a&mut SoundStream
simultaneously with SFML using it from another thread.
- Experiment with splitting up methods into different
impl
blocks, for better organization. SeeRenderWindow
's documentation for example. - Various minor doc fixes.
- Added
is_rgb
method forTexture
,RenderWindow
, andRenderTexture
- Add
RcTexture::raw_texture
to get the underlyingTexture
of anRcTexture
- Add direction arrow cursors from SFML 2.6 to
CursorType
- Add
Scancode
API from SFML 2.6. - Add tip about environment variables to README
Image::set_pixel
andImage::pixel_at
are now safe, checked functions. Added unsafe unchecked variants.- Renamed
SetPixelError
toPixelAccessError
- Rust requirement bumped to 1.81
- Made
Context::get_function
a safe function
- Minor doc fixes, including typos
- Fixed compilation error on Windows MinGW
rust-sfml 0.21 requires SFML 2.6. It will not work with 2.5.
- Added
RcFont
andRcText
for reference counted text (seeexamples/rc-resources.rs
) - pub const DEFAULT for
Vertex
is_smooth
andset_smooth
methods forFont
RenderWindow::recreate
method to recreate a window with new parameters
- Update
RcSprite
andRcTexture
documentation.
- Missing
#include
s in CSFML - Too restrictive lifetime for Music
Default
impl forColor
(transparent)- Help on using
LD_LIBRARY_PATH
for finding SFML shared libraries on *nix. RcTexture
andRcSprite
for reference counted textures (seeexamples/rc-resources.rs
)
- Removed
Sprite::disable_texture
, due to being an unsound API - Methods that used to take
&Rect
now takeRect
by value listener::set_up_vector
now TakesVector3f
instead of&Vector3f
- Use
usize
instead ofu32
forCustomShapePoints
- Use
usize
instead ofu32
forShape
methods - Use
usize
instead ofu32
inCircleShape
andConvexShape
methods
- Remove needless raw conversion methods for Rect
- Remove needless raw conversion methods for Vector2/Vector3
- Basic support for statically linking SFML
- Wrong doc comment for RenderTexture::new
- Joystick axis was inacessible in the JoystickMoved event
joystick::Axis
is now a proper enum
- Fix broken feature combinations (audio, graphics, system)
- Test non-default feature combinations in CI
- Examples for Vector3
- Examples for Vector2
- Examples for Rect
- Examples for RenderWindow
- Examples for Font
- Info about
SFML_INCLUDE_DIR
andSFML_LIBS_DIR
environment variables
window::clipboard::get_string()
now returnsString
instead of&'static SfStr
Color
now has public fields, removed the unnecessary getter/setter methods.
- Update requirements in the crate documentation
- Make
set_mouse_cursor
unsafe, as the cursor must stay alive while in use. - Fix wrong
Vector3::{AddAssign, SubAssign}
impls - Add
Hash
impl forCursorType