Skip to main content
GameDev.net gamedev.net
🔒 Locked

glBindTexture()

Started by HyprLogik Jan 15, 2001 at 3:26 AM 1 replies 450+ views
Original Post
HyprLogik
HyprLogik
I know that since you can''t bind a texture that is currently in use, an error pops up if you try. How do I see if a certain texture is being used at the moment? Thanx. |-|A[k3R$Z R \/\/|-|AT |V|Ak3 t|-|3 \/\/0R|_D g0 R0|_||\|D!!
|-|A[k3R$Z R //|-|AT |V|Ak3 t|-|3 //0R|D g0 R0||||D!!
MButchers
MButchers
the only way I know of is storing the texture id yourself
ie

  

GLuint BoundTexture;

void __fastcall TextureLibClass::BindTexture(int Index)
{
if(glTextureIDs[Index] != BoundTexture){
glBindTexture(GL_TEXTURE_2D,glTextureIDs[Index];
BoundTexture = glTextureIDs[Index];
}
}



hope this helps.
zedzeek
zedzeek
i dont understand u can bind a texture more than once yes its redundant but u shouldnt get an error

ie theres nothing wrong with the following
glBindTexture(GL_TEXTURE_2D,texture)
draw someit
glBindTexture(GL_TEXTURE_2D,texture)
draw someit

http://members.xoom.com/myBollux

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.