Estella 0.113.0
A fast 2D and 3D game engine powered by WebAssembly and ECS
Loading...
Searching...
No Matches
DragonBonesBindings.hpp File Reference

The DragonBones module's exported ABI, declared apart from its bodies. More...

#include <cstddef>
#include <cstdint>
Include dependency graph for DragonBonesBindings.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

int db_loadSkeleton (uintptr_t skeletonPtr, int skeletonLen, uintptr_t atlasPtr, int atlasLen)
const char * db_getLastError ()
void db_unloadSkeleton (int handle)
const char * db_getArmatures (int handle)
 ["armatureA","armatureB"] — a DragonBones file names more than one.
const char * db_getAtlasImageName (int handle)
 The image this file's atlas expects, so the caller knows what to upload.
void db_setAtlasTexture (int handle, uint32_t textureId)
int db_createInstance (int skeletonHandle, const char *armatureName)
void db_destroyInstance (int instanceId)
int db_playAnimation (int instanceId, const char *name, int playTimes)
 playTimes: -1 keeps what the data says, 0 loops, n plays n times.
int db_fadeInAnimation (int instanceId, const char *name, float fadeSeconds, int playTimes)
 Where Spine would set a mix duration: DragonBones fades at the moment of play.
void db_stopAnimation (int instanceId, const char *name)
void db_setTimeScale (int instanceId, float scale)
void db_setColor (int instanceId, float r, float g, float b, float a)
void db_update (int instanceId, float dt)
const char * db_getAnimations (int instanceId)
const char * db_getBones (int instanceId)
int db_getBonePoses (int instanceId, uintptr_t outPtr, int capacity)
int db_getMeshBatchCount (int instanceId)
int db_getMeshBatchVertexCount (int instanceId, int batchIndex)
int db_getMeshBatchIndexCount (int instanceId, int batchIndex)
void db_getMeshBatchData (int instanceId, int batchIndex, uintptr_t outVerticesPtr, uintptr_t outIndicesPtr, uintptr_t outTextureIdPtr, uintptr_t outBlendModePtr)
void db_getBounds (int instanceId, uintptr_t outXPtr, uintptr_t outYPtr, uintptr_t outWPtr, uintptr_t outHPtr)
int db_runtimeVersion ()
 5 — the DragonBones data format this runtime reads, for the SDK's version gate.

Detailed Description

The DragonBones module's exported ABI, declared apart from its bodies.

The web reaches these through embind; a native host reaches them through QuickJS wrappers EHT generates from THIS header. Declaring them here rather than inline in the entry is what makes the second path exist at all — a module whose ABI lives only in its .cpp links into the host and cannot be called from it.

@heapreturn marks an entry point that writes through a pointer the caller allocated, so the generator knows to marshal rather than return.

Author
ESEngine Team
Date
2026

Definition in file DragonBonesBindings.hpp.

Function Documentation

◆ db_createInstance()

int db_createInstance ( int skeletonHandle,
const char * armatureName )

◆ db_destroyInstance()

void db_destroyInstance ( int instanceId)

Definition at line 230 of file DragonBonesModuleEntry.cpp.

References g_ctx.

◆ db_fadeInAnimation()

int db_fadeInAnimation ( int instanceId,
const char * name,
float fadeSeconds,
int playTimes )

Where Spine would set a mix duration: DragonBones fades at the moment of play.

Where Spine would set a mix duration: DragonBones fades at the moment of play.

Definition at line 251 of file DragonBonesModuleEntry.cpp.

References g_ctx.

◆ db_getAnimations()

const char * db_getAnimations ( int instanceId)

Definition at line 295 of file DragonBonesModuleEntry.cpp.

References g_ctx.

◆ db_getArmatures()

const char * db_getArmatures ( int handle)

["armatureA","armatureB"] — a DragonBones file names more than one.

["armatureA","armatureB"] — a DragonBones file names more than one.

Definition at line 179 of file DragonBonesModuleEntry.cpp.

References g_ctx.

◆ db_getAtlasImageName()

const char * db_getAtlasImageName ( int handle)

The image this file's atlas expects, so the caller knows what to upload.

Definition at line 189 of file DragonBonesModuleEntry.cpp.

References g_ctx.

◆ db_getBonePoses()

int db_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. Posed in the y-UP space the geometry leaves the runtime in (see EsArmatureProxy), so the skeleton drawn over the artwork lands on it.

Definition at line 320 of file DragonBonesModuleEntry.cpp.

References g_ctx.

◆ db_getBones()

const char * db_getBones ( int instanceId)

The bone names in armature order, a parent before its children.

The bone names, in the armature's own order — a parent before each of its children.

Definition at line 305 of file DragonBonesModuleEntry.cpp.

References g_ctx.

◆ db_getBounds()

void db_getBounds ( int instanceId,
uintptr_t outXPtr,
uintptr_t outYPtr,
uintptr_t outWPtr,
uintptr_t outHPtr )

@heapreturn outXPtr, outYPtr, outWPtr, outHPtr

Definition at line 390 of file DragonBonesModuleEntry.cpp.

References g_ctx, and es::skeletal::VERTEX_FLOATS.

◆ db_getLastError()

const char * db_getLastError ( )

Definition at line 157 of file DragonBonesModuleEntry.cpp.

References g_ctx.

◆ db_getMeshBatchCount()

int db_getMeshBatchCount ( int instanceId)

Definition at line 355 of file DragonBonesModuleEntry.cpp.

References g_ctx.

◆ db_getMeshBatchData()

void db_getMeshBatchData ( int instanceId,
int batchIndex,
uintptr_t outVerticesPtr,
uintptr_t outIndicesPtr,
uintptr_t outTextureIdPtr,
uintptr_t outBlendModePtr )

◆ db_getMeshBatchIndexCount()

int db_getMeshBatchIndexCount ( int instanceId,
int batchIndex )

Definition at line 368 of file DragonBonesModuleEntry.cpp.

References g_ctx.

◆ db_getMeshBatchVertexCount()

int db_getMeshBatchVertexCount ( int instanceId,
int batchIndex )

Definition at line 361 of file DragonBonesModuleEntry.cpp.

References g_ctx, and es::skeletal::VERTEX_FLOATS.

◆ db_loadSkeleton()

int db_loadSkeleton ( uintptr_t skeletonPtr,
int skeletonLen,
uintptr_t atlasPtr,
int atlasLen )

Definition at line 120 of file DragonBonesModuleEntry.cpp.

References g_ctx, and EsFactory::instance().

◆ db_playAnimation()

int db_playAnimation ( int instanceId,
const char * name,
int playTimes )

playTimes: -1 keeps what the data says, 0 loops, n plays n times.

playTimes: -1 keeps what the data says, 0 loops, n plays n times.

Definition at line 243 of file DragonBonesModuleEntry.cpp.

References g_ctx.

◆ db_runtimeVersion()

int db_runtimeVersion ( )

5 — the DragonBones data format this runtime reads, for the SDK's version gate.

The DragonBones data format this runtime reads, for the SDK's version gate.

Definition at line 420 of file DragonBonesModuleEntry.cpp.

◆ db_setAtlasTexture()

void db_setAtlasTexture ( int handle,
uint32_t textureId )

Definition at line 195 of file DragonBonesModuleEntry.cpp.

References g_ctx.

◆ db_setColor()

void db_setColor ( int instanceId,
float r,
float g,
float b,
float a )

Per-entity tint, multiplied onto each slot's authored colour (1,1,1,1 = as drawn).

Tint this instance. Multiplied onto each slot's authored colour, so opaque white leaves the armature exactly as it was drawn.

Definition at line 272 of file DragonBonesModuleEntry.cpp.

References g_ctx.

◆ db_setTimeScale()

void db_setTimeScale ( int instanceId,
float scale )

Definition at line 264 of file DragonBonesModuleEntry.cpp.

References g_ctx.

◆ db_stopAnimation()

void db_stopAnimation ( int instanceId,
const char * name )

Definition at line 258 of file DragonBonesModuleEntry.cpp.

References g_ctx.

◆ db_unloadSkeleton()

void db_unloadSkeleton ( int handle)

Definition at line 160 of file DragonBonesModuleEntry.cpp.

References g_ctx, and EsFactory::instance().

◆ db_update()

void db_update ( int instanceId,
float dt )