Stas Jaro
Stas Jaro

Reputation: 4885

How to delete textures in OpenGL 2.x?

I followed this tutorial to create a basic game using OpenGL and after profiling it, discovered that even after a sprite is removed, the textures are not being released creating a memory leak. I easily fixed the problem by creating a cache in the Sprite class, but I would like to know how I can delete the texture itself for future reference. It is loaded with GLKTextureLoader.

Upvotes: 1

Views: 1853

Answers (1)

koki
koki

Reputation: 352

GLuint index = self.textureInfo.name;
glDeleteTextures(1, &index);

Upvotes: 3

Related Questions