mirror of
https://github.com/ApfelTeeSaft/vb01.git
synced 2026-08-26 19:33:45 +00:00
flag whether to delete textures from the GPU
This commit is contained in:
+3
-3
@@ -60,8 +60,8 @@ namespace vb01{
|
||||
}
|
||||
}
|
||||
|
||||
void Texture::loadImageData(ImageAsset *asset, int i){
|
||||
glDeleteTextures(1, &texture[i]);
|
||||
void Texture::loadImageData(ImageAsset *asset, bool creating, int i){
|
||||
if(!creating) glDeleteTextures(1, &texture[i]);
|
||||
|
||||
width = asset->width;
|
||||
height = asset->height;
|
||||
@@ -81,7 +81,7 @@ namespace vb01{
|
||||
if(paths[i].substr(length - 4, string::npos) == ".png")
|
||||
png = true;
|
||||
|
||||
loadImageData((ImageAsset*)AssetManager::getSingleton()->getAsset(paths[i]));
|
||||
loadImageData((ImageAsset*)AssetManager::getSingleton()->getAsset(paths[i]), true);
|
||||
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
|
||||
|
||||
@@ -22,7 +22,7 @@ namespace vb01{
|
||||
void select(int = 0, int = 0);
|
||||
void update(int = 0);
|
||||
void animate(float, KeyframeChannel);
|
||||
void loadImageData(ImageAsset*, int = 0);
|
||||
void loadImageData(ImageAsset*, bool, int = 0);
|
||||
inline u32* getTexture(int i = 0){return &(texture[i]);}
|
||||
inline std::string* getPath(){return paths;}
|
||||
inline int getNumFrames(){return numFrames;}
|
||||
|
||||
Reference in New Issue
Block a user