|
From: <axl...@us...> - 2009-04-12 16:29:02
|
Revision: 205
http://hgengine.svn.sourceforge.net/hgengine/?rev=205&view=rev
Author: axlecrusher
Date: 2009-04-12 16:28:55 +0000 (Sun, 12 Apr 2009)
Log Message:
-----------
updates
Modified Paths:
--------------
Mercury2/src/Mercury2.cpp
Mercury2/src/MercuryMatrix.cpp
Mercury2/src/MercuryVBO.cpp
Mercury2/src/MercuryVBO.h
Mercury2/src/Texture.cpp
Mercury2/src/Texture.h
Mercury2/src/TransformNode.cpp
Modified: Mercury2/src/Mercury2.cpp
===================================================================
--- Mercury2/src/Mercury2.cpp 2009-04-12 14:18:33 UTC (rev 204)
+++ Mercury2/src/Mercury2.cpp 2009-04-12 16:28:55 UTC (rev 205)
@@ -14,7 +14,10 @@
#include <MercuryTimer.h>
#include <RenderGraph.h>
+#include <Texture.h>
+bool SHOWBOUNDINGVOLUME = false;
+
MSemaphore UpdateLoopGo;
void* UpdateThread(void* node)
{
@@ -80,7 +83,8 @@
if (fpsTimer.Age() > 1)
{
float batches = MercuryVBO::ResetBatchCount()/(float)m_count;
- printf("FPS: %f, VBO batches %f\n", m_count/fpsTimer.Age(), batches);
+ float binds = Texture::ReadAndResetBindCount()/(float)m_count;
+ printf("FPS: %f, VBO batches %f, TBinds %f\n", m_count/fpsTimer.Age(), batches, binds);
m_count = 0;
fpsTimer = timer;
}
Modified: Mercury2/src/MercuryMatrix.cpp
===================================================================
--- Mercury2/src/MercuryMatrix.cpp 2009-04-12 14:18:33 UTC (rev 204)
+++ Mercury2/src/MercuryMatrix.cpp 2009-04-12 16:28:55 UTC (rev 205)
@@ -1,11 +1,6 @@
#include "MercuryMatrix.h"
#include <stdio.h>
-namespace MercuryMath
-{
- static MercuryMatrix IdentityMatrix;
-}
-
MercuryMatrix::MercuryMatrix()
{
Identity();
Modified: Mercury2/src/MercuryVBO.cpp
===================================================================
--- Mercury2/src/MercuryVBO.cpp 2009-04-12 14:18:33 UTC (rev 204)
+++ Mercury2/src/MercuryVBO.cpp 2009-04-12 16:28:55 UTC (rev 205)
@@ -9,6 +9,8 @@
#define BUFFER_OFFSET(i) ((char*)NULL + (i))
+extern bool SHOWBOUNDINGVOLUME;
+
MercuryVBO::MercuryVBO()
:MercuryAsset(), m_initiated(false)
{
@@ -49,11 +51,11 @@
}
glDrawRangeElements(GL_TRIANGLES, 0, m_indexData.Length()-1, m_indexData.Length(), GL_UNSIGNED_SHORT, NULL);
- m_vboBatches.Increment();
+ m_vboBatches++;
m_lastVBOrendered = this;
- if (m_boundingVolume) m_boundingVolume->Render();
+ if (m_boundingVolume && SHOWBOUNDINGVOLUME) m_boundingVolume->Render();
}
void MercuryVBO::InitVBO()
@@ -84,7 +86,7 @@
}
void* MercuryVBO::m_lastVBOrendered = NULL;
-MSemaphore MercuryVBO::m_vboBatches;
+uint32_t MercuryVBO::m_vboBatches;
/****************************************************************************
* Copyright (C) 2008 by Joshua Allen *
Modified: Mercury2/src/MercuryVBO.h
===================================================================
--- Mercury2/src/MercuryVBO.h 2009-04-12 14:18:33 UTC (rev 204)
+++ Mercury2/src/MercuryVBO.h 2009-04-12 16:28:55 UTC (rev 205)
@@ -18,8 +18,8 @@
void AllocateVertexSpace(unsigned int count);
void AllocateIndexSpace(unsigned int count);
- static uint32_t BatchCount() { return m_vboBatches.Read(); }
- static uint32_t ResetBatchCount() { return m_vboBatches.ReadAndClear(); }
+ static uint32_t BatchCount() { return m_vboBatches; }
+ static uint32_t ResetBatchCount() { uint32_t t = m_vboBatches; m_vboBatches = 0; return t; }
private:
virtual void InitVBO();
@@ -32,7 +32,7 @@
AlignedBuffer<float> m_vertexData;
AlignedBuffer<uint16_t> m_indexData;
- static MSemaphore m_vboBatches;
+ static uint32_t m_vboBatches;
};
#endif
Modified: Mercury2/src/Texture.cpp
===================================================================
--- Mercury2/src/Texture.cpp 2009-04-12 14:18:33 UTC (rev 204)
+++ Mercury2/src/Texture.cpp 2009-04-12 16:28:55 UTC (rev 205)
@@ -99,14 +99,15 @@
void Texture::BindTexture()
{
- m_textureResource = GL_TEXTURE0+m_activeTextures;
- glActiveTexture( m_textureResource );
- glClientActiveTextureARB(m_textureResource);
- glEnableClientState(GL_TEXTURE_COORD_ARRAY);
- glEnable( GL_TEXTURE_2D );
- glBindTexture(GL_TEXTURE_2D, m_textureID);
- glTexEnvi( GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE );
- ++m_activeTextures;
+ m_textureResource = GL_TEXTURE0+m_activeTextures;
+ glActiveTexture( m_textureResource );
+ glClientActiveTextureARB(m_textureResource);
+ glEnableClientState(GL_TEXTURE_COORD_ARRAY);
+ glEnable( GL_TEXTURE_2D );
+ glBindTexture(GL_TEXTURE_2D, m_textureID);
+ glTexEnvi( GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE );
+ ++m_activeTextures;
+ ++m_textureBinds;
}
void Texture::UnbindTexture()
@@ -145,8 +146,8 @@
bool Texture::m_initTextureSuccess = false;
unsigned short Texture::m_activeTextures = 0;
+uint32_t Texture::m_textureBinds = 0;
-
/***************************************************************************
* Copyright (C) 2008 by Joshua Allen *
* *
Modified: Mercury2/src/Texture.h
===================================================================
--- Mercury2/src/Texture.h 2009-04-12 14:18:33 UTC (rev 204)
+++ Mercury2/src/Texture.h 2009-04-12 16:28:55 UTC (rev 205)
@@ -20,6 +20,7 @@
void LoadFromRaw(const RawImageData* raw);
inline static unsigned short NumberActiveTextures() { return m_activeTextures; }
+ inline static uint32_t ReadAndResetBindCount() { uint32_t t = m_textureBinds; m_textureBinds = 0; return t; }
static Texture* Generate();
static MAutoPtr< Texture > LoadFromFile(const MString& path);
@@ -35,6 +36,7 @@
static bool m_initTextureSuccess;
static unsigned short m_activeTextures;
+ static uint32_t m_textureBinds;
MString m_filename;
};
Modified: Mercury2/src/TransformNode.cpp
===================================================================
--- Mercury2/src/TransformNode.cpp 2009-04-12 14:18:33 UTC (rev 204)
+++ Mercury2/src/TransformNode.cpp 2009-04-12 16:28:55 UTC (rev 205)
@@ -52,7 +52,7 @@
m_tainted = false;
MercuryMatrix local;
- local.Identity();
+// local.Identity();
local.Transotale( m_position.x, m_position.y, m_position.z,
m_rotation.x, m_rotation.y, m_rotation.z,
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|