Main Page Class Hierarchy Alphabetical List Compound List File List Compound Members File Members Related Pages

# XFuFPSCount.h

Go to the documentation of this file.

    00001 /*! \file
    00002  * X-Forge Util <br>
    00003  * Copyright 2000-2003 Fathammer Ltd
    00004  *
    00005  * \brief Frame rate counter class
    00006  *
    00007  * $Id: XFuFPSCount.h,v 1.5 2003/08/12 13:33:52 lars Exp $
    00008  * $Date: 2003/08/12 13:33:52 $
    00009  * $Revision: 1.5 $
    00010  */
    00011
    00012 #ifndef XFUFPSCOUNT_H_INCLUDED
    00013 #define XFUFPSCOUNT_H_INCLUDED
    00014
    00015
    00016 //! Frames per second counter utility class.
    00017 class XFuFPSCount
    00018 {
    00019
    00020 public:
    00021
    00022     //! Destructor.
    00023     ~XFuFPSCount();
    00024
    00025     //! Creates a new XFuFPSCount object.
    00026     /*! \param aFrameInterval Describes the interval for which the frame rate is calculated.
    00027      *                        Larger numbers give more stable values, but take more memory, and update slower.
    00028      */
    00029     static XFuFPSCount * create(INT32 aFrameInterval = 5);
    00030
    00031     //! Tick the counter.
    00032     /*! This function should be called once per frame.
    00033      */
    00034     void tick();
    00035
    00036     //! Returns the current FPS value.
    00037     REAL getFPS();
    00038
    00039 protected:
    00040
    00041     //! Protected constructor.
    00042     XFuFPSCount();
    00043
    00044     //! Array of tick timestamps.
    00045     INT32 *mTicks;
    00046     //! Total number of tick timestamps.
    00047     INT32 mTickCount;
    00048     //! The current tick timestamp in the array.
    00049     INT32 mCurrentTick;
    00050 };
    00051
    00052
    00053 #endif // !XFUFPSCOUNT_H_INCLUDED
    00054

|  | X-Forge Documentation Confidential Copyright © 2002-2003 Fathammer |  | Documentation generated with doxygen by Dimitri van Heesch