-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
SD: Graphics API FAQ
Vittorio Romeo edited this page Oct 9, 2024
·
3 revisions
-
Why does
sf::Texturehave am_pixelsFlippedmember?- tl;dr: needed to support SFML's origin being in top-left corner instead of OpenGL's bottom-left corner
- See: https://github.com/SFML/SFML/issues/1733#issuecomment-761708945
-
Why does
sf::Texturehave am_cacheIdmember?-
m_cacheIdis used as a caching optimization strategy insf::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?- tl;dr: possible driver bug
- See: https://en.sfml-dev.org/forums/index.php?topic=9350.msg106570#msg106570
