|
From: <axl...@us...> - 2009-08-21 01:40:12
|
Revision: 505
http://hgengine.svn.sourceforge.net/hgengine/?rev=505&view=rev
Author: axlecrusher
Date: 2009-08-21 01:40:06 +0000 (Fri, 21 Aug 2009)
Log Message:
-----------
move profiling calls into function for easier modifications
Modified Paths:
--------------
Mercury2/src/GLHeaders.h
Mercury2/src/GLHelpers.cpp
Mercury2/src/GLHelpers.h
Modified: Mercury2/src/GLHeaders.h
===================================================================
--- Mercury2/src/GLHeaders.h 2009-08-21 01:17:31 UTC (rev 504)
+++ Mercury2/src/GLHeaders.h 2009-08-21 01:40:06 UTC (rev 505)
@@ -23,8 +23,6 @@
#include <MercuryLog.h>
-#define GLCALL(x) x; ++GLCALLCOUNT; GLFUNCTCOUNT[#x]++;
-
#define GLERRORCHECK { \
uint32_t e = GLCALL( glGetError() ); \
if ( e != GL_NO_ERROR ) { \
Modified: Mercury2/src/GLHelpers.cpp
===================================================================
--- Mercury2/src/GLHelpers.cpp 2009-08-21 01:17:31 UTC (rev 504)
+++ Mercury2/src/GLHelpers.cpp 2009-08-21 01:40:06 UTC (rev 505)
@@ -109,6 +109,12 @@
}
+void ProfileGLCall(const MString& funcName)
+{
+ ++GLCALLCOUNT;
+ GLFUNCTCOUNT[funcName]++;
+}
+
void PrintGLFunctionCalls()
{
std::map<MString,uint32_t>::iterator i;
Modified: Mercury2/src/GLHelpers.h
===================================================================
--- Mercury2/src/GLHelpers.h 2009-08-21 01:17:31 UTC (rev 504)
+++ Mercury2/src/GLHelpers.h 2009-08-21 01:40:06 UTC (rev 505)
@@ -1,3 +1,6 @@
+#ifndef GLHELPERS_H
+#define GLHELPERS_H
+
#include <global.h>
#include <MercuryUtil.h>
#include <MercuryMatrix.h>
@@ -5,14 +8,19 @@
#include <RawImageData.h>
+#define GLCALL(x) x; ProfileGLCall(#x);
+
MString GlError2String(uint32_t e);
void glLoadMatrix(const MercuryMatrix& m);
MercuryMatrix glGetMatrix(unsigned int m);
MercuryVertex pointFromScreenLoc(int screen_x, int screen_y);
unsigned int ToGLColorType(ColorByteType cbt);
+void ProfileGLCall(const MString& funcName);
void PrintGLFunctionCalls();
+#endif
+
/****************************************************************************
* Copyright (C) 2009 by Joshua Allen *
* *
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|