Page 1 of 1

Problem loading .dds-file.

Posted: Tue Mar 16, 2010 12:47
by Nomonkeybusiness
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?

Re: Problem loading .dds-file.

Posted: Tue Mar 16, 2010 19:49
by CrazyEddie
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.