Kaynağa Gözat

No need to completely delete and re-generate texture id when recreating. Can simply re-use the same ID. This makes hot-loading textures into shaders work a bit cleaner

Bill Robinson 11 yıl önce
ebeveyn
işleme
7bc0a1a00b
1 değiştirilmiş dosya ile 2 ekleme ve 3 silme
  1. 2 3
      Core/Contents/Source/PolyGLTexture.cpp

+ 2 - 3
Core/Contents/Source/PolyGLTexture.cpp

@@ -66,11 +66,10 @@ void OpenGLTexture::recreateFromImageData() {
 	
 	Number anisotropy = CoreServices::getInstance()->getRenderer()->getAnisotropyAmount();
 	
-	if(glTextureLoaded) {
-		glDeleteTextures(1, &textureID);
+	if (!glTextureLoaded) {
+		glGenTextures(1, &textureID);
 	}
 	
-	glGenTextures(1, &textureID);
 	glBindTexture(GL_TEXTURE_2D, textureID);
 	
 	if(clamp) {