Changelog¶
0.2.1 (12/08/2012):
RenderWindow.display()doesn’t release the GIL anymore, as it would cause segmentation faults when integrating with PyQt.- Fixed crashes when comparing
Timeobjects withNone. - Removed the default font, since it was removed in C++ SFML. If you still encounter crashes at the end of the program on Windows, this should fix it.
0.2 (07/20/2012):
Keyboard.BACKhas been renamed toKeyboard.BACK_SPACE, to fit with the C++ SFML change.- Added support for file streaming: see
SoundStream,SoundBuffer.load_from_stream(),Music.open_from_stream(),Font.load_from_stream(),Image.load_from_stream(),Texture.load_from_stream(),Shader.load_both_types_from_stream()andShader.load_from_stream(). RectangleShape.sizedoesn’t raise exceptions for no reason anymore.- Removed
RenderTexture.create(), the constructor should be used instead. RenderTexture.activenow raises an exception when setting it causes an error.- Added
copy()and__repr__()methods inVertex. - Removed
View.get_transform()andView.get_inverse_transform(); SFML’s documentation says they are meant for internal use only. View.from_rect()andView.reset()now accept tuples.- Setting
Shape.texturetoNonenow does the right thing at the C++ level (it sets the underlying texture pointer toNULL). - The API reference should now be complete, and it has been reorganized to avoid huge pages. A FAQ page has been started.
0.1.3 (06/19/2012):
- Replaced
Sprite.text_rectwith twoSprite.get_texture_rect()andSprite.set_texture_rect(). RenderStates‘ constructor now takes a blend mode as its first parameter.- Added missing methods in
ConvexShape(get_point(),get_point_count(),set_point(),set_point_count()). Thepoint_countattribute has been removed. - Added
RenderWindow.height,RenderWindow.width,Texture.bind(),Texture.NORMALIZED,Texture.PIXELS,Color.TRANSPARENT,Image.flip_horizontally(),Image.flip_vertically()andRenderWindow.active. Glyph‘s attributes are now modifiable.RenderWindow.wait_event()now raisesPySFMLExceptionwhen the underlying C++ method fails. (In the past, the error would be ignored.)Image.get_pixels()now returns None when the image is empty.Image.get_pixel()andImage.set_pixel()now raiseIndexErrorif the pixel coordinates are out of range.Image.save_to_file()now raisesPySFMLExceptionwhen an error occurs.- The constructors of
Keyboard,MouseandStylenow raiseNotImplementedError. - Fixed a bug where SFML would fail to raise an exception. This
typically happened when a tuple, a
FloatRector anIntRectwas expected, but another type was passed. - Added the tests in the source release.
- Completed the documentation of many graphics classes.
0.1.2:
- Added copy() methods in
Transform,IntRect,FloatRect,TimeandSprite. RenderTarget.draw()now also accepts a tuple of vertices. Also fixed error handling when the objects contained in the list/tuple have the wrong type.- Added
==and!=operators inIntRectandFloatRect. Transform‘s constructor now creates an identity transform when called with no arguments.- Transform now supports the
*=operator. (It already worked in the past, because Python will automatically use the*operator if*=isn’t provided, but it’s slower.) SoundBuffer.save_to_file()now raises an exception in case of failure. (In the past, it didn’t report errors in any way.)- Removed
Chunk.sample_countandSoundBuffer.sample_count. Instead, uselen(Chunk.samples)``and ``len(SoundBuffer.samples), respectively. SoundBuffer.load_from_samples()now uses strings/bytes (for Python 2/3, respectively) instead of list.- Fixed bugs in
Font,ImageandShaderclassmethods that load from strings/bytes objects. - Added
Joystick.update(). Transformableisn’t abstract anymore, and can be inherited safely.- Completed the events and audio documentation, added documentation for some graphics classes.
- Expanded the tutorial for C++ developers.
0.1.1:
- The
seconds(),milliseconds()andmicroseconds()functions are removed. Use theTimeconstructor with keyword arguments instead, e.g.milliseconds(200)becomesTime(milliseconds=200). - Made Sprite more straightforward to inherit,
__cinit__()won’t raise errors because it automatically gets passed the constructor arguments anymore. - Fixed a bug in Time where some arithemtic operators would always raise an exception.
- Fixed a bug in RenderStates where internal attributes and properties got mismatched because they had the same name.
- Added a
__repr__()method inTime(mostly to have more readable unit test errors,__str__()already existed in the past). - Documentation: added a “caveats” page, and a new tutorial for people who are coming from a C++ SFML background.
- Added some unit tests.
0.1:
- The module is now called sfml. To keep using the sf prefix, import the module
with
import sfml as sf. - Python 3 users don’t need to use bytes instead of strings
anymore. When a C++ method expects a byte string and the user passes
a Unicode object, it is encoded to a byte string with
sfml.default_encoding(UTF-8 by default, you can change it as needed). - Added the
Listenerclass. - Added audio streaming (still lacking performance-wise).
- Added
Texture.copy_to_image(). - Improved examples.
- Fixed various bugs and memory leaks.