Guest User

Untitled

a guest
Jan 3rd, 2012
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.71 KB | None | 0 0
  1.  
  2.    GLuint textureID;//handle for new texture
  3.    glGenTextures(1, &textureID);
  4.  
  5.    glBindTexture(GL_TEXTURE_2D, textureID);
  6.  
  7.    glTexImage2D(GL_TEXTURE_2D,      //mode
  8.                 0,                  //reduction level
  9.                 GL_RGB,                  //color components
  10.                 width, height,
  11.                 0,                  //border width
  12.                 GL_BGR,             //format
  13.                 GL_UNSIGNED_BYTE,   //data type
  14.                 bufferData          //texture data
  15.                );
  16.       GLuint texUniformLocation = glGetUniformLocation(texture2D, "Texture");
  17.    glActiveTexture(GL_TEXTURE0);
  18.    glBindTexture(GL_TEXTURE_2D,mod.textureID);
  19.    glUniform1i(textureID,0);
Advertisement
Add Comment
Please, Sign In to add comment