Advertisement
Guest User

Untitled

a guest
Dec 6th, 2013
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 1.17 KB | None | 0 0
  1. //snippe 1
  2.  
  3. GLuint texture = 0;
  4. glGenTextures(1, &texture);
  5. glBindTexture(GL_TEXTURE_2D, texture);
  6. glTexStorage2D(GL_TEXTURE_2D, 10, GL_RGBA8, 512, 512);
  7. glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, 512, 512, GL_RGBA, GL_UNSIGNED_BYTE, image_buffer);
  8. glGenerateMipmap(GL_TEXTURE_2D);
  9.  
  10. //snippe 2
  11.  
  12. GLuint texture = 0;
  13. glGenTextures(1, &texture);
  14. glTextureImage2DEXT(texture, GL_TEXTURE_2D, 0, GL_RGBA8, 512, 512, 0, GL_RGBA, GL_UNSIGNED_BYTE, image_buffer);
  15. glGenerateTextureMipmapEXT(texture, GL_TEXTURE_2D);
  16.  
  17. //snippe 3
  18.  
  19. GLuint texture = 0;
  20. glGenTextures(1, &texture);
  21. glTextureStorage2DEXT(texture, GL_TEXTURE_2D, 10, GL_RGBA8, 512, 512);
  22. glTextureSubImage2DEXT(texture, GL_TEXTURE_2D, 0, 0, 0, 512, 512, GL_RGBA, GL_UNSIGNED_BYTE, image_buffer);
  23. glBindTexture(GL_TEXTURE_2D, texture);
  24. glGenerateMipmap(GL_TEXTURE_2D);
  25.  
  26. //snippe 4
  27.  
  28. GLuint texture = 0;
  29. glGenTextures(1, &texture);
  30. glTextureStorage2DEXT(texture, GL_TEXTURE_2D, 10, GL_RGBA8, 512, 512);
  31. glTextureSubImage2DEXT(texture, GL_TEXTURE_2D, 0, 0, 0, 512, 512, GL_RGBA, GL_UNSIGNED_BYTE, image_buffer);
  32. glBindTexture(GL_TEXTURE_2D, texture); //for some reason
  33. glGenerateTextureMipmapEXT(texture, GL_TEXTURE_2D);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement