Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Can't hide fullscreen window  (Read 5014 times)

0 Members and 1 Guest are viewing this topic.

Yours3lf

  • Newbie
  • *
  • Posts: 43
    • View Profile
Can't hide fullscreen window
« on: July 02, 2013, 07:27:11 pm »
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

Hiura

  • SFML Team
  • Hero Member
  • *****
  • Posts: 4321
    • View Profile
    • Email
Re: Can't hide fullscreen window
« Reply #1 on: July 02, 2013, 08:02:09 pm »
SFML 1.6 is deprecated since a long time now. Please consider upgrading to SFML 2.0.
SFML / OS X developer

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: Can't hide fullscreen window
« Reply #2 on: July 02, 2013, 08:03:09 pm »
Quote
Is this a bug in SFML? Or just how fullscreen windows work (in linux)?
I have no idea. You should try with SDL, for example.
Laurent Gomila - SFML developer

Yours3lf

  • Newbie
  • *
  • Posts: 43
    • View Profile
Re: Can't hide fullscreen window
« Reply #3 on: July 04, 2013, 02:06:38 pm »
thanks for the replies!

@Hiura: I can't unfortunately :( I'm only allowed to use stable versions of software. Is SFML 2.0 stable already?
@Laurent: No way, I'm not going back to SDL :P

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: Can't hide fullscreen window
« Reply #4 on: July 04, 2013, 02:25:09 pm »
Quote
Is SFML 2.0 stable already?
It depends what "stable" means for you. But it's already much better than SFML 1.6.

Quote
I'm not going back to SDL
That's not what I meant. I just said that you should try with SDL, since it has been there for years and has well-defined behaviours. This is good way to differenciate between SFML bugs and OS behaviours.
Laurent Gomila - SFML developer

Yours3lf

  • Newbie
  • *
  • Posts: 43
    • View Profile
Re: Can't hide fullscreen window
« Reply #5 on: July 04, 2013, 02:32:04 pm »
Well, stable means that the release is labeled as stable. Not as release candidate or something like that. (I know RC has been around for a while)
I'd need the stable labeling, because the lead programmer on our project only allows using such software :)

As for SDL, I will try it.

For now I solved the issue by caching the OpenGL resources in system memory, so that when I close the SFML window I still have the data around, and next time, I just need to re-upload the data.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: Can't hide fullscreen window
« Reply #6 on: July 04, 2013, 03:00:09 pm »
Quote
Well, stable means that the release is labeled as stable. Not as release candidate or something like that.
It is. I think it is obvious that SFML 2.0 is no longer in RC stage by looking at the website :P
Laurent Gomila - SFML developer

Yours3lf

  • Newbie
  • *
  • Posts: 43
    • View Profile
Re: Can't hide fullscreen window
« Reply #7 on: July 04, 2013, 03:25:33 pm »
oh well stupid me :D
thank you :)

 

anything