wxWidgets + Ogre + CEGUI causing an error

For help with anything that CEGUI doesn't offer straight out-of-the-box, e.g.:
- Implementation of new features, such as new Core classes, widgets, WindowRenderers, etc. ...
- Modification of any existing features for specific purposes
- Integration of CEGUI in new engines or frameworks and writing of new plugins (Renderer, Parser, ...) or modules

Moderators: CEGUI MVP, CEGUI Team

User avatar
Falagard
Just popping in
Just popping in
Posts: 12
Joined: Wed Jan 12, 2005 12:06

wxWidgets + Ogre + CEGUI causing an error

Postby Falagard » Wed Aug 23, 2006 06:24

Hi guys,

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

User avatar
CrazyEddie
CEGUI Project Lead
Posts: 6760
Joined: Wed Jan 12, 2005 12:06
Location: England
Contact:

Postby CrazyEddie » Wed Aug 23, 2006 08:25

Hi

Resource files under the Ogre renderer are all loaded via the Ogre resource system, so should largely be unaffected by any change in working directories, if such a thing were to occur.

The crash exception looks like an uninitialised pointer - probably coming from the 'missing' font; that is, the one that failed to get created.

It's not really a known issue or anything; the addition of wxWidgets should, at least in theory, change nothing (but you already know that). So, we're left having a few stabs in the dark...

One would be to check the runtimes built against for the static wxWidgets libs - it should be ok, but it's worth checking to make sure it's using the same C/C++ runtime as the rest of the components. Though usually that particular issue manifests itself in other ways.

Sorry that's probably not much help :?

CE

User avatar
Falagard
Just popping in
Just popping in
Posts: 12
Joined: Wed Jan 12, 2005 12:06

Postby Falagard » Wed Aug 23, 2006 16:24

I figured it out ;-)

I compiled CEGUI and stepped into the code and found that createFontFromFT_Face was autoscaling the horizontal dpi and vertical dpi down to a tiny value... because my wxWidget window is being created very small (20x20) when I first create Ogre and initialize CEGUI and is later resized. Anyhow, then FT_Set_Char_Size was returning 0 because it couldn't set the size on such a small dpi.

At least I'm pretty sure this is it, I haven't yet fixed it.


Return to “Modifications / Integrations / Customisations”

Who is online

Users browsing this forum: No registered users and 5 guests