Strange error using canvas::createTexture

bwillers

20-05-2011 18:47:54

Hi there,

I'm running an Ogre application using two monitors, one of which displays a MyGUI gui and the second regular viewports rendering a scene.

I've recently attempted to modify the gui by adding a MyGUI::Canvas element, which is defined in the layout file. In code it is initialized as follows:

mCanvas = mGui->findWidget<MyGUI::Canvas>("MainCanvas");
mCanvas->requestUpdateCanvas = MyGUI::newDelegate(mGuiMainMenu, &GuiMainMenu::requestUpdateCanvas);
mCanvas->createTexture(512, 512, MyGUI::Canvas::TRM_PT_VIEW_REQUESTED );

Which works perfectly when running with both windows in windowed mode (which I do when I'm debugging). However, when running with either window fullscreen, the application crashes. Commenting out the createTexture() line fixes it, but then of course I can't draw to the canvas. The only difference between the working and malfunctioning case is in how the render windows are created:

ProjectorRenderWindow = Root->createRenderWindow("Projector Render Window", 800, 600, false, &nv);
GuiRenderWindow = Root->createRenderWindow("Gui Render Window", 800, 600, false, &nv2);

works perfectly, but

ProjectorRenderWindow = Root->createRenderWindow("Projector Render Window", 800, 600, true, &nv);
GuiRenderWindow = Root->createRenderWindow("Gui Render Window", 800, 600, true, &nv2);

crashes. Nothing useful in either Ogre.log or MyGUI.log, they just cease when the program crashes. Of course the fact that this only happens when running fullscreen makes using the VStudio debugger kind of tricky, so I can't figure out where or how it's crashing.

Anyone have any insight as to what might be happening?