Advertisement
Guest User

Untitled

a guest
Oct 24th, 2014
139
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.89 KB | None | 0 0
  1. void Texture::Load(const std::string &filename) {
  2. // Load only if we havent done so already
  3. if(m_texture_id_ == 0) {
  4. // skip
  5. // Insert texture creation here
  6. // Use gli::createTexture2D to load and create texture name and bind it
  7. m_texture_id_ = gli::createTexture2D(filename);
  8. glBindTexture(GL_TEXTURE_2D, m_texture_id_); // <----- Error occurs here!!!
  9. // Set wrapping to repeat in both S and T directions
  10. glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
  11. glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
  12. // Set linear interpolation for magnification and linear-mipmap-linear for minification
  13. glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
  14. glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
  15. // Construct mipmaps
  16. glTexParameteri(GL_TEXTURE_2D, GL_GENERATE_MIPMAP, GL_TRUE);
  17. // unskip
  18. }
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement