Main Page   Modules   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members  

metrics.h

Go to the documentation of this file.
00001 /* SCEA Confidential */
00002 
00003 //
00004 // ps2gl Metrics Module definitions
00005 //
00006 //  Original author: Stefan Boberg (boberg@team17.com)
00007 //
00008 
00009 #define PS2GL_METRICS_ENABLE            1
00010 
00011 enum MetricsEnum {
00013     kMetricsTextureUploadCount,
00014 
00016     kMetricsTextureUploadBytes,
00017 
00019     kMetricsClutUploadCount,    
00020 
00022     kMetricsRendererUpload,
00023 
00025     kMetricsBindTexture,
00026 
00028     kMetricsCount,
00029 };
00030 
00031 typedef unsigned long Metric_t;     // 64-bit integer
00032 
00033 extern Metric_t g_Metrics[kMetricsCount];
00034 
00037 extern void pglResetMetrics();
00038 
00041 inline Metric_t pglGetMetric(MetricsEnum eMetric) {
00042     return g_Metrics[eMetric];
00043 }
00044 
00047 inline void pglResetMetric(MetricsEnum eMetric) {
00048     g_Metrics[eMetric] = 0;
00049 }
00050 
00053 inline void pglAddToMetric(MetricsEnum eMetric, Metric_t Value = 1) {
00054 #if PS2GL_METRICS_ENABLE
00055     g_Metrics[eMetric] += Value;
00056 #endif
00057 }

ps2gl version 0.2