id generation texture

This commit is contained in:
Guido Diego Quispe Robles
2024-01-18 21:53:38 -03:00
parent 0c0fcd697f
commit d773173ece
4 changed files with 39 additions and 2 deletions
@@ -16,6 +16,7 @@
#include "./models/texture.hpp"
#include "renderer/3d/mesh/mesh.hpp"
#include "renderer/core/2d/sprite/sprite.hpp"
#include "./renderer_core_texture_buffers.hpp"
#include "loaders/texture/base/texture_loader_selector.hpp"
#include <string>
@@ -25,6 +26,8 @@ class TextureRepository {
TextureRepository();
~TextureRepository();
void init(std::vector<RendererCoreTextureBuffers>* textureBuffers);
/** Returns all repository textures. */
std::vector<Texture*>* getAll() { return &textures; }
@@ -99,6 +102,13 @@ class TextureRepository {
void freeByMesh(const Mesh& mesh);
void freeByMesh(const Mesh* mesh);
/**
* remove texture buffer id if exist.
* Texture buffer is NOT destructed.
* easy way to create another texture buffer.
*/
int removeBufferId(const u32& t_texId);
/**
* Remove texture from repository.
* Texture is NOT destructed.
@@ -110,6 +120,7 @@ class TextureRepository {
void removeByIndex(const u32& t_index);
std::vector<Texture*> textures;
std::vector<RendererCoreTextureBuffers>* textureBuffers;
TextureLoaderSelector texLoaderSelector;
};
} // namespace Tyra