Adriel Bradley
Adriel Bradley

Reputation: 45

How do I get glBindTextureUnit() to work?

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.

Upvotes: 0

Views: 188

Answers (1)

Nicol Bolas
Nicol Bolas

Reputation: 473174

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

Upvotes: 2

Related Questions