Gui Design

Forum for general chit-chat or off-topic discussion.

Moderators: CEGUI MVP, CEGUI Team

User avatar
tonyhnz
Just popping in
Just popping in
Posts: 12
Joined: Wed Jan 12, 2005 12:06

Gui Design

Postby tonyhnz » Thu Oct 21, 2004 14:11

I am working on a mmorpg which we have based on the NEL game engine (www.nevrax.org). I liked the look of your GUI and was hoping you could provide some feedback on some questions I had.
I have a few questions regarding your GUI design decisions as we have created a first cut of our GUI and are looking how we can make it better.

We have gone down the same route of subclassing the GUI components from one base class. Our 'window' class then has a map of these base gui classes which represents all components owned by this parent.
My question is what to do when the sub classes implement different functions to the base class - do you rely on the programmer to know that for example only a button component has a get button state function.

I noticed in your system you have implemented a properties class that all properties derive from. Have you tried any other methods then this. We were wondering if we could create a generic properties map held in the base class which would have property name/property value pairs with an accessor provided to read the values.

How hard is it to port your system to a different 3d library such as NEL. (NEL has drivers for OGL and D3D).

User avatar
CrazyEddie
CEGUI Project Lead
Posts: 6760
Joined: Wed Jan 12, 2005 12:06
Location: England
Contact:

Gui Design

Postby CrazyEddie » Thu Oct 21, 2004 18:19

...My question is what to do when the sub classes implement different functions to the base class - do you rely on the programmer to know that for example only a button component has a get button state function.

This is basically what I do, it would not make much sense to have it any other way. You can't call a method on a object of a class that does not either define or inherit the method so I don't see an issue; if the object hierarchy is clean and logical, everything should work fine. The only time an issue may come up is if you have no idea as to the exact type of an UI element and want to cast it; in this situation it's obviously not safe to assume things, so only the base class interface should be used (unless you enable RTTI).

I noticed in your system you have implemented a properties class that all properties derive from. Have you tried any other methods then this. We were wondering if we could create a generic properties map held in the base class which would have property name/property value pairs with an accessor provided to read the values.

I didn't try any alternatives to the current approach to properties. The current approach is simple and reasonably clean. What you describe with regards to the properties map is similar to what I have done; though I inherit from a PropertySet base class that handles the interface to the properties collection. All the UI element subclasses override an 'initialise' method (which is called by the factory system that creates the elements), part of what they do in this method is to add any specific properties that they implement, and call the super-class 'initialise' which does the same. If an attempt is made to access a property that is not defined, an exception is thrown.

How hard is it to port your system to a different 3d library such as NEL. (NEL has drivers for OGL and D3D).

I haven't looked at NEL, though all you need to do is write specialised renderer and texture classes for the target engine. The texture just wraps whatever texture or surface that the engine or API provides, and should support loading of images and copying data direct from a memory buffer. The renderer class itself just queues textured quads, and later sends them to the engine or API for rendering. It's all pretty simple stuff really, so there should be no issues creating a CEGUI::Renderer/CEGUI::Texture pair for NEL.

I hope I have answered your questions :)

CE.


Return to “Offtopic Discussion”

Who is online

Users browsing this forum: Google [Bot] and 1 guest