[Libreoffice-commits] core.git: Branch 'feature/opengl-canvas-rework' - canvas/source
Michael Jaumann
meta_dev at yahoo.com
Thu Nov 27 07:29:11 PST 2014
canvas/source/opengl/ogl_renderHelper.cxx | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
New commits:
commit 95c6e4f420c2e604325151706f95f8f7d4ff9403
Author: Michael Jaumann <meta_dev at yahoo.com>
Date: Thu Nov 27 13:51:33 2014 +0000
fill glbufferdata with the right verticecount
Change-Id: I0efe1b6ec94daa3bac97d7e4f0768aea8d32d738
diff --git a/canvas/source/opengl/ogl_renderHelper.cxx b/canvas/source/opengl/ogl_renderHelper.cxx
index 8d95f46..f53ab33 100644
--- a/canvas/source/opengl/ogl_renderHelper.cxx
+++ b/canvas/source/opengl/ogl_renderHelper.cxx
@@ -65,7 +65,7 @@ namespace oglcanvas
glUseProgram(m_texProgID);
- glBufferData(GL_ARRAY_BUFFER, sizeof(rVertices), &rVertices[0].x, GL_STATIC_DRAW);
+ glBufferData(GL_ARRAY_BUFFER, rVertices.size()*sizeof(float), &rVertices[0].x, GL_STATIC_DRAW);
glUniform4fv(m_texColorUnf, 1, &color[0]);
glUniformMatrix4fv(m_texMVPUnf, 1, GL_FALSE, &m_MVP[0][0]);
glEnableVertexAttribArray(m_texPosAttrb); //vertices
@@ -91,10 +91,10 @@ namespace oglcanvas
void RenderHelper::renderVertexUVTex(const std::vector<glm::vec2>& rVertices, const std::vector<glm::vec2>& rUVcoords, glm::vec4 color, GLenum mode) const
{
glBindBuffer(GL_ARRAY_BUFFER, m_vertexBuffer);
- glBufferData(GL_ARRAY_BUFFER, sizeof(rVertices), &rVertices[0].x, GL_STATIC_DRAW);
+ glBufferData(GL_ARRAY_BUFFER, rVertices.size()*sizeof(float), &rVertices[0].x, GL_STATIC_DRAW);
glBindBuffer(GL_ARRAY_BUFFER, m_uvBuffer);
- glBufferData(GL_ARRAY_BUFFER, sizeof(rUVcoords), &rUVcoords[0].x, GL_STATIC_DRAW);
+ glBufferData(GL_ARRAY_BUFFER, rUVcoords.size()*sizeof(float), &rUVcoords[0].x, GL_STATIC_DRAW);
glUseProgram(m_simpleProgID);
@@ -148,7 +148,7 @@ namespace oglcanvas
void RenderHelper::renderVertexTex(const std::vector<glm::vec2>& rVertices, GLfloat fWidth, GLfloat fHeight, glm::vec4 color, GLenum mode) const
{
glBindBuffer(GL_ARRAY_BUFFER, m_vertexBuffer);
- glBufferData(GL_ARRAY_BUFFER, sizeof(rVertices), &rVertices[0].x, GL_STATIC_DRAW);
+ glBufferData(GL_ARRAY_BUFFER, rVertices.size()*sizeof(float), &rVertices[0].x, GL_STATIC_DRAW);
glUseProgram(m_texManProgID);
More information about the Libreoffice-commits
mailing list