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

Method clear

src/SFML/Graphics/RenderTarget.cpp:201–215  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

199{
200////////////////////////////////////////////////////////////
201void RenderTarget::clear(Color color)
202{
203 if (RenderTargetImpl::isActive(m_id) || setActive(true))
204 {
205 // Unbind texture to fix RenderTexture preventing clear
206 applyTexture(nullptr);
207
208 // Apply the view (scissor testing can affect clearing)
209 if (!m_cache.enable || m_cache.viewChanged)
210 applyCurrentView();
211
212 glCheck(glClearColor(color.r / 255.f, color.g / 255.f, color.b / 255.f, color.a / 255.f));
213 glCheck(glClear(GL_COLOR_BUFFER_BIT));
214 }
215}
216
217
218////////////////////////////////////////////////////////////

Callers

nothing calls this directly

Calls 1

isActiveFunction · 0.85

Tested by

no test coverage detected