rev 220 -> rev 258


12-11-2007 10:48:56

I just upgraded from 220 to 258 and now I am getting a crash at startup. Here is the call stack:

#0 006863C6 ZNSt8_Rb_treeISsSt4pairIKSsPN8QuickGUI7SkinSetEESt10_Select1stIS5_ESt4lessISsESaIS5_EE8_M_beginEv() (??:??)

#1 006861A1 ZNSt8_Rb_treeISsSt4pairIKSsPN8QuickGUI7SkinSetEESt10_Select1stIS5_ESt4lessISsESaIS5_EE4findERS1_() (??:??)

#2 0067BEE8 ZNSt3mapISsPN8QuickGUI7SkinSetESt4lessISsESaISt4pairIKSsS2_EEE4findERS6_() (??:??)

#3 005E844A ZN8QuickGUI14SkinSetManager10skinLoadedERKSs() (C:\code\TinEngine\Core\Test\QuickGUI.dll:??)

#4 005E7FA4 ZN8QuickGUI14SkinSetManager17embeddedInSkinSetERKSsS2_() (C:\code\TinEngine\Core\Test\QuickGUI.dll:??)

#5 005DC274 ZN8QuickGUI4Quad10setTextureERKSs() (C:\code\TinEngine\Core\Test\QuickGUI.dll:??)

#6 005D1138 ZN8QuickGUI11MouseCursorC1ERKNS_4SizeERKSsPNS_10GUIManagerE() (C:\code\TinEngine\Core\Test\QuickGUI.dll:??)

#7 005CB2B4 ZN8QuickGUI10GUIManagerC1EPN4Ogre8ViewportE() (C:\code\TinEngine\Core\Test\QuickGUI.dll:??)

#8 0041FD1A tcf::engine::CreateGUISystem() (??:??)

#9 00423CC8 tcf::engine::Invoke() (??:??)

#10 004076E5 main() (??:??)


12-11-2007 11:07:13

OK, fixed it by adding these lines.


It is getting a bit hard to follow the API changes. If it is not too much work, could you make a thread which lists all further API changes (sorted by rev-number).

And I have a few more bugs to report (all console related).

1. When I move the mouse pointer over the input widget, I get the following error message:
12:04:00: Quickgui : error in Widget::overTransparentPixel getting correct Mouse to widget position

2. After scrolling the console, when the input widget was empty and I return to focus to it, it won't accept keybaord input.

Edit: I took out the loadSkin line again, because I don't want to load the addtional skinset (qgui.skinset/SkinSet.qqui.png). But if these files aren't present, I am still getting a crash. Is there something, that I am missing?

Edit: And another one:

3. The mouse pointer becomes invisible, when it is over a scrollbar.


12-11-2007 17:31:32

Sorry about the API changes, I updated the wiki with an example of how to get QuickGUI running, which briefly explains and shows the code required.

1. I hate that overTransparentPixel bug, it pops up every now and then, and I'm not sure what the root cause is. Basically I'm trying to match the cursor pixel with the image pixel, and the cursor pixel is calculated as a negative position. The cursor pixel must be between (0,0) and (textureWidth,textureHeight)

2. Are you using the Console Widget, or a console made of a collection of widgets? (The easier it is for me to repro your behavior, the faster I can figure out the problem)

3. SkinSetManager::loadSkin will look for qgui.skinset and SkinSet.qgui.png if they exist, and use that to load the SkinSet. If they are not present, the two files should be created and used. I will see if I get a crash when both files are not present. (when you say you don't want to load the additional skinset, does this mean you're using your own personal one, or you don't want to load qgui twice?)

4. On resizable widgets, the mouse goes transparent, when it should become a resize cursor. I am going to make a minor redesign to the cursor handling. Also, I need to fix some problems related to the setSkin function.


12-11-2007 18:31:42

2. Sorry, for not providing enough information. I was a bit in a hurry. I guess it will be the easiest, if I simple post the code which creates the console GUI:

QuickGUI::Sheet& Sheet = *GUI.getDefaultSheet();

QuickGUI::Size Size = Sheet.getSize();

d_Main = Sheet.createWindow();
d_Main->setDimensions (QuickGUI::Rect (0, 0, Size.width*1, Size.height*0.4));
d_Main->setBringToFrontOnFocus (false);

Size = d_Main->getSize();

d_Input = d_Main->createTextBox();

float Height = d_Input->getSize().height;

d_Input->setDimensions (
QuickGUI::Rect (Size.width*0.02, Size.height-Height*1.5, Size.width*0.96, Height));

d_Text = d_Main->createPanel();
d_Text->setDimensions (QuickGUI::Rect (0, 0, Size.width*1, Size.height-Height*2));
d_Text->allowScrolling (true);

3. I am using a slightly modified skin, which exists as a collection of png files.I don't have any skinset files of my own.

4. A scrollbar is resizable?


12-11-2007 18:49:33

2. I will try to repro this.

3. Haven't tested this, will try to run demo without call to loadSkin and see what happens.

4. Nope, they aren't resizable, but depending where your mouse cursor is, it could be related. (the right edge of the scroll bar might be on the right edge of a window) Does the cursor go invis over a scrollbar in the demo? I'll take a loot at it.


12-11-2007 18:57:39

3. Very strange. I can't reproduce the crash I was getting earlier. Works perfectly without the loadSkin call. Probably wasn't the skinset file at all. But I do get crashes, when the SkinTemplate.material file is missing. Is this one mandatory now?

4. No idea about the demo. Haven't tried it for a while and with the current Code::Blocks project file it doesn't compile.


12-11-2007 19:01:43

3. The material is currently required. I will look into a way to make it not required. I remember looking at it before and wanting to change it, but I'm not familiar with rendering materials in the first place, and my render function is a little different than before. Have to figure it out. :wink:

4. Ah, wasn't aware of that. Well I'm useless when it comes to Code::Blocks, so I can't really do much about that. :(


13-11-2007 06:56:08

1. Haven't hit this bug yet, but tomorrow I will update the exception thrown to give the cursor position and the texture dimensions. Or I could just set the position to 0,0... but that doesn't really fix the problem, just hides it.

2. I could not reproduce this with your setup, because I didn't have enough items to cause the ScrollBar to appear. I could not reproduce this with the console widget. If possible, can you switch to using the console widget? I am planning on adding in transparent transfer of widget focus, so typing keys with slider in focus will make the input box focused, and give it the keys.

3. I don't get any crashes when running the demo without the call "loadSkin". Haven't addressed rendering without a material.

4. I thought I saw the mouse go transparent over ScrollBars, but now I don't see it. If I see it I'll investigate.

I haven't committed changes yet, I'm halfway through an internal change, and it would be a bad idea to commit now. I'll update the SVN thread when I have committed the changes. The changes I'm doing shouldn't be visible/affect the public API.


13-11-2007 09:23:20

If possible, can you switch to using the console widget?

I would rather not. I put a lot of work into customizing my console and I don't want to throw that all away. Besides, that wouldn't fix the bug. Since you can't reproduce it, I guess I will have to investigate it myself (not sure though, when I will find the time for it).

I am planning on adding in transparent transfer of widget focus, so typing keys with slider in focus will make the input box focused, and give it the keys.

Not so sure about this one. The problem of the slider taking the focus is not limited to console-implementations. That happens with every scrollable window with writable TextBoxes (or any other widget that can take key input). That is not really the desirable behaviour, but I think it is even less desirable to have this behaviour show up in some places and in other places not.


13-11-2007 14:07:35

I was able to narrow the problem down a bit. It seems that when I click on the TextBox after scrolling, the TextBox is not gaining the focus (the cursor is showing up though). Instead the scrollbar slider is keeping the focus.


13-11-2007 17:10:35

I was thinking maybe you were calling setGainFocusOnClick(false), which might be recursive and make all child widgets have the same property. There might be a scenario where the textbox has it set, but the scrollbar doesn't because, its created at a later date. But I don't see us calling that. Not sure why TextBox doesn't want to receive focus.