Page 1 of 3

TwOgre - An AntTweakBar Integration

Posted: Mon Apr 09, 2007 6:25 am
by CaseyB
<edit>
The project has moved to Bitbucket:

https://bitbucket.org/jacmoe/twogregui

Update your links/bookmarks. :)

</edit>

I have spent a little bit of time integrating the AntTweakBar GUI System, discussed in this thread into Ogre. It's not the prettiest thing, but it's very easy to use and rather fully featured. It would be great for some kind of an editor. I just got all of the appropriate variable type wrapped up so I thought I'd post some pics and a video. I still need to get callbacks working, right now you'd have to poll the values, and I want to build AntTweakBar and TwOgre into the same static lib or dll, so you'd only need the one. I'll release everything once that's done! Now on to the eye candy!

Image
Image
Image

And here's the link to the video:
www.MooProductions.org/TwOgre.avi

Posted: Mon Apr 09, 2007 9:14 am
by betajaen
Betajaen likes, and I really like the dial thing going on with the floating point widgets, back in the Amiga days there was GUI library called MUI which had something quite similar to that.

With all these new Ogre based GUI systems, I think they are all giving CEGUI a run for it's money now. :D

Posted: Mon Apr 09, 2007 9:58 am
by celic
Nice idea to implement this kind of GUI control.

Posted: Mon Apr 09, 2007 10:45 am
by Kencho
Sweet! This will be pretty useful! Thanks for that :)

Posted: Mon Apr 09, 2007 1:20 pm
by P
Great stuff !

It looks like really useful, looking forward to try it.

Posted: Mon Apr 09, 2007 2:15 pm
by Purrpledone
Very nice! I've put AntTweakBar on my Things to Try list since I saw that thread in General Discussion, so I'll definitely give this a try when you release it.

Posted: Mon Apr 09, 2007 5:49 pm
by CaseyB
Thanks everyone for the encouragement! I thought the Dial Widget was very cool too! That's one of the biggest things that made me want to bring this GUI System into Ogre! I have sent the original developer an email with some questions, hopefully he'll respond soon.

Posted: Mon Apr 09, 2007 6:36 pm
by pekar
Excellent! Goodbye tweak-n-build! This could even be useful for original gameplay.

Posted: Mon Apr 09, 2007 9:17 pm
by detox
Nice work, good to see you are making progress on this.

Posted: Mon Apr 09, 2007 10:49 pm
by big_o
Very cool!

Posted: Mon Apr 09, 2007 11:04 pm
by Assaf Raman
Nice work!
:D

Posted: Tue Apr 10, 2007 12:01 pm
by sinbad
I'm also one of those that put AntTweakBar on my 'to play with later' list because it looks very useful. Nice to see it ported to Ogre - of course a place in ogreaddons can be reserved on request :)

Posted: Tue Apr 10, 2007 8:07 pm
by redmonk
Nice! Really nice GUI compare to CEGUI!

Posted: Tue Apr 10, 2007 8:24 pm
by nikki
redmonk wrote:Nice! Really nice GUI compare to CEGUI!
I think it is better off used for tweaking (hence its name) and quick adjustment of variables like in test applications and level editors, whereas CEGUI has more features such as buttons, dialogs etc. So, we really can't compare them.

Posted: Tue Apr 10, 2007 10:08 pm
by CaseyB
nikki wrote:I think it is better off used for tweaking (hence its name) and quick adjustment of variables like in test applications and level editors, whereas CEGUI has more features such as buttons, dialogs etc. So, we really can't compare them.
Absolutely true! This fills a different need than CEGUI, BetaGUI and SimpleGUI, it's not terribly pretty, but is very easy to set up and has great flexibility as far as how to group things and collapse groups, etc.

Posted: Wed Apr 11, 2007 12:01 am
by redmonk
Yup! We both are correct.

Posted: Wed Apr 11, 2007 12:06 am
by redmonk
Where I can download the code so I can integrated in my application?

Posted: Wed Apr 11, 2007 12:51 am
by CaseyB
redmonk wrote:Where I can download the code so I can integrated in my application?
You can't yet, I have a couple more things to wrap up before it's ready to distribute.

Posted: Wed Apr 11, 2007 5:44 am
by CaseyB
Ok, I integrated the AntTweakBar code and my code all into the same project and created four build targets
  • Release
    Debug
    Static_Release
    Static_Debug
so you can choose to link it with a dll or a static lib, I have also included the example that I posted pictures of. I still haven't worked in the callbacks, so for now the only way to get data out of the Variables is to poll them. It's not TOO bad if you don't have that many, but if you're going to make a real World Editor you'll really need the callback. I am working on it. I have also emailed Philippe Decaudin, the creator of AntTweakBar, and he told me that add a String variable type is #1 on his TODO list, so that should be coming around soon!

You can get it from an SVN repo hosted by Google:
svn checkout http://twogregui.googlecode.com/svn/trunk/ twogregui

SETUP
If you use the Ogre SDK then you should be all set. TwOgre should build right out of the box for you.

If you Build Ogre from Source then you'll need to add the OGRE_SRC environment variable to point to your ogrenew folder. Then TwOgre should build with no problems.

Posted: Wed Apr 11, 2007 10:53 am
by Kencho
Thanks :) Will definitely have to sink my teeth on this :)

Posted: Wed Apr 11, 2007 11:06 am
by redmonk
Ogre 1.4.0 (Eihort) with VS2005 SP1 [debug-mode] and is crashing on Line 38 / OgreApp.cpp and the Ogre.log is Ok!

Code: Select all

Line 38 / OgreApp.cpp:
Ogre::ResourceGroupManager::getSingleton().initialiseAllResourceGroups();

Code: Select all

Error dialog:
Unhandled exception at 0x106ea7d6 in Example_WorldEditor.exe: 0xC0000005: Access violation reading location 0x0000005c.

Code: Select all

Ogre.log:
12:19:13: *-*-* OGRE Initialising
12:19:13: *-*-* Version 1.4.0 (Eihort)
12:19:13: Creating resource group Bootstrap
12:19:13: Added resource location 'media/packs/OgreCore.zip' of type 'Zip' to resource group 'Bootstrap'
12:19:13: Added resource location 'media' of type 'FileSystem' to resource group 'General'
12:19:13: Added resource location 'media/fonts' of type 'FileSystem' to resource group 'General'
12:19:13: Added resource location 'media/materials/programs' of type 'FileSystem' to resource group 'General'
12:19:13: Added resource location 'media/materials/scripts' of type 'FileSystem' to resource group 'General'
12:19:13: Added resource location 'media/materials/textures' of type 'FileSystem' to resource group 'General'
12:19:13: Added resource location 'media/models' of type 'FileSystem' to resource group 'General'
12:19:13: Added resource location 'media/overlays' of type 'FileSystem' to resource group 'General'
12:19:13: Added resource location 'media/particle' of type 'FileSystem' to resource group 'General'
12:19:13: Added resource location 'media/gui' of type 'FileSystem' to resource group 'General'
12:19:13: Added resource location 'media/DeferredShadingMedia' of type 'FileSystem' to resource group 'General'
12:19:13: Added resource location 'media/packs/cubemap.zip' of type 'Zip' to resource group 'General'
12:19:13: Added resource location 'media/packs/cubemapsJS.zip' of type 'Zip' to resource group 'General'
12:19:13: Added resource location 'media/packs/dragon.zip' of type 'Zip' to resource group 'General'
12:19:13: Added resource location 'media/packs/fresneldemo.zip' of type 'Zip' to resource group 'General'
12:19:13: Added resource location 'media/packs/ogretestmap.zip' of type 'Zip' to resource group 'General'
12:19:13: Added resource location 'media/packs/skybox.zip' of type 'Zip' to resource group 'General'
12:19:14: Parsing scripts for resource group Autodetect
12:19:14: Finished parsing scripts for resource group Autodetect
12:19:14: Parsing scripts for resource group Bootstrap
12:19:14: Parsing script OgreCore.material
12:19:14: Parsing script OgreProfiler.material
12:19:14: Parsing script Ogre.fontdef
12:19:14: Parsing script OgreDebugPanel.overlay

Posted: Wed Apr 11, 2007 11:20 am
by syedhs
Okay I have got it running, but I have to change the followings:-
Listener.cpp

Code: Select all

...
if(mInputManager->numMice() > 0)
...
if(mInputManager->numKeyboards() > 0)
Your OIS version is not the same as mine, not sure which is more recent.

And in plugins.cfg, change the pluginfolder to wherever you store it.

Nice! Btw, cant we edit the value using keyboard directly?

Posted: Wed Apr 11, 2007 11:34 am
by redmonk
Working! Thank for this nice GUI. Great work.

Posted: Wed Apr 11, 2007 2:48 pm
by CaseyB
syedhs wrote: Your OIS version is not the same as mine, not sure which is more recent.
And in plugins.cfg, change the pluginfolder to wherever you store it.
Nice! Btw, cant we edit the value using keyboard directly?
Doh, sorry about that's because I am using the CVS Head version of OIS. I'll fix that. And good catch on the plugins.cfg, I'll put that in the original post. You can add Keyboard shortcuts, I forgot about that, I'll update the example tonight.

Posted: Wed Apr 11, 2007 4:43 pm
by Chimelion
Nice, thank you. Only thing I will need to change before I test it out will be to de-couple the OIS dependency from the TwOgre API. Since I don't use OIS in my own app, that's the only hang-up atm. No problem having OIS in the example, but I don't think it should be coupled in API.