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

Method pushGLStates

src/SFML/Graphics/RenderTarget.cpp:523–550  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

521
522////////////////////////////////////////////////////////////
523void RenderTarget::pushGLStates()
524{
525 if (RenderTargetImpl::isActive(m_id) || setActive(true))
526 {
527#ifdef SFML_DEBUG
528 // make sure that the user didn't leave an unchecked OpenGL error
529 const GLenum error = glGetError();
530 if (error != GL_NO_ERROR)
531 {
532 err() << "OpenGL error (" << error << ") detected in user code, "
533 << "you should check for errors with glGetError()" << std::endl;
534 }
535#endif
536
537#ifndef SFML_OPENGL_ES
538 glCheck(glPushClientAttrib(GL_CLIENT_ALL_ATTRIB_BITS));
539 glCheck(glPushAttrib(GL_ALL_ATTRIB_BITS));
540#endif
541 glCheck(glMatrixMode(GL_MODELVIEW));
542 glCheck(glPushMatrix());
543 glCheck(glMatrixMode(GL_PROJECTION));
544 glCheck(glPushMatrix());
545 glCheck(glMatrixMode(GL_TEXTURE));
546 glCheck(glPushMatrix());
547 }
548
549 resetGLStates();
550}
551
552
553////////////////////////////////////////////////////////////

Callers 1

mainFunction · 0.80

Calls 1

isActiveFunction · 0.85

Tested by

no test coverage detected