Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- GLuint textureID;//handle for new texture
- glGenTextures(1, &textureID);
- glBindTexture(GL_TEXTURE_2D, textureID);
- glTexImage2D(GL_TEXTURE_2D, //mode
- 0, //reduction level
- GL_RGB, //color components
- width, height,
- 0, //border width
- GL_BGR, //format
- GL_UNSIGNED_BYTE, //data type
- bufferData //texture data
- );
- GLuint texUniformLocation = glGetUniformLocation(texture2D, "Texture");
- glActiveTexture(GL_TEXTURE0);
- glBindTexture(GL_TEXTURE_2D,mod.textureID);
- glUniform1i(textureID,0);
Advertisement
Add Comment
Please, Sign In to add comment