Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Unbinding a texture

895 views
Skip to first unread message

Riccardo Rossi

unread,
Apr 14, 2004, 9:22:49 AM4/14/04
to
Hi all!

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


Roger Rowland

unread,
Apr 14, 2004, 9:28:02 AM4/14/04
to
"Riccardo Rossi" <riccardo...@email.it> wrote in message
news:JWafc.1967$Qc.8...@twister1.libero.it...

> Hi all!
>
> If a bind a texture using glBindTexture, how can I unbind this texture?
I'm
> looking for a command like "glUnbindTexture".


glBindTexture(GL_TEXTURE_nD, 0);


----------------------------------------------------------------------------
-----------
EMail: roger dot rowland at rmrsystems dot co dot uk


yooyo

unread,
Apr 16, 2004, 10:25:17 AM4/16/04
to

"Roger Rowland" <see...@bottomof.message> wrote in message
news:108194928...@echo.uk.clara.net...

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


Roger Rowland

unread,
Apr 16, 2004, 10:56:37 AM4/16/04
to
"yooyo" <yoo...@sbb.co.yu> wrote in message
news:c5oqce$4acpv$1...@ID-219049.news.uni-berlin.de...

>
> 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.


------------------------------------------------------

fungus

unread,
Apr 16, 2004, 2:02:54 PM4/16/04
to
yooyo wrote:
>
> 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.
>

Maybe he wants to delete the texture....?


--
<\___/> "To err is human, to moo bovine."
/ O O \
\_____/ FTB. For email, remove my socks.

Wolfgang Draxinger

unread,
Apr 18, 2004, 10:54:03 AM4/18/04
to
fungus wrote:

> 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

siba...@hotmail.com

unread,
Jun 26, 2004, 11:41:57 PM6/26/04
to
From the 'redbook':

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

0 new messages