Denis Andrašec 0d5c3e3b18
Spine iOS (#2504)
* Add `spine-iOS` SPM package & example app (#1)

* Basic Mesh Rendering (#2)

* Spine C++ Swift Wrapper (#3)

* Load `Atlas` & `SkeletonData` (#4)

Load & dispose `Atlas` & `SkeletonData` from bundled files.

* Generate Swift classes from `spine-cpp-lite.h` (#5)

* Draw `SkeletonData` render commands (#6)

- Use `SkeletonData` render commands in the renderer
- Simple loop for animation support

* Add `BoundsProvider` (#7)

- Implement & support `BoundsProvider` classes
- Introduce alignment and content mode
- Update c to swift script to return optional for find prefixed methods

* Support `SpineController` & `Event` callbacks (#8)

- Support SpineController callbacks
- Support Event callbacks
- Apply tint color in renderer

* Support `DressUp` sample (#9)

- Add `DressUp` sample
- Move SpineViewController to SpineUIView
- Implement SpineUIView export to image

* Remove unused file

* Add `Physics` sample (#10)

- Add `Physics` sample
- Fix offsets in `IKFollowing` sample
- Fix `SpineView` background color

* Add `DebugRendering` sample (#11)

- Add `DebugRendering` sample
- Make `SpineUIView` transparent

* Move remaining files to SPM package (#12)

- Move remaining files to SPM package
- Rename `SpineWrapper` to `SpineCppLite`

* Load assets from different sources (#13)

- Load from bundle, file, http & drawable
- Apply correct blend mode & pma in renderer

* Add `Obj-C` + `UIKit` sample (#14)

- Add `Obj-C` + `UIKit` sample
- Update `Spine` to be usable in Obj-C code base

* Support CocoaPods (#15)

* Metal Best Practices (#16)

- Tripple Buffering
- Buffer Bindings
- Shared Objects

* Annotate functions that should return optional (#17)

* Add option to disable drawing when out of viewport (#18)

- Add option to disable drawing when out of viewport
- Move update clock to controller so multiple views can share it

* Add docs for public Spine classes/methods (#19)

* Fix various regressions (#20)

- Fix retain `SpineController` retain cycle
- Fix issue wehre images were not rendered
2024-06-18 10:02:25 +02:00
..
2024-06-18 10:02:25 +02:00
2023-04-28 14:05:57 +02:00

spine-cpp

The spine-cpp runtime provides basic functionality to load and manipulate spine skeletal animation data using C++. It does not perform rendering but can be extended to enable spine animations for other projects that utilize C++.

Licensing

You are welcome to evaluate the Spine Runtimes and the examples we provide in this repository free of charge.

You can integrate the Spine Runtimes into your software free of charge, but users of your software must have their own Spine license. Please make your users aware of this requirement! This option is often chosen by those making development tools, such as an SDK, game toolkit, or software library.

In order to distribute your software containing the Spine Runtimes to others that don't have a Spine license, you need a Spine license at the time of integration. Then you can distribute your software containing the Spine Runtimes however you like, provided others don't modify it or use it to create new software. If others want to do that, they'll need their own Spine license.

For the official legal terms governing the Spine Runtimes, please read the Spine Runtimes License Agreement and Section 2 of the Spine Editor License Agreement.

Spine version

spine-cpp works with data exported from spine 4.2.xx.

spine-cpp supports all spine features.

Setup

  1. Download the spine Runtimes source using git or by downloading it as a zip via the download button above.
  2. Copy the contents of the spine-cpp/spine-cpp/src and spine-cpp/spine-cpp/include directories into your project. Be sure your header search is configured to find the contents of the spine-cpp/spine-cpp/include directory. Note that the includes use spine/Xxx.h, so the spine directory cannot be omitted when copying the files.

Usage

Please see the spine-cpp guide for full documentation

Extension

Extending spine-cpp requires implementing both the SpineExtension class and the TextureLoader class:

#include <spine/Extension.h>
void spine::SpineExtension *spine::getDefaultExtension() {
  return new spine::DefaultExtension();
}

class MyTextureLoader : public spine::TextureLoader
{
  virtual void load(spine::AtlasPage& page, const spine::String& path) {
    void* texture = ... load the texture based on path ...
    page->setRendererObject(texture); // use the texture later in your rendering code
  }

  virtual void unload(void* texture) { // TODO }
};

Runtimes extending spine-cpp