Hi,
I have a simple openGL ES 2.0 program and instead of creating a window surface. I am trying to use pbuffer to create load and compiler the shader.
but i am getting EGL_BAD_CONFIG error.
can anyone help me with it
Hi,
I have a simple openGL ES 2.0 program and instead of creating a window surface. I am trying to use pbuffer to create load and compiler the shader.
but i am getting EGL_BAD_CONFIG error.
can anyone help me with it
Please guys…
help me out
this is my code
EGLint err;
EGLBoolean eRetStatus;
EGLContext context;
EGLDisplay dpy;
EGLSurface pbuffer;
//EGLSurface pbuffer;
EGLint major, minor;
EGLint numConfigs;
EGLConfig config[10];
EGLint context_attribs[] = {EGL_CONTEXT_CLIENT_VERSION, 2, EGL_NONE};
EGLint attribList[]={
EGL_SURFACE_TYPE, EGL_PBUFFER_BIT,
EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT,
EGL_RED_SIZE, 5,
EGL_GREEN_SIZE, 6,
EGL_BLUE_SIZE, 5,
EGL_DEPTH_SIZE, 1,
EGL_NONE
};
EGLint pbuffattribList[]={
EGL_WIDTH, 640,
EGL_HEIGHT, 480,
EGL_LARGEST_PBUFFER, EGL_TRUE,
EGL_NONE
};
// EGL_TEXTURE_FORMAT, EGL_TEXTURE_RGB,
//EGL_TEXTURE_TARGET, EGL_TEXTURE_2D,
//EGL_NONE
//
EGLint red, blue, green,m;
dpy = eglGetDisplay(EGL_DEFAULT_DISPLAY);
err=eglGetError();
if(err=EGL_NO_DISPLAY)
{
printf(“no display”);
return EGL_FALSE;
}
eRetStatus = eglInitialize(dpy, &major, &minor);
if(eRetStatus==EGL_TRUE)
printf(“initialized kaka”);
eRetStatus = eglGetConfigs (dpy, config, 10, &numConfigs);
if(eRetStatus==EGL_BAD_PARAMETER )
printf(“configs bad in getconfigs”);
printf("
Config_count=%d
",numConfigs);
for( m=0; m<10 ; m++)
{
eglGetConfigAttrib(dpy, config[m], EGL_RED_SIZE, &red);
eglGetConfigAttrib(dpy, config[m], EGL_GREEN_SIZE, &green);
eglGetConfigAttrib(dpy, config[m], EGL_BLUE_SIZE, &blue);
// eglGetConfigAttrib(dpy, configs[m], EGL_ALPHA_SIZE, &alpha);
printf("( Pixel format = %d %d %d %d
",m+1,red, green, blue);
}
eRetStatus=eglChooseConfig(dpy, attribList, &config, 1, &numConfigs);
if( eRetStatus == EGL_TRUE)
printf(“chooseconfig keka”);
pbuffer = eglCreatePbufferSurface(dpy, config, pbuffattribList);
err=eglGetError();
if(err==EGL_NO_SURFACE)
{
printf(“err==EGL_NO_SURFACE”);
}
if(err==EGL_BAD_ALLOC)
{
printf(“err==EGL_BAD_ALLOC”);
}
if(err==EGL_BAD_CONFIG)
{
printf(“err==EGL_BAD_CONFIG”);
}
if(err==EGL_BAD_PARAMETER)
{
printf(“err==EGL_BAD_PARAMETER”);
}
if(err==EGL_BAD_MATCH)
{
printf(“err==EGL_BAD_MATCH”);
}
context=eglCreateContext (dpy, config, EGL_NO_CONTEXT, context_attribs);
if (context == EGL_NO_CONTEXT)
{
printf(“context also wasted”);
return EGL_FALSE;
}
if(!eglMakeCurrent(dpy, pbuffer, pbuffer, context))
{
return EGL_FALSE;
}
got my error
thank you all
This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.