Problem hide overlay then shows black GUI object

wilsonwing

30-01-2009 07:08:08

Hi, me again.
I am having a nice time using QuickGUI.
But I got some problem now.

I made my project base on the "ExampleFrameListener" supported by the Tutorials in the wiki page.
And in the ExampleFrameListener constructor there is

mDebugOverlay = OverlayManager::getSingleton().getByName("Core/DebugOverlay");
...
...
...
showDebugOverlay(true);
...
...


I make the showDebugOverlay() set to false, to disable the debug overlay.(The overlay shows the FPS, batch count, triangle count...etc).
And then the QuickGUI components on the screen goes black, like showed in the picture:


Should be something like this(but without the debug overlay on the left button)


I also tried to create a overlay by myself.
Or even not to create overlay.
But the result goes, I must use "show" a overlay to make QuickGUI unit to show on the screen.

I search the forum and find that the Ogre Overlay should has no relations to the GuickGUI :?
Would some help , THANKS!

kungfoomasta

30-01-2009 18:29:35

Is this using QuickGUI 8.12 or later? This could somehow be related to the GUI inheritting the previous render pass, which I fixed in 8.12. The GUI should not be related to the Overlay in any way. If you're getting this on 9.1 drop, I can look into this over the weekend. I think 8.12 or 9.1 should fix the issue.

wilsonwing

31-01-2009 06:34:35

Is this using QuickGUI 8.12 or later? This could somehow be related to the GUI inheritting the previous render pass, which I fixed in 8.12. The GUI should not be related to the Overlay in any way. If you're getting this on 9.1 drop, I can look into this over the weekend. I think 8.12 or 9.1 should fix the issue.
I was using QuickGUI 8.09 version.
And just download the 8.12 and give it a try, the problem mentioned above is not appear using 8.12.

But I found something strange in ver 8.12, maybe a bug?
I am not able to create more than 1 GUIManager.
I was having many GUIManagers in the 8.09 ver created in each of my game scene like this.

QuickGUI::GUIManagerDesc l_GUIManagerDesc;
l_GUIManagerDesc.sceneManager = pSceneManager;
m_pGUIManager = QuickGUI::Root::getSingletonPtr()->createGUIManager(l_GUIManagerDesc);

If not a bug, how do I deal with this problem :?

And the other one.
This is part of my code

l_pTextBoxD->widget_dimensions = QuickGUI::Rect(68, 200+i*22, 44, 22);
l_pTextBoxD->widget_enabled = false;//problem should be here
m_pBiasValueTextBox[i] = defaultSheet->createTextBox(l_pTextBoxD);//<--- after this line, crash
m_pBiasValueTextBox[i]->addCharacter('0');


I got crash and run into here:

void TextBox::setEnabled(bool enabled)
{
Widget::setEnabled(enabled);

if(!mWidgetDesc->widget_enabled)
{
if(mBlinkTimer != NULL)
mBlinkTimer->stop(); [color=#BF0000]//<----here[/color]
if(mTextCursor != NULL)
mTextCursor->setVisible(false);

if((mWidgetDesc->sheet != NULL) && (mWidgetDesc->sheet->getKeyboardListener() == this))
mWidgetDesc->sheet->setKeyboardListener(NULL);
}
}


I tried this, this time works fine:

l_pTextBoxD->widget_dimensions = QuickGUI::Rect(68, 200+i*22, 44, 22);
//l_pTextBoxD->widget_enabled = false;
m_pBiasValueTextBox[i] = defaultSheet->createTextBox(l_pTextBoxD);
m_pBiasValueTextBox[i]->setEnabled(false);
m_pBiasValueTextBox[i]->addCharacter('0');

kungfoomasta

31-01-2009 09:39:41

I've fixed both issues. In the first case, you cannot have 2 GUIManagers with the same name. I was also auto generating names for GUIManagers incorrectly, so now you can have multiple GUIManagers even if you don't specify a name. Also, a GUIManager's default sheet is not called "DefaultSheet", since duplicate Sheets are not allowed. Instead, the default sheet = GUIManager's name + ".DefaultSheet".

Fixed the disabling of the TextBox, I had forgotten to set a pointer to NULL in the constructor. I also applied the fix to the TextArea widget.

I'll upload the next version in a few days. Thanks for reporting the issues!

wilsonwing

02-02-2009 05:30:38

I've fixed both issues. In the first case, you cannot have 2 GUIManagers with the same name. I was also auto generating names for GUIManagers incorrectly, so now you can have multiple GUIManagers even if you don't specify a name. Also, a GUIManager's default sheet is not called "DefaultSheet", since duplicate Sheets are not allowed. Instead, the default sheet = GUIManager's name + ".DefaultSheet".

Fixed the disabling of the TextBox, I had forgotten to set a pointer to NULL in the constructor. I also applied the fix to the TextArea widget.

I'll upload the next version in a few days. Thanks for reporting the issues!

Thanks for the explain. :D
But still have problem even give it a specific name:

QuickGUI::GUIManagerDesc l_GUIManagerDesc;
l_GUIManagerDesc.sceneManager = pSceneManager;
l_GUIManagerDesc.name = pSceneManager->getName() + "_GUI";
m_pGUIManager = QuickGUI::Root::getSingletonPtr()->createGUIManager(l_GUIManagerDesc);

Still can't make mor than 1 GUIManager :?