• Runtimes
  • Nice to have: official C++11 runtime for Spine

  • संपादित
Related Discussions
...

I have been working with the spine-sfml runtime for a little while. It works well, but since my own project is written in C++11, it is a bit awkward at times to combine the two cleanly. It would be nice to have a pure C++11 runtime for Spine. Not just to make the code more uniform, but also to be able to make use of the new iterators and the C++11 placement new operator to create skeletons on pre-allocated memory (using allocators). Given that Spine is often used in games, which inevitably have some kind of game loop that iterates over a bunch of animated entities, it would be nice to be able to take advantage of contiguous memory blocks, which are more cache friendly than pointers to dynamic memory segments. Currently I get a pointer to a Skeleton when "requesting" one via Skeleton_create, but I have no control whatsoever over the actual allocation.

I know that there was a third-party C++11 runtime at some point, but it hasn't been maintained for quite a while. This is not uncommon, since third-party library maintainers often start working on a library in their free time and when they no longer have the time (or the motivation) they will likely stop maintaining it. In addition, it is not easy to make one for Spine, since you need quite some knowledge on how Spine works to be able to create a good runtime.

This leads me to ask:

Would you consider creating an official C++11 Spine runtime? Or is it entirely out of the question?

I know that you have quite some runtimes to maintain already, so I am not sure how likely you are to even consider it. And like I said, it is nice to have, but not a must have per se. I am also interested to see what you think about this idea in itself regarding the pros/cons of C++11, regardless of the time that you may not have.

I've been itching to do this for a while, but as you said, it'd be another runtime to maintain. Also, targeting C++11 would be so, so, so nice, but support for that, especially on consoles, might not be where it should be yet. For this reasons we are currently a bit hesitant to provide another runtime. I totally agree that having an idiomatic C++ runtime would be super great.

Regarding memory allocation, you can actually control it! Use these functions to specify your own allocators spine-runtimes/extension.h at 3.6

It is nice to hear that you feel the same way and I totally understand that you are hesitant to write a C++11 runtime right now. I actually thought that C++11 support was pretty established by now, so I am surprised to hear that support for it is still lacking (particularly on consoles). Should I expect any problems with my own projects? I try to make heavy use of C++11 features where it makes sense. Console support is not really relevant for me, but I want to be able to target different platforms, such as Windows, MacOS and Linux.

(I am going to have a look at the extension.h you gave me.)

Windows, macOS and Linux should be OK regarding C++11 (though MSVC may have some funkiness in that regard, as usual...). The story on mobile and iOS as well as consoles may be a bit different, I'll have to investigate. We also need to support set-top boxes, which is essentially embedded stuff, so all bets are off.

I'll evaluate the current state of toolchains on all our target platforms soon. If that turns out to be good, I can commence writing that C++11 runtime.

I really hope so. It would be really nice to have it. Let me know how the evaluation goes.

I've created an issue here you can follow along Investigate C++11 runtime · #981

Thank you. I will follow the issue and hopefully something comes out of it eventually. It will probably take some time (even assuming that everything goes smoothly), so I will be patient.