Files
anm2ed/src/resources.hpp
T
shweetandClaude Opus 5.5 26ab394fe4 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>
2026-10-03 14:52:34 -04:00

30 lines
578 B
C++

#pragma once
#include <imgui/imgui.h>
#include "audio.hpp"
#include "font.hpp"
#include "icon.hpp"
#include "shader.hpp"
#include "texture.hpp"
namespace anm2ed
{
class Resources
{
public:
resource::Font fonts[resource::font::COUNT]{};
resource::Image icons[resource::icon::COUNT]{};
resource::Shader shaders[resource::shader::COUNT]{};
resource::AudioData music{};
Resources();
GLuint icon_id_get(int);
resource::AudioData& music_track();
resource::AudioData* music_track_if_loaded();
private:
bool isMusicLoaded{false};
};
}