Hello All,
I need to implement timer functionality for following scenario
I am working on a HTML Viewer widget. For implementing this widget, It is required to take images as inputs from Container application. I can send a request to the container application for sending an image-using Message.
The issue is, to specify the time limit for receiving the response form the container, i.e. for how much time widget should wait before displaying an error.
I want to implement this feature-using feature similar to standard windows timers[WM_TIMER event]. i.e.
Widget should be able to set a timer after sending a Request for image to container.
After specified amount of time, a timer event should be received by widget, at this moment widget should check whether container has given the image or not, and take the necessary action.
Any other design approach is also welcome.
Thanks and regards,
Ritz
Needed Timer functionality
Moderators: CEGUI MVP, CEGUI Team
- lindquist
- CEGUI Team (Retired)
- Posts: 770
- Joined: Mon Jan 24, 2005 21:20
- Location: Copenhagen, Denmark
Re: Needed Timer functionality
CEGUI::Window has a virtual member function which you can use instead - or to make the feature.
Code: Select all
/*!
\brief
Perform actual update processing for this Window.
\param elapsed
float value indicating the number of seconds elapsed since the last update call.
\return
Nothing.
*/
virtual void updateSelf(float elapsed);
Re: Needed Timer functionality
Hi,
I tried using this method bu calling injectTimePulse fucntion of System class, but could not get the desired effects.
Please validate my understanding regarding the usage.
If i will call injectTimePulse(10) function updateself method will be called by the system class internally after 10 ticks(secs).
Please help me out by giving some sample code.
Some more details about your approach for using the method will help.
Thanks a Lot.
Ritz
I tried using this method bu calling injectTimePulse fucntion of System class, but could not get the desired effects.
Please validate my understanding regarding the usage.
If i will call injectTimePulse(10) function updateself method will be called by the system class internally after 10 ticks(secs).
Please help me out by giving some sample code.
Some more details about your approach for using the method will help.
Thanks a Lot.
Ritz
- lindquist
- CEGUI Team (Retired)
- Posts: 770
- Joined: Mon Jan 24, 2005 21:20
- Location: Copenhagen, Denmark
Re: Needed Timer functionality
not exactly.
when you call injectTimePulse with 10 updateSelf will be called instantly with the same parameter ten.
injectTimePulse should be used to constantly pass timer events to CEGUI.
fx if you send 100 time pulses each second, the elapsed parameter should be 0.01f
so... do as the code comment says. call injectTimePulse as often as possible (moderate) and make sure the elapsed parameter holds the time in seconds since the last time you injected.
HTH
when you call injectTimePulse with 10 updateSelf will be called instantly with the same parameter ten.
injectTimePulse should be used to constantly pass timer events to CEGUI.
fx if you send 100 time pulses each second, the elapsed parameter should be 0.01f
so... do as the code comment says. call injectTimePulse as often as possible (moderate) and make sure the elapsed parameter holds the time in seconds since the last time you injected.
HTH
Return to “CEGUI Library Development Discussion”
Who is online
Users browsing this forum: No registered users and 6 guests