I'm not sure but it seems like you're doing your RestoreGL that memsets cache in target to 0
after binding your atlas. That means that vertices that have texture coords set will not draw properly when not using any texture without doing something about your atlas.
#include <SFML/Graphics.hpp>
#include <SFGUI/SFGUI.hpp>
int main()
{
sf::RenderWindow app(sf::VideoMode(600,600),"bug");
app.resetGLStates();
sfg::SFGUI gui;
sfg::Desktop desk;
desk.Add(sfg::Window::Create());
sf::Event eve;
sf::Clock clo;
sf::Vertex ver[4];
ver[1].texCoords=ver[1].position=sf::Vector2f(0.f,256.f);
ver[2].texCoords=ver[2].position=sf::Vector2f(256.f,256.f);
ver[3].texCoords=ver[3].position=sf::Vector2f(256.f,0.f);
for(int i=0;i<4;++i)
{
//ver[i].texCoords=sf::Vector2f();//doing that fixes it as well, but that's not the point
}
while(1)
{
while(app.pollEvent(eve))
{
desk.HandleEvent(eve);
if(eve.type==sf::Event::Closed) return 0;
}
desk.Update(clo.restart().asSeconds());
app.clear();
gui.Display(app);
if(sf::Keyboard::isKeyPressed(sf::Keyboard::Space))
{
sf::Texture::bind(nullptr);
}
app.draw(ver,4,sf::Quads);
app.display();
}
}
The effect this code gives me(I really hope it's not just me) is that I get nothing except sfg window inside sf window drawn unless I press space or uncomment the zeroing of texture coords from the array.
Here's ready to test .exe of that from vs 10:
https://docs.google.com/file/d/0B8dEkQw1a4WveFdDTWpWQ2ljYWc/edit