Crash when using DirectX

wacom

25-02-2008 11:51:14

Hi,

I have some problems with QuickGUI as soon as I use DirectX. With OpenGL, everything is fine. But with Direct3D, the app crashes as soon as I move the mouse. I tried something very hacky, and to a degree, it works:



mSheet = mManager->getDefaultSheet();
mSheet->setSkin("qgui", true);
mSheet->setFont("micross.16", true);
mSheet->setSkinComponent(".textbox"); // hack!
mSheet->hideSkin(); // hack!


Now it only crashes when the mouse cursor is near the border - the errors are the same. Here's the callstack:


> QuickGUI_d.dll!std::vector<QuickGUI::MemberFunctionSlot *,std::allocator<QuickGUI::MemberFunctionSlot *> >::size() Line 726 + 0x6 Bytes
QuickGUI_d.dll!std::vector<QuickGUI::MemberFunctionSlot *,std::allocator<QuickGUI::MemberFunctionSlot *> >::empty() Line 736 + 0x8 Bytes
QuickGUI_d.dll!QuickGUI::Widget::fireEvent(QuickGUI::Widget::Event e=EVENT_MOUSE_ENTER, QuickGUI::EventArgs & args={...}) Line 1121 + 0x15 Bytes
QuickGUI_d.dll!QuickGUI::GUIManager::injectMouseMove(const int & xPixelOffset=0, const int & yPixelOffset=-1) Line 608 + 0x14 Bytes
xxxxx.exe!UserInterface::injectMouseMove(const int & X=0, const int & Y=-1) Line 27 + 0x16 Bytes



It fires an EVENT_MOUSE_ENTER to a widget that doesn't exist - it even happens when I only have this sheet and no widgets on screen.

kungfoomasta

25-02-2008 18:09:42

I can't tell whats going on, I'd have to step through. Are you running in debug mode?

Also, why would you be using the setSkinComponent method? This is mostly used internally, or if you want to change a button's appearance without changing skins. Using that line of code, you're making your sheet look like the following texture "qgui.textbox.png". Is that desired?

wacom

25-02-2008 20:59:25

I can't tell whats going on, I'd have to step through. Are you running in debug mode?

Yes.

Also, why would you be using the setSkinComponent method? This is mostly used internally, or if you want to change a button's appearance without changing skins. Using that line of code, you're making your sheet look like the following texture "qgui.textbox.png". Is that desired?

As you can see, I aso hide the skin, so the sheet looks like it always does. I relly don't know why it was helping, but giving the sheet a skin somehow reduced my problems.

wacom

26-02-2008 19:55:03

So, I reduced the problem to the following fact: sometimes my cursor is over no widget. (In DirectX _and_ OpenGL now ...) My app then throws an exception because it tries to fire an event to a widget with value 0x00000000. To clear that out: my sheet has the correct size, it spans over the whole OGRE window.
I wish the QuickGUI demo app would be a little bit more structured, because I just can't find out where my error lies. I initialise OGRE, then QuickGUI, then OIS. I use a buffered mouse.

wacom

26-02-2008 20:27:06

Well, it seems that my mSheet has a (unknown) skin texture from the beginning, with pretty much transparent pixels. I really don't know how this is possible, but after calling mSheet->setUseTransparencyPicking(false), everything is fine.

Very strange.

kungfoomasta

26-02-2008 21:12:54

Sorry I haven't gotten time to look more into this yet. Do you know who is trying to fire an event to a NULL widget? (I'm guessing the GUIManager in one of the injection functions, but it could be anything really)

I use the demo to test things out, I should clean it up one of these days..

Do you find the same issues when using the demo?

kungfoomasta

28-02-2008 05:16:30

wacom, I found a really silly error and fixed it, thanks for bringing it to my attention. Its committed into SVN.

Thanks again. :)