|
From: <cn...@us...> - 2009-10-02 06:48:04
|
Revision: 546
http://hgengine.svn.sourceforge.net/hgengine/?rev=546&view=rev
Author: cnlohr
Date: 2009-10-02 06:47:57 +0000 (Fri, 02 Oct 2009)
Log Message:
-----------
permit disabling of the GL profiling based on the configure flags
Modified Paths:
--------------
Mercury2/src/GLHeaders.h
Mercury2/src/GLHelpers.cpp
Mercury2/src/Mercury2.cpp
Mercury2/src/global.h
Modified: Mercury2/src/GLHeaders.h
===================================================================
--- Mercury2/src/GLHeaders.h 2009-10-02 06:47:10 UTC (rev 545)
+++ Mercury2/src/GLHeaders.h 2009-10-02 06:47:57 UTC (rev 546)
@@ -1,5 +1,7 @@
#ifndef GLHEADERS_H
#define GLHEADERS_H
+
+#include <configuration.h>
#ifdef WIN32
#include <windows.h>
Modified: Mercury2/src/GLHelpers.cpp
===================================================================
--- Mercury2/src/GLHelpers.cpp 2009-10-02 06:47:10 UTC (rev 545)
+++ Mercury2/src/GLHelpers.cpp 2009-10-02 06:47:57 UTC (rev 546)
@@ -2,8 +2,6 @@
#include <GLHelpers.h>
#include <MercuryHash.h>
-uint32_t GLCALLCOUNT = 0;
-MHash< uint32_t> GLFUNCTCOUNT;
MString GlError2String(uint32_t e)
{
@@ -110,6 +108,10 @@
}
+#ifdef GL_PROFILE
+uint32_t GLCALLCOUNT = 0;
+MHash< uint32_t> GLFUNCTCOUNT;
+
void ProfileGLCall(const MString& funcName)
{
++GLCALLCOUNT;
@@ -126,6 +128,12 @@
GLFUNCTCOUNT.clear();
}
+#else
+void PrintGLFunctionCalls()
+{
+ LOG.Write( "No profiling performed on data set because it was configrued off." );
+}
+#endif
/****************************************************************************
* Copyright (C) 2009 by Joshua Allen *
Modified: Mercury2/src/Mercury2.cpp
===================================================================
--- Mercury2/src/Mercury2.cpp 2009-10-02 06:47:10 UTC (rev 545)
+++ Mercury2/src/Mercury2.cpp 2009-10-02 06:47:57 UTC (rev 546)
@@ -165,11 +165,13 @@
float batches = MercuryVBO::ResetBatchCount()/(float)m_count;
float VBinds = MercuryVBO::ResetBindCount()/(float)m_count;
float Tbinds = Texture::ReadAndResetBindCount()/(float)m_count;
+ LOG.Write( ssprintf("FPS: %f, VBO batches %f, TBinds %f, VBinds %f", m_count/fpsTimer.Age(), batches, Tbinds, VBinds) );
+#ifdef GL_PROFILE
float GLcalls = GLCALLCOUNT/(float)m_count;
- LOG.Write( ssprintf("FPS: %f, VBO batches %f, TBinds %f, VBinds %f", m_count/fpsTimer.Age(), batches, Tbinds, VBinds) );
- LOG.Write( ssprintf("GL/f: %f", GLcalls) );
+ GLCALLCOUNT = 0;
+ LOG.Write( ssprintf("GL/f: %f", GLcalls) );
+#endif
m_count = 0;
- GLCALLCOUNT = 0;
fpsTimer = timer;
}
}
Modified: Mercury2/src/global.h
===================================================================
--- Mercury2/src/global.h 2009-10-02 06:47:10 UTC (rev 545)
+++ Mercury2/src/global.h 2009-10-02 06:47:57 UTC (rev 546)
@@ -4,7 +4,7 @@
#ifdef WIN32
#pragma warning( disable : 4100 )
#endif
-
+#include <configuration.h>
#include <Mint.h>
-#endif
\ No newline at end of file
+#endif
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|