|
@@ -1,8 +1,6 @@
|
|
|
# spine-c
|
|
|
|
|
|
-The spine-c runtime provides basic functionality to load and manipulate [Spine](http://esotericsoftware.com) skeletal animation data using ANSI C. It does not perform rendering but can be extended to enable Spine animations for other C-based projects, including C++ or Objective-C projects.
|
|
|
-
|
|
|
-For a pure C++ API, you may consider the third party Spine runtime [Chobolabs/spine-cpp](https://github.com/Chobolabs/spine-cpp).
|
|
|
+The spine-c runtime provides basic functionality to load and manipulate [Spine](http://esotericsoftware.com) skeletal animation data using ANSI C89. It does not perform rendering but can be extended to enable Spine animations for other C-based projects, including C++ or Objective-C projects.
|
|
|
|
|
|
## Licensing
|
|
|
|
|
@@ -12,19 +10,20 @@ The Spine Runtimes are developed with the intent to be used with data exported f
|
|
|
|
|
|
## Spine version
|
|
|
|
|
|
-spine-c works with data exported from Spine 3.6.xx.
|
|
|
+spine-c works with data exported from Spine 3.7.xx.
|
|
|
|
|
|
spine-c supports all Spine features.
|
|
|
|
|
|
## Setup
|
|
|
|
|
|
1. Download the Spine Runtimes source using [git](https://help.github.com/articles/set-up-git) or by downloading it as a zip via the download button above.
|
|
|
-1. Open the `spine-c.sln` Visual C++ 2010 Express project file. For other IDEs, you will need to create a new project and import the source.
|
|
|
-
|
|
|
-Alternatively, the contents of the `spine-c/spine-c/src` and `spine-c/spine-c/include` directories can be copied into your project. Be sure your header search is configured to find the contents of the `spine-c/spine-c/include` directory. Note that the includes use `spine/Xxx.h`, so the `spine` directory cannot be omitted when copying the files.
|
|
|
+1. Copy the contents of the `spine-c/spine-c/src` and `spine-c/spine-c/include` directories into your project. Be sure your header search is configured to find the contents of the `spine-c/spine-c/include` directory. Note that the includes use `spine/Xxx.h`, so the `spine` directory cannot be omitted when copying the files.
|
|
|
|
|
|
If `SPINE_SHORT_NAMES` is defined, the `sp` prefix for all structs and functions is optional. Only use this if the spine-c names won't cause a conflict.
|
|
|
|
|
|
+## Usage
|
|
|
+### [Please see the spine-c guide for full documentation](http://esotericsoftware.com/spine-c)
|
|
|
+
|
|
|
## Extension
|
|
|
|
|
|
Extending spine-c requires implementing three methods:
|
|
@@ -37,12 +36,11 @@ With these implemented, the spine-c API can then be used to load Spine animation
|
|
|
|
|
|
For example, `AtlasAttachmentLoader` is typically used to load attachments when using a Spine texture atlas. When `AtlasAttachmentLoader` loads a `RegionAttachment`, the attachment's `void* rendererObject` is set to an `AtlasRegion`. Rendering code can then obtain the `AtlasRegion` from the attachment, get the `AtlasPage` it belongs to, and get the page's `void* rendererObject`. This is the renderer specific texture object set by `_spAtlasPage_createTexture`. Attachment loading can be [customized](http://esotericsoftware.com/spine-using-runtimes/#attachmentloader) if not using `AtlasAttachmentLoader` or to provider different renderer specific data.
|
|
|
|
|
|
-[spine-sfml](../spine-sfml/src/spine/spine-sfml.cpp#L39) serves as a simple example of extending spine-c.
|
|
|
+[spine-sfml](../spine-sfml/src/c/spine/spine-sfml.cpp#L39) serves as a simple example of extending spine-c.
|
|
|
|
|
|
spine-c uses an OOP style of programming where each "class" is made up of a struct and a number of functions prefixed with the struct name. More detals about how this works are available in [extension.h](spine-c/include/spine/extension.h#L2). This mechanism allows you to provide your own implementations for `spAttachmentLoader`, `spAttachment` and `spTimeline`, if necessary.
|
|
|
|
|
|
## Runtimes extending spine-c
|
|
|
|
|
|
-- [spine-cocos2d-iphone](../spine-cocos2d-objc)
|
|
|
-- [spine-cocos2dx](../spine-cocos2dx)
|
|
|
+- [spine-cocos2d-objc](../spine-cocos2d-objc)
|
|
|
- [spine-sfml](../spine-sfml)
|