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

Method cleanupDraw

src/SFML/Graphics/RenderTarget.cpp:903–920  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

901
902////////////////////////////////////////////////////////////
903void RenderTarget::cleanupDraw(const RenderStates& states)
904{
905 // Unbind the shader, if any
906 if (states.shader)
907 applyShader(nullptr);
908
909 // If the texture we used to draw belonged to a RenderTexture, then forcibly unbind that texture.
910 // This prevents a bug where some drivers do not clear RenderTextures properly.
911 if (states.texture && states.texture->m_fboAttachment)
912 applyTexture(nullptr);
913
914 // Mask the color buffer back on if necessary
915 if (states.stencilMode.stencilOnly)
916 glCheck(glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE));
917
918 // Re-enable the cache at the end of the draw if it was disabled
919 m_cache.enable = true;
920}
921
922} // namespace sf
923

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected