diff options
author | Markus Mohrhard <markus.mohrhard@collabora.co.uk> | 2014-01-11 20:00:48 +0100 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2014-01-29 08:09:42 +0100 |
commit | 717ae7fb8c04a9cd735af5fac9d899ed6b404d73 (patch) | |
tree | a0b7aeed5e5f49b01f391425dec72b2fb0978a23 /chart2 | |
parent | c6d1ffb2a4c63354738eda5c7238328d3a6ce529 (diff) |
I already know where the error is but want to be sure
Change-Id: Ibe90e99320243aadec2e2d8ab3740567e83f7f56
Diffstat (limited to 'chart2')
-rwxr-xr-x | chart2/source/view/main/OpenGLRender.cxx | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/chart2/source/view/main/OpenGLRender.cxx b/chart2/source/view/main/OpenGLRender.cxx index 9a21b63e0cc2..a495bd95c913 100755 --- a/chart2/source/view/main/OpenGLRender.cxx +++ b/chart2/source/view/main/OpenGLRender.cxx @@ -571,15 +571,21 @@ int OpenGLRender::RenderLine2FBO(int) Line2DPointList &pointList = m_Line2DShapePointList.front(); //fill vertex buffer glBindBuffer(GL_ARRAY_BUFFER, m_VertexBuffer); + CHECK_GL_ERROR(); glBufferData(GL_ARRAY_BUFFER, pointList.bufLen, pointList.pointBuf, GL_STATIC_DRAW); + CHECK_GL_ERROR(); // Use our shader glUseProgram(m_Line2DProID); + CHECK_GL_ERROR(); glUniform4fv(m_Line2DColorID, 1, &m_Line2DColor[0]); + CHECK_GL_ERROR(); // 1rst attribute buffer : vertices glEnableVertexAttribArray(m_Line2DVertexID); + CHECK_GL_ERROR(); glBindBuffer(GL_ARRAY_BUFFER, m_VertexBuffer); + CHECK_GL_ERROR(); glVertexAttribPointer( m_Line2DVertexID, // attribute. No particular reason for 0, but must match the layout in the shader. 2, // size @@ -589,8 +595,12 @@ int OpenGLRender::RenderLine2FBO(int) (void*)0 // array buffer offset ); glDrawArrays(GL_LINE_STRIP, 0, pointList.bufLen / sizeof(float) / 2); // 12*3 indices starting at 0 -> 12 triangles + CHECK_GL_ERROR(); glDisableVertexAttribArray(m_Line2DWholeVertexID); + CHECK_GL_ERROR(); glUseProgram(0); + CHECK_GL_ERROR(); + free(pointList.pointBuf); m_Line2DShapePointList.pop_front(); free(pointList.pointBuf); } |