Main Page   Class Hierarchy   Compound List   File List   Compound Members  

glperformance.h

00001 /*
00002 Copyright (c) 2000-2003 Lee Thomason (www.grinninglizard.com)
00003 
00004 Grinning Lizard Utilities. Note that software that uses the 
00005 utility package (including Lilith3D and Kyra) have more restrictive
00006 licences which applies to code outside of the utility package.
00007 
00008 
00009 This software is provided 'as-is', without any express or implied 
00010 warranty. In no event will the authors be held liable for any 
00011 damages arising from the use of this software.
00012 
00013 Permission is granted to anyone to use this software for any 
00014 purpose, including commercial applications, and to alter it and 
00015 redistribute it freely, subject to the following restrictions:
00016 
00017 1. The origin of this software must not be misrepresented; you must 
00018 not claim that you wrote the original software. If you use this 
00019 software in a product, an acknowledgment in the product documentation 
00020 would be appreciated but is not required.
00021 
00022 2. Altered source versions must be plainly marked as such, and 
00023 must not be misrepresented as being the original software.
00024 
00025 3. This notice may not be removed or altered from any source 
00026 distribution.
00027 */
00028 
00029 #ifndef GL_PERFORMANCE_MEASURE
00030 #define GL_PERFORMANCE_MEASURE
00031 
00032 #include "gltypes.h"
00033 #include "glmap.h"
00034 
00035 
00036 class GlPerformance
00037 {
00038   public:
00039         GlPerformance( const char*      measure );
00040         ~GlPerformance();
00041 
00042     static void Dump( FILE* fp );
00043   
00044   private:
00045         struct PerfData
00046         {
00047                 PerfData() { count = 0; totalTime = 0; }
00048 
00049                 U32 count;
00050                 S64 totalTime;
00051                 std::string name;
00052 
00053                 bool operator<( const PerfData& rhs ) const
00054                 {
00055                         return ( rhs.totalTime < totalTime );
00056                 }
00057 
00058                 bool operator==( const PerfData& rhs ) const
00059                 {
00060                         return ( rhs.totalTime == totalTime );
00061                 }
00062         };
00063 
00064         enum {
00065                 MAX_DATA = 30
00066         };
00067         static PerfData map[ MAX_DATA ];
00068         static int numMap;
00069         
00070         std::string name;
00071         PerfData*       data;
00072         S64                     start;
00073         S64                     end;
00074 };
00075                 
00076 
00077 #endif

Generated on Mon Sep 15 12:01:10 2003 for Kyra by doxygen1.2.11.1 written by Dimitri van Heesch, © 1997-2001