Commit fec25eca by Kai Westerkamp

removed qInfo() and windows compile errors

parent 2b4f6b1c
...@@ -33,7 +33,7 @@ HEADERS += mainwindow.h \ ...@@ -33,7 +33,7 @@ HEADERS += mainwindow.h \
subdivision.h \ subdivision.h \
vertex.h \ vertex.h \
triangle.h \ triangle.h \
logcategories.cpp logcategories.h
FORMS += FORMS +=
......
...@@ -188,7 +188,7 @@ QOpenGLShaderProgram* MainWidget::initShaderProgram(QString vertSource, QString ...@@ -188,7 +188,7 @@ QOpenGLShaderProgram* MainWidget::initShaderProgram(QString vertSource, QString
qCritical()<< "Linking shader failed:"<<shader->log(); qCritical()<< "Linking shader failed:"<<shader->log();
exit(5); exit(5);
} }
qInfo()<<"Linking Shader done"; qDebug()<<"Linking Shader done";
return shader; return shader;
......
...@@ -34,11 +34,11 @@ MainWindow::MainWindow(QWidget *parent) : ...@@ -34,11 +34,11 @@ MainWindow::MainWindow(QWidget *parent) :
connect(CamHome, SIGNAL(triggered()), cam, SLOT(home())); connect(CamHome, SIGNAL(triggered()), cam, SLOT(home()));
toolBar->addAction(CamHome); toolBar->addAction(CamHome);
debugOutput = new QAction("DebugOutput",this); // debugOutput = new QAction("DebugOutput",this);
debugOutput->setCheckable(true); // debugOutput->setCheckable(true);
debugOutput->setChecked(false); // debugOutput->setChecked(false);
connect(debugOutput, SIGNAL(triggered(bool)), m_centralWidget, SLOT(setdebugOutput(bool))); // connect(debugOutput, SIGNAL(triggered(bool)), m_centralWidget, SLOT(setdebugOutput(bool)));
toolBar->addAction(debugOutput); // toolBar->addAction(debugOutput);
subdivSlider = new QSlider(Qt::Horizontal); subdivSlider = new QSlider(Qt::Horizontal);
subdivSlider->setMinimum(0); subdivSlider->setMinimum(0);
......
...@@ -21,16 +21,18 @@ void Mesh::SubdivEntry::updateIndices() { ...@@ -21,16 +21,18 @@ void Mesh::SubdivEntry::updateIndices() {
f->glDeleteBuffers(1, &IB_irregular_handle); f->glDeleteBuffers(1, &IB_irregular_handle);
f->glGenBuffers(1, &IB_irregular_handle); f->glGenBuffers(1, &IB_irregular_handle);
f->glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, IB_irregular_handle); f->glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, IB_irregular_handle);
f->glBufferData(GL_ELEMENT_ARRAY_BUFFER, sizeof(unsigned int) * indices_irregular.size(), &indices_irregular[0], GL_STATIC_DRAW); if(indices_irregular.size() != 0)
f->glBufferData(GL_ELEMENT_ARRAY_BUFFER, sizeof(unsigned int) * indices_irregular.size(), &indices_irregular[0], GL_STATIC_DRAW);
f->glDeleteBuffers(1, &IB_regular_handle); f->glDeleteBuffers(1, &IB_regular_handle);
f->glGenBuffers(1, &IB_regular_handle); f->glGenBuffers(1, &IB_regular_handle);
f->glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, IB_regular_handle); f->glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, IB_regular_handle);
f->glBufferData(GL_ELEMENT_ARRAY_BUFFER, sizeof(unsigned int) * indices_regular.size(), &indices_regular[0], GL_STATIC_DRAW); if(indices_regular.size() != 0)
f->glBufferData(GL_ELEMENT_ARRAY_BUFFER, sizeof(unsigned int) * indices_regular.size(), &indices_regular[0], GL_STATIC_DRAW);
} }
void Mesh::SubdivEntry::init(QOpenGLFunctions_4_3_Core *f,QVector<Vertex>& Vertices, void Mesh::SubdivEntry::init(QOpenGLFunctions_4_3_Core *f,QVector<Vertex>& Vertices,
QVector<unsigned int>& Indices_irregular){ QVector<unsigned int>& Indices_irregular){
f->glGenBuffers(1, &VB_handle); f->glGenBuffers(1, &VB_handle);
f->glBindBuffer(GL_ARRAY_BUFFER, VB_handle); f->glBindBuffer(GL_ARRAY_BUFFER, VB_handle);
...@@ -41,7 +43,7 @@ void Mesh::SubdivEntry::init(QOpenGLFunctions_4_3_Core *f,QVector<Vertex>& Verti ...@@ -41,7 +43,7 @@ void Mesh::SubdivEntry::init(QOpenGLFunctions_4_3_Core *f,QVector<Vertex>& Verti
} }
void Mesh::SubdivEntry::init(QOpenGLFunctions_4_3_Core *f, GLuint VB_handle, QVector<Vertex>& Vertices, void Mesh::SubdivEntry::init(QOpenGLFunctions_4_3_Core *f, GLuint VB_handle, QVector<Vertex>& Vertices,
QVector<unsigned int>& Indices_irregular, QVector<unsigned int>& patches){ QVector<unsigned int>& Indices_irregular, QVector<unsigned int>& patches){
this->f = f; this->f = f;
this->VB_handle = VB_handle; this->VB_handle = VB_handle;
...@@ -55,11 +57,13 @@ void Mesh::SubdivEntry::init(QOpenGLFunctions_4_3_Core *f, GLuint VB_handle, QVe ...@@ -55,11 +57,13 @@ void Mesh::SubdivEntry::init(QOpenGLFunctions_4_3_Core *f, GLuint VB_handle, QVe
f->glGenBuffers(1, &IB_irregular_handle); f->glGenBuffers(1, &IB_irregular_handle);
f->glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, IB_irregular_handle); f->glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, IB_irregular_handle);
f->glBufferData(GL_ELEMENT_ARRAY_BUFFER, sizeof(unsigned int) * indices_irregular.size(), &indices_irregular[0], GL_STATIC_DRAW); if(indices_irregular.size() != 0)
f->glBufferData(GL_ELEMENT_ARRAY_BUFFER, sizeof(unsigned int) * indices_irregular.size(), &indices_irregular[0], GL_STATIC_DRAW);
f->glGenBuffers(1, &IB_regular_handle); f->glGenBuffers(1, &IB_regular_handle);
f->glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, IB_regular_handle); f->glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, IB_regular_handle);
f->glBufferData(GL_ELEMENT_ARRAY_BUFFER, sizeof(unsigned int) * patches.size(), &patches[0], GL_STATIC_DRAW); if(patches.size() != 0)
f->glBufferData(GL_ELEMENT_ARRAY_BUFFER, sizeof(unsigned int) * patches.size(), &patches[0], GL_STATIC_DRAW);
} }
......
...@@ -70,7 +70,7 @@ void main() ...@@ -70,7 +70,7 @@ void main()
addWireframe(); addWireframe();
// color = materialInfo.Diffuse; // color = vec4(materialInfo.Diffuse,0);
// color = normalize(abs(vec3(gCamPosition.x,gCamPosition.y,0.0))); // color = normalize(abs(vec3(gCamPosition.x,gCamPosition.y,0.0)));
} }
...@@ -22,7 +22,7 @@ void Subdivision::init() { ...@@ -22,7 +22,7 @@ void Subdivision::init() {
} }
QOpenGLShaderProgram *Subdivision::initComputeShaderProgram(QString &source){ QOpenGLShaderProgram *Subdivision::initComputeShaderProgram(QString &source){
qCInfo(log_subdiv) << "Compiling compute shader ..."; qCDebug(log_subdiv) << "Compiling compute shader ...";
QOpenGLShader *computeShader = new QOpenGLShader(QOpenGLShader::Compute); QOpenGLShader *computeShader = new QOpenGLShader(QOpenGLShader::Compute);
if(!computeShader->compileSourceFile(source)){ if(!computeShader->compileSourceFile(source)){
qCCritical(log_subdiv) << "Compute Shader" << source << "failed" << computeShader->log(); qCCritical(log_subdiv) << "Compute Shader" << source << "failed" << computeShader->log();
...@@ -57,7 +57,7 @@ void Subdivision::subdivide(Mesh *mesh, int level) { ...@@ -57,7 +57,7 @@ void Subdivision::subdivide(Mesh *mesh, int level) {
Input input; Input input;
int currentMax = current_mesh->buffers.size()-1; int currentMax = current_mesh->buffers.size()-1;
qCInfo(log_subdiv) << "Subdiv Level" << level << "Requested. Current Max:" << currentMax; qCDebug(log_subdiv) << "Subdiv Level" << level << "Requested. Current Max:" << currentMax;
if(level <= currentMax) if(level <= currentMax)
return; return;
...@@ -152,7 +152,7 @@ Subdivision::Tables Subdivision::precomputeTables(Input input) { ...@@ -152,7 +152,7 @@ Subdivision::Tables Subdivision::precomputeTables(Input input) {
precomputeVertexTable(tables, vb, ib); precomputeVertexTable(tables, vb, ib);
tables.index_regular = getPatchIndexBuffer(ib); tables.index_regular = getPatchIndexBuffer(ib);
qCInfo(log_subdiv) << "Precompute Tables Done"; qCDebug(log_subdiv) << "Precompute Tables Done";
return tables; return tables;
} }
...@@ -548,7 +548,7 @@ bool Subdivision::matchAndCompleteTriangle(unsigned int sx, unsigned int sy, uns ...@@ -548,7 +548,7 @@ bool Subdivision::matchAndCompleteTriangle(unsigned int sx, unsigned int sy, uns
} }
Subdivision::Result Subdivision::runShader(Input input, Tables &tables) { Subdivision::Result Subdivision::runShader(Input input, Tables &tables) {
qCInfo(log_subdiv) << "Running compute shader"; qCDebug(log_subdiv) << "Running compute shader";
Result result; Result result;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment