2014-01-19 17:52:31 +01:00
..
2013-03-28 04:22:39 +01:00
2013-09-24 11:29:58 +02:00
2014-01-11 21:20:46 +01:00
2014-01-17 00:58:29 +01:00
2014-01-06 21:26:37 +01:00
2013-03-28 04:22:39 +01:00
2014-01-19 17:52:31 +01:00
2013-10-13 17:18:21 +02:00
2013-10-13 17:18:21 +02:00

spine-c

The spine-c runtime provides basic functionality to load and manipulate Spine skeletal animation data using ANSI C. It does not perform rendering but can can be extended to enable Spine animations for any C-based language, such as C++ or Objective-C.

Setup

Project files are provided for Visual C++ Express 2010.

If SPINE_SHORT_NAMES is defined, the sp prefix for all structs and functions is optional.

Examples

Loading data

Extension

Extending spine-c requires implementing three methods:

  • _spAtlasPage_createTexture Loads a texture and stores it in the void* rendererObject field of an spAtlasPage struct.
  • _spAtlasPage_disposeTexture Disposes of a texture loaded with _spAtlasPage_createTexture.
  • _spUtil_readFile Reads a file. If this doesn't need to be customized, _readFile is provided which reads a file using fopen.

This allows the spine-c API to be used to load Spine animation data. Rendering is done by iterating the slots of a skeleton and rendering the attachment for each slot. spine-sfml 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. This mechanism allows you to provide your own implementations for spAttachmentLoader, spAttachment and spTimeline, if necessary.

Runtimes Extending spine-c