I'm not sure if you'll be able to help but here goes:
I'm porting an existing application that uses CEGUI and Ogre to a new version that runs within a wxWidgets created control. Basically, this means I'm creating a window in wxWidgets and passing that handle to Ogre so that it initializes the render system to that window instead of creating its own.
I'm attempting to initialize CEGUI and it's giving me an error and crashing when I call:
CEGUI::SchemeManager::getSingleton().loadScheme((CEGUI::utf8*)"WindowsLook.scheme");
It's giving me a "Unhandled exception at 0x00000000 in GOOFEd_d.exe: 0xC0000005: Access violation reading location 0x00000000." and the call stack is empty.
It doesn't give me an error if I allow Ogre to create the window for me and don't use wxWidgets.
I'm using the version of CEGUI that comes with Ogre, the log file says it's version 0.4.1 and I'm using wxWidgets 2.6 compiled in debug mode and statically linked.
Here's my CEGUI.log:
Code: Select all
23/08/2006 02:06:45 (InfL1) +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
23/08/2006 02:06:45 (InfL1) + Crazy Eddie's GUI System - Event log +
23/08/2006 02:06:45 (InfL1) + (http://www.cegui.org.uk/) +
23/08/2006 02:06:45 (InfL1) +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
23/08/2006 02:06:45 (InfL1) CEGUI::Logger singleton created.
23/08/2006 02:06:45 (InfL1) ---- Begining CEGUI System initialisation ----
23/08/2006 02:06:45 (InfL1) CEGUI::ImagesetManager singleton created
23/08/2006 02:06:45 (InfL1) CEGUI::FontManager singleton created.
23/08/2006 02:06:45 (InfL1) CEGUI::WindowFactoryManager singleton created
23/08/2006 02:06:45 (InfL1) CEGUI::WindowManager singleton created
23/08/2006 02:06:45 (InfL1) CEGUI::SchemeManager singleton created.
23/08/2006 02:06:45 (InfL1) CEGUI::MouseCursor singleton created.
23/08/2006 02:06:45 (InfL1) CEGUI::GlobalEventSet singleton created.
23/08/2006 02:06:45 (InfL1) CEGUI::WidgetLookManager singleton created.
23/08/2006 02:06:45 (InfL1) WindowFactory for 'DefaultWindow' windows added.
23/08/2006 02:06:45 (InfL1) WindowFactory for 'DragContainer' windows added.
23/08/2006 02:06:45 (InfL1) WindowFactory for 'ScrolledContainer' windows added.
23/08/2006 02:06:45 (InfL1) Window type alias named 'DefaultGUISheet' added for window type 'DefaultWindow'.
23/08/2006 02:06:45 (InfL1) CEGUI::System singleton created.
23/08/2006 02:06:45 (InfL1) ---- CEGUI System initialisation completed ----
23/08/2006 02:06:45 (InfL1) ---- Version 0.4.1 ----
23/08/2006 02:06:45 (InfL1) ---- Renderer module is: CEGUI::OgreRenderer - Official Ogre based renderer module for CEGUI ----
23/08/2006 02:06:45 (InfL1) ---- XML Parser module is: CEGUI::TinyXMLParser - Official tinyXML based parser module for CEGUI ----
23/08/2006 02:06:45 (InfL1) ---- Scripting module is: None ----
23/08/2006 02:06:46 (InfL1) Attempting to load Scheme from file 'WindowsLook.scheme'.
23/08/2006 02:06:46 (InfL2) Started creation of Scheme 'WindowsLook' via XML file.
23/08/2006 02:06:46 (InfL2) Finished creation of Scheme 'WindowsLook' via XML file.
23/08/2006 02:06:46 (InfL2) Loaded GUI scheme 'WindowsLook' from data in file 'WindowsLook.scheme'.
23/08/2006 02:06:46 (InfL2) ---- Begining resource loading for GUI scheme 'WindowsLook' ----
23/08/2006 02:06:46 (InfL1) Attempting to create an Imageset from the information specified in file 'WindowsLook.imageset'.
23/08/2006 02:06:46 (InfL2) Started creation of Imageset 'WindowsLook' via XML file.
23/08/2006 02:06:46 (InfL2) Finished creation of Imageset 'WindowsLook' via XML file.
23/08/2006 02:06:46 (InfL1) Attempting to create Font from the information specified in file 'Tahoma6.font'.
23/08/2006 02:06:46 (InfL2) Started creation of Font 'Tahoma6' via XML file.
23/08/2006 02:06:46 (InfL1) Attempting to create Imageset 'Tahoma6_auto_glyph_images' with texture only.
23/08/2006 02:06:46 (Error) Exception: Font::createFontFromFT_Face - An error occurred while creating a source font with the requested size.
23/08/2006 02:06:46 (InfL2) Imageset 'Tahoma6_auto_glyph_images' has been destroyed.
23/08/2006 02:06:46 (Error) Font::load - loading of Font from file 'Tahoma6.font' failed.
As you can see, it's failing to create and load a font.
Also the final entry in Ogre.log is:
Code: Select all
02:06:46: Texture: WindowsLook.tga: Loading 1 faces(PF_A8R8G8B8,128x128x1) with 0 generated mipmaps from Image. Internal format is PF_A8R8G8B8,128x128x1.
... and there doesn't appear to be anything else interesting in the Ogre.log
I'm wondering if you might know what causes this? I haven't attempted to compile CEGUI from scratch and debug it - I will do so if no one can help me here.
A couple things come to mind: perhaps the current working directory is being changed by wxWidgets and CEGUI relies on that?
Perhaps wxWidgets is doing something weird with fonts that causes CEGUI to have an issue? I noticed that a few projects here are using CEGUI + wxWidgets... so maybe it's a problem with the combination of CEGUI + Ogre + wxWidgets?
Thanks,
Clay