OpenGL取消绑定纹理 [英] OpenGL Unbind texture
本文介绍了OpenGL取消绑定纹理的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有大量的2D纹理,每次加载地图时都会加载(取决于地图及其内容).我正在寻找一种方法来解除绑定纹理的绑定,以减少内存使用.绑定纹理功能非常完美,只是看不到要取消绑定某些或全部ID的任何功能.
I have a huge list of 2D Textures that I load each time a map loads (Depending on the map and it's contents). I'm looking for a way to anyhow unbind a bound texture to reduce usage of memory. The bind texture function works perfect just don't see any function to unbind some ids or all of them.
推荐答案
尝试
glDeleteTextures(1, &texID)
这应该从内存中删除纹理.在该调用之前,请确保通过简单的调用来取消绑定纹理:
This should remove texture from memory. Before that call be sure to unbind currect texture by simply calling:
glBindTexture(target, 0) // << default texture object
这篇关于OpenGL取消绑定纹理的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文