Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

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.

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

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

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading