Dear all,

My DirectFB versio is 1.0.0.
I try to create an window and get its surface.
When I draw a filled rectangle on the window surface, it become transparent.
Here is my code,
=============================================
    dfb->GetDisplayLayer(dfb, DLID_PRIMARY, &layer);
    layer->SetCooperativeLevel(layer, DLSCL_ADMINISTRATIVE);

    layer->EnableCursor(layer, 0);

    layer->SetBackgroundColor(layer, 0, 0, 0, 0);
    layer->SetBackgroundMode(layer, DLBM_COLOR);

    DFBWindowDescription wdsc;

    wdsc.flags = DWDESC_CAPS |
             DWDESC_POSX | DWDESC_POSY |
             DWDESC_WIDTH | DWDESC_HEIGHT |
             DWDESC_PIXELFORMAT;
             DWDESC_SURFACE_CAPS;

    wdsc.caps = DWCAPS_ALPHACHANNEL;
    wdsc.posx = 0;
    wdsc.posy = 0;
    wdsc.width = 720;
    wdsc.height = 480;
    wdsc.pixelformat = DSPF_ARGB;
    wdsc.surface_caps = DSCAPS_VIDEOONLY;

    layer->CreateWindow(layer, &wdsc, &window);

    window->SetOpacity(window, 255);
    window->GetSurface(window, &primary);

    primary->Clear(primary, 0, 0, 255, 0);

    primary->SetColor(primary, 0, 255, 0, 0);
    primary->FillRectangle(primary, 0, 0, 200, 200);
    primary->Flip(primary, NULL, 0);
=============================================
Another problem is before I run the application, I use fbset to see the
framebuffer color depth is ARGB.
After I run the application, the framebuffer color depth became RGB565.
Why?

Thanks.
BRs

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

Reply via email to