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 -5
View File
@@ -26,8 +26,8 @@ namespace anm2ed
static constexpr auto STEP = 1.0f;
static constexpr auto STEP_FAST = 5.0f;
static constexpr auto ZOOM_LEVEL_STEP = 1;
static constexpr std::array ZOOM_LEVELS = {1.0f, 2.0f, 5.0f, 10.0f, 15.0f, 25.0f, 33.0f,
50.0f, 66.0f, 75.0f, 100.0f, 125.0f, 150.0f, 200.0f,
static constexpr std::array ZOOM_LEVELS = {1.0f, 2.0f, 5.0f, 10.0f, 15.0f, 25.0f, 33.0f,
50.0f, 66.0f, 75.0f, 100.0f, 125.0f, 150.0f, 200.0f,
300.0f, 400.0f, 600.0f, 800.0f, 1200.0f, 2000.0f};
static constexpr auto GRID_SIZE_MIN = 1;
static constexpr auto GRID_SIZE_MAX = 10000;
@@ -60,10 +60,9 @@ namespace anm2ed
void axes_render(resource::Shader&, float, glm::vec2, glm::vec4 = glm::vec4(1.0f)) const;
void grid_render(resource::Shader&, float, glm::vec2, glm::ivec2 = glm::ivec2(32, 32), glm::ivec2 = {},
glm::vec4 = glm::vec4(1.0f)) const;
void texture_render(resource::Shader&, GLuint&, glm::mat4 = {1.0f}, glm::vec4 = glm::vec4(1.0f), glm::vec3 = {},
void texture_render(resource::Shader&, GLuint, glm::mat4 = {1.0f}, glm::vec4 = glm::vec4(1.0f), glm::vec3 = {},
float* = (float*)TEXTURE_VERTICES, glm::vec2 = {}, float = 0.0f) const;
void rect_fill_render(resource::Shader&, const glm::mat4&, const glm::mat4&,
glm::vec4 = glm::vec4(1.0f)) const;
void rect_fill_render(resource::Shader&, const glm::mat4&, const glm::mat4&, glm::vec4 = glm::vec4(1.0f)) const;
void rect_render(resource::Shader&, const glm::mat4&, const glm::mat4&, glm::vec4 = glm::vec4(1.0f),
float dashLength = DASH_LENGTH, float dashGap = DASH_GAP, float dashOffset = DASH_OFFSET) const;
float zoom_level_get(float, int) const;