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

Author Topic: any way to make sure the opengl window is the active one?  (Read 3582 times)

0 Members and 1 Guest are viewing this topic.

TTK-Bandit

  • Newbie
  • *
  • Posts: 21
    • View Profile
any way to make sure the opengl window is the active one?
« 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.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
any way to make sure the opengl window is the active one?
« Reply #1 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 ;)
Laurent Gomila - SFML developer

TTK-Bandit

  • Newbie
  • *
  • Posts: 21
    • View Profile
any way to make sure the opengl window is the active one?
« Reply #2 on: March 10, 2008, 04:29:02 am »
ok, thx, any timeframe ? I know its always hard to give dates, but weeks or month ?

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
any way to make sure the opengl window is the active one?
« Reply #3 on: March 10, 2008, 04:48:01 am »
Sorry, I can't tell you. but probably weeks more than months ;)
Laurent Gomila - SFML developer

 

anything