Page 1 of 1

injectTimePulse and "Updated" event

Posted: Tue Sep 04, 2012 07:50
by gjaegy
Hi,

I guess I am doing something wrong, however, I am not sure what. I am working with the latest 1.0 source code from the Mercurial repository.

Basically, I have subscribed to the "Updated" event, however, the handler never gets called. I am calling the following method in my code, each frame:

Code: Select all

CEGUI::System::getSingleton().injectTimePulse(fElapsed);


However, I have noticed that the Window::update() doesn't get called, so, no "Updated" event gets triggered.

I have found out I have to call the following method too:

Code: Select all

CEGUI::System::getSingleton().getDefaultGUIContext().injectTimePulse(fElapsed);


Should I really call both methods ?

Thanks !

Re: injectTimePulse and "Updated" event

Posted: Mon Sep 10, 2012 07:36
by CrazyEddie
Hi,

Yes, you do need to call both of those - at least for the moment. Basically the GUIContext one is the main one now (the input injection interface moved there as you have seen). The lingering API on CEGUI::System effectively just serves the Animation system, and I would like to clean that up so the two calls are not needed (though I'm currently undecided on how to go about that).

Hope this reassures you that you're not doing something unnecessary.

CE.

Re: injectTimePulse and "Updated" event

Posted: Mon Sep 10, 2012 09:40
by gjaegy
yes, that's great, thanks for answering.

BTW you convinced me to switch to dynamic linking - to be honnest I didn't have much choice, because Lua is used by both my engine and Cegui, and I wanted to share the LuaState object. So, it took me two days, but now all the dependencies are linked dynamically :)