From fd0cc3b417368c82407b583931852628446f0986 Mon Sep 17 00:00:00 2001 From: ZappoMan Date: Thu, 26 Sep 2013 16:33:37 -0700 Subject: [PATCH] style fixes --- interface/src/Application.cpp | 85 ----------------------------------- interface/src/Menu.cpp | 9 ++-- 2 files changed, 6 insertions(+), 88 deletions(-) diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index 1f231b9e2f..1659127def 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -2589,91 +2589,6 @@ void Application::displaySide(Camera& whichCamera) { renderViewFrustum(_viewFrustum); } - // brad's voxel shader debugging - if (false) { - - const float TEST_STRIP_COLOR[] = { 0.0f, 1.0f, 0.0f }; - glColor3fv(TEST_STRIP_COLOR); - - _voxelShader.begin(); - const float VOXEL_COLOR[] = { 1.0f, 0.0f, 0.0f }; - glColor3fv(VOXEL_COLOR); - - struct VoxelData - { - float x, y, z; // position - float s; // size - unsigned char r,g,b; // color - }; - - VoxelData voxels[3]; - - //VERTEX 0 - voxels[0].x = 0.0; - voxels[0].y = 0.0; - voxels[0].z = 1.0; - voxels[0].s = 0.1; - voxels[0].r = 255; - voxels[0].g = 0; - voxels[0].b = 0; - - //VERTEX 1 - voxels[1].x = 1.0; - voxels[1].y = 0.0; - voxels[1].z = 0.0; - voxels[1].s = 0.2; - voxels[1].r = 0; - voxels[1].g = 255; - voxels[1].b = 0; - - //VERTEX 2 - voxels[2].x = 0.0; - voxels[2].y = 1.0; - voxels[2].z = 0.0; - voxels[2].s = 0.3; - voxels[2].r = 0; - voxels[2].g = 0; - voxels[2].b = 255; - - GLuint VertexVBOID; - GLuint IndexVBOID; - - glGenBuffers(1, &VertexVBOID); - glBindBuffer(GL_ARRAY_BUFFER, VertexVBOID); - glBufferData(GL_ARRAY_BUFFER, sizeof(voxels), &voxels[0].x, GL_STATIC_DRAW); - - ushort indices[3]; - indices[0] = 0; - indices[1] = 1; - indices[2] = 2; - - glGenBuffers(1, &IndexVBOID); - glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, IndexVBOID); - glBufferData(GL_ELEMENT_ARRAY_BUFFER, sizeof(indices), indices, GL_STATIC_DRAW); - - //Define this somewhere in your header file - #define BUFFER_OFFSET(i) ((void*)(i)) - - glBindBuffer(GL_ARRAY_BUFFER, VertexVBOID); - glEnableClientState(GL_VERTEX_ARRAY); - glVertexPointer(3, GL_FLOAT, sizeof(VoxelData), BUFFER_OFFSET(0)); //The starting point of the VBO, for the vertices - int loc = _voxelShader.attributeLocation("voxelSizeIn"); - glEnableVertexAttribArray(loc); - glVertexAttribPointer(loc, 1, GL_FLOAT, false, sizeof(VoxelData), BUFFER_OFFSET(3*sizeof(float))); - - glEnableClientState(GL_COLOR_ARRAY); - glColorPointer(3, GL_UNSIGNED_BYTE, sizeof(VoxelData), BUFFER_OFFSET(4*sizeof(float)));//The starting point of colors - - - glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, IndexVBOID); - glDrawElements(GL_POINTS, 3, GL_UNSIGNED_SHORT, BUFFER_OFFSET(0)); //The starting point of the IBO - - glDeleteBuffers(1, &VertexVBOID); - glDeleteBuffers(1, &IndexVBOID); - - _voxelShader.end(); - } - // render voxel fades if they exist if (_voxelFades.size() > 0) { for(std::vector::iterator fade = _voxelFades.begin(); fade != _voxelFades.end();) { diff --git a/interface/src/Menu.cpp b/interface/src/Menu.cpp index 3fd9334830..ec322def85 100644 --- a/interface/src/Menu.cpp +++ b/interface/src/Menu.cpp @@ -788,9 +788,12 @@ void Menu::editPreferences() { form->addRow("Audio Jitter Buffer Samples (0 for automatic):", audioJitterBufferSamples); QSpinBox* maxVoxels = new QSpinBox(); - maxVoxels->setMaximum(5000000); - maxVoxels->setMinimum(0); - maxVoxels->setSingleStep(50000); + const int MAX_MAX_VOXELS = 5000000; + const int MIN_MAX_VOXELS = 0; + const int STEP_MAX_VOXELS = 50000; + maxVoxels->setMaximum(MAX_MAX_VOXELS); + maxVoxels->setMinimum(MIN_MAX_VOXELS); + maxVoxels->setSingleStep(STEP_MAX_VOXELS); maxVoxels->setValue(_maxVoxels); form->addRow("Maximum Voxels:", maxVoxels);