SFML community forums

General => General discussions => Topic started by: Sonkun on April 23, 2013, 03:48:59 pm

Title: News regarding the Python bindings (python-sfml)
Post by: Sonkun on April 23, 2013, 03:48:59 pm
Version 1.2 is out

Version 1.2 has been released since November 2012, offering new features.

First and foremost, the bindings have been relicenced from GPLv3 to the much more liberal LGPLv3.

Secondly, the load/open/create methods have been deprecated in favor of their from_foo counterparts, which we believe more closely resemble the standard library's naming conventions. Similarly, the save/conversion methods have been deprecated in favor of to_bar methods.

The voip example is now available and various multi-threading issues have been fixed.

Be sure to check out the website for Windows installers and Debian packages.

For a complete list of changes, check out the changelog: http://python-sfml.org/1.2/changelog.html

Known bug in this version: convert_coords methods return None no matter what. This is already fixed in the master branch, so you'll need to compile from source or wait for version 1.3 to get past this limitation.

Thor library is almost ported

In addition, most of the Thor library modules have been ported and can be interpolated with the SFML bindings. This port joins sfeMovie in the list of officially supported add-ons.

It consists of a top-level thor package which in-turn is composed of nine modules. Here's a table showing their implementation status.

ModulesStatusRemarks
TimeImplemented
ParticleImplemented
AnimationImplementedLimitation: so far, can only animate a sprite :/
GraphicsImplementedColorGradient creation is different from C++
ShapesImplemented
VectorPartially implemented
MathPartially implemented
EventsNot implemented
ResourcesNot implemented

For more information, visit the thor section of the website: http://thor.python-sfml.org.

Version 1.3 coming soon

Version 1.3 is set to be released in conjunction with the official release of SFML2. The API, tutorials and documentation will thoroughly be updated to match the latest changes from the SFML2 codebase.

As packages won't be made  available beforehand, you'll need to compile the bindings from source if you wish to get a sneak peak of these upcoming chnages (sfml_latest branch). Details on how to do this can be found below.

In this “final” version, you'll be able to embed Python code into your C++ application and write your own extensions using the C/Cython API. We've dedicated an entire section of the documentation on how to do this, complete with two working examples (embedding and extending).
Title: Re: News regarding the Python bindings (python-sfml)
Post by: Nexus on April 24, 2013, 08:13:34 pm
Thor library is almost ported
Wow, very nice. :)

An important note: As mentioned on my homepage, Thor is partially still under heavy changes (especially the Particles module is planned to be modified), so you should maybe wait some time before you port everything. Take a look at the progress site (http://www.bromeon.ch/libraries/thor/progress.html) to see what's planned.

Also, I wonder if there were no problems because of language limitations? I use a lot of advanced C++ techniques (templates, std::function, Aurora stuff), and I could imagine some of them are difficult to bring to Python...

[Edit] I announced your binding on Thor's download page (http://www.bromeon.ch/libraries/thor/download.html). Furthermore, I think you should not port every single Thor functionality to Python. For example, the Resources module is mainly interesting because of the shared-ownership semantics, I don't know if it would make much sense in a GC language.
Title: Re: News regarding the Python bindings (python-sfml)
Post by: Sonkun on April 26, 2013, 05:14:00 am
Thanks for the link you put on your webpage, that helps me keep motivated in porting SFML based works to Python as well. :)

When I started to port Thor, I was aware of these planned changes so don't worry. Even if some part of the Thor API is meant to disappear or be re-factored, I think that most of the code would be reused.

As for difficulties I had in bringing Thor to Python... Yes, the template usage was quite pain in the ass but I finally mastered it and this has improved both my C++ and Python skills! For the record, the worst feature to port was the Distribution class, I really suffered.

You're right about the resources module and that's why it's still not implemented. I still need to think about it to properly explain how it wouldn't exist in Python, before removing it.