diff options
author | Markus Mohrhard <markus.mohrhard@collabora.co.uk> | 2014-05-08 05:16:49 +0200 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2014-05-08 05:20:57 +0200 |
commit | 8018772ac7c75a042a6749d1c675401cd4c77d62 (patch) | |
tree | 4f111f1e19ffed60af23142bad2489fb528070eb /chart2 | |
parent | 38519bad1f74ad248c5c2c37dce2f978984a977c (diff) |
fix wrong access to array
Change-Id: I3298bd15260b2cbfd9a74024504d982dc00f4137
Diffstat (limited to 'chart2')
-rw-r--r-- | chart2/source/view/main/GL3DRenderer.cxx | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/chart2/source/view/main/GL3DRenderer.cxx b/chart2/source/view/main/GL3DRenderer.cxx index a1f648b2bac2..438fa77faea3 100644 --- a/chart2/source/view/main/GL3DRenderer.cxx +++ b/chart2/source/view/main/GL3DRenderer.cxx @@ -1082,7 +1082,8 @@ void OpenGL3DRenderer::RenderExtrudeFlatSurface(const Extrude3DInfo& extrude3D, glm::mat3 normalInverseTranspos = glm::inverseTranspose(normalMatrix); glUniformMatrix4fv(m_3DModelID, 1, GL_FALSE, &m_Model[0][0]); glUniformMatrix3fv(m_3DNormalMatrixID, 1, GL_FALSE, &normalInverseTranspos[0][0]); - glDrawElements(GL_TRIANGLES, extrude3D.size[surIndex], GL_UNSIGNED_SHORT, (void *)extrude3D.startIndex[surIndex]); + //TODO: moggi: startIndex is int!!!! + glDrawElements(GL_TRIANGLES, extrude3D.size[surIndex], GL_UNSIGNED_SHORT, &extrude3D.startIndex[surIndex]); } void OpenGL3DRenderer::RenderExtrudeBottomSurface(const Extrude3DInfo& extrude3D) @@ -1115,7 +1116,8 @@ void OpenGL3DRenderer::RenderExtrudeBottomSurface(const Extrude3DInfo& extrude3D glm::mat3 normalInverseTranspos = glm::inverseTranspose(normalMatrix); glUniformMatrix4fv(m_3DModelID, 1, GL_FALSE, &m_Model[0][0]); glUniformMatrix3fv(m_3DNormalMatrixID, 1, GL_FALSE, &normalInverseTranspos[0][0]); - glDrawElements(GL_TRIANGLES, extrude3D.size[BOTTOM_SURFACE], GL_UNSIGNED_SHORT, (void *)extrude3D.startIndex[BOTTOM_SURFACE]); + //TODO: moggi: startIndex is int!!!! + glDrawElements(GL_TRIANGLES, extrude3D.size[BOTTOM_SURFACE], GL_UNSIGNED_SHORT, &extrude3D.startIndex[BOTTOM_SURFACE]); } void OpenGL3DRenderer::RenderExtrudeMiddleSurface(const Extrude3DInfo& extrude3D) @@ -1150,7 +1152,7 @@ void OpenGL3DRenderer::RenderExtrudeMiddleSurface(const Extrude3DInfo& extrude3D glm::mat3 normalInverseTranspos = glm::inverseTranspose(normalMatrix); glUniformMatrix4fv(m_3DModelID, 1, GL_FALSE, &m_Model[0][0]); glUniformMatrix3fv(m_3DNormalMatrixID, 1, GL_FALSE, &normalInverseTranspos[0][0]); - glDrawElements(GL_TRIANGLES, extrude3D.size[MIDDLE_SURFACE], GL_UNSIGNED_SHORT, (void *)extrude3D.startIndex[MIDDLE_SURFACE]); + glDrawElements(GL_TRIANGLES, extrude3D.size[MIDDLE_SURFACE], GL_UNSIGNED_SHORT, &extrude3D.startIndex[MIDDLE_SURFACE]); } void OpenGL3DRenderer::RenderExtrudeTopSurface(const Extrude3DInfo& extrude3D) @@ -1186,7 +1188,7 @@ void OpenGL3DRenderer::RenderExtrudeTopSurface(const Extrude3DInfo& extrude3D) glm::mat3 normalInverseTranspos = glm::inverseTranspose(normalMatrix); glUniformMatrix4fv(m_3DModelID, 1, GL_FALSE, &m_Model[0][0]); glUniformMatrix3fv(m_3DNormalMatrixID, 1, GL_FALSE, &normalInverseTranspos[0][0]); - glDrawElements(GL_TRIANGLES, extrude3D.size[TOP_SURFACE], GL_UNSIGNED_SHORT, (void *)extrude3D.startIndex[TOP_SURFACE]); + glDrawElements(GL_TRIANGLES, extrude3D.size[TOP_SURFACE], GL_UNSIGNED_SHORT, &extrude3D.startIndex[TOP_SURFACE]); RenderExtrudeFlatSurface(extrude3D, FLAT_BOTTOM_SURFACE); } |