Problem loading .dds-file.

For help with general CEGUI usage:
- Questions about the usage of CEGUI and its features, if not explained in the documentation.
- Problems with the CMAKE configuration or problems occuring during the build process/compilation.
- Errors or unexpected behaviour.

Moderators: CEGUI MVP, CEGUI Team

Nomonkeybusiness
Not too shy to talk
Not too shy to talk
Posts: 45
Joined: Wed Sep 09, 2009 11:20

Problem loading .dds-file.

Postby Nomonkeybusiness » Tue Mar 16, 2010 12:47

Hello. I've run into some trouble while trying to load a .dds-file, and creating a texture from it.
Basically what I'm doing is this:

Code: Select all

CEGUI::Texture* pTex = &m_pGUIRenderer->createTexture( );
pTex->loadFromFile( sImageFilename.c_str( ), "GUI_PATH" );


I get this error from the log:

Code: Select all

16/03/2010 13:33:42 (Error)   CEGUI::RendererException in file d:\temp\cegui-0.7.1-vc9\cegui\src\renderermodules\direct3d9\ceguidirect3d9texture.cpp(174) : Direct3D9Texture::loadFromFile - SILLYImageCodec - Official SILLY based image codec failed to load image '../Game/Files/Graphic/GUI/GUI_Common/GUI_Loadingscreen.dds'.


Can someone please enlighten me as to why this worked before I converted to CEGUI 0.7.1 from 0.6.2, and how I can fix it?

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

Re: Problem loading .dds-file.

Postby CrazyEddie » Tue Mar 16, 2010 19:49

The reason this worked prior to 0.7 was because we were using some function or other in the D3DX lib for image loading, whereas now we're using the CEGUI::ImageCodec approach for all renderers. So what you need is to use an ImageCodec that supports the format(s) you need. SILLY does not load this format, generally to load DDS files will mean the use of one of the "big two" (i.e. DevIL or FreeImage), or alternatively you could have a stab at writing an ImageCodec based off of the D3DX image loading (or raise it as a feature request, and we'll do it - eventually ;) ).

To set an alternate default image codec, you can either compile it in as the default (change the option in config.lua), or use code similar to this prior to instantiating the CEGUI::System object:

Code: Select all

CEGUI::System::setDefaultImageCodecName( "FreeImageImageCodec" );


HTH

CE.


Return to “Help”

Who is online

Users browsing this forum: No registered users and 14 guests