MCPcopy Create free account
hub / github.com/SFML/SFML / generateMipmap

Method generateMipmap

src/SFML/Graphics/Texture.cpp:890–915  ·  view source on GitHub ↗

///////////////////////////////////////////////////////

Source from the content-addressed store, hash-verified

888
889////////////////////////////////////////////////////////////
890bool 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////////////////////////////////////////////////////////////

Callers 3

Texture.test.cppFile · 0.45
mainFunction · 0.45

Calls 1

ensureExtensionsInitFunction · 0.70

Tested by

no test coverage detected