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

Method makeCurrent

src/SFML/Window/Win32/WglContext.cpp:206–221  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

204
205////////////////////////////////////////////////////////////
206bool WglContext::makeCurrent(bool current)
207{
208 if (!m_deviceContext || !m_context)
209 return false;
210
211 if (wglMakeCurrent(m_deviceContext, current ? m_context : nullptr) == FALSE)
212 {
213 err() << "Failed to " << (current ? "activate" : "deactivate")
214 << " OpenGL context: " << getErrorString(GetLastError()) << std::endl;
215 return false;
216 }
217
218 WglContextImpl::currentContext = (current ? this : nullptr);
219
220 return true;
221}
222
223
224////////////////////////////////////////////////////////////

Callers

nothing calls this directly

Calls 1

getErrorStringFunction · 0.85

Tested by

no test coverage detected