Hi, everybody

    I have found a strange problem with directfb's DrawString() function. In 
order to describe this problem clearly, I copied my test source code below.
    When I do the test with those code --- "surface1->SetColor(surface1, 0xff, 
0xff, 0xff, 0xff);   // blinking !", then I got the lcd screen blinking all the 
time; but when I do the test with those code ---"surface1->SetColor(surface1, 
0xff, 0x00, 0x00, 0xff); // ok, no blinking.", then no blinking at all.
    It seems that the color setting affect the blinking thing, and I also 
changed the color to RED, BLUE, GREEN, YELLOW... The conclusion is if NOT 
WHITE(0xff,0xff,0xff), then OK, no blinking, just WHITE makes blinking!
    Does anyone find the same problem?

BTW: My test environment is DirectFB-1.1.1, freetype-2.3.5, and if need more 
information please let me know, thanks advance!

test source code:

#include <directfb.h>
#include <stdio.h>

static IDirectFB *dfb = NULL;
static IDirectFBDisplayLayer *layer = NULL;
static IDirectFBWindow *window1 = NULL;
static IDirectFBSurface *surface1 = NULL;
static IDirectFBFont *font = NULL;

int main(int argc, char **argv)
{
    DFBDisplayLayerConfig   layer_config;
    DFBWindowDescription    window_desc;
    DFBSurfaceDescription   dsc;
    int err;
    DFBFontDescription desc;
    
    DirectFBInit(&argc, &argv);
    DirectFBCreate(&dfb);

    dfb->GetDisplayLayer(dfb, DLID_PRIMARY, &layer);
    layer->SetCooperativeLevel( layer, DLSCL_ADMINISTRATIVE );
    //layer->SetCooperativeLevel( layer, DLSCL_EXCLUSIVE );
    
    layer_config.flags = DLCONF_WIDTH | DLCONF_HEIGHT;
    layer_config.width = 800;
    layer_config.height = 600;
    err = layer->SetConfiguration(layer, &layer_config);
    printf("err=%d\n", err);
    
    window_desc.flags = DWDESC_WIDTH | DWDESC_HEIGHT | DWDESC_POSX | 
DWDESC_POSY;
    window_desc.posx = 0;
    window_desc.posy = 0;
    window_desc.width = layer_config.width;
    window_desc.height = layer_config.height;
    layer->CreateWindow(layer, &window_desc, &window1);
    window1->SetOpacity(window1, 0xFF);
    window1->GetSurface(window1, &surface1);
    
    surface1->SetColor(surface1, 0xff, 0xff, 0xff, 0xff);   // blinking !
    //surface1->SetColor(surface1, 0xff, 0x00, 0x00, 0xff); // ok, no blinking.
    desc.flags = DFDESC_HEIGHT;
    desc.height = 14;
    dfb->CreateFont(dfb, "/mnt/jffs2/decker.ttf", &desc, &font);  // maybe you 
need to change the font directory to yourself!
    surface1->SetFont(surface1, font);
    surface1->SetDrawingFlags(surface1, DSDRAW_NOFX);
    surface1->DrawString(surface1, "NIBP", -1, 600, 100, DSTF_TOPLEFT);
    surface1->DrawString(surface1, "mmHg", -1, 700, 100, DSTF_TOPLEFT);
    surface1->Flip(surface1, NULL, 0);
    printf("after DrawString at window1...\n");
    while(!getchar());
    
    font->Release(font);
    layer->Release(layer);
    window1->Release(window1);
    surface1->Release(surface1);
    dfb->Release(dfb);
    return 0;
}
_______________________________________________
directfb-users mailing list
[email protected]
http://mail.directfb.org/cgi-bin/mailman/listinfo/directfb-users

Reply via email to