Kaydet (Commit) 33c8b164 authored tarafından Markus Mohrhard's avatar Markus Mohrhard Kaydeden (comit) Markus Mohrhard

add a few more debug statements

Change-Id: I9c9f4f216f1505d66911cfcf049eb991fbe59ccf
üst ec4b0ed8
...@@ -1423,9 +1423,12 @@ int OpenGLRender::RenderTextShape() ...@@ -1423,9 +1423,12 @@ int OpenGLRender::RenderTextShape()
MoveModelf(trans, angle, scale); MoveModelf(trans, angle, scale);
m_MVP = m_Projection * m_View * m_Model; m_MVP = m_Projection * m_View * m_Model;
glBindBuffer(GL_ARRAY_BUFFER, m_VertexBuffer); glBindBuffer(GL_ARRAY_BUFFER, m_VertexBuffer);
CHECK_GL_ERROR();
glBufferData(GL_ARRAY_BUFFER, sizeof(textInfo.vertex), textInfo.vertex, GL_STATIC_DRAW); glBufferData(GL_ARRAY_BUFFER, sizeof(textInfo.vertex), textInfo.vertex, GL_STATIC_DRAW);
CHECK_GL_ERROR();
glUseProgram(m_TextProID); glUseProgram(m_TextProID);
CHECK_GL_ERROR();
glUniformMatrix4fv(m_TextMatrixID, 1, GL_FALSE, &m_MVP[0][0]); glUniformMatrix4fv(m_TextMatrixID, 1, GL_FALSE, &m_MVP[0][0]);
// 1rst attribute buffer : vertices // 1rst attribute buffer : vertices
glEnableVertexAttribArray(m_TextVertexID); glEnableVertexAttribArray(m_TextVertexID);
...@@ -1439,6 +1442,7 @@ int OpenGLRender::RenderTextShape() ...@@ -1439,6 +1442,7 @@ int OpenGLRender::RenderTextShape()
(void*)0 // array buffer offset (void*)0 // array buffer offset
); );
//tex coord //tex coord
CHECK_GL_ERROR();
glEnableVertexAttribArray(m_TextTexCoordID); glEnableVertexAttribArray(m_TextTexCoordID);
glBindBuffer(GL_ARRAY_BUFFER, m_TextTexCoordBuf); glBindBuffer(GL_ARRAY_BUFFER, m_TextTexCoordBuf);
glVertexAttribPointer( glVertexAttribPointer(
...@@ -1450,15 +1454,22 @@ int OpenGLRender::RenderTextShape() ...@@ -1450,15 +1454,22 @@ int OpenGLRender::RenderTextShape()
(void*)0 // array buffer offset (void*)0 // array buffer offset
); );
//texture //texture
CHECK_GL_ERROR();
glBindTexture(GL_TEXTURE_2D, textInfo.texture); glBindTexture(GL_TEXTURE_2D, textInfo.texture);
CHECK_GL_ERROR();
glUniform1i(m_TextTexID, 0); glUniform1i(m_TextTexID, 0);
CHECK_GL_ERROR();
//TODO: moggi: get rid fo GL_QUADS //TODO: moggi: get rid fo GL_QUADS
glDrawArrays(GL_QUADS, 0, 4); glDrawArrays(GL_QUADS, 0, 3);
CHECK_GL_ERROR();
glDisableVertexAttribArray(m_TextTexCoordID); glDisableVertexAttribArray(m_TextTexCoordID);
CHECK_GL_ERROR();
glDisableVertexAttribArray(m_TextVertexID); glDisableVertexAttribArray(m_TextVertexID);
CHECK_GL_ERROR();
glBindTexture(GL_TEXTURE_2D, 0); glBindTexture(GL_TEXTURE_2D, 0);
glUseProgram(0); glUseProgram(0);
glDeleteTextures(1, &textInfo.texture); glDeleteTextures(1, &textInfo.texture);
CHECK_GL_ERROR();
m_TextInfoList.pop_front(); m_TextInfoList.pop_front();
} }
CHECK_GL_ERROR(); CHECK_GL_ERROR();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment