Page 1 of 1

injectTimePulse() missing in CEGuiD9BaseApplication.cpp

Posted: Wed Apr 26, 2006 10:59
by Rackle
I finally figured out why I could not get tooltips to function...the CEGuiD3D9BaseApplication::execute() main loop does not inject time pulses into the CEGUI system, which prevents tooltips from functionning. I've made the following modifications to make it work:

Code: Select all

if (FAILED(pimpl->d_3DDevice->BeginScene()))
{
    continue;
}

//BEGIN MODIFICATION

++d_frames; // Update frame count
DWORD thisTime = GetTickCount();
if (thisTime - d_lastTime >= 100)
{
   // Update FPS
    d_FPS = d_frames;
    d_frames = 0;
   // Inject time pulse
    CEGUI::System::getSingleton().injectTimePulse(static_cast<float>(thisTime - d_lastTime) / 1000);
   d_lastTime = thisTime;
}

//updateFPS();

// END MODIFICATION

char fpsbuff[16];
sprintf(fpsbuff, "FPS: %d", d_FPS);


The DirectX v8.1 also does not inject pulses so the same modifications would apply there as well. The Irrlicht, Ogre, and OpenGL base applications inject the time pulses, so using one of these renderers might be the simplest solution for some.