hi, I need to render on pixmap surfase.
When I do it on screen surfase it works just fine, but when I call eglCreatePixmapSurface instead of eglCreateWindowSurface, the function return EGL_NO_SURFACE:
void CRenderer::ConstructL()
{
EGLint attribList[] =
{
EGL_BUFFER_SIZE, 0,
EGL_RED_SIZE, 4,
EGL_GREEN_SIZE, 4,
EGL_BLUE_SIZE, 4,
EGL_DEPTH_SIZE, 16,
EGL_SURFACE_TYPE, EGL_PIXMAP_BIT,
EGL_NONE
};
switch( iBitmap.DisplayMode() )
{
case( EColor4K ) : { attribList[1] = 12; break; }
case( EColor64K ): { attribList[1] = 16; break; }
case( EColor16M ): { attribList[1] = 24; break; }
default: attribList[1] = 32; // for EColor16MU
}
EGLint numConfigs;
EGLint majorVersion;
EGLint minorVersion;
iGldisplay = eglGetDisplay( EGL_DEFAULT_DISPLAY );
if( iGldisplay == EGL_NO_DISPLAY )
{
User::Panic( _L("GL No Display"),0 );
}
if( !eglInitialize( iGldisplay, &majorVersion, &minorVersion ) )
{
User::Panic( _L("GL Init"), 0 );
}
if( eglGetConfigs( iGldisplay, NULL, 0, &numConfigs) == EGL_FALSE )
{
User::Panic(_L("GL Get Configs"), 0 );
}
if( !eglChooseConfig( iGldisplay, attribList, &iGlconfig, 1, &numConfigs ) )
{
User::Panic(_L("GL Config"), 0 );
}
int val = 0;
eglGetConfigAttrib( iGldisplay, iGlconfig, EGL_SURFACE_TYPE, &val);
if(!(val & EGL_PIXMAP_BIT))
{
User::Panic(_L("GL Get config attrib"), 0 );
}
iGlcontext = eglCreateContext( iGldisplay, iGlconfig, NULL, NULL );
if( iGlcontext==0 )
{
User::Panic( _L("GL Context"), 0 );
}
iGlsurface = eglCreatePixmapSurface( iGldisplay, iGlconfig, iBitmap, NULL );
if( iGlsurface == EGL_NO_SURFACE )
{
User::Panic( _L("GL Surface"), 0 );
}
…
.
.
bitmap is created as:
iBitmap = new (ELeave) CWsBitmap( iEikonEnv->WsSession() );
iBitmap->Create(TSize(176, 208), EColor4K );
where is my mistake?
thanks for any help.