I found an tutorial which is providing a overview about building an ogre program yourself (without any appContexts or stuff like that). I read over the sections which are loading and initializing the resources for ogre and I am getting a file not found exception. Here is the log entry:
17:47:02: Parsing scripts for resource group Autodetect
17:47:02: Finished parsing scripts for resource group Autodetect
17:47:02: Creating resources for group Autodetect
17:47:02: All done
17:47:02: Parsing scripts for resource group General
17:47:02: Parsing script DualQuaternion.program
17:47:02: FileNotFoundException: Cannot locate resource DualQuaternion_Common.glsl in resource group General. in ResourceGroupManager::openResource at D:\SDKs\ogre-1.10.8\OgreMain\src\OgreResourceGroupManager.cpp (line 708)
I provide you my function which is doing all the stuff with resources and scenes below. Note: I didn't implement the sceneManager or anything to display because I wanted to check if everything is working and now I am getting this log-messages...
I am wondering why it is searching in this file. I mean this is really not the location of my program. This is the location of where I built my OgreSDK. Can you give me a hint what I can do?
I already tried to debug the program, but the exception is acurring in the last line, everytime. When I add for example a scene manager the exception is thrown in this part of code.
Also I am wondering that I can't find log-messages about the creation of the group [Essentials] which should be the very first one... What are I am doing wrong?
Code: Select all
bool Application::init()
{
//setting names for config files.
pluginsCFG = "plugins.cfg";
resourcesCFG = "resources.cfg";
// creating the root object which will load plugins.
root = new Ogre::Root(pluginsCFG);
//creating config file and loading resources.cfg in it.
Ogre::ConfigFile configFile;
configFile.load(resourcesCFG);
// creating strings in which filepath and location type
//for resources are saved
Ogre::String filePath, locationType;
//Getting Section iterator for sections like [general]
Ogre::ConfigFile::SectionIterator sectionIterator = configFile.getSectionIterator();
//getting all sections:
while (sectionIterator.hasMoreElements()) {
//Iterator for items in the sections
Ogre::ConfigFile::SettingsMultiMap* items= sectionIterator.getNext();
Ogre::ConfigFile::SettingsMultiMap::iterator itemIterator;
//Get Items in section
for (itemIterator = items->begin(); itemIterator != items->end(); ++itemIterator) {
//Saving pair in our strings (filePath and locationType)
locationType = itemIterator->first;
filePath = itemIterator->second;
// Adding this to resource locations
Ogre::ResourceGroupManager::getSingleton().addResourceLocation(filePath, locationType);
}
}
//Renderwindow
Ogre::RenderWindow* renderWindow;
//showing config dialog just when ogre.cfg couldn't be find.
if (!(root->restoreConfig() || root->showConfigDialog())) return false;
renderWindow = root->initialise(true, "renderWindow");
//Set number of default mipmaps.
Ogre::TextureManager::getSingleton().setDefaultNumMipmaps(5);
//Initialize all resource groups.
Ogre::ResourceGroupManager::getSingleton().initialiseAllResourceGroups();
return true;
}
Daniel