SFML community forums

Help => Window => Topic started by: TTK-Bandit on March 10, 2008, 01:34:37 am

Title: any way to make sure the opengl window is the active one?
Post by: TTK-Bandit on March 10, 2008, 01:34:37 am
I want to make the mouse turn the camera, when the opengl window is active (focused),
but the gainedFocus and lostFocus events are not reliable, often they come when they shouldnt, or they dont come when they should.
like when switching from windowed mode to fullscreen or vice versa, I always get lostFocus.
Is there any way to check wether the app has focus or not ? couldnt find anything except for the events.
Title: any way to make sure the opengl window is the active one?
Post by: Laurent on March 10, 2008, 02:16:39 am
Quote
but the gainedFocus and lostFocus events are not reliable, often they come when they shouldnt, or they dont come when they should.
like when switching from windowed mode to fullscreen or vice versa, I always get lostFocus.

It's because switching video mode requires to call sf::Window::Create, and it recreates the window (destroy the old one and create a new one). So you always get a LostFocus event, and no GainedFocus.

That's a know "bug" that will be fixed in the future. Then the focus events will be reliable enough ;)
Title: any way to make sure the opengl window is the active one?
Post by: TTK-Bandit on March 10, 2008, 04:29:02 am
ok, thx, any timeframe ? I know its always hard to give dates, but weeks or month ?
Title: any way to make sure the opengl window is the active one?
Post by: Laurent on March 10, 2008, 04:48:01 am
Sorry, I can't tell you. but probably weeks more than months ;)