First attempt with QuickGUI 0.9.6b, crash...

chunky

11-12-2007 01:28:58

Heya,

I really like the look of quickGUI and have started trying to use it, and have come across a crash. I imagine I'm missing something horribly obvious, but I simply don't see what I'm doing wrong, I hope someone can point me in the correct direction.

First, I inject events in OIS using code exactly taken from QuickGUIDemo.

Second, this is all my GUI code so far [literally, all of it]:

mGUIManager = QuickGUI::GUIManager::getSingletonPtr();
mGUIManager->setup(mWindow->getWidth(),mWindow->getHeight());

mSheet = mGUIManager->getDefaultSheet();
mSheet->setDefaultFont("TuxWars");
// This font exists, and is the one I'm using for the stuff [fps/speed] you see at the top of the screen

mChatWindow = mSheet->createWindow("Chat Window",QuickGUI::Rect(0.0,0.8,0.4,0.19));

mChatInputTB = mChatWindow->createTextBox(QuickGUI::Rect(0,0.8,1.0,0.2));


On-screen, that works fine and looks like this:
http://chunkyks.com/videos/firstwindow.mov
Of note is that at this point, there's no text in the titlebar of the window. I don't know if that's relevant, but it stands out to me.

All good so far. Next I click on the textbox, and the cursor appears at the far left. As soon as I hit a key, I get a segmentation fault.

Apologies for using a screenshot where text would arguably have been easier, I have a hard time getting XCode to give me text that's usefully pastable while debugging:
http://chunkyks.com/quickguicrash.png.
Basically it appears that the crash is due to QuickGUITextBox.cpp:186. This line returning NULL:
Quad* character = mText->getCharacter((mCursorIndex - mVisibleStart) - 1);

So, I don't really know how to progress. I'm pretty much certain that I haven't initialised something in my code, but I'm not sure. I looked at the wiki, specifically http://www.ogre3d.org/wiki/index.php/QuickGUI_Beginner_Tutorial_1, but I fell at the first hurdle there, "STEP 1 : Registering the configuration parser", since QuickGUI::registerScriptParser(); appears to not exist.

Thank-you very much for your time,
Gary (-;

kungfoomasta

11-12-2007 03:26:44

Welcome, chunky!

Can you try this version?

http://stormsonggames.com/downloads/QuickGUIv0.9.7PreRelease.zip

The demo was written for this version, which is why certain functions don't exist from 0.9.6b.

I couldn't play the .mov file, I believe thats a quicktime extension right? Either way, update to this version and let me know further problems, I will do my best to help. :)

chunky

11-12-2007 19:04:05

OK, so. In order to make it compile, I had to apply most of the stuff from this linux thread [I'm on OSX]: http://www.ogre3d.org/phpBB2addons/viewtopic.php?t=5819

I'm still working on getting it so I can actually input text. Mainly now, I'm confused as to where fonts are set, there doesn't appear to be a single global setFontDefault type setting?

Thanks,
Gary (-;

kungfoomasta

11-12-2007 19:12:09

QuickGUI uses ogre fonts, so if you don't specify a font, the first loaded font is used.

If you set the Sheets font via setFont("myfont"), all child widgets will inherit the font on creation. Make sure "myfont" is defined within a .fontdef file.

I'm not familiar with OSX, sorry for your troubles there.

Now that you're using a more updated version, you're still getting a crash when pressing a key, with the text box in focus? I wonder if maybe the font you're using is too large to fit into the text box?

Can you provide a call stack, and re-outline the steps to repro the crash, in case they've changed?

chunky

11-12-2007 22:30:43

Heya, sorry I'm so slow, I'm doing about eighteen things at once.

Please don't apologise for porting issues, it's mostly compiler witchery and your code itself works great, that's something to be proud of if you've never tried to compile on OSX :-D

Anyways. Regarding getting text working, it seems to actually work now, so that's good. More information as it becomes avaialble!

Thank-you very much,
Gary (-;

kungfoomasta

11-12-2007 23:35:13

Its awesome to know it works on OSX! Thanks for the kind words. :D

Let me know any problems you encounter.