hi,

   I initialize  OpenGL ES in driver_init_device like below, and I
implement all the other draw functions. all the draw functions are
written with openGL ES API functions, just emulate implementations of
gl driver.

  the test result: I did see the draw functions being called (not
software, it is my own functions), but It can't render anything to the
screen. what's wrong with my own implementation gfx driver? Please
give me some kindly help as possible as you can, I'd be very
appreciated that.

  if you want more infomation about this problem, please let me know.
thank you for you kindly help.

static DFBResult
driver_init_device( CoreGraphicsDevice *device,
                    GraphicsDeviceInfo *device_info,
                    void               *driver_data,
                    void               *device_data )
{

     // EGL variables
        EGLDisplay                      eglDisplay      = 0;
        EGLConfig                       eglConfig       = 0;
        EGLSurface                      eglSurface      = 0;
        EGLContext                      eglContext      = 0;
        
        EGLint pi32ConfigAttribs[3];
        pi32ConfigAttribs[0] = EGL_SURFACE_TYPE;
        pi32ConfigAttribs[1] = EGL_WINDOW_BIT;
        pi32ConfigAttribs[2] = EGL_NONE;


        eglDisplay = eglGetDisplay((NativeDisplayType)0);
        printf("eglDisplay return value = %d \n", eglDisplay );
        
        EGLint iMajorVersion, iMinorVersion;
        if (!eglInitialize(eglDisplay, &iMajorVersion, &iMinorVersion))
        {
                printf("Error: eglInitialize() failed.\n");
                return 0;
        }
        else
        {
                printf("eglInitialize() OpenGLES %d.%d \n",
iMajorVersion, iMinorVersion );
        }

        int iConfigs;
        if (!eglChooseConfig(eglDisplay, pi32ConfigAttribs, &eglConfig, 1,
&iConfigs) || (iConfigs != 1))
        {
                printf("Error: eglChooseConfig() failed.\n");
                return 0;
        }

        eglSurface = eglCreateWindowSurface(eglDisplay, eglConfig,
(NativeWindowType)0, NULL);
        if (!TestEGLError("eglCreateWindowSurface"))
        {
                return 0;
        }


        eglContext = eglCreateContext(eglDisplay, eglConfig, NULL, NULL);
        if (!TestEGLError("eglCreateContext"))
        {
                return 0;
        }

        eglMakeCurrent(eglDisplay, eglSurface, eglSurface, eglContext);
        if (!TestEGLError("eglMakeCurrent"))
        {
                return 0;
        }

     const char* renderer = (const char*) glGetString (GL_RENDERER);
     direct_snputs( device_info->name,
                    renderer ?: "Unknown",
DFB_GRAPHICS_DEVICE_INFO_NAME_LENGTH );
     direct_snputs( device_info->vendor,
                    "OpenGLES Acceleration -",
DFB_GRAPHICS_DEVICE_INFO_VENDOR_LENGTH );


     /* device limitations */
     device_info->limits.surface_byteoffset_alignment = 8;
     device_info->limits.surface_bytepitch_alignment  = 8;

     device_info->caps.flags    = CCF_CLIPPING | CCF_RENDEROPTS;
     device_info->caps.accel    = GL_SUPPORTED_DRAWINGFUNCTIONS |
                                  GL_SUPPORTED_BLITTINGFUNCTIONS;
     device_info->caps.drawing  = GL_SUPPORTED_DRAWINGFLAGS;
     device_info->caps.blitting = GL_SUPPORTED_BLITTINGFLAGS;

     return DFB_OK;
}

 Best Regards

thanks
_______________________________________________
directfb-dev mailing list
directfb-dev@directfb.org
http://mail.directfb.org/cgi-bin/mailman/listinfo/directfb-dev

Reply via email to