///////////////////////////////////////////////////////
| 888 | |
| 889 | //////////////////////////////////////////////////////////// |
| 890 | bool Texture::generateMipmap() |
| 891 | { |
| 892 | if (!m_texture) |
| 893 | return false; |
| 894 | |
| 895 | const TransientContextLock lock; |
| 896 | |
| 897 | // Make sure that extensions are initialized |
| 898 | priv::ensureExtensionsInit(); |
| 899 | |
| 900 | if (!GLEXT_framebuffer_object) |
| 901 | return false; |
| 902 | |
| 903 | // Make sure that the current texture binding will be preserved |
| 904 | const priv::TextureSaver save; |
| 905 | |
| 906 | glCheck(glBindTexture(GL_TEXTURE_2D, m_texture)); |
| 907 | glCheck(GLEXT_glGenerateMipmap(GL_TEXTURE_2D)); |
| 908 | glCheck(glTexParameteri(GL_TEXTURE_2D, |
| 909 | GL_TEXTURE_MIN_FILTER, |
| 910 | m_isSmooth ? GL_LINEAR_MIPMAP_LINEAR : GL_NEAREST_MIPMAP_LINEAR)); |
| 911 | |
| 912 | m_hasMipmap = true; |
| 913 | |
| 914 | return true; |
| 915 | } |
| 916 | |
| 917 | |
| 918 | //////////////////////////////////////////////////////////// |
no test coverage detected