mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-02-11 17:48:45 +08:00
[c][cpp] Improved README.md
This commit is contained in:
parent
84a541b098
commit
9de99309f4
56
spine-c/README.md
Normal file
56
spine-c/README.md
Normal file
@ -0,0 +1,56 @@
|
||||
# spine-c
|
||||
|
||||
The spine-c runtime provides basic functionality to load and manipulate [spine](http://esotericsoftware.com) skeletal animation data using C. It does not perform rendering but can be extended to enable spine animations for other projects that utilize C.
|
||||
|
||||
**Note:** The spine-c code is generated using a code generator. For details on the code generation process, please see the [codegen/README.md](codegen/README.md).
|
||||
|
||||
## 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](https://esotericsoftware.com/spine-purchase). 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](https://esotericsoftware.com/spine-purchase) 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](http://esotericsoftware.com/spine-runtimes-license) and Section 2 of the [Spine Editor License Agreement](http://esotericsoftware.com/spine-editor-license#s2).
|
||||
|
||||
## Spine version
|
||||
|
||||
spine-c works with data exported from spine 4.3.xx.
|
||||
|
||||
spine-c supports all spine features.
|
||||
|
||||
## Setup
|
||||
|
||||
### Manual Copy
|
||||
|
||||
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.
|
||||
2. Copy the contents of the `spine-c/src` and `spine-c/include` directories into your project. Be sure your header search is configured to find the contents of the `spine-c/include` directory.
|
||||
|
||||
### CMake
|
||||
|
||||
You can use CMake's FetchContent to include spine-c in your project:
|
||||
|
||||
```cmake
|
||||
include(FetchContent)
|
||||
FetchContent_Declare(
|
||||
spine-runtimes
|
||||
GIT_REPOSITORY https://github.com/EsotericSoftware/spine-runtimes.git
|
||||
GIT_TAG 4.3
|
||||
)
|
||||
FetchContent_MakeAvailable(spine-runtimes)
|
||||
|
||||
add_subdirectory(${spine-runtimes_SOURCE_DIR}/spine-c ${spine-runtimes_BINARY_DIR}/spine-c)
|
||||
target_link_libraries(your_target PRIVATE spine-c)
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
### [Please see the spine-c guide for full documentation](http://esotericsoftware.com/spine-c)
|
||||
|
||||
## Runtimes extending spine-c
|
||||
- [spine-ios](../spine-ios)
|
||||
- [spine-flutter](../spine-flutter)
|
||||
- [spine-sfml/c](../spine-sfml/c)
|
||||
- [spine-sdl](../spine-sdl)
|
||||
- [spine-glfw](../spine-glfw)
|
||||
@ -14,40 +14,38 @@ For the official legal terms governing the Spine Runtimes, please read the [Spin
|
||||
|
||||
## Spine version
|
||||
|
||||
spine-cpp works with data exported from spine 4.2.xx.
|
||||
spine-cpp works with data exported from spine 4.3.xx.
|
||||
|
||||
spine-cpp supports all spine features.
|
||||
|
||||
## Setup
|
||||
|
||||
### Manual Copy
|
||||
|
||||
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.
|
||||
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.
|
||||
|
||||
### CMake
|
||||
|
||||
You can use CMake's FetchContent to include spine-cpp in your project:
|
||||
|
||||
```cmake
|
||||
include(FetchContent)
|
||||
FetchContent_Declare(
|
||||
spine-runtimes
|
||||
GIT_REPOSITORY https://github.com/EsotericSoftware/spine-runtimes.git
|
||||
GIT_TAG 4.3
|
||||
)
|
||||
FetchContent_MakeAvailable(spine-runtimes)
|
||||
|
||||
add_subdirectory(${spine-runtimes_SOURCE_DIR}/spine-cpp ${spine-runtimes_BINARY_DIR}/spine-cpp)
|
||||
target_link_libraries(your_target PRIVATE spine-cpp)
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
### [Please see the spine-cpp guide for full documentation](http://esotericsoftware.com/spine-cpp)
|
||||
|
||||
## 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
|
||||
- [spine-glfw](../spine-glfw)
|
||||
- [spine-sdl](../spine-sdl)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user