diff options
author | Miikka Heikkinen <miikka.heikkinen@digia.com> | 2013-10-15 12:52:02 +0300 |
---|---|---|
committer | Miikka Heikkinen <miikka.heikkinen@digia.com> | 2013-10-15 12:56:39 +0300 |
commit | 7861ae308bd9fd495f677400cc07c657a1439656 (patch) | |
tree | 994bab0cd5a31728ec653c2b3886ee15bed8ced0 /src/datavisualization/engine/surface3drenderer.cpp | |
parent | 0109b085710bfabc81faf43118ad5654cbd96081 (diff) |
Fix crashes and bugs when using surface with ES2
+Fix compile warnings
+Fix qmlsurface example
Change-Id: I28bbf38e7aa51b1ec315374182a9daae8eded87c
Reviewed-by: Tomi Korpipää <tomi.korpipaa@digia.com>
Diffstat (limited to 'src/datavisualization/engine/surface3drenderer.cpp')
-rw-r--r-- | src/datavisualization/engine/surface3drenderer.cpp | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/src/datavisualization/engine/surface3drenderer.cpp b/src/datavisualization/engine/surface3drenderer.cpp index 7aec3ff4..b73332f3 100644 --- a/src/datavisualization/engine/surface3drenderer.cpp +++ b/src/datavisualization/engine/surface3drenderer.cpp @@ -114,7 +114,6 @@ Surface3DRenderer::Surface3DRenderer(Surface3DController *controller) m_selectionModeChanged(false), m_hasHeightAdjustmentChanged(true) { -#if !defined(QT_OPENGL_ES_2) // Check if flat feature is supported ShaderHelper tester(this, QStringLiteral(":/shaders/vertexSurfaceFlat"), QStringLiteral(":/shaders/fragmentSurfaceFlat")); @@ -122,7 +121,6 @@ Surface3DRenderer::Surface3DRenderer(Surface3DController *controller) m_flatSupported = false; m_controller->setSmoothSurface(true); } -#endif m_cachedSmoothSurface = m_controller->smoothSurface(); updateSurfaceGridStatus(m_controller->surfaceGrid()); @@ -815,13 +813,13 @@ void Surface3DRenderer::drawScene(GLuint defaultFboHandle) QMatrix4x4 depthProjectionMatrix; QMatrix4x4 depthProjectionViewMatrix; - GLfloat adjustedLightStrength = m_cachedTheme.m_lightStrength / 10.0f; QVector3D surfaceScaler(m_surfaceScaleX, 1.0f, m_surfaceScaleZ); QVector3D surfaceOffset(m_surfaceOffsetX, 0.0f, m_surfaceOffsetZ + zComp); // Draw depth buffer #if !defined(QT_OPENGL_ES_2) + GLfloat adjustedLightStrength = m_cachedTheme.m_lightStrength / 10.0f; if (m_cachedShadowQuality > QDataVis::ShadowQualityNone && m_surfaceObj) { // Render scene into a depth texture for using with shadow mapping // Enable drawing to depth framebuffer @@ -966,10 +964,10 @@ void Surface3DRenderer::drawScene(GLuint defaultFboHandle) m_selectionShader->release(); // Put the RGBA value back to uint -#if defined (Q_OS_ANDROID) - selectionId = pixel[0] + pixel[1] * 256 + pixel[2] * 65536; -#else +#if !defined(QT_OPENGL_ES_2) selectionId = pixel[0] + pixel[1] * 256 + pixel[2] * 65536 + pixel[3] * 16777216; +#else + selectionId = pixel[0] + pixel[1] * 256 + pixel[2] * 65536; #endif selectionDirty = true; |