I try to set the target of glTexImage2D to GL_TEXTURE_2D_MULTISAMPLE. But I just see a white texture!
Here’s my code:
glGenTextures(1, &m_texture2 );
glBindTexture(GL_TEXTURE_2D_MULTISAMPLE, m_texture2 );
glTexParameteri(GL_TEXTURE_2D_MULTISAMPLE,GL_TEXTURE_MIN_FILTER,GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D_MULTISAMPLE,GL_TEXTURE_MAG_FILTER,GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D_MULTISAMPLE, GL_TEXTURE_WRAP_S, GL_REPEAT);
glTexParameteri(GL_TEXTURE_2D_MULTISAMPLE, GL_TEXTURE_WRAP_T, GL_REPEAT);
glTexImage2D(GL_TEXTURE_2D_MULTISAMPLE, 0, channels, size, size, 0, type, GL_UNSIGNED_BYTE, NULL );
So what’s wrong?