Created
August 27, 2014 13:32
-
-
Save anonymous/53307d146d3d1a750554 to your computer and use it in GitHub Desktop.
OpenGL non-power of two
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
GLuint textureID; | |
glGenTextures(1, &textureID); | |
[augmentationTexture[i] setTextureID:textureID]; | |
glBindTexture(GL_TEXTURE_2D, textureID); | |
// use linear filetring | |
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_LINEAR); | |
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_LINEAR); | |
// clamp to edge | |
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); | |
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); | |
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, [augmentationTexture[i] width], [augmentationTexture[i] height], 0, GL_RGBA, GL_UNSIGNED_BYTE, (GLvoid*)[augmentationTexture[i] pngData]); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment