From f38df5579b48c2923879545af080aa462feddc6c Mon Sep 17 00:00:00 2001 From: Stephen Birarda Date: Mon, 1 Apr 2013 15:12:39 -0700 Subject: [PATCH] remove the VBO transfer frequency tests --- interface/src/VoxelSystem.cpp | 8 +------- interface/src/VoxelSystem.h | 3 +-- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/interface/src/VoxelSystem.cpp b/interface/src/VoxelSystem.cpp index 7af432d520..7ff162f427 100644 --- a/interface/src/VoxelSystem.cpp +++ b/interface/src/VoxelSystem.cpp @@ -40,8 +40,6 @@ VoxelSystem::VoxelSystem() { voxelsRendered = 0; tree = new VoxelTree(); pthread_mutex_init(&bufferWriteLock, NULL); - lastBufferCopy.tv_sec = 0; - lastBufferCopy.tv_usec = 0; } VoxelSystem::~VoxelSystem() { @@ -233,9 +231,7 @@ void VoxelSystem::render() { glPushMatrix(); - double timeSinceLastDraw = usecTimestampNow() - usecTimestamp(&lastBufferCopy); - if (readVerticesEndPointer != readVerticesArray && timeSinceLastDraw >= 500 * 1000) { - printf("The time since the last draw was %f\n", timeSinceLastDraw); + if (readVerticesEndPointer != readVerticesArray) { // try to lock on the buffer write // just avoid pulling new data if it is currently being written if (pthread_mutex_trylock(&bufferWriteLock) == 0) { @@ -252,8 +248,6 @@ void VoxelSystem::render() { pthread_mutex_unlock(&bufferWriteLock); } - - gettimeofday(&lastBufferCopy, NULL); } // tell OpenGL where to find vertex and color information diff --git a/interface/src/VoxelSystem.h b/interface/src/VoxelSystem.h index eabe704d11..c35e2bd5b8 100644 --- a/interface/src/VoxelSystem.h +++ b/interface/src/VoxelSystem.h @@ -51,8 +51,7 @@ private: GLuint vboColorsID; GLuint vboIndicesID; pthread_mutex_t bufferWriteLock; - timeval lastBufferCopy; - + int treeToArrays(VoxelNode *currentNode, float nodePosition[3]); void setupNewVoxelsForDrawing(); void copyWrittenDataToReadArrays();