Skip to main content

Module ffi

Module ffi 

Source
Expand description

The “ffi” face: the C ABI over the Rust API, for C/C++ hosts on DX12 / Vulkan / Metal.

This module is a translation layer and nothing else. Every entry point does the same three things: validate the C arguments, convert them to Rust types, and call NativeHost (the wgpu host) or SSPlayer (playback). No rendering or playback logic lives here — when something needs doing it belongs in host.rs or player.rs, where the Rust API gets it too.

Raw window handles cannot cross the ABI as Rust traits, so the caller fills in a flat SsWindowHandle (HWND / NSView / CAMetalLayer / Xlib / Wayland) which surface_target turns into what wgpu wants.

Two handles, not one. ss_scene_t is the window — surface, device, renderer, scene — and ss_player_t is one character drawn into it. Fusing them would make a second character in one window need a second surface, and the two would clear and present over each other.

Conventions:

  • Status is int32_t: SS_OK (0), positive = an ssruntime error code (same numbering as the SDK’s C-API), negative = a player/host error. ss_last_error carries the human-readable detail.
  • No entry point unwinds: the workspace builds with panic = "abort".
  • Nothing here retains the window; the caller must keep it (and its layer) alive until ss_scene_destroy.

Structs§

SsCrowdMember
One copy of a player in a crowd: where it stands, in ss_player_set_transform terms and composed under that, and its alpha (0..1) and tint (0xRRGGBB), each multiplied into the player’s own. {0, 0, 1, 1, 0, 1, 0xFFFFFF} stands where the player does, unchanged.
SsEventData
One timeline event, flattened for the ABI.
SsMissingAsset
Something a load needed and did not get, flattened for the ABI. What ss_player_missing_at fills in.
SsPlaced
What ss_player_fit_into wrote, in ss_player_set_transform terms: pixels from the view centre, y downward.
SsPlacement
Everything ss_player_fit_into needs.
SsPlayer
Opaque player handle: which scene, and which player within it.
SsRect
A box in player-local units — the space ss_player_part_transform reports in, with y downward.
SsScene
Opaque scene handle: one window’s NativeHost, the player handles it has issued, and the buffers backing the strings its players hand back to C.
SsSceneDesc
Everything ss_scene_create needs: where to draw, how big, and how to clear.
SsSceneStats
What the last frame cost, flattened for the ABI.
SsSignalParamData
One signal parameter, flattened for the ABI. value_type says which field to read; SS_SIGNAL_VALUE_NONE means the parameter exists but was left unset.
SsTextureRef
One atlas a pack asks for, flattened for the ABI. What ss_player_texture_at fills in.
SsWindowHandle
A platform window, flattened for the ABI. Which fields are read depends on kind (SS_WINDOW_*); unused ones must be null/zero.

Constants§

SS_ALIGN_BOTTOM
SS_ALIGN_BOTTOM_LEFT
SS_ALIGN_BOTTOM_RIGHT
SS_ALIGN_CENTER
Which point of the content box lands on the matching point of the view. On the vertical axis, “top” is the top of the screen.
SS_ALIGN_LEFT
SS_ALIGN_RIGHT
SS_ALIGN_TOP
SS_ALIGN_TOP_LEFT
SS_ALIGN_TOP_RIGHT
SS_BACKEND_AUTO
Let wgpu pick the platform’s primary backend.
SS_BACKEND_DX12
Force Direct3D 12 (Windows).
SS_BACKEND_METAL
Force Metal (macOS / iOS).
SS_BACKEND_VULKAN
Force Vulkan (Linux / Windows / Android).
SS_ERROR_GPU
wgpu could not provide what was asked for (no adapter/device, surface creation or presentation failed).
SS_ERROR_INVALID_ARGUMENT
A pointer argument was null, a string was not UTF-8, or a value was out of range.
SS_EVENT_AUDIO
See SS_EVENT_USER_DATA.
SS_EVENT_SIGNAL
See SS_EVENT_USER_DATA.
SS_EVENT_USER_DATA
What kind of thing an ss_event_data_t is; read it before the payload.
SS_FIT_CONTAIN
Scale the content box until it fits entirely inside the view.
SS_FIT_COVER
Scale until the content box covers the view. The spill is not clipped — the player has no scissor of its own.
SS_FIT_NONE
No fit: scale 1, centred, and scale / offset_x / offset_y are the whole placement.
SS_INVALID_SOURCE
ss_player_track_main_source on a track with no animation.
SS_MAX_CROWD_MEMBERS
The most members ss_player_set_crowd takes.
SS_MISSING_PACK
An animation pack that did not load. The instance parts playing it do not appear.
SS_MISSING_TEXTURE
An atlas that did not load. The parts using it draw against the white fallback, so they appear as silhouettes.
SS_OK
Success.
SS_SIGNAL_VALUE_BOOL
See SS_SIGNAL_VALUE_NONE.
SS_SIGNAL_VALUE_FLOATING
See SS_SIGNAL_VALUE_NONE.
SS_SIGNAL_VALUE_INDEX
A choice from a list, as its index. See SS_SIGNAL_VALUE_NONE.
SS_SIGNAL_VALUE_INTEGER
See SS_SIGNAL_VALUE_NONE.
SS_SIGNAL_VALUE_NONE
Which field of an ss_signal_param_data_t carries the value.
SS_SIGNAL_VALUE_TEXT
See SS_SIGNAL_VALUE_NONE.
SS_TRACK_BLEND_ADDITIVE
ss_player_set_track_blend: add the track’s offset from the setup pose.
SS_TRACK_BLEND_MIX
ss_player_set_track_blend: lerp toward the track’s pose.
SS_TRACK_SYNC_FREE
ss_player_set_track_sync: an animation laid on the track starts from its head.
SS_TRACK_SYNC_START
ss_player_set_track_sync: it starts at the phase track 0 stands at.
SS_WINDOW_APPKIT
macOS NSView*. wgpu attaches (or reuses) the view’s CAMetalLayer; must be passed from the main thread.
SS_WINDOW_METAL_LAYER
macOS CAMetalLayer* directly. Apple targets only.
SS_WINDOW_WAYLAND
Wayland wl_surface* in window, wl_display* in display.
SS_WINDOW_WIN32
Win32 HWND (+ optional HINSTANCE in display).
SS_WINDOW_XLIB
X11 Window XID in window, Display* in display, screen in screen.

Functions§

ss_last_error⚠
The message for the most recent failure on this thread.
ss_placement_default⚠
Fill out with the default placement: contain, centred, unscaled, unflipped, unrotated, and the animation’s own canvas as the box.
ss_player_add_ssab⚠
Register an .ssab pack under pack_name without changing what plays.
ss_player_add_track_source⚠
Lay anim_name on track beside what it already carries, at weight, and write its handle to out_source. On an empty track it becomes the main source. out_source is untouched on failure.
ss_player_alpha⚠
The player-level fade in effect, after ss_player_set_alpha clamped it to 0..1; 1 for a null handle.
ss_player_animation_count⚠
How many animations the main pack holds (0 if nothing is loaded).
ss_player_animation_name⚠
The index-th animation name of the main pack, or null if out of range.
ss_player_cancel_track_fade⚠
Stop the fade on track, leaving alpha and weights where they stand.
ss_player_canvas_rect⚠
Write the authored canvas of the animation now playing into out, as a box in player-local units — what ss_player_fit_into fits when has_frame is false.
ss_player_canvas_size⚠
Canvas size of the animation currently playing. Either out-pointer may be null.
ss_player_cell_count⚠
How many cells cellmap holds: 0 when no pack is bound, the cellmap is not in it, or cellmap is not valid UTF-8.
ss_player_cell_name⚠
The index-th cell name inside cellmap — the other half of what ss_player_set_part_cell_override takes. Null if out of range, or when the cellmap is not in the main pack.
ss_player_cellmap_count⚠
How many cellmaps the main pack holds (0 if nothing is loaded).
ss_player_cellmap_name⚠
The index-th cellmap name of the main pack, without the .ssce extension — the namespace ss_player_set_part_cell_override takes. Null if out of range.
ss_player_cellmap_texture_count⚠
How many cellmap and TextureChange-target names a pack offers for replacement. pack_name null selects the main pack; 0 if nothing is loaded.
ss_player_cellmap_texture_name⚠
The index-th replaceable name of a pack — what to pass ss_player_set_cellmap_texture. pack_name null selects the main pack.
ss_player_clear_all_part_overrides⚠
Drop every override on the root animation at once.
ss_player_clear_part_cell_override⚠
Revert a part to the animation’s own cell, by part name.
ss_player_clear_part_cell_override_by_index⚠
Revert a part to the animation’s own cell.
ss_player_clear_part_color_override⚠
Revert a part to the animation’s own colour, by part name.
ss_player_clear_part_color_override_by_index⚠
Revert a part to the animation’s own colour.
ss_player_clear_part_visibility_override⚠
Revert a part to the animation’s own visibility, by part name.
ss_player_clear_part_visibility_override_by_index⚠
Revert a part to the animation’s own visibility.
ss_player_clear_track⚠
Silence a track. Track 0 is refused — fade it to alpha 0 instead.
ss_player_crossfade⚠
Fade track to anim_name over duration_ms, starting from whatever it is playing. Advanced by ss_scene_update. On track 0, anim_name takes over from the call on: it is the current animation, its state is what ss_player_is_finished reports, and it plays with the speed, direction and loop count the host set. The instance tree is not rebuilt; the instance and effect parts belong to the pack, so the running children carry on.
ss_player_crowd_count⚠
How many members ss_player_set_crowd last gave the player; 0 when it draws once, and for a null handle.
ss_player_current_animation⚠
The animation currently set up, or null before the first ss_player_set_animation and again after a load replaced the pack. No animation is not a failure, so that null leaves ss_last_error alone.
ss_player_destroy⚠
Remove a player from its scene. Null, or a handle already destroyed, is a safe no-op — the handle itself stays allocated until the scene goes.
ss_player_end_frame⚠
Last frame of that range.
ss_player_event_at⚠
Fill out with the index-th event of the last update.
ss_player_event_count⚠
How many timeline events the last ss_scene_update crossed.
ss_player_event_signal_param_at⚠
Fill out with parameter param of the index-th event, which must be a signal.
ss_player_event_signal_param_count⚠
How many parameters the index-th event carries, or 0 when it is not a signal.
ss_player_fade_track⚠
Drive track’s alpha to target over duration_ms. Fading track 0 to 0 settles the character onto the setup pose.
ss_player_find_part_index⚠
Resolve a part name to its index in the current animation, or -1 when the name is unknown, name is not valid UTF-8, or no animation is set up.
ss_player_fit_into⚠
Fit the animation into a width x height box and place it there, as ss_player_set_transform would.
ss_player_frame_no⚠
Current playhead position, fractional. 0 when nothing is loaded.
ss_player_frame_rate⚠
The rate the animation advances at. 0 when nothing is loaded.
ss_player_frame_skip_enabled⚠
See ss_player_set_frame_skip_enabled.
ss_player_is_cellmap_overridden⚠
Whether a cellmap currently carries a runtime override on this player. pack_name null selects the main pack; a null/destroyed handle reads false.
ss_player_is_culled⚠
Whether the player is culled, as ss_player_set_culled set it; false for a null handle.
ss_player_is_finished⚠
Whether every configured loop has played. Sticky until the next play or ss_player_set_animation, and never true under an infinite loop.
ss_player_is_part_hidden⚠
Whether part is hidden on the frame the last ss_scene_update built: 1 hidden, 0 shown or no frame built yet, or -1 when the name is unknown, part is not valid UTF-8, or no animation is set up. An override shows from the next update.
ss_player_is_part_hidden_by_index⚠
Index form of ss_player_is_part_hidden: 1 hidden, 0 shown, -1 when part is out of range or no animation is set up.
ss_player_is_part_skinned_mesh⚠
Whether part is a skinned mesh — a mesh part whose vertices are drawn by bone skinning: 1 if it is, 0 if it is not (a rigid deform-only mesh, or any non-mesh part — all good follow targets), or -1 when the name is unknown, part is not valid UTF-8, or no pack is bound.
ss_player_is_part_skinned_mesh_by_index⚠
Index form of ss_player_is_part_skinned_mesh: 1 skinned, 0 not, -1 when part is out of range or no pack is bound.
ss_player_is_pausing⚠
Whether playback is held in place. ss_player_is_playing stays true.
ss_player_is_playing⚠
Whether an animation has been started and has neither stopped nor finished. ss_player_pause leaves it true; ss_player_is_pausing says whether it is held.
ss_player_is_playing_forward⚠
Which way the playhead is actually travelling — not the heading ss_player_set_playback_direction configured, which ss_player_playback_direction reports. Under ping-pong the return leg runs backward while the configured heading still reads forward. Gate audio on this: SpriteStudio has no reverse audio. True with no animation set up.
ss_player_is_track_finished⚠
Whether track’s animation has played its loop count out and holds its last frame. A state, as ss_player_is_finished is for track 0; there is no edge.
ss_player_is_visible⚠
Whether the player draws, as ss_player_set_visible set it; true for a null handle.
ss_player_just_finished⚠
Whether the last ss_scene_update completed playback: true for exactly one update, unlike the sticky ss_player_is_finished. Never true under an infinite loop, and not raised by ss_player_stop.
ss_player_just_looped⚠
Whether the last ss_scene_update crossed a loop boundary. An edge: true only inside the update that crossed.
ss_player_just_started⚠
Whether the last ss_scene_update was the first to run after an ss_player_play / ss_player_play_from: true for exactly one update. Not raised by ss_player_resume, which carries on rather than starting.
ss_player_load⚠
Load a .ssab from path and everything it depends on, then select it.
ss_player_load_ssab⚠
Register pack_name and make it the pack ss_player_set_animation selects from.
ss_player_loop_count⚠
The configured loop count — before an animation is set up, the one ss_player_set_loop_count is holding for it, or 0 when none was set.
ss_player_missing_at⚠
Detail of one entry in the list ss_player_missing_count sizes.
ss_player_missing_count⚠
How many things the player’s last load could not get.
ss_player_order⚠
The draw order ss_player_set_order set; 0 for a null handle.
ss_player_part_count⚠
How many parts the root animation has; 0 before one is set up.
ss_player_part_name⚠
The name of part index, in part-index order — what turns the part_index an event carries back into something a human reads. An unnamed part reads as an empty string; null past the last part or with no pack bound.
ss_player_part_transform⚠
Write a part’s current-frame transform into out, by part name.
ss_player_part_transform_by_index⚠
Write the part’s current-frame transform into out as the 2D affine [m00, m01, m10, m11, tx, ty], in animation-local (Y-down) space with neither ss_player_set_transform nor the scene’s projection applied. A point maps as x' = m00*x + m01*y + tx, y' = m10*x + m11*y + ty.
ss_player_pause⚠
Hold playback on the current frame. Idempotent, and ignored while nothing is playing. Lift it with ss_player_resume.
ss_player_play⚠
Start the selected animation from the head of its section, re-arming the loop count. Not a resume: it rewinds, so lifting a ss_player_pause is ss_player_resume’s job. Does nothing until ss_player_set_animation has succeeded.
ss_player_play_from⚠
ss_player_play from start_frame rather than the head of the section. The family spells this play(startFrame); C has no overloads, so it is a second entry point here. Re-arms the loop count exactly as ss_player_play does. A frame outside the section is brought inside it, as ss_player_seek does.
ss_player_playback_direction⚠
0 forward, 1 backward.
ss_player_playback_style⚠
0 normal, 1 ping-pong.
ss_player_remaining_loops⚠
How many cycles of the loop count are left; 0 with no animation.
ss_player_reset_transform⚠
Back to the identity placement: centred, unscaled, unrotated.
ss_player_resume⚠
Lift a ss_player_pause, carrying on from the same frame. Idempotent, and a no-op on a stopped animation — starting one is ss_player_play’s job.
ss_player_seek⚠
Jump to frame. Fractional values are honoured.
ss_player_set_alpha⚠
Player-level fade, clamped to 0..1. Mask coverage is unaffected: a faded player clips exactly as it would at full opacity.
ss_player_set_animation⚠
Select the animation to play, rebuilding the instance tree. It is left at its start frame and not playing — call ss_player_play to start it.
ss_player_set_animation_section⚠
Restrict playback to start..=end of the current animation, so looping and ping-pong turn around inside that range. Both ends are included; an end outside the animation (-1, say) stands for the animation’s edge on that side. An end before the start, both inside the animation, is refused with the runtime’s invalid-parameter code, and the section and the playhead stay as they were.
ss_player_set_cellmap_texture⚠
Replace the texture a cellmap binds, on one player, from straight-alpha RGBA8 pixels — a costume change or dynamic expression, driven from the program rather than the authoring data.
ss_player_set_crowd⚠
Draw this one playhead count times, once at each member’s placement: a crowd that costs one player’s evaluation and draw calls, however large. count 0 draws the player once again, where ss_player_set_transform put it. The members are copied; members may be null when count is 0.
ss_player_set_culled⚠
Skip this player entirely when true: its timeline does not advance and it produces no geometry, and the time spent culled is dropped. For a player the caller knows cannot be seen; use ss_player_set_visible(false) to hide one that should keep playing.
ss_player_set_frame_rate⚠
Override the advance rate in fps. Prefer ss_player_set_speed_scale, which scales playback without replacing the authored rate.
ss_player_set_frame_skip_enabled⚠
True (the default) keeps playback on the wall clock by dropping frames under load; false advances exactly one frame per ss_scene_update.
ss_player_set_loop_count⚠
count cycles then stop; -1 (or 0) loops forever. Under ping-pong one cycle is a full round trip.
ss_player_set_order⚠
Draw order within the scene; lower draws first. The order among equal values is not guaranteed, so give players that overlap distinct orders.
ss_player_set_part_cell_override⚠
Make a part draw a different cell, by part name.
ss_player_set_part_cell_override_by_index⚠
Make a part draw a different cell. cellmap_name is written without the .ssce extension. Normal and Mask parts only; fails when the cell cannot be resolved against the loaded pack.
ss_player_set_part_color_override⚠
Override a part’s colour, by part name. Arguments as the _by_index sibling.
ss_player_set_part_color_override_by_index⚠
Override a part’s colour. blend_op: 0 mix, 1 mul, 2 add, 3 sub. rgba is packed 0xRRGGBBAA in the authored 8-bit sRGB space — do not pre-multiply it. priority: 0 until the next keyframe, 1 until the next animation, 2 permanent. Normal parts only; other kinds ignore it and still return SS_OK.
ss_player_set_part_color_override_corners⚠
Four-corner colour override, by part name. Arguments as the _by_index sibling.
ss_player_set_part_color_override_corners_by_index⚠
Four-corner colour override, for a gradient. corners points at 16 bytes in the runtime’s order — left-top, right-top, left-bottom, right-bottom, each [r, g, b, a]. Otherwise as ss_player_set_part_color_override.
ss_player_set_part_visibility_override⚠
Force-hide a part (hide true) or revert it to the animation, by part name.
ss_player_set_part_visibility_override_by_index⚠
Force-hide a part (hide true) or revert it to the animation. cascade propagates a force-hide to the part’s descendants — a keyframe hide never cascades, so this is the only way to hide a sub-tree.
ss_player_set_playback_direction⚠
direction: 0 forward, 1 backward. style: 0 normal, 1 ping-pong. Set as a pair — pass the current value for whichever you are not changing.
ss_player_set_source_event_threshold⚠
The weight at or above which source fires its events. Only track 0’s main source fires by default (the default threshold is infinity); lower this to the source’s weight or below to have it fire too.
ss_player_set_source_frame⚠
Seek one source — how a host keeps sources of different lengths in step.
ss_player_set_source_weight⚠
A source’s share within its track; weights are ratios.
ss_player_set_speed_scale⚠
Scale playback speed; 1.0 is the authored speed.
ss_player_set_sub_frame_enabled⚠
True (the default) draws between authored frames; false floors the frame that is drawn, pinning playback to whole ones.
ss_player_set_tint⚠
Player-level tint, 0xRRGGBB, multiplied into every part after the PartColor blend. 0xFFFFFF — the default — leaves colours untouched. Mask coverage is unaffected, as with ss_player_set_alpha.
ss_player_set_track_alpha⚠
How much of track survives onto the pose the tracks below produced. Not clamped: above 1 extrapolates, 0 or below contributes nothing.
ss_player_set_track_animation⚠
Put anim_name on track, replacing what it was playing. Track 0 is better set with ss_player_set_animation, which rebuilds the instance tree; this is for the overlay tracks above it. On track 0 it still makes anim_name the current animation.
ss_player_set_track_blend⚠
blend is one of SS_TRACK_BLEND_*.
ss_player_set_track_frame⚠
Seek track’s animation — how a continuous-control axis is driven.
ss_player_set_track_frame_rate⚠
ss_player_set_frame_rate for one track.
ss_player_set_track_frame_skip_enabled⚠
ss_player_set_frame_skip_enabled for one track.
ss_player_set_track_loop_count⚠
How many times track’s animation plays before it holds its last frame; -1 (or 0) loops forever. Set it after laying the animation: one is laid looping forever. On track 0 this is ss_player_set_loop_count, and the player keeps the count for every animation laid there.
ss_player_set_track_outgoing_event_threshold⚠
How far into a crossfade on track the outgoing animation keeps firing events: while its share of the track, 1 - progress, is at least threshold. The default, infinity, silences it from the moment the fade begins; 0.5 keeps it firing for the first half. Kept by the track. The update that completes the fade has already released the outgoing animation, so it fires nothing there, even at 0.
ss_player_set_track_playback_direction⚠
ss_player_set_playback_direction for one track: direction and style take the same 0 / 1 values.
ss_player_set_track_speed⚠
track’s own playback speed; 0 parks it, which is how a scrubbed axis stays where ss_player_set_track_frame puts it.
ss_player_set_track_sync⚠
sync is one of SS_TRACK_SYNC_*: where the animations laid on track from now on start. Set it before laying; a track with nothing on it yet is created for it, and ss_player_set_animation resets every track to FREE.
ss_player_set_transform⚠
Place this player in its scene: translation in pixels from the centre, scale, then rotation in radians.
ss_player_set_visible⚠
Draw nothing when false, while the timeline keeps running: the playhead advances and events are reported, so hiding a character for a moment does not slow it down. Use ss_player_set_culled to stop paying for a player that cannot be seen at all.
ss_player_source_event_threshold⚠
A source’s event threshold (infinity by default); 0 for a handle that names nothing.
ss_player_source_frame⚠
A source’s playhead; 0 for a handle that names nothing.
ss_player_source_weight⚠
A source’s weight; 0 for a handle that names nothing.
ss_player_speed_scale⚠
The speed in effect, as a multiple of the frame rate: 0 for a speed that was set to zero or below, since that is the stop it became.
ss_player_start_frame⚠
First frame of the range being played; follows ss_player_set_animation_section.
ss_player_stop⚠
Stop playback. The playhead stays where it stands; nothing rewinds.
ss_player_sub_frame_enabled⚠
See ss_player_set_sub_frame_enabled.
ss_player_texture_at⚠
Describe the index-th atlas of a registered pack, so a reference-mode host knows what to load and where the exporter put it.
ss_player_texture_count⚠
How many atlases a registered pack asks for. pack_name null selects the main pack; 0 means nothing is registered under that name.
ss_player_tint⚠
The player-level tint as 0xRRGGBB; 0xFFFFFF for a null handle.
ss_player_total_frames⚠
Length of that range, both ends inclusive.
ss_player_track_alpha⚠
track’s alpha; 0 for a track that does not exist.
ss_player_track_blend⚠
One of SS_TRACK_BLEND_*; SS_TRACK_BLEND_MIX for a track that does not exist.
ss_player_track_count⚠
Number of tracks, empty ones included; 0 before an animation is set up.
ss_player_track_fade_progress⚠
How far the fade on track has got, 0 to 1; -1 when it is not fading, since 0 is a fade that has just started.
ss_player_track_frame⚠
track’s playhead; 0 for a track with no animation.
ss_player_track_frame_rate⚠
The rate track’s animation plays at, the override or the authored rate; 0 for a track with neither, or that does not exist.
ss_player_track_frame_skip_enabled⚠
false for a track that does not exist.
ss_player_track_just_looped⚠
Whether the last ss_scene_update wrapped track’s animation back to its start, as ss_player_just_looped is for track 0.
ss_player_track_loop_count⚠
-1 for a track that loops forever; 0 for one with no animation, a count no animation reads back as.
ss_player_track_main_source⚠
The source carrying track’s animation; SS_INVALID_SOURCE when the track has none, since 0 is a handle.
ss_player_track_outgoing_event_threshold⚠
The track’s outgoing event threshold (infinity by default); 0 for a track that does not exist.
ss_player_track_playback_direction⚠
0 forward, 1 backward; 0 for a track that does not exist.
ss_player_track_playback_style⚠
0 normal, 1 ping-pong; 0 for a track that does not exist.
ss_player_track_speed⚠
What ss_player_set_track_speed stored; 0 for a track that does not exist.
ss_player_track_sync⚠
One of SS_TRACK_SYNC_*; SS_TRACK_SYNC_FREE for a track that does not exist.
ss_scene_add_texture⚠
Supply a texture for a reference-mode pack under ss_texture_ref_t.key — what ss_player_texture_at reports for the atlas. It identifies the image, not the cell map hash in DrawBatch.texture_hash. rgba is straight-alpha RGBA8, width * height * 4 bytes; it is premultiplied on the way to the GPU.
ss_scene_add_texture_png⚠
ss_scene_add_texture from encoded image bytes (PNG) instead of raw RGBA: the library decodes, premultiplies and uploads.
ss_scene_create⚠
Create a scene that renders into the window described by desc.
ss_scene_create_player⚠
Add a player to scene and return its handle, or null if scene is null.
ss_scene_destroy⚠
Destroy a scene, its players and its wgpu resources. Null is a no-op.
ss_scene_group_alpha⚠
Whether ss_scene_set_group_alpha is on; false for a null scene.
ss_scene_is_device_lost⚠
Whether the driver has taken the GPU device away. False for a null scene. While this is true ss_scene_update / ss_scene_render do nothing and ss_scene_resize only records the size.
ss_scene_player_count⚠
How many players scene currently holds.
ss_scene_render⚠
Acquire the swapchain image, draw the prepared frame into it, and present.
ss_scene_resize⚠
Resize the swapchain, the depth/stencil buffer and the projection to a new drawable size in pixels. Zero in either dimension is ignored, and a size past the device’s max_texture_dimension_2d draws at that limit.
ss_scene_restore_device⚠
Rebuild the GPU stack after a device loss and restore every player drawing into this window, resuming playback where it was interrupted.
ss_scene_set_group_alpha⚠
Fade each player whose alpha is below 1 as one layer, composited at its alpha, rather than part by part — so overlapping parts of a half-faded character read half, not three quarters. Off by default.
ss_scene_stats⚠
What the last frame cost. Writes out and returns SS_OK, or leaves it untouched and reports the reason.
ss_scene_update⚠
Advance every player in the scene by delta_seconds and build this frame’s GPU buffers. Call once per frame, before ss_scene_render.
ss_sdk_version
The SpriteStudio-SDK version whose runtime this library links, written as its release tag (v7.0.0), or local from a plain cargo build. The release zips carry the same string in lib/VERSION.
ss_version
This library’s version.