Stage 1: headless Image and AudioData; GPU and playback caches in the UI

- resource::Image (pixels, size, uid) replaces Texture in documents, undo and
  wizards; it lives in anm2ed_core with no GL. uid changes with the pixels.
- resource::texture::id_get uploads lazily and evicts textures not drawn in a frame
- resource::AudioData (bytes, uid) replaces Audio; resource::audio::play/stop/
  track_detach/is_playing cache decoded audio and tracks per uid
- Resources::icon_id_get shortens the icon call sites
- tests/assets.cpp covers Image png round trip, uid tracking, merge_append

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
shweetandClaude Opus 5.5 committed 2026-10-03 14:52:34 -04:00
1 parent 5311c2835f
commit 26ab394fe4
37 files changed
+538 -614

No files matched your search

+4 -4
View File
@@ -170,7 +170,7 @@ namespace anm2ed::imgui
auto spritesheetTransform = transform * spritesheetModel;
if (baseTexture && baseTexture->is_valid())
texture_render(shaderTexture, baseTexture->id, spritesheetTransform);
texture_render(shaderTexture, resource::texture::id_get(*baseTexture), spritesheetTransform);
if (isGrid) grid_render(shaderGrid, zoom, pan, gridSize, gridOffset, gridColor);
@@ -223,7 +223,7 @@ namespace anm2ed::imgui
auto pivotTransform =
transform * math::quad_model_get(PIVOT_SIZE, region.crop + region.pivot, PIVOT_SIZE * 0.5f);
texture_render(shaderTexture, resources.icons[icon::PIVOT].id, pivotTransform, color::WHITE);
texture_render(shaderTexture, resources.icon_id_get(icon::PIVOT), pivotTransform, color::WHITE);
}
if (highlightedRegionId != -1)
@@ -234,7 +234,7 @@ namespace anm2ed::imgui
auto pivotTransform =
transform * math::quad_model_get(PIVOT_SIZE, region->crop + region->pivot, PIVOT_SIZE * 0.5f);
texture_render(shaderTexture, resources.icons[icon::PIVOT].id, pivotTransform, PIVOT_COLOR);
texture_render(shaderTexture, resources.icon_id_get(icon::PIVOT), pivotTransform, PIVOT_COLOR);
}
}
@@ -247,7 +247,7 @@ namespace anm2ed::imgui
auto pivotTransform =
transform * math::quad_model_get(PIVOT_SIZE, frame->crop + frame->pivot, PIVOT_SIZE * 0.5f);
texture_render(shaderTexture, resources.icons[icon::PIVOT].id, pivotTransform, PIVOT_COLOR);
texture_render(shaderTexture, resources.icon_id_get(icon::PIVOT), pivotTransform, PIVOT_COLOR);
}
}