Skip to content

SD: Graphics API FAQ

Vittorio Romeo edited this page Oct 9, 2024 · 3 revisions
  • Why does sf::Texture have a m_pixelsFlipped member?

  • Why does sf::Texture have a m_cacheId member?

    • m_cacheId is used as a caching optimization strategy in sf::RenderTarget. If the last used texture's cache ID matches the cache ID of the texture currently used to draw, there's no need to rebind it. The reason why a custom cache ID is used instead of the OpenGL-provided texture ID is that the latter might be "recycled" by OpenGL after a texture is destroyed and another one is created, while the former is guaranteed to always be unique.
  • Why are textures unbound during sf::RenderTarget::clear?

Clone this wiki locally