Hi,
I'm trying to hide a fullscreen window I've created with SFML 1.6 (stable, Linux), but the window won't disappear. When I create a simple window (not fullscreen) it works fine.
here's what I'm doing:
//the_window is and sfml window, doesn't work like this
the_window.Create( sf::VideoMode( w, h, 32 ), "test", sf::Style::Fullscreen );
//this works
/*w = 800;
h = 600;
the_window.Create( sf::VideoMode( w, h, 32 ), "test", sf::Style::Titlebar | sf::Style::Close );*/
if( !the_window.IsOpened() )
{
std::cerr << "Couldn't initialize SFML." << std::endl;
the_window.Close();
exit( 1 );
}
sf::Event ev;
show(); //show the window
glClearColor( 1, 0, 0, 1 ); //fill with red
glClear( GL_COLOR_BUFFER_BIT );
the_window.Display(); //display it
while( the_window.GetEvent(ev) ); //make sure events are processed
sf::Sleep(3); //the window should stay up for 3 seconds
hide(); //then disappear
while( the_window.GetEvent(ev) ); //process events again
sf::Sleep(3);
show(); //show again, etc.
glClearColor( 1, 0, 0, 1 );
glClear( GL_COLOR_BUFFER_BIT );
the_window.Display();
while( the_window.GetEvent(ev) );
sf::Sleep(3);
hide();
while( the_window.GetEvent(ev) );
sf::Sleep(3);
So basically for the full screen it shows up once, and it stays like that until I close the window (the_window.Close()
Is this a bug in SFML? Or just how fullscreen windows work (in linux)?
Best regards,
Yours3lf