egl/sfegltest/src/eglrendering.cpp
branchbug235_bringup_0
changeset 215 097e92a68d68
parent 211 3804ba25b23f
equal deleted inserted replaced
213:deb2534f581f 215:097e92a68d68
    56         RDebug::Printf("[EBT] CEglRendering::VGCheckError error %d", error);
    56         RDebug::Printf("[EBT] CEglRendering::VGCheckError error %d", error);
    57         User::Panic(_L("EBT-VG"), error);
    57         User::Panic(_L("EBT-VG"), error);
    58         }
    58         }
    59     }
    59     }
    60 
    60 
    61 CEGLRendering::CEGLRendering(RWindow& aWindow)
    61 void CEGLRendering::GLCheckError()
       
    62     {
       
    63 	GLenum error = glGetError();
       
    64     if(GL_NO_ERROR != error)
       
    65         {
       
    66         RDebug::Printf("[EBT] CEglRendering::GLCheckError error %d", error);
       
    67         User::Panic(_L("EBT-GL"), error);
       
    68         }
       
    69     }
       
    70 
       
    71 CEGLRendering::CEGLRendering(RWindow& aWindow, EGLenum aApi)
    62 	:  iWindow(aWindow)
    72 	:  iWindow(aWindow)
       
    73 	,  iApi(aApi)
    63 	{
    74 	{
    64 	}
    75 	}
    65 
    76 
    66 /*
    77 /*
    67  * Construct EGL objects, and OpenVG binding.
    78  * Construct EGL objects, and OpenVG binding.
    83 	KhrSetup();
    94 	KhrSetup();
    84 	KhrPaint();
    95 	KhrPaint();
    85 	EglSwapBuffers();
    96 	EglSwapBuffers();
    86 	}
    97 	}
    87 
    98 
       
    99 TSize CEGLRendering::WindowSize() const
       
   100 	{
       
   101 	return iWindow.Size();
       
   102 	}
       
   103 
    88 void CEGLRendering::EglSetupL()
   104 void CEGLRendering::EglSetupL()
    89     {
   105     {
    90     RDebug::Printf("[EBT] CEGLRendering::EglSetupL eglGetDisplay");
   106     RDebug::Printf("[EBT] CEGLRendering::EglSetupL eglGetDisplay");
    91     iDisplay = eglGetDisplay(EGL_DEFAULT_DISPLAY);
   107     iDisplay = eglGetDisplay(EGL_DEFAULT_DISPLAY);
    92     EGLCheckError();
   108     EGLCheckError();
   119         {
   135         {
   120         RDebug::Printf("[EBT] No matching configs found", eglQueryString(iDisplay, EGL_EXTENSIONS));
   136         RDebug::Printf("[EBT] No matching configs found", eglQueryString(iDisplay, EGL_EXTENSIONS));
   121         User::Leave(KErrNotSupported);
   137         User::Leave(KErrNotSupported);
   122         }
   138         }
   123 
   139 
   124     RDebug::Printf("[EBT] CEGLRendering::EglSetupL eglBindApi");
   140     RDebug::Printf("[EBT] CEGLRendering::EglSetupL eglBindApi 0x%x", iApi);
   125     EGLCheckReturnError(eglBindAPI(EGL_OPENVG_API));
   141     EGLCheckReturnError(eglBindAPI(iApi));
   126 
   142 
   127     RDebug::Printf("[EBT] CEGLRendering::EglSetupL eglCreateWindowSurface");
   143     RDebug::Printf("[EBT] CEGLRendering::EglSetupL eglCreateWindowSurface");
   128     iSurface = eglCreateWindowSurface(iDisplay, chosenConfig, &iWindow, NULL);
   144     iSurface = eglCreateWindowSurface(iDisplay, chosenConfig, &iWindow, NULL);
   129     EGLCheckError();
   145     EGLCheckError();
   130 
   146