My core module calls these functions like so:
Code: Select all
ogre->renderUp(); // start up new rendering system and window
ogre->loadMenuResources();
if (!ogre->displayFlashScreens()) // if user cancels/exits during flash screens
{
return;
}
Code: Select all
void ClientOgre::renderUp()
{
window = root->initialise(true,"Game Title");
}
void ClientOgre::loadMenuResources()
{
resgrpmgr->addResourceLocation("./data/menu","FileSystem","Menu");
resgrpmgr->initialiseResourceGroup("Menu");
}
bool ClientOgre::displayFlashScreens()
{
Ogre::Overlay *flashscreen = Ogre::OverlayManager::getSingleton().create("flashscreen");
flashscreen->show();
Ogre::OverlayContainer *screenpanel = static_cast<Ogre::OverlayContainer*>(Ogre::OverlayManager::getSingleton().createOverlayElement("Panel","myflashscreen"));
screenpanel->setMaterialName("iccflashscreen.gif");
flashscreen->add2D(screenpanel);
screenpanel->show();
root->startRendering();
Sleep(2);
flashscreen->remove2D(screenpanel);
Ogre::OverlayManager::getSingleton().destroyOverlayElement(screenpanel);
screenpanel = NULL;
Ogre::OverlayManager::getSingleton().destroy(flashscreen);
flashscreen = NULL;
return true;
}
The image does exist at .\data\menu\iccflashscreen.gif . I'm guessing that I shouldn't be calling this a 'material', or I need to do something else entirely. If someone could point me towards the right approach I'd really appreciate it -- I've been looking in QuickGUI's source for some idea of how this type of thing works, but it's a little dense for me to get to grips with right now.13:52:17: Creating resource group Menu
13:52:17: Added resource location './data/menu' of type 'FileSystem' to resource group 'Menu'
13:52:17: Initialising resource group Menu
13:52:17: Parsing scripts for resource group Menu
13:52:17: Finished parsing scripts for resource group Menu
13:52:17: OGRE EXCEPTION(5:ItemIdentityException): Could not find material iccflashscreen.gif in OverlayElement::setMaterialName at C:\SoftwareDevelopment\C++\MinGW\ogrenew_HEAD_clean\OgreMain\src\OgreOverlayElement.cpp (line 330)