MyGUI / mygui

Fast, flexible and simple GUI.
http://mygui.info/
Other
713 stars 205 forks source link

MyGUI is crashing on a second monitor #238

Open corentinjaffre opened 2 years ago

corentinjaffre commented 2 years ago

Tried the demos (ex: Demo_PanelView.exe), with Ogre 1.13.2, using directX9 and they crash when I move the window on my second screen.

Could be an issue with the font textures: From Paroj: My guess would be that the MyGUI Fonts are manually created but without providing a loader callback, so we cannot auto-restore them.

Altren commented 2 years ago

My guess would be that the MyGUI Fonts are manually created but without providing a loader callback, so we cannot auto-restore them.

MyGUI always handled that. Also not auto-restoring resources would cause empty data rather than crash in most cases. Could you be more specific about the crash? Logs, crash callstack, error message, etc.

corentinjaffre commented 2 years ago

When I move Demo_PanelView.exe to the 2nd monitor: "cannot increment value-initialized map/set iterator" in D3D9ResourceManager::notifyOnDeviceCreate(IDirect3DDevice9* d3d9Device) Seems to be with Ogre::Resource = {mCreator=0x0000000000443f70 {...} mName="97634480_TrueTypeFont" mGroup="MyGuiResourceGroup" ...}

Ogre.log doesn't have the time to update its log before the crash, so there is no relevant information in it.

My call stack:

RenderSystem_Direct3D9_d.dll!std::_Tree_const_iterator<std::_Tree_val<std::_Tree_simple_types<Ogre::D3D9Resource *>>>::operator++() Line 198    C++
>   RenderSystem_Direct3D9_d.dll!Ogre::D3D9ResourceManager::notifyOnDeviceCreate(IDirect3DDevice9 * d3d9Device=0x0000000005b9c5c0) Line 70  C++
    RenderSystem_Direct3D9_d.dll!Ogre::D3D9Device::createD3D9Device() Line 776  C++
    RenderSystem_Direct3D9_d.dll!Ogre::D3D9Device::acquire() Line 146   C++
    RenderSystem_Direct3D9_d.dll!Ogre::D3D9DeviceManager::linkRenderWindow(Ogre::D3D9RenderWindow * renderWindow=0x00000000004473e0) Line 137   C++
    RenderSystem_Direct3D9_d.dll!Ogre::D3D9Device::validateDisplayMonitor(Ogre::D3D9RenderWindow * renderWindow=0x00000000004473e0) Line 991    C++
    RenderSystem_Direct3D9_d.dll!Ogre::D3D9Device::validate(Ogre::D3D9RenderWindow * renderWindow=0x00000000004473e0) Line 844  C++
    RenderSystem_Direct3D9_d.dll!Ogre::D3D9RenderWindow::_beginUpdate() Line 821    C++
    OgreMain_d.dll!Ogre::RenderTarget::updateImpl() Line 153    C++
    OgreMain_d.dll!Ogre::RenderTarget::update(bool swap=false) Line 558 C++
    OgreMain_d.dll!Ogre::RenderSystem::_updateAllRenderTargets(bool swapBuffers=false) Line 265 C++
    OgreMain_d.dll!Ogre::Root::_updateAllRenderTargets() Line 1230  C++
    OgreMain_d.dll!Ogre::Root::renderOneFrame() Line 863    C++
    Demo_PanelView.exe!base::BaseManager::drawOneFrame() Line 149   C++
    Demo_PanelView.exe!base::SdlBaseManager::run() Line 165 C++
    Demo_PanelView.exe!startApp<demo::DemoKeeper>() Line 59 C++
    Demo_PanelView.exe!WinMain(HINSTANCE__ * hInst=0x000000013fe10000, HINSTANCE__ * __formal=0x0000000000000000, char * strCmdLine=0x000000000036444e, int argc=1) Line 82 C++
    [External Code] 
paroj commented 2 years ago

looks like your loader becomes invalid, while the texture is still alive: https://forums.ogre3d.org/viewtopic.php?p=552832#p552832