[Solved]No Output to Screen with MyGUI + OpenGL 3 Engine

Apostate

24-07-2012 05:12:51

I'm trying to integrate MyGUI 3.2.0 into my OpenGL 3 engine, but I'm having some problems. My OpenGL engine does not use any OpenGL functions deprecated/removed in OpenGL 3.3. I have everything built and linked ,with a little mucking around to make sure the FreeType libs ended up in the right place so MyGUI could find them.

I followed the quick start guide and adjusted it to use OpenGLPlatform, but I skipped over the input sections just so I could get it displaying first. I wrote the image loader interface, which works, but I left the save function empty for now if that makes any difference. I don't get any compilation errors or crashes. There aren't any errors in the log file. I've been through the FAQ and I'm kind of in the same situation as the last two entries, but the functions they mention don't exist for OpenGLPlatform, so they probably don't apply.

At one point I had random triangles with what looked like MyGUI's textures on them sticking out from the last mesh I drew from my engine, but I figured out they were just getting caught up in the previous shaders I had bound for my meshes and they disappeared after I unbound the shaders. I checked in gDEBugger and there are vertex buffers and textures being loaded from MyGUI code, so I'm pretty sure they're loading correctly. I know the textures are loading correctly, at least, and the vertex buffers don't look corrupted or anything. I also stepped through the code and it seemed to be drawing something, but I don't get any output on the screen from MyGUI. What am I missing?

In my WindowMgr init():

if (m_platform == NULL)
{
m_platform = new MyGUI::OpenGLPlatform();
m_platform->initialise(&m_imageLoader);
m_platform->getDataManagerPtr()->addResourceLocation("./data/ui/MyGUI", false);
}
if (m_GUI == NULL && m_platform != NULL)
{
m_GUI = new MyGUI::Gui();
m_GUI->initialise();
}

MyGUI::ButtonPtr button = m_GUI->createWidget<MyGUI::Button>("Button", 300, 10, 300, 26, MyGUI::Align::Default, "Main", "test");
button->setCaption("Test");


In WindowMgr render():

if (m_platform != NULL)
{
renderGlobals.shaderMgr.unbindAll();
m_platform->getRenderManagerPtr()->drawOneFrame();
}


In WindowMgr resizeWindow():

if (m_platform != NULL)
{
m_platform->getRenderManagerPtr()->setViewSize(_width, _height);
}


In WindowMgr close():

if (m_GUI != NULL)
{
m_GUI->shutdown();
delete m_GUI;
m_GUI = NULL;
}
if (m_platform != NULL)
{
m_platform->shutdown();
delete m_platform;
m_platform = NULL;
}

Apostate

26-07-2012 06:07:35

Durrrr, I forgot to unbind whatever vertex array object was currently bound, which messed up the vertex buffer that MyGUI uses. Problem solved, I'm dumb.