Original post is here ( http://www.ogre3d.org/addonforums/viewtopic.php?f=17&t=13968 ), maybe someone from this forum had already tried to use MyGUI with LE and faced the same problem:
Have 2 questions:
1) when i'm trying to render something (single button or simple example), i got this:
Is it familiar to you? What can be the reason?
2) i catch exception when shuting down MyGui.
Call stack:
1) i got something like that on my laptop even when i was trying to launch your examples. When i tried them on computer, examples works fine, but when i tried to launch mygui in my engine, this happens again.
Constructor is:
MyGuiManager::MyGuiManager(void)
{
Gdiplus::GdiplusStartupInput m_gdiplusStartupInput;
Gdiplus::GdiplusStartup(&m_pGdiToken, &m_gdiplusStartupInput, NULL);
mPlatform = new MyGUI::OpenGLPlatform();
mPlatform->initialise(this);
mPlatform->getDataManagerPtr()->addResourceLocation("..//Assets//MyGUI_Media", false);
mGUI = new MyGUI::Gui();
mGUI->initialise("MyGUI_Core.xml");
mInfo = new diagnostic::StatisticInfo();
mFocusInfo = new diagnostic::InputFocusInfo();
MyGUI::ButtonPtr button = mGUI->createWidget<MyGUI::Button>(
"Button", 10, 10, 300, 26, MyGUI::Align::Center, "Main");
button->setCaption("exit");
button->setVisible(true);
So i hope to see a simple button, not a halfly-blurred screen.
2)
Text of exception:
Test_d.exe has triggered a breakpoint
It happens here:
if (mSizeInBytes != (size_t)bufferSize)
{
destroy();
MYGUI_PLATFORM_EXCEPT("Data size is mismatch with input array");
}
MyGUI::OpenGLVertexBuffer::create()
Line 100
MyGUI_OpenGLVertexBuffer.cpp
//because you are trying to shut down MyGUI after render or in the middle of render process.
Quite strange.
the main structure is like this:
while(!AppTerminate() && !_isQuit)
{
TimeManager.Update();
InputManager.Update();
***
MyGUImanager.Render();
}
So it shouldn't want to destruct while rendering.
Destructor is:
MyGuiManager::~MyGuiManager(void)
{
mGUI->shutdown();
delete mGUI;
mGUI = 0;
mPlatform->shutdown();
delete mPlatform;
mPlatform = 0;
Gdiplus::GdiplusShutdown(m_pGdiToken);
}
Update function is:
void MyGuiManager::Render()
{
if (mPlatform)
mPlatform->getRenderManagerPtr()->drawOneFrame();
}