Minor oddities


22-08-2007 14:01:31

I am in the process of switching from CEGUI to QuickGUI now. CEGUI's bloat was finally annoying me too much.

So far it went mostly well, except for importing the VC project files into Code::Blocks which required some tinkering. However while integrating QuickGUI into my project I noticed a few (mostly) stylistic oddities:

1. You specify the default font name (»BlueHighway«) in the GUIManager constructor. Took me a while to figure out what the problem was, because I don't have this font in my project resources. Giving a default font is certainly a good idea, but I would specify it in a place, where it is more clearly visible. How about an additional parameter for the constructor, which has »BlueHighway« as a default value?

2. You are using Ogre::Vector4 to represent gadget size and position. Convenient, but IMHO a misuse of Ogre::Vector4, which is according to the Ogre documentation a »4-dimensional homogenous vector« and therefore offers some methods that are not suitable for a pair of 2-dimensional vectors (like dotProduct). No big thing, but it looks a bit unclean to me.

Anyway, I will now start to translate some of the in CEGUI implemented functionality to QuickGUI and I am already looking forward to the upcoming release.

Edit: 3. I found a file named SkinSetImage.png in my projects directory and I am 99% sure, that I didn't place it there. Is QuickGUI generating this file?


22-08-2007 19:03:42

Regarding the skin file, yes it is generated, and its only produced on disk because I didn't comment out the lines. It shows you the skinset texture (texture atlas) used to minimize batching.

1. I think you're right, it's a good idea. Possibly a better idea is for me to iterate through font manager and grab the first font I find and use that. If no fonts are found, then I'll throw an exception.

2. Absolutely right. In fact, I put in effort and swapped out most use of Vector4 and Vector2, so don't get used to them too much. :wink: Instead, you will be using "Rect", "Point", and "Size". A Rect consists of: x, y, width, height values. I am aiming for easy to read/use code, and the vectors weren't that intuitive.

Thanks for the comments, I will fix the font idea and comment out the skinset texture saving to disk. :)