diff options
author | Tomi Korpipää <tomi.korpipaa@digia.com> | 2013-03-15 12:42:12 +0200 |
---|---|---|
committer | Tomi Korpipää <tomi.korpipaa@digia.com> | 2013-03-15 12:42:12 +0200 |
commit | 8c7c70658770a311612f0025511b099973f61ad1 (patch) | |
tree | bb49e666361b9ef74b16d679805e975b70518bee | |
parent | 6a4fc71e4af13c8ea18dadf7dc34cfd4e55c6b8c (diff) |
ANGLE fixes
..but causes crash on desktop opengl
-rw-r--r-- | src/datavis3d/engine/q3dbars.cpp | 11 | ||||
-rw-r--r-- | src/datavis3d/engine/q3dwindow.cpp | 2 |
2 files changed, 7 insertions, 6 deletions
diff --git a/src/datavis3d/engine/q3dbars.cpp b/src/datavis3d/engine/q3dbars.cpp index 45c7f86b..89f49dea 100644 --- a/src/datavis3d/engine/q3dbars.cpp +++ b/src/datavis3d/engine/q3dbars.cpp @@ -355,7 +355,7 @@ void Q3DBars::render() glVertexAttribPointer(d_ptr->m_positionAttrBackground, 3, GL_FLOAT, GL_FALSE, 0, (void*)0); // 2nd attribute buffer : normals - //glEnableVertexAttribArray(1); + glEnableVertexAttribArray(1); // this causes trouble with desktop opengl, but ANGLE requires it glBindBuffer(GL_ARRAY_BUFFER, d_ptr->m_normalbufferBackground); glVertexAttribPointer(d_ptr->m_normalAttrBackground, 3, GL_FLOAT, GL_FALSE, 0, (void*)0); @@ -371,7 +371,7 @@ void Q3DBars::render() glDrawElements(GL_TRIANGLES, d_ptr->m_indexCountBackground, GL_UNSIGNED_SHORT, (void*)0); //glDisableVertexAttribArray(2); - //glDisableVertexAttribArray(1); + glDisableVertexAttribArray(1); // this causes trouble with desktop opengl, but ANGLE requires it glDisableVertexAttribArray(0); } @@ -418,6 +418,7 @@ void Q3DBars::render() QVector3D barColor = baseColor + heightColor + depthColor; float lightStrength = 5.0f; + // TODO: Make highlightings modifiable via API (highlight row & column, or just bar) Q3DBarsPrivate::SelectionType selectionType = d_ptr->isSelected(row, bar, selection); switch (selectionType) { case Q3DBarsPrivate::Bar: @@ -428,7 +429,7 @@ void Q3DBars::render() if (d_ptr->m_mousePressed) { qDebug() << "selected object:" << barIndex << "( row:" << row + 1 << ", column:" << bar + 1 << ")"; qDebug() << barIndex << "object position:" << modelMatrix.column(3).toVector3D(); - qDebug() << "light position:" << lightPos; + //qDebug() << "light position:" << lightPos; } break; } @@ -473,7 +474,7 @@ void Q3DBars::render() glVertexAttribPointer(d_ptr->m_positionAttr, 3, GL_FLOAT, GL_FALSE, 0, (void*)0); // 2nd attribute buffer : normals - //glEnableVertexAttribArray(1); + glEnableVertexAttribArray(1); // this causes trouble with desktop opengl, but ANGLE requires it glBindBuffer(GL_ARRAY_BUFFER, d_ptr->m_normalbuffer); glVertexAttribPointer(d_ptr->m_normalAttr, 3, GL_FLOAT, GL_FALSE, 0, (void*)0); @@ -489,7 +490,7 @@ void Q3DBars::render() glDrawElements(GL_TRIANGLES, d_ptr->m_indexCount, GL_UNSIGNED_SHORT, (void*)0); //glDisableVertexAttribArray(2); - //glDisableVertexAttribArray(1); + glDisableVertexAttribArray(1); // this causes trouble with desktop opengl, but ANGLE requires it glDisableVertexAttribArray(0); } } diff --git a/src/datavis3d/engine/q3dwindow.cpp b/src/datavis3d/engine/q3dwindow.cpp index 67565b33..68f41b51 100644 --- a/src/datavis3d/engine/q3dwindow.cpp +++ b/src/datavis3d/engine/q3dwindow.cpp @@ -62,7 +62,7 @@ Q3DWindow::Q3DWindow(QWindow *parent) //surfaceFormat.setMajorVersion(2); //surfaceFormat.setMinorVersion(1); surfaceFormat.setSwapBehavior(QSurfaceFormat::DoubleBuffer); - surfaceFormat.setRenderableType(QSurfaceFormat::OpenGL); // OpenGL crashes with ANGLE, comment out or define OpenGLES + //surfaceFormat.setRenderableType(QSurfaceFormat::OpenGLES); // OpenGL crashes with ANGLE, comment out or define OpenGLES setFormat(surfaceFormat); qDebug() << "OpenGL version" << format().majorVersion() << format().minorVersion(); qDebug() << "OpenGL renderer" << format().renderableType(); |