Search code examples
eventswindowsdlsdl-2

How to Check or detect if Window is minimized or not active in SDL?


I want to do some background work if window is minimized or not active but how can I detect if the window is active or not in SDL?


Solution

  • SDL_GetWindowFlags() & check for the SDL_WINDOW_MINIMIZED/SDL_WINDOW_INPUT_FOCUS/SDL_WINDOW_MOUSE_FOCUS flags.