GraphicSystems : Adding log output on gl Error
authorMichael Schuldt <michael.schuldt@bmw.de>
Mon, 5 Mar 2012 15:19:06 +0000 (17:19 +0200)
committerMichael Schuldt <michael.schuldt@bmw.de>
Mon, 5 Mar 2012 15:19:06 +0000 (17:19 +0200)
- During the surface renderloop the output of the glErrorCode
  was enabled.

- Some heavenly log outputs during debug mode were removed

LayerManagerPlugins/Renderers/Graphic/src/GraphicSystems/GLESGraphicSystem.cpp
LayerManagerPlugins/Renderers/Graphic/src/GraphicSystems/GLXGraphicSystem.cpp

index 569309b..caeef0d 100644 (file)
@@ -54,7 +54,6 @@ GLESGraphicsystem::GLESGraphicsystem(int windowWidth, int windowHeight, PfnShade
 
 void GLESGraphicsystem::activateGraphicContext()
 {
-    LOG_DEBUG("GLESGraphicsystem", "Activate Graphic Context");
     EGLBoolean eglStatus = false;
     eglStatus = eglMakeCurrent(m_eglDisplay, m_eglSurface, m_eglSurface, m_eglContext);
     
@@ -62,7 +61,6 @@ void GLESGraphicsystem::activateGraphicContext()
 
 void GLESGraphicsystem::releaseGraphicContext() 
 {
-    LOG_DEBUG("GLESGraphicsystem", "Release Graphic Context");
     EGLBoolean eglStatus = false;
     eglStatus = eglMakeCurrent(m_eglDisplay, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT);
 }   
@@ -253,7 +251,7 @@ Shader *GLESGraphicsystem::pickOptimizedShader(Shader* currentShader, const Shad
 void GLESGraphicsystem::renderSurface(Surface* surface)
 {
 //  LOG_DEBUG("GLESGraphicsystem", "renderSurface " << surface->getID());
-
+    GLenum glErrorCode = GL_NO_ERROR;
     // check if surface is cropped completely, if so then skip rendering
     if (ViewportTransform::isFullyCropped(surface->getDestinationRegion(), m_currentLayer->getSourceRegion() ) )
         return; // skip rendering of this surface, because it is cropped by layer source region
@@ -367,7 +365,11 @@ void GLESGraphicsystem::renderSurface(Surface* surface)
     glDrawArrays(GL_TRIANGLES, index, 6);
 
     glBindBuffer(GL_ARRAY_BUFFER, 0);
-    glGetError(); // TODO
+    glErrorCode = glGetError();
+    if ( GL_NO_ERROR != glErrorCode )
+    {
+        LOG_ERROR("GLESGraphicsystem", "GL Error occured :" << glErrorCode );
+    };
 
     delete textureCoordinates;
 }
index 3847911..65a9267 100644 (file)
@@ -92,14 +92,11 @@ bool GLXGraphicsystem::CheckConfigValue(Display *curDisplay,GLXFBConfig currentC
 
 void GLXGraphicsystem::activateGraphicContext()
 {
-    LOG_DEBUG("GLXGraphicsystem", "Activate Graphic Context");
-    glXMakeCurrent(m_x11display, m_window, m_context);
-    
+    glXMakeCurrent(m_x11display, m_window, m_context);   
 }
 
 void GLXGraphicsystem::releaseGraphicContext() 
 {
-    LOG_DEBUG("GLXGraphicsystem", "Release Graphic Context");
     glXMakeCurrent(m_x11display, None, NULL);
 }
 
@@ -192,7 +189,7 @@ bool GLXGraphicsystem::init(Display* x11Display, Window x11Window)
 
     XVisualInfo* windowVis = GetMatchingVisual(m_x11display);
 
-    LOG_DEBUG("X11GLXRenderer", "Initialising opengl");
+    LOG_DEBUG("GLXGraphicsystem", "Initialising opengl");
     m_context = glXCreateContext(m_x11display, windowVis, 0, GL_TRUE);
     if (!m_context)
     {
@@ -314,7 +311,7 @@ void GLXGraphicsystem::endLayer()
 void GLXGraphicsystem::renderSurface(Surface* currentSurface)
 {
 //    LOG_DEBUG("GLXGraphicsystem", "renderSurface " << currentSurface->getID() );
-    
+    GLenum glErrorCode = GL_NO_ERROR;
     const Rectangle &layerDestinationRegion = (m_currentLayer)->getDestinationRegion();
     const Rectangle &layerSourceRegion = (m_currentLayer)->getSourceRegion();
     
@@ -367,6 +364,11 @@ void GLXGraphicsystem::renderSurface(Surface* currentSurface)
 
     m_binder->unbindSurfaceTexture(currentSurface);
     glPopMatrix();
+    glErrorCode = glGetError();
+    if ( GL_NO_ERROR != glErrorCode )
+    {
+        LOG_ERROR("GLXGraphicsystem", "GL Error occured :" << glErrorCode );
+    };    
     currentSurface->drawCounter++;    
     delete textureCoordinates;
 }