Page 1 of 1


Posted: Sat May 11, 2013 03:44
by Nickenstein79
Got CEGUI working in my game. It only took a few hours of tinkering before I had to catch a morning train and a few helpful pointers from the nice chaps on this forum. :)

In the vid you can see my own GUI which I am switching out in favour of using CEGUI. In the top left you can see a TaharezLook test window, and a TaharezLook mouse pointer in the centre of the screen.
Tomorrow I can plumb in the key/mouse injection code from OIS->CEGUI and then start making some proper GUIs with it. :)

My own GUI system is one that I wrote a couple of years ago for console games when I was in the games industry before I went Indie. It's actually in a whole bunch of 360/PS2/PS3/Wii games. But getting it to half-work with Ogre has been an utter pain in the arse.

The reason for me switching is also seen in the video. Whenever I toggle on an Ogre postrender filter effect it interferes with my sprite system and my GUI disappears (some renderstate conflict somewhere), which is no good.
Note that CEGUI does not suffer from this problem, and stays perfectly visible when post-filter effects are applied. Also my sprite code interferes with Ogre's shadow buffer so I have had to disable shadows until now, which again, is no good.

An additional problem I have struggled with when using my own GUI system alongside Ogre: I can't for the life of me get the texture-filtering to be consistent between DirectX and OpenGL. (Another renderstate conflict somewhere.) This is a new problem I recently encountered when getting my game Linux/Mac-ready. Coders should be aware, there are a bunch of hurdles and conflicts to overcome when you try and implement a flexible 2D sprite system alongside Ogre. CEGUI has already wrangled these conflicts into submission for you.

I have wanted to make the switch to CEGUI for a while now as the scrollable windows will make doing things like scrollable tech/research-tree GUIs a breeze. My scrollbars don't yet function, and my font support is nowhere near as good as CEGUIs. :)

I accidentally stumbled upon the CEGUI-Unified editor a couple of days ago and after tinkering with it for a bit, I saw how easily I could change the look of the demos with it. This is the point where I finally swallowed my stupid pride and decided to make the switch to CEGUI.

So, given the time I have lost implementing my own solution (because of myriad conflicts between my sprite code and Ogre's PostFilters & ShadowTargets), and given that I got CEGUI working in only a few hours, and also given that CEGUI now has a very nice Drag&Drop GUI editor; I will be strongly recommending that anyone thinking of rolling their own GUI system should at least spend _one_ day tinkering with CEGUI before they embark on that highly perilous errand. ;)


Thanks to CrazyEddie and Kulik for their fast replies and help when I was getting it set up! :)

And a second thanks to Eddie for making this in the first place. It's pretty damn slick, man! Very nice work! :D


EDIT - There is a discussion over on the Ogre forums about rolling your own GUI system, so I have barged in with my new opinion on the matter.

Re: Success!

Posted: Mon May 13, 2013 08:29
by CrazyEddie
Thanks for the nice post :)


Re: Success!

Posted: Mon May 13, 2013 17:58
by Nickenstein79
No worries. :)