Hello to anyone,
I've successfully fired up fluxbox, gnome, enlightenment etc etc
using XDirectFB- 1.0_rc5-r2 (Gentoo) compiled with the 2 days ago
directfb-cvs
on a SiS315 (SiS 661 MX) series vga adapter
Everything works well but it's like the cursor soils (actually they
seems scratches)
the desktop and the other windows when it hovers.
Is this normal? Is a driver problem or a mine one?
What can I do?

Another little thing: I'm learning directfb programming and
I did a little modification to the simple.c tutorial,
now it draw a bouncing square, but the square flickers all the time
I've tried this:
    dsc.caps = DSCAPS_PRIMARY | DSCAPS_DOUBLE;
and
    dsc.caps = DSCAPS_PRIMARY | DSCAPS_TRIPLE;
for buffering but it doesn't work.
What can I do for stopping the flicker?
Follows the code of my simple.c
thank you very much in advance,
cheers
Fabio



///////////----CODE  STARTS  HERE-----///////////
#include<unistd.h>
#include<stdio.h>

#include<directfb.h>

static IDirectFB *dfb = NULL;
static IDirectFBSurface *primary=NULL;
static int noBounces=0;

static int screen_width=0, screen_height=0;

int main(int argc, char* argv[]){
    int isGoingLeft=0, isGoingUp=0, width=80, height=80, x=100, y=100;
    DFBSurfaceDescription dsc;

    DirectFBInit(&argc, &argv);
    DirectFBCreate(&dfb);

    dfb->SetCooperativeLevel(dfb, DFSCL_FULLSCREEN);

    dsc.flags = DSDESC_CAPS;
    dsc.caps = DSCAPS_PRIMARY | DSCAPS_TRIPLE;

    dfb->CreateSurface(dfb, &dsc, &primary);
    primary->GetSize(primary, &screen_width, &screen_height);
   

    struct timespec timeToWait;
    timeToWait.tv_sec=0;
    timeToWait.tv_nsec=100000;
   

    while(noBounces<10){
        if(isGoingLeft) x -= 3;
        else x += 3;
        if(isGoingUp) y -= 3;
        else y += 3;
       
        if(x<=1 || x+width>=screen_width-1){
            isGoingLeft = !isGoingLeft;
            noBounces++;
        }
        if(y<=1 || y+height>=screen_height-1){
            isGoingUp = !isGoingUp;
            noBounces++;
        }
       
        //primary->SetColor(primary, 0xff, 0x33, 0xff, 0x33);
        primary->SetColor(primary, 0x80, 0x80, 0xff, 0xff);
        primary->FillRectangle(primary,0,0,screen_width, screen_height);
       
        primary->SetColor(primary, 0xff, 0x33, 0x22, 0x11);
       
        primary->FillRectangle(primary, x, y, width, height);

        primary->Flip(primary, NULL, DSFLIP_WAITFORSYNC);

        //nanosleep(&timeToWait,NULL);
    }
}

//////-----CODE  ENDS  HERE-----////////
 

 

 --

 Email.it, the professional e-mail, gratis per te: http://www.email.it/f

 

 Sponsor:

 Conto Arancio: 3.50% per tutto il 2006! Scopri come

 Clicca qui: http://adv.email.it/cgi-bin/foclick.cgi?mid=5043&d=20-7

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

Reply via email to