Page 1 of 1

Where to add new class’ declare and define ?

Posted: Thu Apr 21, 2011 03:45
by ogre2012
I have created new class called TimerWindow and the render class called FalagardTimerWindow.But don’t know where to add their declear and define.

One book said add the following code in the CEGUIBaseFactories.h and CEGUIBaseFactories.cpp. But I can’t find the .h and .cpp flies in the CEgui0.7.5 source code.


Code: Select all

   CEGUI_DECLARE_WINDOW_FACTORY(TimerWindow);
   CEGUI_DEFINE_WINDOW_FACTORY(TimerWindow);
   CEGUI_DEFINE_WR_FACTORY(FalagardTimerWindow);


Where to add the code in the cegui0.7.5?

Re: Where to add new class’ declare and define ?

Posted: Thu Apr 21, 2011 08:44
by CrazyEddie
In 0.7 we did away with the factory macro nastiness. What you do now is create your Window and WindowRenderer subclasses as normal, and register them with the system as follows:

Code: Select all

CEGUI::WindowFactoryManager::addFactory<TplWindowFactory<TimerWindow> >();
CEGUI::WindowRendererManager::addFactory<TplWindowRendererFactory<FalagardTimerWindow> >();


CE.