Hi,
To make the back buffer visible, I called eglSwapBuffers like below,
static DFBResult
omapFlipRegion( CoreLayer *layer,
void *driver_data,
void *layer_data,
void *region_data,
CoreSurface *surface,
DFBSurfaceFlipFlags flags)
{
printf("debug: swaped omapflip region \n");
if(eglSurface != 0)
{
eglSwapBuffers(eglDisplay, eglSurface);
printf("%s: swaped buffer \n",__FUNCTION__);
}
return DFB_OK;
}
DisplayLayerFuncs omapPrimaryLayerFuncs = {
.UpdateRegion = omapUpdateRegion,
.FlipRegion = omapFlipRegion,
};
and in driver_init_driver function, I add this line (to let omapFlipRegion
function be called by system):
dfb_layers_hook_primary( device, driver_data, &omapPrimaryLayerFuncs, NULL,
NULL );
The Result: I still saw nothing image rendered to screen. what's wrong with
my opengl es driver ?
to use opengl es acceleration, if I need to do some modifies to core system
code in directFB, rather than writing a gfxdriver?
if it is so, how should I do that, what's the main work related? I don't
know much about grahpic driver implementation :(
thanks in advance.
On Jul 30, 2009 12:02am, "Strelchun, Timothy" <timothy.strelc...@intel.com>
wrote:
Since your using an EGL window surface, you will need to make the back
buffer visible by calling eglSwapBuffers. A systems driver would do this
in the DisplayLayerFuncs::FlipRegion function. Single buffered display
layers do it in the UpdateRegion function, however I do not believe EGL
supports single buffered EGL window surfaces.
Timothy
--
Timothy Strelchun
CE Software Engineering
Digital Home Group
Intel Corporation
The views expressed above are my own and not those of Intel
>-----Original Message-----
>From: directfb-dev-boun...@directfb.org
>[mailto:directfb-dev-boun...@directfb.org] On Behalf Of Favor Tang
>Sent: Tuesday, July 28, 2009 8:45 PM
>To: directfb-us...@directfb.org; directfb-dev@directfb.org
>Cc: Hui Tang
>Subject: [directfb-dev] problem with writing directfb
>gfxdriver for openGL ES
>
>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
_______________________________________________
directfb-dev mailing list
directfb-dev@directfb.org
http://mail.directfb.org/cgi-bin/mailman/listinfo/directfb-dev