Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void Texture::Load(const std::string &filename) {
- // Load only if we havent done so already
- if(m_texture_id_ == 0) {
- // skip
- // Insert texture creation here
- // Use gli::createTexture2D to load and create texture name and bind it
- m_texture_id_ = gli::createTexture2D(filename);
- glBindTexture(GL_TEXTURE_2D, m_texture_id_); // <----- Error occurs here!!!
- // Set wrapping to repeat in both S and T directions
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
- // Set linear interpolation for magnification and linear-mipmap-linear for minification
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
- // Construct mipmaps
- glTexParameteri(GL_TEXTURE_2D, GL_GENERATE_MIPMAP, GL_TRUE);
- // unskip
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement