Imagination PowerVR SDK Blog

about eglCreatePixmapSurface


#1

All I want to say is about LG SU76 cell phone, android 2.2.2, OpenGL ES 2.0.    I tried to create a off-screen buffer via “eglCreatePixmapSurface”. Everything seem OK until “glLinkProgram”. After calling “glGetProgramiv ( nProgramObject, GL_LINK_STATUS, &linked );”, “linked” was zero. Further more, I tried “glGetBooleanv( GL_SHADER_COMPILER, &tag);”, the “tag” returned 0. I am sure that all the source code of GLSL is correct, because I run the on-screen rendering successfully with the same GLSL.  Does the powerVR support “eglCreatePixmapSurface” on device? If yes, would you please send me a simple test bed to show me how to use eglCreatePixmapSurface. Following are my code about creating pixmap surface.

        egl = (EGL10)EGLContext.getEGL();
        dpy = egl.eglGetDisplay(EGL10.EGL_DEFAULT_DISPLAY);

        int[] version = new int[2];
        egl.eglInitialize(dpy, version);

        int[] configSpec = {
                EGL10.EGL_SURFACE_TYPE, EGL10.EGL_PIXMAP_BIT,
                EGL10.EGL_RENDERABLE_TYPE, 0x0004,
                EGL10.EGL_RED_SIZE, 5,
                EGL10.EGL_GREEN_SIZE, 6,
                EGL10.EGL_BLUE_SIZE, 5,
                EGL10.EGL_DEPTH_SIZE, 16,
                EGL10.EGL_NONE
        };
        EGLConfig[] configs = new EGLConfig[1];
        int[] num_config = new int[1];
        egl.eglChooseConfig(dpy, configSpec, configs, 1, num_config);
        config = configs[0];


        int ContextAttrib[] = {0x3098, 2, EGL10.EGL_NONE };
        context = egl.eglCreateContext(dpy, config,
                EGL10.EGL_NO_CONTEXT, ContextAttrib);

        native_pixmap = Bitmap.createBitmap(128, 128, Config.RGB_565);
        surface = egl.eglCreatePixmapSurface(dpy, config, native_pixmap, null);


        egl.eglMakeCurrent(dpy, surface, surface, context);