I currently have runtime errors using the CEGUI Ogre Renderer.
First the specs:
I am working on Windows 8 Dev. Preview (also compiling the code under Ubuntu 11.10)
I am using Visual Studio 10
I am using Ogre 1.7.3 (custom build)
I am using CeGui 0.7.6 (also tried 0.7.5 both custom build against ogre 1.7.3)
Now the error:
When I am trying to load a scheme file the system crashes. The error is:
Run-Time Check Failure #2 - Stack around the variable 'input' was corrupted
The Debugger tracks the crash down to
OgreResourceProvider::loadRawDataContainer(const String& filename, RawDataContainer& output, const String& resourceGroup)
Which lies in the CEGUIOgreResourceProvider.cpp file.
The code of this method is:
Code: Select all
String orpGroup;
if (resourceGroup.empty())
orpGroup = d_defaultResourceGroup.empty() ?
Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME.c_str() :
d_defaultResourceGroup;
else
orpGroup = resourceGroup;
Ogre::DataStreamPtr input = Ogre::ResourceGroupManager::getSingleton().
openResource(filename.c_str(), orpGroup.c_str());
if (input.isNull())
CEGUI_THROW(InvalidRequestException(
"OgreCEGUIResourceProvider::loadRawDataContainer: Unable to open "
"resource file '" + filename + "' in resource group '" + orpGroup +
"'."));
Ogre::String buf = input->getAsString();
const size_t memBuffSize = buf.length();
unsigned char* mem = new unsigned char[memBuffSize];
memcpy(mem, buf.c_str(), memBuffSize);
output.setData(mem);
output.setSize(memBuffSize);
In the debugger it looks like the variable orpGroup has a wierd value:
+orpGroup {d_cplength=7 d_reserve=32 d_encodedbuff=0x0fd30a90 "îþîþîþîþîþîþîþîþîþîþîþîþîþîþîþîþ •|b/øÓ" ...} CEGUI::String
Also the Ogre Resource System is initialised as I can create textured Ogre Objects.
The code looks like this:
Code: Select all
//process: create the cegui renderer
mCeguiRenderer = &CEGUI::OgreRenderer::bootstrapSystem();
CEGUI::SchemeManager::getSingleton().create((CEGUI::utf8*)"VanillaSkin.scheme");
If i comment the last line the code runs just fine. (Except that i am not able to use CeGui then).
I did of course internet research. Therefore I checked the resource.cfg file from Ogre. I have tried both version i found:
Code: Select all
[Imagesets]
FileSystem=../../media/cegui/imagesets
[Fonts]
FileSystem=../../media/cegui/fonts
[Schemes]
FileSystem=../../media/cegui/schemes
[LookNFeel]
FileSystem=../../media/cegui/looknfeel
[Layouts]
FileSystem=../../media/cegui/layouts
As well as:
Code: Select all
[CEGUI]
FileSystem=../../media/cegui/imagesets
FileSystem=../../media/cegui/fonts
FileSystem=../../media/cegui/schemes
FileSystem=../../media/cegui/looknfeel
FileSystem=../../media/cegui/layouts
FileSystem=../../media/cegui/lua_scripts
FileSystem=../../media/cegui/xml_schemas
Also I tried different scheme files. Plus I checked that all dll files are present in the binary folder.
The log files didn't show an error at all, as Ogres last message is OIS is successfully created (according to the Ogre tutorials) and Cegui log tells me that the Cegui System was successfully created.
Any help would be appreciated!
Thanks in advance!/