How do I get glBindTextureUnit() to work?

65 views Asked by At

The following works fine:

glActiveTexture(GL_TEXTURE0);
glBindTexture(GL_TEXTURE_2D, m_ID);

But when I replace it with this, it doesn't work. (I don't get any errors, just a black color instead of the texture):

glBindTextureUnit(GL_TEXTURE0, m_ID);

From what I searched online I can't see what I'm doing wrong, so I'm not sure how to troubleshoot this.

1

There are 1 answers

0
Nicol Bolas On BEST ANSWER

glBindTextureUnit does not take OpenGL texture unit enumerators like GL_TEXTURE0. It takes texture unit indices, like 0.