what's the update frequency in cegui?

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

User avatar
spracle
Not too shy to talk
Not too shy to talk
Posts: 34
Joined: Tue Aug 24, 2010 07:29

what's the update frequency in cegui?

Postby spracle » Wed Dec 22, 2010 08:37

better if anyone can talk about more information about this :D

uelkfr
Not too shy to talk
Not too shy to talk
Posts: 34
Joined: Tue Dec 14, 2010 16:57

Re: what's the update frequency in cegui?

Postby uelkfr » Wed Dec 22, 2010 13:06

There is no constant frequency. It limited by your hardware (CPU, GPU, RAM speed, bus speed, algorithm optimization, etc). The CEGUI lib's overhead is very low, because CEGUI Team optimizes speed in each release.

The animation speed is implemented through injectTimePulse() function. I think you are curious why the delta is in float data type, not in integer milleseconds. Well because all animation is calculated in floats, so it better to store time in float.

It used for example for displaying tooltips after some time, fade in and fade out windows, wobbling effect, animation system.
helper to newbies

"i help you, dear newbie
but nobody helps me!"

User avatar
spracle
Not too shy to talk
Not too shy to talk
Posts: 34
Joined: Tue Aug 24, 2010 07:29

Re: what's the update frequency in cegui?

Postby spracle » Thu Dec 23, 2010 07:52

I don't know where to call the function "Window::update()"

uelkfr
Not too shy to talk
Not too shy to talk
Posts: 34
Joined: Tue Dec 14, 2010 16:57

Re: what's the update frequency in cegui?

Postby uelkfr » Thu Dec 23, 2010 17:16

spracle wrote:I don't know where to call the function "Window::update()"


As said here:
virtual void CEGUI::Window::update ( float elapsed ) [virtual]
Cause window to update itself and any attached children. Client code does not need to call this method; to ensure full, and proper updates, call the injectTimePulse methodname method provided by the System class.


You just call CEGUI::System::getSingleton().renderGUI() in main event loop and it draws all your GUI, for example:

Code: Select all

   // Main loop
   int runningFlag = GL_TRUE;
   double lastTime = glfwGetTime();
   while( runningFlag == GL_TRUE )
   {
      glClear( GL_COLOR_BUFFER_BIT ); // Clear the window with the defined clear color

      CEGUI::System::getSingleton().injectTimePulse( glfwGetTime() - lastTime );
      lastTime = glfwGetTime();

      drawScene();

      CEGUI::System::getSingleton().renderGUI();

      glfwSwapBuffers();
      runningFlag = !glfwGetKey( GLFW_KEY_ESC ) && glfwGetWindowParam( GLFW_OPENED ); // ESC key or Window Closed test
   }
helper to newbies

"i help you, dear newbie
but nobody helps me!"


Return to “Help”

Who is online

Users browsing this forum: No registered users and 30 guests