Page 1 of 1

createTexture not throwing exception

Posted: Sun Apr 02, 2006 14:26
by SuperMegaMau
hi,

I have a weird problem using the createTexture() method.

Code: Select all

try
{
   CEGUI::Texture* texture = mGUIRenderer->createTexture(imagePath);
   imageSet = CEGUI::ImagesetManager::getSingleton().createImageset(imageID, texture);
   imageSet->defineImage(imageID,CEGUI::Point(0.0f, 0.0f),CEGUI::Size(texture->getWidth(), texture->getHeight()),CEGUI::Point(0.0f,0.0f));      
}   
catch (...)
{
   CEGUI::Texture* texture = mGUIRenderer->createTexture(imagePath);
   imageSet = CEGUI::ImagesetManager::getSingleton().createImageset(imageID, texture);
   imageSet->defineImage(imageID,CEGUI::Point(0.0f, 0.0f),CEGUI::Size(texture->getWidth(), texture->getHeight()),CEGUI::Point(0.0f,0.0f));      
}


this is just a reproduction of a problem I'm having, this is not the code I'm programming :).
As you can see, I'm using the exact code in the try and catch, so basically, the same code is executed two times. First, it throws an exception an the createTexture function, then at the catch part, the same code is again executed. The problem is that this time, the createTexture function does not throw the exception. I need it to throw it everytime...

thanks

Posted: Tue Apr 25, 2006 15:43
by lindquist
First, sorry for the long delay.

What renderer module are you using?
I've had a look at the renderers we have in the repository (not ogre) and while there is a problem it should not prevent the exception from being thrown.

The problem there is, is that even if the createTexture functions throws, the texture will still be added to the internal list.
This list is anonymous tho, and in no way reference counted, so it should still throw.

If you using Ogre, then the problem is likely in that renderer code. If not let me know and I'll investige further.

I will add these bugs to our tracker, and fix them when I get the time.

Posted: Wed Apr 26, 2006 09:24
by SuperMegaMau
Yes, I'm using OGRE... about that internal list, is there a way to remove the texture from this list so it throws the exception again like if it was the first time (a workarround for now...)?