private readonly Dictionary<NamespacedKey, Texture2D> _textures = new();
internal void Load() {
var path = "assets/textures";
var files = Directory.GetFiles(path);
foreach (var file in files) {
var texture = Raylib.LoadTexture(file);
var id = NamespacedKey.texture(file.Replace("assets/textures\\", "").Replace(".png", ""));
_textures.Add(id, texture);
Console.WriteLine("Loaded texture with id " + id.Full + " Texture Format:" + texture.Format);
}
}
internal void Unload() {
foreach (var texture in _textures) {
Raylib.UnloadTexture(texture.Value);
}
}
private readonly Dictionary<NamespacedKey, Texture2D> _textures = new();
internal void Load() {
var path = "assets/textures";
var files = Directory.GetFiles(path);
foreach (var file in files) {
var texture = Raylib.LoadTexture(file);
var id = NamespacedKey.texture(file.Replace("assets/textures\\", "").Replace(".png", ""));
_textures.Add(id, texture);
Console.WriteLine("Loaded texture with id " + id.Full + " Texture Format:" + texture.Format);
}
}
internal void Unload() {
foreach (var texture in _textures) {
Raylib.UnloadTexture(texture.Value);
}
}