Added MipMap to Texture and proper opengl debug info

This commit is contained in:
Julian Nießner
2018-05-10 23:16:23 +02:00
parent 47a47a15a4
commit 50fe9dbe02
5 changed files with 13 additions and 23 deletions

View File

@@ -15,6 +15,8 @@ void Texture2D::Generate(GLuint width, GLuint height, unsigned char* data) {
// Create Texture
glBindTexture(GL_TEXTURE_2D, this->ID);
glTexImage2D(GL_TEXTURE_2D, 0, this->Internal_Format, width, height, 0, this->Image_Format, GL_UNSIGNED_BYTE, data);
glGenerateMipmap(GL_TEXTURE_2D);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR);
// Set Texture wrap and filter modes
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, this->Wrap_S);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, this->Wrap_T);