It is too much vertexes crash

korbul

10-07-2012 14:16:03

Hey guys, i recently changed my gui library to MyGUI. I got to say, it's much better than what i used before, however i kinda have a problem. I can load layouts just fine but i get an error when i try to unload them. So here is what i have:
My current project is composed of states, and when i switch between them i call a function that loads/unloads layouts. example:

void MyGuiManager::errorStateGUI( Ogre::RenderWindow* rw,Ogre::SceneManager* sm, std::string errmsg)
{
MyGUI::WidgetManager::getInstancePtr()->destroyWidgets(currentLayout);
//MyGUI::LayoutManager::getInstance ().unloadLayout (currentLayout);

setRenderWindow (rw);
setSceneManager (sm);

currentLayout = MyGUI::LayoutManager::getInstance().loadLayout("FatalError.layout");

mGUI->findWidget<MyGUI::TextBox>("ErrorTextBox")->setCaption(errmsg);
}


Here is the tricky part. This works in debug and release mode, but when i Start without debbuging (ctrl+f5) in debug mode it crashes with don't send error. Here's what the log says:


...
16:02:03 | Core | Info | Load ini file 'MyGUI_BlackOrangeTheme.xml' | C:\Users\Gladiator\Desktop\MyGUI_3.2.0\MyGUIEngine\src\MyGUI_ResourceManager.cpp | 130
16:02:03 | Core | Info | Load ini file 'MyGUI_BlackOrangeImages.xml' | C:\Users\Gladiator\Desktop\MyGUI_3.2.0\MyGUIEngine\src\MyGUI_ResourceManager.cpp | 130
16:02:03 | Core | Info | Load ini file 'MyGUI_BlackOrangeSkins.xml' | C:\Users\Gladiator\Desktop\MyGUI_3.2.0\MyGUIEngine\src\MyGUI_ResourceManager.cpp | 130
16:02:03 | Core | Info | Load ini file 'MyGUI_BlackOrangeTemplates.xml' | C:\Users\Gladiator\Desktop\MyGUI_3.2.0\MyGUIEngine\src\MyGUI_ResourceManager.cpp | 130
16:02:03 | Core | Info | Load ini file 'MyGUI_Pointers.xml' | C:\Users\Gladiator\Desktop\MyGUI_3.2.0\MyGUIEngine\src\MyGUI_ResourceManager.cpp | 130
16:02:03 | Core | Info | Load ini file 'MyGUI_Layers.xml' | C:\Users\Gladiator\Desktop\MyGUI_3.2.0\MyGUIEngine\src\MyGUI_ResourceManager.cpp | 130
16:02:03 | Core | Info | Load ini file 'MyGUI_Settings.xml' | C:\Users\Gladiator\Desktop\MyGUI_3.2.0\MyGUIEngine\src\MyGUI_ResourceManager.cpp | 130
16:02:03 | Core | Info | Gui successfully initialized | C:\Users\Gladiator\Desktop\MyGUI_3.2.0\MyGUIEngine\src\MyGUI_Gui.cpp | 133
16:02:06 | Core | Critical | It is too much vertexes | C:\Users\Gladiator\Desktop\MyGUI_3.2.0\MyGUIEngine\src\MyGUI_RenderItem.cpp | 79


as the log says, the app crashes at

// колличество отрисованных вершин
MYGUI_DEBUG_ASSERT(mLastVertexCount <= (*iter).second, "It is too much vertexes");


MyGUI::WidgetManager::getInstancePtr()->destroyWidgets(currentLayout); -> seems to be the problem. If i remove this it works but the layout remains on screen.

I would really appreciate if somebody could offer a little knowledge

Altren

11-07-2012 09:30:02

Tell me MyGUI version, that you use. Also show message, that you are trying to set in setCaption.

korbul

15-07-2012 17:36:46

sorry for being so late. I am using mygui 3.2.0 . I am not exactly sure what the problem was, or why it was solved , but all i did was to initialize my "wrapper" class (which contained mygui initialization ) later in my code and the error disappeared. I hate it when "i don't know what i did but it's solved" happens :(