Texture crash

kingdranix

20-10-2007 08:48:55

Hi, it's me again.
How do I set background image? The codes I used crashes whenever I hover to the top of my game. Here's the code:
QuickGUI::Image * bgImage = m_Sheet->createImage();
bgImage->setDimensions(QuickGUI::Rect(0,0,1024,768));
bgImage->setTexture("background.jpg", false);

After doing further testing, I found that it also crashes when I set it to
bgImage->setDimensions(QuickGUI::Rect(200,200,500,500));
This happens when the mouse cursor touches the top image border and it crashes on
QuickGUIWidget.cpp line 881.
Ogre::ColourValue c = mWidgetImage->getColourAt((relX * mWidgetImage->getWidth()) - 1, (relY * mWidgetImage->getHeight()) - 1,0);

I also tried with different images and power of two textures. It also crashes with png.

Edit: I found out how to set background image but the above method crashes.
I use this:
m_Sheet->setTexture("background.jpg");

kungfoomasta

20-10-2007 13:28:26

I will try to repro this on my end. If you can get this to repro in the demo, (and post the code for me to use in demo) that would make it really easy for me to duplicate and fix.

I haven't tested with jpgs, I'm glad it works! :)

kingdranix

20-10-2007 13:49:24

I tested it in the demo. I put this code
QuickGUI::Image * bgImage = mSheet->createImage();
bgImage->setDimensions(QuickGUI::Rect(0,0,1024,768));
bgImage->setTexture("background.jpg", false);

below this code
*/ // Logos
QuickGUI::Image* logoImage = mSheet->createImage();
logoImage->setDimensions(Rect(16,42,240,180));


As for the background image, i tested it with the SkinSetImage.png and renamed it. Other images i tested are the ones without transparencies. All of them gives the same result.

kungfoomasta

20-10-2007 19:01:53

revision 199 has the fix, it was an out of bounds error.

Hopefully I haven't already discouraged you from using the library! Thanks for posting this issue, let me know of any other problems/suggestions you have. :)