Problem in displaying the frames

Hi!
I’ve add a frame counter to my app using texured fonts…but the counter display always zero:(…here the code:

void CTexture::AppInit( TUint8 *tex1, TUint8 *tex2, TUint8 *tex3, TUint8 *tex4, TUint8 *tex5, TUint8 *tex6, TUint8 *tex7, TUint8 *tex8 )
 {
    fps = 0;
    counter = 0;
    startTime.HomeTime();
    oneSecond = 1;

In the appInit I set the init value of fps(incresed every time that draw is called), counter(it counts the seconds) and oneSecond(the time I update the total frame counter).
In the code below, I check if oneSecond is passed; if it is therefore I update the number of total frame, than I calculate the avarage frames per second: this value is used to have the coordinates of the texture for mapping the right font:

void CTexture::AppCycle( TInt aFrame,TInt dirx,TInt diry,TInt dirz)
 {
 
    TTimeIntervalSeconds durationInSeconds;
    currentTime.HomeTime();
    currentTime.SecondsFrom(startTime, durationInSeconds);
    if(durationInSeconds >= oneSecond)
    {
       counter++;
       totalFps += fps;
       fps = 0;
       startTime.HomeTime();
       (TInt)averageFps = totalFps/counter;
       lmargin = averageFps*0.0625;
       //else if(averageFps>9 && averageFps<=19)
          
    }

Always in the appCycle, I call the function ShowFps, that draw the quad with the texture of the font, the textureCoord are:

  
    static const GLfloat nokTexCoords_quad1[4 * 2] =
    {
    lmargin,0.1875,
    lmargin+0.0625,0.1875,
    lmargin+0.0625,0.25,
    lmargin,0.25
    };

The value displayed is always zero!
Can you help me?!

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.