createTexture not throwing exception

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

SuperMegaMau
Just popping in
Just popping in
Posts: 8
Joined: Fri Mar 31, 2006 17:33
Location: Portugal

createTexture not throwing exception

Postby SuperMegaMau » Sun Apr 02, 2006 14:26

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

User avatar
lindquist
CEGUI Team (Retired)
Posts: 770
Joined: Mon Jan 24, 2005 21:20
Location: Copenhagen, Denmark

Postby lindquist » Tue Apr 25, 2006 15:43

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.

SuperMegaMau
Just popping in
Just popping in
Posts: 8
Joined: Fri Mar 31, 2006 17:33
Location: Portugal

Postby SuperMegaMau » Wed Apr 26, 2006 09:24

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...)?


Return to “Modifications / Integrations / Customisations”

Who is online

Users browsing this forum: No registered users and 5 guests