Results 1 to 3 of 3

Thread: error in pbuffer configs.

  1. #1
    Junior Member
    Join Date
    Jun 2012
    Posts
    19

    error in pbuffer configs.

    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

  2. #2
    Junior Member
    Join Date
    Jun 2012
    Posts
    19

    Re: error in pbuffer configs.

    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("\nConfig_count=%d\n",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\n",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;
    }

  3. #3
    Junior Member
    Join Date
    Jun 2012
    Posts
    19

    Re: error in pbuffer configs.

    got my error
    thank you all

Similar Threads

  1. fatal error C1189: #error : ERROR: Use of C runtime library
    By gjermani in forum OpenGL ES general technical discussions
    Replies: 1
    Last Post: 09-24-2007, 03:02 AM
  2. Pbuffer
    By jpsml in forum OpenGL ES general technical discussions
    Replies: 0
    Last Post: 11-10-2005, 08:32 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •