Problems with version 231


30-10-2007 18:01:52

I've updated from around 224 to 231 and now I've got some serious problems: I can only get a minimum GUI to run, meaning a GUI manager with a sheet and a mouse cursor, like this:

this->GUIManager = new QuickGUI::GUIManager();
this->GUIManager->init( RenderEngine::GetSingleton()->GetCamera()->getViewport(), "qgui" ,"quickgui" );// Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME );
this->GUIManager->setSceneManager( RenderEngine::GetSingleton()->GetSceneManager() );
//Create and init menu sheet:
//this->menuSheet = this->GUIManager->createSheet();
this->menuSheet = this->GUIManager->getDefaultSheet();

this->GUIManager->setActiveSheet( this->menuSheet );

If I try to add a label like this:
//What to create label:
QuickGUI::Label* whatToCreateLabel = this->menuSheet->createLabel();
whatToCreateLabel->setPosition( 25, 300 );
whatToCreateLabel->setText( "What to create:" );
whatToCreateLabel->setTexture( "" );

It crashes as soon as ogre wants to start rendering with
Assertion failed: pRep, file e:\projects\ogrecvs\branches\eihort_vc8_clean\ogren
ew\ogremain\include\ogresharedptr.h, line 134

The ogre log doesn't give me any information. (no exception)

Now to the fun part: with Direct3D, it even crashes with the minimum GUI (the first code-block), saying farewell with
18:46:00: OGRE EXCEPTION(3:RenderingAPIException): D3DXLoadSurfaceFromSurface failed in D3D9HardwarePixelBuffer::blitToMemory at e:\projects\ogrecvs\branches\eihort_vc8_clean\ogrenew\rendersystems\direct3d9\src\ogred3d9hardwarepixelbuffer.cpp (line 486)
as you see, this time with an ogre exception...

Now, what I think is, that it might be a sort of "resource" problem.
Has anything been changed here?
As you can see in the commented part of the first line, I've also tried the default resource group as I add all resources with the CFG file.
Might this cause the problem?

The demo compiles, and actually I copied all the media from the demo media folders...

On the other side, if its a resource problem, why can I see the qgui mousecursor? (or if i apply mine, I see it also)

If I debug through the program and take a look at the menusheet when it is set to active by the guiManager, I see that there are several NULL pointers:
(doesnt matter if I create it with createSheet or getDefaultSheet)

Any suggestions?
I really don't know where to start, cause it all worked a few revisions ago ;)


30-10-2007 18:25:04

I can't remember, but I think those NULLs are correct, actually. The ScrollPane and ScrollBar's aren't created unless you call setEnableScrolling, or a function similarly named. (sorry for my bad memory right now)

Does the demo run correctly? There have been some recent commits to SVN, and I haven't gotten to run them on my machine yet. I know that the last commit I did last night worked well on my end, maybe you can revert to the last commit I made. (maybe 230, I'm not sure. Read SVN log to find out)

I'll run through this tonight and see what comes of it. Sorry for the problems.


30-10-2007 18:32:44

i'll try the 230 :)

the weird thing is, that the demo runs.
but the initialization is actually the same, except for the resource-adding.
I do it with a cfg, you per code.
Must it be in the "quickgui" resource group?


30-10-2007 18:55:58

Strange, looks like you'll have to debug to find out, if demo works and your app doesn't. :(

I think the QuickGUI resource group is just for some organization, as long as the resources are declared in some resource group, it won't matter. I'm guessing the demo doesn't use the same resources as your own project? Try minimizing differences in resources. Also, do you have a file sort of named like qgui.skinset.png, or skinset.qgui.png, and a matching qgui.skinset file?

In your code used to create a label, step line by line to see what QuickGUI line of code causes the crash to occur.


30-10-2007 22:24:05

I think thats the problem!

I got a qgui.skinset, filled with "ok" looking data, stuff like

skinset qgui
size 1024 1024
texture SkinSet.qgui.png
element button.disabled
dimension 0 0.0507813 0.131836 0.0898438
element button.down
dimension 0.132813 0.0507813 0.264648 0.0898438
element button.over
dimension 0.265625 0.0507813 0.397461 0.0898438

But the SkinSet.qgui.png looks "corrupt":

it should acutally contain all the graphics... do you know what could cause this?
it's created in media\quickgui\skins\qgui where all the other qgui graphics are... again, grateful for any hint!

Meanwhile I'll try the "hardcoded" resource-loading approach


30-10-2007 22:41:50

I pointed this out to Tuan, I thought he fixed it. You must be running in OpenGL, can you run in Direct X? It works in DX mode for sure. I'm not too experienced with pixel buffers, so I haven't fixed it myself. The alternative to DX mode is to comment out a few lines in the SkinSet class that save and load (look for) the skin, forcing the skin to be built at all times. Or I think I commented it out in the last commit I made, but I'm not certain.


31-10-2007 02:27:46

Please revert to revision 228 until things get more stable. I updated to the latest and got some funky errors myself. It may be a day or two before I can look into the bugs and see whats happening.


31-10-2007 07:44:29

ok, thanks!

tuan kuranes

31-10-2007 09:32:41

Latest working version for me was 232 yesterday (grey texture and texture resource load).
Anyway I made some fixes this until, mainly fixing Demo uses of bacground compositor (now you must hit a button to enable disable it.),so here latest 237 is working.


31-10-2007 17:54:09

great! I will update tonight and hopefully don't run into that strange material error I was getting.


02-11-2007 11:42:55

Ok, I'd like to invite everyone to spank my butt with a baseball bat or something like that :oops:

I found the problem: I forgot to load:

Only had:

The weird thing is, I didn't see any resource-problem logs in the ogre.log

Anyway, I'm happy that things are running again, thanks for support and effort!


02-11-2007 15:57:06

Strange.. if ogre doesn't find a specified material (in the skins folder) it should complain, no?

Well at least you got it working! Update to the latest revision if you liked the previous way GUIManager constructor was. No initialize function anymore. :)