diff options
author | Markus Mohrhard <markus.mohrhard@collabora.co.uk> | 2014-02-15 03:05:34 +0100 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2014-02-15 03:08:18 +0100 |
commit | 6d6ba15f7dd3251e70d5311e6138f294025a0a5f (patch) | |
tree | 7bee33861a354d9efba568ef23525767fd33e360 /chart2 | |
parent | remove unnecessary stuff (diff) | |
download | core-6d6ba15f7dd3251e70d5311e6138f294025a0a5f.tar.gz core-6d6ba15f7dd3251e70d5311e6138f294025a0a5f.zip |
fix OpenGL text rendering
Change-Id: Ia5dd022d8b79d4276a92bcf741196137d5e9d36e
Diffstat (limited to 'chart2')
-rwxr-xr-x | chart2/source/view/main/OpenGLRender.cxx | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/chart2/source/view/main/OpenGLRender.cxx b/chart2/source/view/main/OpenGLRender.cxx index 1dabe73921d1..963d6b0c8d0c 100755 --- a/chart2/source/view/main/OpenGLRender.cxx +++ b/chart2/source/view/main/OpenGLRender.cxx @@ -221,6 +221,17 @@ GLint OpenGLRender::LoadShaders(const OUString& rVertexShaderName,const OUString return ProgramID; } +namespace { + +GLfloat texCoords[] = { + 0.0f, 0.0f, + 1.0f, 0.0f, + 1.0f, 1.0f, + 0.0f, 1.0f +}; + +} + int OpenGLRender::InitOpenGL(GLWindow aWindow) { glWin = aWindow; @@ -318,10 +329,12 @@ int OpenGLRender::InitOpenGL(GLWindow aWindow) glGenBuffers(1, &m_RenderTexCoordBuf); glBindBuffer(GL_ARRAY_BUFFER, m_RenderTexCoordBuf); + glBufferData(GL_ARRAY_BUFFER, sizeof(texCoords), texCoords, GL_STATIC_DRAW); glBindBuffer(GL_ARRAY_BUFFER, 0); glGenBuffers(1, &m_TextTexCoordBuf); glBindBuffer(GL_ARRAY_BUFFER, m_TextTexCoordBuf); + glBufferData(GL_ARRAY_BUFFER, sizeof(texCoords), texCoords, GL_STATIC_DRAW); glBindBuffer(GL_ARRAY_BUFFER, 0); #if defined( WNT ) @@ -1476,7 +1489,7 @@ int OpenGLRender::RenderTextShape() glUniform1i(m_TextTexID, 0); CHECK_GL_ERROR(); //TODO: moggi: get rid fo GL_QUADS - glDrawArrays(GL_QUADS, 0, 3); + glDrawArrays(GL_QUADS, 0, 4); CHECK_GL_ERROR(); glDisableVertexAttribArray(m_TextTexCoordID); CHECK_GL_ERROR(); |