Mouse problems and gui display error maybe ?

hotdot

28-11-2007 04:12:01

Hi

what could be the problem : when renderQueueStarted call mMouseCursor->render();

it seems mVisibleRenderObjectList never receives any elements because the only one item that goes into the loop seem to be missing a TextureName, What could make this happen ? I am not receiving any information in the log texture loaded are not correct :



...
22:48:05: Info: Freetype returned null for character 158 in font BlueHighway
22:48:05: Info: Freetype returned null for character 159 in font BlueHighway
22:48:05: Info: Freetype returned null for character 160 in font BlueHighway
22:48:05: Texture: BlueHighwayTexture: Loading 1 faces(PF_BYTE_LA,512x512x1) with 0 generated mipmaps from Image. Internal format is PF_BYTE_LA,512x512x1.
22:48:05: Texture: ogretext.png: Loading 1 faces(PF_A8R8G8B8,256x128x1) with hardware generated mipmaps from Image. Internal format is PF_A8R8G8B8,256x128x1.
22:48:05: Parsing script OgreLoadingPanel.overlay
22:48:05: Finished parsing scripts for resource group Bootstrap
22:48:05: Parsing scripts for resource group General
22:48:05: Parsing script console.material
22:48:05: Parsing script Example.material
22:48:05: Error in material Examples/Robot at line 26 of Example.material: Invalid vertex_program_ref entry - vertex program Ogre/HardwareSkinningOneWeight has not been defined.
22:48:05: Error in material Examples/Robot at line 38 of Example.material: Invalid shadow_caster_vertex_program_ref entry - vertex program Ogre/HardwareSkinningOneWeightShadowCaster has not been defined.
22:48:05: Parsing script lambert1.material
22:48:05: Parsing script Lines.material
22:48:05: Parsing script skinTemplate.material
22:48:05: Parsing script qgui.skinset
22:48:05: Parsing script acmesa.fontdef
22:48:05: Parsing script console.fontdef
22:48:05: Parsing script micross.fontdef
22:48:05: Finished parsing scripts for resource group General
22:48:05: Parsing scripts for resource group Internal
22:48:05: Finished parsing scripts for resource group Internal
22:48:05: Creating viewport on target 'OGRE Render Window', rendering from camera 'BaseCamera', relative dimensions L: 0.00 T: 0.00 W: 1.00 H: 1.00 ZOrder: 0
22:48:05: *** Initializing OIS ***
22:48:05: Font consoleusing texture size 512x256
22:48:05: Info: Freetype returned null for character 141 in font console
22:48:05: Info: Freetype returned null for character 160 in font console
22:48:05: Texture: consoleTexture: Loading 1 faces(PF_BYTE_LA,512x256x1) with 0 generated mipmaps from Image. Internal format is PF_BYTE_LA,512x256x1.
22:48:05: Quickgui : Adding qgui.button.disabled.pngto skinqgui
22:48:05: Quickgui : Adding qgui.button.down.pngto skinqgui
22:48:05: Quickgui : Adding qgui.button.over.pngto skinqgui
22:48:05: Quickgui : Adding qgui.button.pngto skinqgui
22:48:05: Quickgui : Adding qgui.checkbox.checked.disabled.pngto skinqgui
22:48:05: Quickgui : Adding qgui.checkbox.checked.down.pngto skinqgui
22:48:05: Quickgui : Adding qgui.checkbox.checked.over.pngto skinqgui
22:48:05: Quickgui : Adding qgui.checkbox.checked.pngto skinqgui
22:48:05: Quickgui : Adding qgui.checkbox.unchecked.disabled.pngto skinqgui
22:48:05: Quickgui : Adding qgui.checkbox.unchecked.down.pngto skinqgui
22:48:05: Quickgui : Adding qgui.checkbox.unchecked.over.pngto skinqgui
22:48:05: Quickgui : Adding qgui.checkbox.unchecked.pngto skinqgui
22:48:05: Quickgui : Adding qgui.checked.disabled.pngto skinqgui
22:48:05: Quickgui : Adding qgui.checked.down.pngto skinqgui
22:48:05: Quickgui : Adding qgui.checked.over.pngto skinqgui
22:48:05: Quickgui : Adding qgui.checked.pngto skinqgui
22:48:05: Quickgui : Adding qgui.combobox.button.down.pngto skinqgui
22:48:05: Quickgui : Adding qgui.combobox.button.over.pngto skinqgui
22:48:05: Quickgui : Adding qgui.combobox.button.pngto skinqgui
22:48:05: Quickgui : Adding qgui.combobox.down.pngto skinqgui
22:48:05: Quickgui : Adding qgui.combobox.highlight.pngto skinqgui
22:48:05: Quickgui : Adding qgui.combobox.list.pngto skinqgui
22:48:05: Quickgui : Adding qgui.combobox.over.pngto skinqgui
22:48:05: Quickgui : Adding qgui.combobox.pngto skinqgui
22:48:05: Quickgui : Adding qgui.console.border.bottom.pngto skinqgui
22:48:05: Quickgui : Adding qgui.console.border.bottomleft.pngto skinqgui
22:48:05: Quickgui : Adding qgui.console.border.bottomright.pngto skinqgui
22:48:05: Quickgui : Adding qgui.console.border.left.pngto skinqgui
22:48:05: Quickgui : Adding qgui.console.border.right.pngto skinqgui
22:48:05: Quickgui : Adding qgui.console.border.top.pngto skinqgui
22:48:05: Quickgui : Adding qgui.console.border.topleft.pngto skinqgui
22:48:05: Quickgui : Adding qgui.console.border.topright.pngto skinqgui
22:48:05: Quickgui : Adding qgui.console.pngto skinqgui
22:48:05: Quickgui : Adding qgui.cursor.pngto skinqgui
22:48:05: Quickgui : Adding qgui.cursor.resize.diagonal1.pngto skinqgui
22:48:05: Quickgui : Adding qgui.cursor.resize.diagonal2.pngto skinqgui
22:48:05: Quickgui : Adding qgui.cursor.resize.leftright.pngto skinqgui
22:48:05: Quickgui : Adding qgui.cursor.resize.updown.pngto skinqgui
22:48:05: Quickgui : Adding qgui.image.border.bottom.pngto skinqgui
22:48:05: Quickgui : Adding qgui.image.border.right.pngto skinqgui
22:48:05: Quickgui : Adding qgui.image.pngto skinqgui
22:48:05: Quickgui : Adding qgui.label.pngto skinqgui
22:48:05: Quickgui : Adding qgui.list.highlight.pngto skinqgui
22:48:05: Quickgui : Adding qgui.list.pngto skinqgui
22:48:05: Quickgui : Adding qgui.menu.pngto skinqgui
22:48:05: Quickgui : Adding qgui.menulist.button.down.pngto skinqgui
22:48:05: Quickgui : Adding qgui.menulist.button.over.pngto skinqgui
22:48:05: Quickgui : Adding qgui.menulist.list.border.bottom.pngto skinqgui
22:48:05: Quickgui : Adding qgui.menulist.list.border.left.pngto skinqgui
22:48:05: Quickgui : Adding qgui.menulist.list.border.right.pngto skinqgui
22:48:05: Quickgui : Adding qgui.menulist.list.pngto skinqgui
22:48:05: Quickgui : Adding qgui.multilinelabel.pngto skinqgui
22:48:05: Quickgui : Adding qgui.panel.pngto skinqgui
22:48:05: Quickgui : Adding qgui.progressbar.bar.pngto skinqgui
22:48:05: Quickgui : Adding qgui.progressbar.pngto skinqgui
22:48:05: Quickgui : Adding qgui.scrollbar.horizontal.left.down.pngto skinqgui
22:48:05: Quickgui : Adding qgui.scrollbar.horizontal.left.over.pngto skinqgui
22:48:05: Quickgui : Adding qgui.scrollbar.horizontal.left.pngto skinqgui
22:48:05: Quickgui : Adding qgui.scrollbar.horizontal.pngto skinqgui
22:48:05: Quickgui : Adding qgui.scrollbar.horizontal.right.down.pngto skinqgui
22:48:05: Quickgui : Adding qgui.scrollbar.horizontal.right.over.pngto skinqgui
22:48:05: Quickgui : Adding qgui.scrollbar.horizontal.right.pngto skinqgui
22:48:05: Quickgui : Adding qgui.scrollbar.horizontal.slider.down.pngto skinqgui
22:48:05: Quickgui : Adding qgui.scrollbar.horizontal.slider.over.pngto skinqgui
22:48:05: Quickgui : Adding qgui.scrollbar.horizontal.slider.pngto skinqgui
22:48:05: Quickgui : Adding qgui.scrollbar.vertical.down.down.pngto skinqgui
22:48:05: Quickgui : Adding qgui.scrollbar.vertical.down.over.pngto skinqgui
22:48:05: Quickgui : Adding qgui.scrollbar.vertical.down.pngto skinqgui
22:48:05: Quickgui : Adding qgui.scrollbar.vertical.pngto skinqgui
22:48:05: Quickgui : Adding qgui.scrollbar.vertical.slider.down.pngto skinqgui
22:48:05: Quickgui : Adding qgui.scrollbar.vertical.slider.over.pngto skinqgui
22:48:05: Quickgui : Adding qgui.scrollbar.vertical.slider.pngto skinqgui
22:48:05: Quickgui : Adding qgui.scrollbar.vertical.up.down.pngto skinqgui
22:48:05: Quickgui : Adding qgui.scrollbar.vertical.up.over.pngto skinqgui
22:48:05: Quickgui : Adding qgui.scrollbar.vertical.up.pngto skinqgui
22:48:05: Quickgui : Adding qgui.textbox.border.bottom.pngto skinqgui
22:48:05: Quickgui : Adding qgui.textbox.border.bottomleft.pngto skinqgui
22:48:05: Quickgui : Adding qgui.textbox.border.bottomright.pngto skinqgui
22:48:05: Quickgui : Adding qgui.textbox.border.left.pngto skinqgui
22:48:05: Quickgui : Adding qgui.textbox.border.pngto skinqgui
22:48:05: Quickgui : Adding qgui.textbox.border.right.pngto skinqgui
22:48:05: Quickgui : Adding qgui.textbox.border.top.pngto skinqgui
22:48:05: Quickgui : Adding qgui.textbox.border.topleft.pngto skinqgui
22:48:05: Quickgui : Adding qgui.textbox.border.topright.pngto skinqgui
22:48:05: Quickgui : Adding qgui.textbox.pngto skinqgui
22:48:05: Quickgui : Adding qgui.textbox.textcursor.pngto skinqgui
22:48:05: Quickgui : Adding qgui.textcursor.pngto skinqgui
22:48:05: Quickgui : Adding qgui.titlebar.button.down.pngto skinqgui
22:48:05: Quickgui : Adding qgui.titlebar.button.over.pngto skinqgui
22:48:05: Quickgui : Adding qgui.titlebar.button.pngto skinqgui
22:48:05: Quickgui : Adding qgui.titlebar.pngto skinqgui
22:48:05: Quickgui : Adding qgui.trackbar.horizontal.pngto skinqgui
22:48:05: Quickgui : Adding qgui.trackbar.horizontal.slider.down.pngto skinqgui
22:48:05: Quickgui : Adding qgui.trackbar.horizontal.slider.over.pngto skinqgui
22:48:05: Quickgui : Adding qgui.trackbar.horizontal.slider.pngto skinqgui
22:48:05: Quickgui : Adding qgui.trackbar.vertical.pngto skinqgui
22:48:05: Quickgui : Adding qgui.trackbar.vertical.slider.down.pngto skinqgui
22:48:05: Quickgui : Adding qgui.trackbar.vertical.slider.over.pngto skinqgui
22:48:05: Quickgui : Adding qgui.trackbar.vertical.slider.pngto skinqgui
22:48:05: Quickgui : Adding qgui.unchecked.down.pngto skinqgui
22:48:05: Quickgui : Adding qgui.unchecked.over.pngto skinqgui
22:48:05: Quickgui : Adding qgui.unchecked.pngto skinqgui
22:48:05: Quickgui : Adding qgui.window.border.bottom.pngto skinqgui
22:48:05: Quickgui : Adding qgui.window.border.bottomleft.pngto skinqgui
22:48:05: Quickgui : Adding qgui.window.border.bottomright.pngto skinqgui
22:48:05: Quickgui : Adding qgui.window.border.left.pngto skinqgui
22:48:05: Quickgui : Adding qgui.window.border.right.pngto skinqgui
22:48:05: Quickgui : Adding qgui.window.border.top.pngto skinqgui
22:48:05: Quickgui : Adding qgui.window.border.topleft.pngto skinqgui
22:48:05: Quickgui : Adding qgui.window.border.topright.pngto skinqgui
22:48:05: Quickgui : Adding qgui.window.pngto skinqgui
22:48:05: Quickgui : Adding qgui.window.titlebar.button.down.pngto skinqgui
22:48:05: Quickgui : Adding qgui.window.titlebar.button.over.pngto skinqgui
22:48:05: Quickgui : Adding qgui.window.titlebar.button.pngto skinqgui
22:48:05: Quickgui : Adding qgui.window.titlebar.pngto skinqgui
22:48:06: QuickGui ConfigScriptSerializer : saving to./media/skins/qgui/qgui.skinset
22:48:06: ConfigScriptSerializer : done.
22:48:06: Mesh: Loading SpaceChaloupe.mesh.
22:48:06: WARNING: SpaceChaloupe.mesh is an older format ([MeshSerializer_v1.30]); you should upgrade it as soon as possible using the OgreMeshUpgrade tool.
22:48:06: Can't assign material lambert1 to SubEntity of Chaloupe1 because this Material does not exist. Have you forgotten to define it in a .material script?
22:48:06: Texture: wood_188.jpg: Loading 1 faces(PF_R8G8B8,512x512x1) with hardware generated mipmaps from Image. Internal format is PF_X8R8G8B8,512x512x1.
22:48:07: Movement node direction : 0 0 0 Position : (0 0 0)
22:48:07: Font micross.12using texture size 256x256
22:48:07: Info: Freetype returned null for character 160 in font micross.12
22:48:07: Texture: micross.12Texture: Loading 1 faces(PF_BYTE_LA,256x256x1) with 0 generated mipmaps from Image. Internal format is PF_BYTE_LA,256x256x1.
22:48:07: WARNING: Texture instance 'SkinSet.qgui.png' was defined as manually loaded, but no manual loader was provided. This Resource will be lost if it has to be reloaded.
22:48:07: Texture: ogrelogo.png: Loading 1 faces(PF_R8G8B8,1024x1024x1) with hardware generated mipmaps from Image. Internal format is PF_X8R8G8B8,1024x1024x1.


And for other quirks here is what i got rendered without mouse its a simple button :

m_Sheet = m_GUIManager->getDefaultSheet();

QuickGUI::Label* logoLabel = m_Sheet->createLabel();
logoLabel->setDimensions(Rect(100,100,240,60));
logoLabel->setPosition(Point(60,240));
logoLabel->setText("Click Me >");

m_Sheet->setFont("micross.12",true);




It is suppose to render Click Me >, but i only see lick me :wink: This is after one call to the above code (it happens on when i hit a key. If i hit the key multiple times, a new Widget is created on top again. but now it shows something more :



... and things get alot clearer when i have 5 buttons on top of each others, i did not put any transparency in the code as you can see, so why is the text not showing properly ?

After 5 hit :

kungfoomasta

28-11-2007 04:19:46

Are you using the latest version of "qgui.cursor.png" texture? (26 x 32 pixels) I have had odd things occur when trying to render vertex buffers incorrectly.

Also, for setting dimensions:

Rect object: (x,y,width,height)

setDimensions just calls setPosition(x,y) and then setSize(width,height), so you shouldn't need setPosition after the call to setDimensions.

hotdot

28-11-2007 04:41:02

Strangely the cursor icon is the same than the demo which run fine, if we can say...

hotdot

28-11-2007 04:44:43

also it is to note that i tryed to change the renderer and in OpenGL the widget appear crisp and the text shows nicely, but... alas an error pops up when exiting the application

if(Ogre::MaterialManager::getSingletonPtr() != NULL)
Ogre::MaterialManager::getSingleton().remove(mMaterialName);


where mMaterialName = "qguiMaterial" when i inspect the variable.

Aquatix

28-11-2007 04:50:12

If that's of any help - my demo also runs fine, but the latest revision does not show any cursor in my app. Dunno much about details yet, but that was not the case a few revisions ago.

hotdot

28-11-2007 04:55:43

Thanks Aquatix, there is a definite bug somewhere or we miss some initialization, but i hunted the demo for the last 2 hours wihtout any results. I am running on a Dell Inspiron 9400 with a ATI x1400 card, could the shaders not be functionning properly with my hardware ?

Aquatix

28-11-2007 04:58:07

90% sure, nope. I tested this with cards from ATI x800 up to ATI x1900 and nVidia up to 8800 GTX, so looks like it's not to do with the card... But it's really frustrating. I mean, I'm sure I copied all the files from the demo. The only thing I do not manually add all those resources via code, but instead just add the paths to the config file.

kungfoomasta

28-11-2007 05:10:25

I did update a lot of existing qgui images, so make sure you have overwritten them.

These files definately need to be updated:

qgui.skinset
SkinSet.qgui.png
qgui.cursor.png


Possibly others, but if you were seeing the mouse previously, and still don't see the mouse after updating these files, I will be surprised.

Also, I have heard of some visual issues regarding some ATI cards. What resolution did you run the demo at, hotdot? It's odd that some of the text isn't showing up. Is it the same in OpenGL as in DirectX?

hotdot, you shouldn't be trying to remove the material like that, is that from QuickGUI code? Basically the logic should be "if this material exists, remove it", instead of "if the material manager exists, remove this material"

hotdot

28-11-2007 14:37:43

This is my Ogre.cfg, when i tried openGl the crash was in quickGuiSkinset.cpp at line 40.


[Direct3D9 Rendering Subsystem]
Allow NVPerfHUD=No
Anti aliasing=None
Floating-point mode=Fastest
Full Screen=No
Rendering Device=ATI Mobility Radeon X1400
VSync=Yes
Video Mode=1024 x 768 @ 32-bit colour

[OpenGL Rendering Subsystem]
Colour Depth=32
Display Frequency=N/A
FSAA=0
Full Screen=No
RTT Preferred Mode=FBO
VSync=No
Video Mode=1024 x 768


It is possible me and aquatix are missing some resource paths, because i am also using the resource.cfg file to declare QuickGUI paths. Anyhow i will try to mess with the resource path as well as get those graphics. I will post my results :D

hotdot

28-11-2007 16:11:00

Ok i have narrowed the problem and it seems that since i am using the resource.cfg the SkinManager does not find my qgui.skinset.png.


bool SkinSet::loadSkin()
{
ConfigNode *skinRootNode = ConfigScriptLoader::getSingleton().getConfigScript("skinset", mSkinName);
if (skinRootNode)
{
ConfigNode *size = skinRootNode->findChild("size");
if (size)
{
mTextureWidth = Ogre::StringConverter::parseInt(size->getValues()[0]);
mTextureHeight = Ogre::StringConverter::parseInt(size->getValues()[1]);
}

ConfigNode *texName = skinRootNode->findChild("texture");
// If the corresponding skinset image file is not available, return.
Ogre::StringVectorPtr results = Ogre::ResourceGroupManager::getSingleton().findResourceNames(mResourceGroup, mTextureName);
if(results.isNull() || results->empty())
return false;



Ogre::ResourceGroupManager::getSingleton().findResourceNames(mResourceGroup, mTextureName);

In the FindResource call, mResourceGroup= autodetect and mTextureName="SkinSet.qgui.png"
So either there is something not working in the autodetection, or again we are missing something.

hotdot

28-11-2007 16:27:16

Ok talk about duh, everything works now, i am going to update the wiki explicitly, this was kinda big error on my part, for some unknown reason i tried to create the QuickGuiManager before calling SetSkin, probably because it did not made sense to skin something that did not exist :P

So be sure to call

QuickGUI::SkinSetManager::getSingleton().loadSkin("qgui",QuickGUI::SkinSet::IMAGE_TYPE_PNG);

then can you can the initialisation of the manager.

mGUIManager = new QuickGUI::GUIManager(mCamera->getViewport());
mGUIManager->setSceneManager(mSceneMgr);


From an architecture point if i made this mistake and i am no newbie, probably it would be best for simplicity's sake to put the singleton's call seamlessly inside the GUIManager's constructor. That should lower errors me think, for the moment i will update the wiki on this.

kungfoomasta

28-11-2007 17:51:01

Firstly, glad you got it working.

As I have tested in my own application, QuickGUI works on multiple Render Windows. Each window has its own viewport, and each viewport is associated with its own GUIManager. With the previous design of QuickGUI, each GUIManager would make/load a "qgui" skin, which is the direction you're going. Instead, I made a SkinSetManager class, which creates and manages skins that can be used in any GUIManager.

What we could do is make all GUIManager's try to make/load the "qgui" skin, but if it already exists, do nothing. But in the case where the user doesn't want to waste time loading the "qgui" skin and has no plans to use it, its extra cost.

I try to design QuickGUI with minimal assumptions, its turning out to be quite an adventure. :lol:

hotdot

28-11-2007 18:02:16

LOL, quite an adventure ideed, i think it was just not clear in the wiki, i updated the first tutorial to reflect how important it is to do these things in order. BTW, thanks for being so open to critics, sometime we just do not know why things where made in a certain way, your explenations make things very clear. I am now in the process of doing a copy of the demo application for our gui testing purpose, i think it will end up being a Skinning test bed, i will send you screen shots when finished, after its done, i will investigate for a wrapper in lua to load gui's from scripts so artist can do exceptional stuff :) we will give away our base skin, because it will probably receive alot of iterations, we will try to facelift your programmers graphics ;)

kungfoomasta

28-11-2007 18:34:58

I'm a big fan of usability and user feedback in general. It usually results in tons of work for me to do, but the end result is a better library, whether is features, stability, or other. Looking forward to seeing what you come up with!