If a bind a texture using glBindTexture, how can I unbind this texture? I'm
looking for a command like "glUnbindTexture".
Thanks a lot!
Riccardo
glBindTexture(GL_TEXTURE_nD, 0);
----------------------------------------------------------------------------
-----------
EMail: roger dot rowland at rmrsystems dot co dot uk
Why do this? You need just glDisable(GL_TEXTURE_nD). After that
it desn't matter is texture binded or not. It will not appear in further
rendering.
yooyo
Yes I know.
I just answered the guy's question. Didn't see any need to patronise.
------------------------------------------------------
Maybe he wants to delete the texture....?
--
<\___/> "To err is human, to moo bovine."
/ O O \
\_____/ FTB. For email, remove my socks.
> Maybe he wants to delete the texture....?
I'm more the recycler type:
Instead of just deleting it I throw the texture ID into a prioritizing
garbage collector. If some texture with of the same size and type is needed
again I just recycle the old ID and use glTexSubImage to insert the new
data. That's one important strategy of my engine enabling it to load new
portions of the map without pausing the game. I could of course let the
driver manage the texture management, but it gets really problemetic when
you use 1024x1024 textures in huge environments. Even if all textures for a
given location fit into 64MB VRAM it can be problematic if all texture for
a map would suck up more then 256MB RAM. The geometry must be stored
somewhere, also sounds etc. This can drive a machine with 512MB RAM into
huge problems, especially if you lock major memory pages from
swapping(=performance killer).
Eception: If the user switches the task (minimizes the window) the engine
frees all pages for swapping.
Wolfgang
void glBindTexture(GLenum target, GLuint textureName);
glBindTexture() does three things. When using textureName of
an unsigned integer other than zero for the first time, a
new texture object is created and assigned that name. When
binding to a previously created texture object, that texture
object becomes active. When binding to a textureName value
of zero, OpenGL stops using texture objects and returns to
the unnamed default texture.
I found this because I wanted the same answer!
Pete Baron