Guest User

Untitled

a guest
May 16th, 2018
131
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.69 KB | None | 0 0
  1. //enable textures.
  2. glEnable(GL_TEXTURE_2D);
  3. glHint(GL_PERSPECTIVE_CORRECTION_HINT,GL_FASTEST);
  4. glEnable(GL_BLEND);
  5. glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
  6.  
  7. // Bind the number of textures we need.
  8. glGenTextures(1, &texture[textureNumber]);
  9. glBindTexture(GL_TEXTURE_2D, texture[textureNumber]);
  10. glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER,GL_LINEAR_MIPMAP_NEAREST);
  11. glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER,GL_LINEAR);
  12. glTexParameterf(GL_TEXTURE_2D,GL_GENERATE_MIPMAP,GL_TRUE);
  13. glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S,GL_CLAMP_TO_EDGE);
  14. glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T,GL_CLAMP_TO_EDGE);
Add Comment
Please, Sign In to add comment