On the future of ThorAs Laurent announced to change SFML's naming convention, I have to decide how to continue with Thor. Since Thor and SFML have a similar API (some SFML classes are inherited by Thor or have the same member functions) and the former is officially an extension of the latter, it is standing to reason that I need to adapt the new convention.
I want to exploit this opportunity to improve the general API in Thor and to break some other interfaces. Ideas I have had so far:
- Simplification of the whole smart pointer module
- MovedPtr is doomed. I remove this class template, because it is an error-prone and inefficient workaround to emulate move semantics in C++98.
- CopiedPtr becomes smarter and more flexible: I plan to add support for separate cloner/deleter functors (instead of the compile-time policies) and derived-to-base conversions.
- ScopedPtr is either removed or changed to a CopiedPtr, but without cloner functors in order to remain noncopyable.
- Resources and ownership
- Replace thor::ResourcePtr with std::tr1::shared_ptr. Currently it is only a wrapper anyway, the change to shared_ptr allows people to work with standard library classes and to reduces dependencies.
- I must decide how classes depending on resources hold them. There are two extremes: Simple pointers and reliance on the user to keep resources alive, or overall reference counting with shared_ptr. Involved resource customers are ParticleSystem, FrameAnimation, BigSprite.
- General reorganization
- Rename some classes with too general names or move them in a separate namespace. I'm thinking of Vertex (specific to triangulation), Connection (specific to events) and maybe the Geometry classes. This preserves the ability to introduce new classes (for example for network connections) without API breaks.
- Reorder modules. I'm not completely happy with Geometry, Multimedia and Math; their application fields are blurry. I have no clue yet, ideas are welcome!
- I have even considered to split parts of the Tools module, which are not directly connected to multimedia programming, into a separate library. This concerns smart pointers, dynamic dispatchers, the NonCopyable base class and foreach macros. Doing so would render this functionality more interesting for people that don't use SFML. It would still be used by Thor.
- Possibly C++11 features (optional or unconditional). Implementation as well as usage gets easier and more efficient. Rvalue references for the smart pointers are a popular example.
Please tell me what you think about those points. I'm also open to other suggestions regarding the API. What do you find unintuitive? Are there things you consider unnecessary/useless?
Don't hesitate to post your opinions, unfortunately I recently receive only few feedback from the people using Thor. I'm happy about all inputs, even if you yourself don't use my library.
Concerning the addition of new features, I will wait until a stable code base is established. If you have ideas, please still mention them, this allows me to plan more exactly and to make future integration easier.
Perhaps I am going to release a version 1.1 with the current API, if there are people wishing it.