Imgui: DirectX9 example becomes unresponsive when rendering interrupted by external activity

Created on 28 Nov 2017  路  2Comments  路  Source: ocornut/imgui

Not sure how to word the issue title really...but hopefully my description explains it.

Basically what i found is that when the rendering is interrupted ImGui stops responding to user input but only on the graphical level. So if I cause a UAC dialog to popup from another application, or if I lock my pc and unlock it, this happens. The buttons no longer react to being hovered on and the dialogs all don't respond. I thought maybe I broke something but I did it on a clean build of the example project (the direct x 9 one ) and the same happens. The functions of the buttons however still respond. So I have a button to launch a url and the button fires when clicked, but the graphical ImGui changes don't. So no hover, pressed or state changes happen.

backenbinding bug

Most helpful comment

Should be fixed with the code I committed in main.cpp

        // Handle loss of D3D9 device
        if (result == D3DERR_DEVICELOST && g_pd3dDevice->TestCooperativeLevel() == D3DERR_DEVICENOTRESET)
        {
            ImGui_ImplDX9_InvalidateDeviceObjects();
            g_pd3dDevice->Reset(&g_d3dpp);
            ImGui_ImplDX9_CreateDeviceObjects();
        }

All 2 comments

Hello, I can confirm the issue, it seems to only happen with the DirectX9 demo and it's not really a problem in core imgui. I think we need to change the code in main.cpp to handle Lost Devices:
https://msdn.microsoft.com/en-us/library/windows/desktop/bb174714(v=vs.85).aspx

Should be fixed with the code I committed in main.cpp

        // Handle loss of D3D9 device
        if (result == D3DERR_DEVICELOST && g_pd3dDevice->TestCooperativeLevel() == D3DERR_DEVICENOTRESET)
        {
            ImGui_ImplDX9_InvalidateDeviceObjects();
            g_pd3dDevice->Reset(&g_d3dpp);
            ImGui_ImplDX9_CreateDeviceObjects();
        }
Was this page helpful?
0 / 5 - 0 ratings

Related issues

GrammarLord picture GrammarLord  路  3Comments

spaderthomas picture spaderthomas  路  3Comments

the-lay picture the-lay  路  3Comments

ILoveImgui picture ILoveImgui  路  3Comments

mkanakis picture mkanakis  路  3Comments