mirror of
https://github.com/JulianGro/overte.git
synced 2025-04-29 23:23:11 +02:00
remove the VBO transfer frequency tests
This commit is contained in:
parent
3135d50ca9
commit
f38df5579b
2 changed files with 2 additions and 9 deletions
|
@ -40,8 +40,6 @@ VoxelSystem::VoxelSystem() {
|
||||||
voxelsRendered = 0;
|
voxelsRendered = 0;
|
||||||
tree = new VoxelTree();
|
tree = new VoxelTree();
|
||||||
pthread_mutex_init(&bufferWriteLock, NULL);
|
pthread_mutex_init(&bufferWriteLock, NULL);
|
||||||
lastBufferCopy.tv_sec = 0;
|
|
||||||
lastBufferCopy.tv_usec = 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
VoxelSystem::~VoxelSystem() {
|
VoxelSystem::~VoxelSystem() {
|
||||||
|
@ -233,9 +231,7 @@ void VoxelSystem::render() {
|
||||||
|
|
||||||
glPushMatrix();
|
glPushMatrix();
|
||||||
|
|
||||||
double timeSinceLastDraw = usecTimestampNow() - usecTimestamp(&lastBufferCopy);
|
if (readVerticesEndPointer != readVerticesArray) {
|
||||||
if (readVerticesEndPointer != readVerticesArray && timeSinceLastDraw >= 500 * 1000) {
|
|
||||||
printf("The time since the last draw was %f\n", timeSinceLastDraw);
|
|
||||||
// try to lock on the buffer write
|
// try to lock on the buffer write
|
||||||
// just avoid pulling new data if it is currently being written
|
// just avoid pulling new data if it is currently being written
|
||||||
if (pthread_mutex_trylock(&bufferWriteLock) == 0) {
|
if (pthread_mutex_trylock(&bufferWriteLock) == 0) {
|
||||||
|
@ -252,8 +248,6 @@ void VoxelSystem::render() {
|
||||||
|
|
||||||
pthread_mutex_unlock(&bufferWriteLock);
|
pthread_mutex_unlock(&bufferWriteLock);
|
||||||
}
|
}
|
||||||
|
|
||||||
gettimeofday(&lastBufferCopy, NULL);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// tell OpenGL where to find vertex and color information
|
// tell OpenGL where to find vertex and color information
|
||||||
|
|
|
@ -51,7 +51,6 @@ private:
|
||||||
GLuint vboColorsID;
|
GLuint vboColorsID;
|
||||||
GLuint vboIndicesID;
|
GLuint vboIndicesID;
|
||||||
pthread_mutex_t bufferWriteLock;
|
pthread_mutex_t bufferWriteLock;
|
||||||
timeval lastBufferCopy;
|
|
||||||
|
|
||||||
int treeToArrays(VoxelNode *currentNode, float nodePosition[3]);
|
int treeToArrays(VoxelNode *currentNode, float nodePosition[3]);
|
||||||
void setupNewVoxelsForDrawing();
|
void setupNewVoxelsForDrawing();
|
||||||
|
|
Loading…
Reference in a new issue