Currently, one can tell a render target to preserve OpenGL state, but this means the complete render state is pushed/popped for each and every drawable. Most of the time when combining OpenGL rendering and SFML rendering, we have a large section of GL code (3D rendering) and a large section of SFML code (GUI overlays etc). Therefore it would be far more efficient to push GL state once before using SFML and popping it once afterward (instead of for each individual sprite, font etc.).
Currently I solved this by making my own (see below), but adding these to the API might be useful.
// taken from RenderTarget::Draw and RenderTarget::SetRenderStates
void _preSFML()
{
glMatrixMode(GL_MODELVIEW); glPushMatrix();
glMatrixMode(GL_PROJECTION); glPushMatrix();
glPushAttrib(GL_COLOR_BUFFER_BIT | GL_CURRENT_BIT | GL_ENABLE_BIT |
GL_TEXTURE_BIT | GL_TRANSFORM_BIT | GL_VIEWPORT_BIT);
glDisable(GL_ALPHA_TEST);
glDisable(GL_DEPTH_TEST);
glDisable(GL_LIGHTING);
}
void _postSFML()
{
glMatrixMode(GL_PROJECTION); glPopMatrix();
glMatrixMode(GL_MODELVIEW); glPopMatrix();
glPopAttrib();
}