SDL Device correctly processing events?

You discovered a bug in the engine, and you are sure that it is not a problem of your code? Just post it in here. Please read the bug posting guidelines first.

SDL Device correctly processing events?

Postby despair » Sat Aug 19, 2017 11:04 pm

Is the Irrlicht SDL device binding correctly processing input/window focus events? I am unable to get it to stop rendering when the focus is released, or when the window is minimised.

How to reproduce: create any irrlicht device using type EIDT_SDL, and insert code that occurs when device->isWindowActive() or device->isWindowMinimized().

Expected: when the device window loses focus, the loop falls through to the next code that occurs when the window is NOT active. When the device is minimised, the loop additionally jumps to the code when the device is minimised.

Actual: I cannot break out of the regular device rendering loop; i.e. the device thinks it's always active and in focus.

Posts: 1
Joined: Wed Aug 16, 2017 7:27 am

Re: SDL Device correctly processing events?

Postby CuteAlien » Sun Aug 20, 2017 1:57 am

Phew, I've only started working with SDL device a little bit very recently and original coder long gone. From code (CIrrDeviceSDL.cpp) it looks like it tries to handle it at least:
cpp Code: Select all
    if (( == SDL_APPMOUSEFOCUS) ||
            ( == SDL_APPINPUTFOCUS))
        WindowHasFocus = (;
    if ( == SDL_APPACTIVE)
        WindowMinimized = (!=1);

isWindowActive returns "WindowHasFocus && !WindowMinimized);" and isWindowFocused and isWindowMinimized return the corresponding variables.

That seems to be all code about this. Not sure if it's enough or would need to handle any other events. Might also depend on platform somewhat (for example I use SDL in webbrowser/emscripten which does not always work exactly the same as SDL on desktop).
IRC: #irrlicht on
Code snippets, patches&stuff:
Free racer created with Irrlicht:
User avatar
Posts: 8528
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany

Return to Bug reports

Who is online

Users browsing this forum: No registered users and 1 guest