Hi,

That means is i want palette support also, then i need to use LUT8 format.
Am i correct.
So do Directfb takes care of format conversion. Like if my hardware supports
only RGB565 format, and DirectFB is Hardware Accelerated on the platform,
then the required format conversion will be done in DirectFb, or i should
handle this.

Because in x86, even if i set the Pixelformat as LUT8, and pass
setcolor(0xff, 0x00, 0x00, 0xff), it draws with red color, though i have not
specified a lookup table in my application.

Is it necessary to call Flip to display on the screen, or it can be done
automatically to draw on the screen.


regards
Animesh

On Tue, Mar 4, 2008 at 11:57 PM, Claudio Ciccani <[EMAIL PROTECTED]> wrote:

>
> Il giorno lun, 03/03/2008 alle 22.08 +0530, animesh ha scritto:
> > Hi All,
> >     I am sending this mail with the hope that i would get some reply.
> >     I am writing a simple DirectFB application, but when i change the
> > PixelFormat, Iget errors that CreateSurface is Not supported.
> > #include <stdio.h>
> > #include <unistd.h>
> > #include <directfb.h>
> >
> > static IDirectFB *dfb = NULL;
> > static IDirectFBSurface *primary = NULL;
> > static int screen_width  = 0;
> > static int screen_height = 0;
> >
> > #define DFBCHECK(x...)                                         \
> >   {                                                            \
> >     DFBResult err = x;                                         \
> >                                                                \
> >     if (err != DFB_OK)                                         \
> >       {                                                        \
> >         fprintf( stderr, "%s <%d>:\n\t", __FILE__, __LINE__ ); \
> >         DirectFBErrorFatal( #x, err );                         \
> >       }                                                        \
> >   }
> > int main (int argc, char **argv)
> > {
> >
> >   DFBSurfaceDescription dsc;
> >
> >   DFBCHECK (DirectFBInit (&argc, &argv));
> >   DFBCHECK (DirectFBCreate (&dfb));
> >   DFBCHECK (dfb->SetCooperativeLevel (dfb, DFSCL_FULLSCREEN));
> >
> >   dsc.flags = DSDESC_CAPS;
> > /*Now if I Change this line to
> >   dsc.flags = DSDESC_CAPS | DSDESC_PIXELFORMAT*/
> >
> >   dsc.caps  = DSCAPS_PRIMARY | DSCAPS_FLIPPING;
> >
> > /*And Add this line
> > dsc.pixelformat = DSPF_A8
> > or
> > dsc.pixelformat = DSPF_ALUT44
> > or, many other Pixel format then i get an error while executing the
> > code the
> > dfb->CreateSurface( dfb, &dsc, &primary ) is not supported.*/
> >
> >
> >   DFBCHECK (dfb->CreateSurface( dfb, &dsc, &primary ));
> >   DFBCHECK (primary->GetSize (primary, &screen_width,
> > &screen_height));
> >   DFBCHECK (primary->FillRectangle (primary, 0, 0, screen_width,
> > screen_height));
> >   DFBCHECK (primary->SetColor (primary, 0x80, 0x80, 0xff, 0xff));
> >   DFBCHECK (primary->DrawLine (primary,
> >                                   0, screen_height / 2,
> >                    screen_width - 1, screen_height / 2));
> >
> >   DFBCHECK (primary->Flip (primary, NULL, 0));
> >
> >   sleep (5);
> >
> >
> >   primary->Release( primary );
> >   dfb->Release( dfb );
> >
> >   return 23;
> > }
>
> Of course, you cannot set the primary surface format to A8.
> The primary surface is nevertheless the surface of the primary layer
> (i.e. of the screen). Never screen a screen supporting A8.
>
> >
> > In this code  I have to enable Palette Support also, so how can i do
> > this.
> > Can anyone help me out why i am getting this error.
> >
> LUT8 should be supported by the primary layer.
>
> --
> Claudio Ciccani
> [EMAIL PROTECTED]
> [EMAIL PROTECTED]
> http://directfb.org
>
>


-- 
Regards,
Animesh Bhadra,
+91-9880868571
_______________________________________________
directfb-users mailing list
directfb-users@directfb.org
http://mail.directfb.org/cgi-bin/mailman/listinfo/directfb-users

Reply via email to