how to add a "Renderer"?

For help with general CEGUI usage:
- Questions about the usage of CEGUI and its features, if not explained in the documentation.
- Problems with the CMAKE configuration or problems occuring during the build process/compilation.
- Errors or unexpected behaviour.

Moderators: CEGUI MVP, CEGUI Team

wang37921
Just popping in
Just popping in
Posts: 20
Joined: Thu Dec 24, 2009 11:22
Contact:

how to add a "Renderer"?

Postby wang37921 » Tue Mar 09, 2010 12:26

I inherit a ImageItemEntry from ItemEntry. Add a StaticImage and some StaticText to the ImageItem as child windows simply. So, I will write a new render for this type to getItemPixelSize() for my new lady who has some new child, Rather than relying on the text.
All is OK, besides the problem that the title show. how to add a "Renderer" in sample_demo 7 ?
So, CE, Expect for your Detailed answers.
Could you write the code please~ Because I'm a dull child.
thanks~

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

Re: how to add a "Renderer"?

Postby CrazyEddie » Tue Mar 09, 2010 19:25

I don't really understand 90% of your post.

When you say Renderer, presumably you mean WindowRenderer? You register those in a similar fashion to the way you registered the Window type itself; there is a CEGUI::WindowRendererManager class, and you can register new types via a templatised function:

Code: Select all

CEGUI::WindowRendererManager::addFactory<TplWindowRendererFactory<MyWindowRenderer> >();


You then use an entry in the scheme file to bind all the bits together.

I have no intention of writing a full example of this and posting it here; the technique is used extensively in CEGUI, there's an example in CEImagesetEditor - the 'ElasticBox' type, and I've posted a couple of examples already on the forum (as I recall).

CE.


Return to “Help”

Who is online

Users browsing this forum: Baidu [Spider] and 27 guests