summaryrefslogtreecommitdiff
path: root/chart2
diff options
context:
space:
mode:
authorMarkus Mohrhard <markus.mohrhard@googlemail.com>2014-01-31 13:55:57 +0100
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2014-01-31 18:49:23 +0100
commit9aa225f0cb980d81bf0fdcc91dede3c7a3bdf99f (patch)
treeceb06396de9b144cb3d9a6dfebcadbbc571d10ac /chart2
parent9741870c3e149befcee34fe01d12e3e7ab6670f2 (diff)
better OpenGL debug output
Change-Id: I90a3883c0bbead0de02c8d4096eccecc59f1b0e3
Diffstat (limited to 'chart2')
-rwxr-xr-xchart2/source/view/main/OpenGLRender.cxx16
1 files changed, 12 insertions, 4 deletions
diff --git a/chart2/source/view/main/OpenGLRender.cxx b/chart2/source/view/main/OpenGLRender.cxx
index 1e401dcee9df..da99f813df5f 100755
--- a/chart2/source/view/main/OpenGLRender.cxx
+++ b/chart2/source/view/main/OpenGLRender.cxx
@@ -364,11 +364,15 @@ int OpenGLRender::InitOpenGL(GLWindow aWindow)
glGenBuffers(1, &m_VertexBuffer);
glGenBuffers(1, &m_ColorBuffer);
+ CHECK_GL_ERROR();
+
m_RenderProID = LoadShaders("renderVertexShader", "renderFragmentShader");
m_RenderVertexID = glGetAttribLocation(m_RenderProID, "vPosition");
m_RenderTexCoordID = glGetAttribLocation(m_RenderProID, "texCoord");
m_RenderTexID = glGetUniformLocation(m_RenderProID, "RenderTex");
+ CHECK_GL_ERROR();
+
m_CommonProID = LoadShaders("commonVertexShader", "commonFragmentShader");
m_MatrixID = glGetUniformLocation(m_CommonProID, "MVP");
m_2DVertexID = glGetAttribLocation(m_CommonProID, "vPosition");
@@ -378,19 +382,23 @@ int OpenGLRender::InitOpenGL(GLWindow aWindow)
#if DEBUG_POSITIONING
m_DebugProID = LoadShaders("debugVertexShader", "debugFragmentShader");
m_DebugVertexID = glGetAttribLocation(m_DebugProID, "vPosition");
-#endif
CHECK_GL_ERROR();
+#endif
m_BackgroundProID = LoadShaders("backgroundVertexShader", "backgroundFragmentShader");
m_BackgroundMatrixID = glGetUniformLocation(m_BackgroundProID, "MVP");
m_BackgroundVertexID = glGetAttribLocation(m_BackgroundProID, "vPosition");
m_BackgroundColorID = glGetAttribLocation(m_BackgroundProID, "vColor");
+ CHECK_GL_ERROR();
+
m_SymbolProID = LoadShaders("symbolVertexShader", "symbolFragmentShader");
m_SymbolVertexID = glGetAttribLocation(m_SymbolProID, "vPosition");
m_SymbolMatrixID = glGetAttribLocation(m_SymbolProID, "MVP");
m_SymbolColorID = glGetAttribLocation(m_SymbolProID, "vColor");
+ CHECK_GL_ERROR();
+
m_TextProID = LoadShaders("textVertexShader", "textFragmentShader");
m_TextMatrixID = glGetUniformLocation(m_TextProID, "MVP");
m_TextVertexID = glGetAttribLocation(m_TextProID, "vPosition");
@@ -1734,6 +1742,7 @@ int OpenGLRender::RenderSymbol2DShape(float x, float y, float width, float heigh
glDisable(GL_POINT_SMOOTH);
glDisable(GL_MULTISAMPLE);
glPointSize(10.f);
+ CHECK_GL_ERROR();
PosVecf3 trans = {x/OPENGL_SCALE_VALUE, y/OPENGL_SCALE_VALUE, m_fZStep};
PosVecf3 angle = {0.0f, 0.0f, 0.0f};
PosVecf3 scale = {width/OPENGL_SCALE_VALUE, height/OPENGL_SCALE_VALUE, 1.0f};
@@ -1744,12 +1753,11 @@ int OpenGLRender::RenderSymbol2DShape(float x, float y, float width, float heigh
//fill vertex buffer
glBindBuffer(GL_ARRAY_BUFFER, m_VertexBuffer);
glBufferData(GL_ARRAY_BUFFER, 3 * sizeof(float), aPos, GL_STATIC_DRAW);
+ CHECK_GL_ERROR();
// Use our shader
glUseProgram(m_SymbolProID);
-
glUniform4fv(m_SymbolColorID, 1, &m_2DColor[0]);
-
glUniformMatrix4fv(m_SymbolMatrixID, 1, GL_FALSE, &m_MVP[0][0]);
// 1rst attribute buffer : vertices
@@ -1769,9 +1777,9 @@ int OpenGLRender::RenderSymbol2DShape(float x, float y, float width, float heigh
glUseProgram(0);
glEnable(GL_MULTISAMPLE);
glEnable(GL_POINT_SMOOTH);
- CHECK_GL_ERROR();
m_fZStep += Z_STEP;
+ CHECK_GL_ERROR();
return 0;
}