Problem with images!

ruichaves

27-08-2007 15:58:49

i've a problem when i put other directory in "resources.cfg" , that contain images...

FileSystem=./media/gui
FileSystem=./media/gui/quickgui
FileSystem=./media/gui/interface //if i add this directory


When i put some directorie it throws an exception saying that the:


OGRE EXCEPTION (1:): the texture is not large enough to fit all widget images in QuickGUIImageSet


How i can fix this??

kungfoomasta

27-08-2007 16:13:40

SkinSet textures are set to 1024 by 1024 size. It is really hard to exceed this limit unless you have a few big images, like the older version of qgui.image.png, which was 1024 x 1024 or so.

In QuickGUI the only skin that is preloaded for you is the default QuickGUI skin, ie mGUIManager->loadSkin("qgui"). All images that are prefixed with "qgui" are used to create a texture atlas. Simply using the textures will automatically be grabbed from the SkinSet if they exist in one. You can also use textures that are not a part of a SkinSet, although they add to your batch count.

As we discussed over msn, you have not deleted your previous qgui image files. As the error message shows you, all qgui*.png files in your resource paths are larger than 1024 by 1024. I have saved the SkinSet to disk, and can say there is no way the qgui skin images come close to filling this size. (maybe 1/3 the texture is written on)

ruichaves

27-08-2007 16:23:12

So, i have images with size 1024*768!!

I cannot have that images?? If i resize the images i will have poor image quality, cause it will resize to the resolution that is rendering.

(I want to put backgrounds and other stuff)

thecaptain

27-08-2007 21:52:42

Large images such as backgrounds should not begin with qgui.* or whatever your skin name is in their filename. Only smaller images that are directly related to widgets should be there, because the SkinSet is only 1024x1024.

This is for a good reason, because other images can be used without them having to take up space in the SkinSet. You should be able to use setTexture(filename) or something similiar in the QuickGUI::Image class.

ruichaves

27-08-2007 23:26:01

But my problem is that!

i don't have qgui.* in that large images! If they are too large it throws me an exception!!

my files have the next filenames: lost.singleplayer.button.png, or shadow.png...

i had to resize the shadow.png to 200*200 because of that! the image had 1024*768...

i create the background, setting the texture...

mSheet = GUIManager::getSingletonPtr()->createSheet("lostSheet", "shadow.png");

the shadow.png is in interface diretory...

try that, cause i think it's a bug!!

kungfoomasta

28-08-2007 06:46:03

So what is the problem again? 8)




This is the code, modified right from the demo:


void createGUI()
{
using QuickGUI::Rect;
using QuickGUI::Point;
using QuickGUI::Size;

mSheet = mGUIManager->getDefaultSheet();
mSheet->setTexture("warcraft3pic_simplegui.jpg");
mSheet->setDefaultFont("acmesa.14");


I do not have a skin called "warcraft3pic_simplegui", thus this image is not part of any SkinSet.

KungFooMasta

PS, I think the screenshot looks pretty cool lol.