|
Estella 0.113.0
A fast 2D and 3D game engine powered by WebAssembly and ECS
|
The Spine runtime's entry points, declared once for both platforms. More...
#include <cstddef>#include <cstdint>

Go to the source code of this file.
Functions | |
| int | spine_loadSkeleton (uintptr_t skelDataPtr, int skelDataLen, uintptr_t atlasPtr, int atlasLen, int isBinary) |
| const char * | spine_getLastError () |
| void | spine_unloadSkeleton (int handle) |
| int | spine_getAtlasPageCount (int handle) |
| const char * | spine_getAtlasPageTextureName (int handle, int pageIndex) |
| void | spine_setAtlasPageTexture (int handle, int pageIndex, uint32_t textureId, int width, int height) |
| int | spine_createInstance (int skeletonHandle) |
| void | spine_destroyInstance (int instanceId) |
| int | spine_playAnimation (int instanceId, const char *name, int loop, int track) |
| void | spine_setToSetupPose (int instanceId) |
| int | spine_addAnimation (int instanceId, const char *name, int loop, float delay, int track) |
| void | spine_setSkin (int instanceId, const char *name) |
| void | spine_update (int instanceId, float dt) |
| const char * | spine_getAnimations (int instanceId) |
| const char * | spine_getSkins (int instanceId) |
| int | spine_getBonePosition (int instanceId, const char *bone, uintptr_t outXPtr, uintptr_t outYPtr) |
| float | spine_getBoneRotation (int instanceId, const char *bone) |
| const char * | spine_getBones (int instanceId) |
| int | spine_getBonePoses (int instanceId, uintptr_t outPtr, int capacity) |
| void | spine_getBounds (int instanceId, uintptr_t outXPtr, uintptr_t outYPtr, uintptr_t outWPtr, uintptr_t outHPtr) |
| int | spine_getMeshBatchCount (int instanceId) |
| int | spine_getMeshBatchColorPremultiplied (int instanceId, int batchIndex) |
| int | spine_getMeshBatchVertexCount (int instanceId, int batchIndex) |
| int | spine_getMeshBatchIndexCount (int instanceId, int batchIndex) |
| void | spine_getMeshBatchData (int instanceId, int batchIndex, uintptr_t outVerticesPtr, uintptr_t outIndicesPtr, uintptr_t outTextureIdPtr, uintptr_t outBlendModePtr) |
| void | spine_setClippingEnabled (int enabled) |
| void | spine_setDefaultMix (int skeletonHandle, float duration) |
| void | spine_setMixDuration (int skeletonHandle, const char *fromAnim, const char *toAnim, float duration) |
| void | spine_setTrackAlpha (int instanceId, int track, float alpha) |
| void | spine_enableEvents (int instanceId) |
| int | spine_getEventCount (int instanceId) |
| uintptr_t | spine_getEventBuffer () |
| void | spine_clearEvents () |
| const char * | spine_getEventAnimationName (int index) |
| const char * | spine_getEventName (int index) |
| const char * | spine_getEventStringValue (int index) |
| int | spine_setAttachment (int instanceId, const char *slotName, const char *attachmentName) |
| int | spine_setIKTarget (int instanceId, const char *constraintName, float targetX, float targetY, float mix) |
| const char * | spine_listConstraints (int instanceId) |
| const char * | spine_getTransformConstraintMix (int instanceId, const char *name) |
| int | spine_setTransformConstraintMix (int instanceId, const char *name, float rotate, float x, float y, float scaleX, float scaleY, float shearY) |
| const char * | spine_getPathConstraintMix (int instanceId, const char *name) |
| int | spine_setPathConstraintMix (int instanceId, const char *name, float position, float spacing, float rotate, float x, float y) |
| int | spine_setSlotColor (int instanceId, const char *slotName, float r, float g, float b, float a) |
| int | spine_setSkeletonColor (int instanceId, float r, float g, float b, float a) |
| int | spine_runtimeVersion () |
| size_t | spine_eventBufferBytes () |
| int | spine_probe_extract (int instanceId, int stage, int useCollector) |
| void | spine_probe_counts (uint32_t *out) |
| void | spine_advanceAndApply (int instanceId, float dt) |
| void | spine_materializeWorldPose (int instanceId, float dt) |
| float | spine_getAnimationDuration (int skeletonHandle, const char *animation) |
| int | spine_requiresContinuousWorldPose (int skeletonHandle) |
| int | spine_getSkeletonBounds (int skeletonHandle, uintptr_t outXPtr, uintptr_t outYPtr, uintptr_t outWPtr, uintptr_t outHPtr) |
| int | spine_probe_clip_start (int instanceId, int stage) |
| void | spine_probe_clip_start_counts (uint32_t *out) |
| int | spine_clipBudget (int instanceId, uint32_t *out) |
| void | spine_probe_clip_storage (uint32_t *out) |
| int | spine_probe_pose (int instanceId, float dt, int stage) |
| void | spine_probe_pose_counts (uint32_t *out) |
| void | spine_probe_storage (uint32_t *out) |
The Spine runtime's entry points, declared once for both platforms.
Spine is plain C over spine-c: load a skeleton + atlas, drive animation state, and hand back mesh batches the engine's renderer submits. On the web it links as a per-version wasm side module (spine38 / spine41 / spine42, which is how one editor opens projects authored against different Spine releases); a native app compiles ONE of those runtimes into the host binary and reaches it through the QuickJS wrappers EHT generates from here — the three vendored runtimes export the same symbol names, so only one can link. spine_runtimeVersion is how the SDK asks which one it got.
Names (animations, skins, slots, constraints) cross as strings; vertex, index and event data cross as offsets into the caller's heap — wasm linear memory on the web, the host arena on a device.
Definition in file SpineBindings.hpp.
| int spine_addAnimation | ( | int | instanceId, |
| const char * | name, | ||
| int | loop, | ||
| float | delay, | ||
| int | track ) |
Definition at line 242 of file SpineModuleEntry.cpp.
References g_ctx.
| void spine_advanceAndApply | ( | int | instanceId, |
| float | dt ) |
Advance the animation clock and apply it to the bones' LOCAL transforms — everything an animation means, and nothing about where it is in the world. The events this produced are queued here, so a caller drains them whether or not it goes on to materialize a world pose.
Definition at line 267 of file SpineModuleEntry.cpp.
References g_ctx.
| void spine_clearEvents | ( | ) |
Definition at line 665 of file SpineModuleEntry.cpp.
References g_ctx.
| int spine_clipBudget | ( | int | instanceId, |
| uint32_t * | out ) |
| int spine_createInstance | ( | int | skeletonHandle | ) |
Definition at line 207 of file SpineModuleEntry.cpp.
References g_ctx.
| void spine_destroyInstance | ( | int | instanceId | ) |
Definition at line 220 of file SpineModuleEntry.cpp.
References g_ctx.
| void spine_enableEvents | ( | int | instanceId | ) |
Definition at line 644 of file SpineModuleEntry.cpp.
References g_ctx.
| size_t spine_eventBufferBytes | ( | ) |
Definition at line 814 of file SpineModuleEntry.cpp.
References g_ctx.
| float spine_getAnimationDuration | ( | int | skeletonHandle, |
| const char * | animation ) |
How long one animation runs; negative where there is no such animation.
Definition at line 285 of file SpineModuleEntry.cpp.
References g_ctx.
| const char * spine_getAnimations | ( | int | instanceId | ) |
Definition at line 300 of file SpineModuleEntry.cpp.
References g_ctx.
| int spine_getAtlasPageCount | ( | int | handle | ) |
Definition at line 187 of file SpineModuleEntry.cpp.
References g_ctx.
| const char * spine_getAtlasPageTextureName | ( | int | handle, |
| int | pageIndex ) |
Definition at line 192 of file SpineModuleEntry.cpp.
References g_ctx.
| int spine_getBonePoses | ( | int | instanceId, |
| uintptr_t | outPtr, | ||
| int | capacity ) |
@heapreturn outPtr: five floats a bone — parent index (-1 for a root), x, y, degrees, length; returns the count
Every bone's parent index and pose in one call: 5 floats a bone — parent (-1 for a root), x, y, degrees, length — into outPtr, at most capacity bones. Returns how many it wrote. One crossing for the whole tree, because an overlay asks every frame.
Definition at line 340 of file SpineModuleEntry.cpp.
References g_ctx.
| int spine_getBonePosition | ( | int | instanceId, |
| const char * | bone, | ||
| uintptr_t | outXPtr, | ||
| uintptr_t | outYPtr ) |
Definition at line 316 of file SpineModuleEntry.cpp.
References g_ctx.
| float spine_getBoneRotation | ( | int | instanceId, |
| const char * | bone ) |
Definition at line 361 of file SpineModuleEntry.cpp.
References g_ctx.
| const char * spine_getBones | ( | int | instanceId | ) |
The bone names in skeleton order, a parent before its children.
The bone names, in the skeleton's own order — a parent before each of its children.
Definition at line 327 of file SpineModuleEntry.cpp.
References g_ctx.
| void spine_getBounds | ( | int | instanceId, |
| uintptr_t | outXPtr, | ||
| uintptr_t | outYPtr, | ||
| uintptr_t | outWPtr, | ||
| uintptr_t | outHPtr ) |
Definition at line 368 of file SpineModuleEntry.cpp.
References g_ctx.
| const char * spine_getEventAnimationName | ( | int | index | ) |
Definition at line 670 of file SpineModuleEntry.cpp.
References g_ctx.
| uintptr_t spine_getEventBuffer | ( | ) |
Definition at line 659 of file SpineModuleEntry.cpp.
References g_ctx.
| int spine_getEventCount | ( | int | instanceId | ) |
Definition at line 652 of file SpineModuleEntry.cpp.
References g_ctx.
| const char * spine_getEventName | ( | int | index | ) |
Definition at line 679 of file SpineModuleEntry.cpp.
References g_ctx.
| const char * spine_getEventStringValue | ( | int | index | ) |
Definition at line 688 of file SpineModuleEntry.cpp.
References g_ctx.
| const char * spine_getLastError | ( | ) |
Definition at line 169 of file SpineModuleEntry.cpp.
References g_ctx.
| int spine_getMeshBatchColorPremultiplied | ( | int | instanceId, |
| int | batchIndex ) |
Definition at line 572 of file SpineModuleEntry.cpp.
References g_ctx.
| int spine_getMeshBatchCount | ( | int | instanceId | ) |
Definition at line 579 of file SpineModuleEntry.cpp.
References g_ctx.
| void spine_getMeshBatchData | ( | int | instanceId, |
| int | batchIndex, | ||
| uintptr_t | outVerticesPtr, | ||
| uintptr_t | outIndicesPtr, | ||
| uintptr_t | outTextureIdPtr, | ||
| uintptr_t | outBlendModePtr ) |
Definition at line 599 of file SpineModuleEntry.cpp.
References es::skeletal::MeshBatch::blendMode, es::skeletal::Buffer< T >::data(), g_ctx, es::skeletal::MeshBatch::indices, es::skeletal::Buffer< T >::size(), es::skeletal::MeshBatch::texture, and es::skeletal::MeshBatch::vertices.
| int spine_getMeshBatchIndexCount | ( | int | instanceId, |
| int | batchIndex ) |
Definition at line 592 of file SpineModuleEntry.cpp.
References g_ctx.
| int spine_getMeshBatchVertexCount | ( | int | instanceId, |
| int | batchIndex ) |
Definition at line 585 of file SpineModuleEntry.cpp.
References g_ctx, and es::skeletal::VERTEX_FLOATS.
| const char * spine_getPathConstraintMix | ( | int | instanceId, |
| const char * | name ) |
Definition at line 770 of file SpineModuleEntry.cpp.
References g_ctx.
| int spine_getSkeletonBounds | ( | int | skeletonHandle, |
| uintptr_t | outXPtr, | ||
| uintptr_t | outYPtr, | ||
| uintptr_t | outWPtr, | ||
| uintptr_t | outHPtr ) |
The skeleton's AUTHORED extent, into four floats. Answerable from the data alone — no instance, no pose — which is what makes it usable for deciding whether a pose is worth computing. Zero and false where the runtime cannot report it.
Definition at line 382 of file SpineModuleEntry.cpp.
References g_ctx.
| const char * spine_getSkins | ( | int | instanceId | ) |
Definition at line 308 of file SpineModuleEntry.cpp.
References g_ctx.
| const char * spine_getTransformConstraintMix | ( | int | instanceId, |
| const char * | name ) |
Definition at line 750 of file SpineModuleEntry.cpp.
References g_ctx.
| const char * spine_listConstraints | ( | int | instanceId | ) |
Definition at line 715 of file SpineModuleEntry.cpp.
References g_ctx.
| int spine_loadSkeleton | ( | uintptr_t | skelDataPtr, |
| int | skelDataLen, | ||
| uintptr_t | atlasPtr, | ||
| int | atlasLen, | ||
| int | isBinary ) |
Definition at line 155 of file SpineModuleEntry.cpp.
References g_ctx.
| void spine_materializeWorldPose | ( | int | instanceId, |
| float | dt ) |
Resolve the world transforms the local pose implies. Deferring it past an advance is only equivalent where the skeleton says so — see spine_requiresContinuousWorldPose.
Definition at line 279 of file SpineModuleEntry.cpp.
References g_ctx.
| int spine_playAnimation | ( | int | instanceId, |
| const char * | name, | ||
| int | loop, | ||
| int | track ) |
Definition at line 237 of file SpineModuleEntry.cpp.
References g_ctx.
| int spine_probe_clip_start | ( | int | instanceId, |
| int | stage ) |
BENCHMARK ONLY — open the instance's first clip region to stage (es::ES_SPINE_NS::ClipStartStage), so what a 39-vertex polygon costs before a single triangle is cut can be priced without a clock inside the preparation.
Definition at line 458 of file SpineModuleEntry.cpp.
References g_clipStartCounts, and g_ctx.
| void spine_probe_clip_start_counts | ( | uint32_t * | out | ) |
| void spine_probe_clip_storage | ( | uint32_t * | out | ) |
| void spine_probe_counts | ( | uint32_t * | out | ) |
| int spine_probe_extract | ( | int | instanceId, |
| int | stage, | ||
| int | useCollector ) |
BENCHMARK ONLY — the extraction run to stage.
useCollector 0 counts the emitted triangles and drops them, 1 stores them as a frame does; the difference at the last stage is what the collector's vectors cost. Not on any frame path: the staged walk is its own instantiation.
Definition at line 404 of file SpineModuleEntry.cpp.
References g_ctx.
| int spine_probe_pose | ( | int | instanceId, |
| float | dt, | ||
| int | stage ) |
BENCHMARK ONLY — the pose run to stage (es::ES_SPINE_NS::PoseStage). Advancing a pose is not a query: this MOVES the instance forward, so a caller measuring with it owns the instance's clock.
Definition at line 533 of file SpineModuleEntry.cpp.
References g_ctx.
| void spine_probe_pose_counts | ( | uint32_t * | out | ) |
| void spine_probe_storage | ( | uint32_t * | out | ) |
| int spine_requiresContinuousWorldPose | ( | int | skeletonHandle | ) |
1 where this skeleton's world pose carries state and may not be deferred.
Definition at line 291 of file SpineModuleEntry.cpp.
References g_ctx.
| int spine_runtimeVersion | ( | ) |
Definition at line 806 of file SpineModuleEntry.cpp.
| void spine_setAtlasPageTexture | ( | int | handle, |
| int | pageIndex, | ||
| uint32_t | textureId, | ||
| int | width, | ||
| int | height ) |
Definition at line 197 of file SpineModuleEntry.cpp.
References g_ctx.
| int spine_setAttachment | ( | int | instanceId, |
| const char * | slotName, | ||
| const char * | attachmentName ) |
Definition at line 701 of file SpineModuleEntry.cpp.
References g_ctx.
| void spine_setClippingEnabled | ( | int | enabled | ) |
Definition at line 615 of file SpineModuleEntry.cpp.
References g_ctx.
| void spine_setDefaultMix | ( | int | skeletonHandle, |
| float | duration ) |
Definition at line 624 of file SpineModuleEntry.cpp.
References g_ctx.
| int spine_setIKTarget | ( | int | instanceId, |
| const char * | constraintName, | ||
| float | targetX, | ||
| float | targetY, | ||
| float | mix ) |
Definition at line 706 of file SpineModuleEntry.cpp.
References g_ctx.
| void spine_setMixDuration | ( | int | skeletonHandle, |
| const char * | fromAnim, | ||
| const char * | toAnim, | ||
| float | duration ) |
Definition at line 629 of file SpineModuleEntry.cpp.
References g_ctx.
| int spine_setPathConstraintMix | ( | int | instanceId, |
| const char * | name, | ||
| float | position, | ||
| float | spacing, | ||
| float | rotate, | ||
| float | x, | ||
| float | y ) |
Definition at line 783 of file SpineModuleEntry.cpp.
References g_ctx.
| int spine_setSkeletonColor | ( | int | instanceId, |
| float | r, | ||
| float | g, | ||
| float | b, | ||
| float | a ) |
Definition at line 798 of file SpineModuleEntry.cpp.
References g_ctx.
| void spine_setSkin | ( | int | instanceId, |
| const char * | name ) |
Definition at line 247 of file SpineModuleEntry.cpp.
References g_ctx.
| int spine_setSlotColor | ( | int | instanceId, |
| const char * | slotName, | ||
| float | r, | ||
| float | g, | ||
| float | b, | ||
| float | a ) |
Definition at line 790 of file SpineModuleEntry.cpp.
References g_ctx.
| void spine_setToSetupPose | ( | int | instanceId | ) |
Back to the data's own starting pose, tracks cleared — what a replay starts from.
Back to where the data says the skeleton starts — the one state a replay can be reproduced from. See es::ES_SPINE_NS::setToSetupPose.
Definition at line 232 of file SpineModuleEntry.cpp.
References g_ctx.
| void spine_setTrackAlpha | ( | int | instanceId, |
| int | track, | ||
| float | alpha ) |
Definition at line 635 of file SpineModuleEntry.cpp.
References g_ctx.
| int spine_setTransformConstraintMix | ( | int | instanceId, |
| const char * | name, | ||
| float | rotate, | ||
| float | x, | ||
| float | y, | ||
| float | scaleX, | ||
| float | scaleY, | ||
| float | shearY ) |
Definition at line 763 of file SpineModuleEntry.cpp.
References g_ctx.
| void spine_unloadSkeleton | ( | int | handle | ) |
Definition at line 174 of file SpineModuleEntry.cpp.
References g_ctx.
| void spine_update | ( | int | instanceId, |
| float | dt ) |
Definition at line 252 of file SpineModuleEntry.cpp.
References g_ctx.