mirror of
https://github.com/devZoGok/vb01.git
synced 2026-08-26 19:43:30 +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);
|
||||
|
||||
Reference in New Issue
Block a user