Thanks granarout for your suggestion.
Actualy, I am using this code
#include "DarkGDK.h"
void showFPS(void) {
char szFPS[256]="";
strcpy(szFPS, "fps = ");
strcat(szFPS, dbStr(dbScreenFPS()));
dbText(dbScreenWidth()-20-dbTextWidth(szFPS), dbScreenHeight()-40, szFPS);
}
void DarkGDK ( void ) {
int numberTarget=2;
int frameRate=60;
int setLeftFrequency=5;
int setRightFrequency=3;
int leftFrequency=frameRate/(2*setLeftFrequency);
int rightFrequency=frameRate/(2*setRightFrequency);
int posSquare1[2]={140, 250};
int posSquare2[2]={740, 250};
int posFreccia[4]={240,250-134,940,250-134}; // (x_1,y_1,x_2,y_2)
dbSetWindowPosition(0,0);
dbSetDisplayMode(1280,800,32);
dbSetWindowOff();
//dbSetWindowSize(1280,800);
dbSyncOn();
dbSyncRate(60);
//dbInk(dbRGB(255,0,0),(dbRGB(0,0,0)));
dbLoadImage("background.jpg",1); //1280x800
dbSprite(1,0,0,1);
//dbPasteImage(1,0,0);
dbLoadImage("black.jpg",2); // 300x300
dbLoadImage("white.jpg",3); //300x300
//dbLoadImage("freccia1.png",4); //100x134
//dbSprite(4,posFreccia[0],posFreccia[1],4);
//dbPasteImage(4,posFreccia[0],posFreccia[1]);
while(LoopGDK()) {
if(dbEscapeKey()) {
return;
}
for(int i=0; i<300; i++) {
if(i%leftFrequency==0) {
dbPasteImage(2,posSquare1[0],posSquare1[1]);
}
else {
dbPasteImage(3,posSquare1[0],posSquare1[1]);
}
if(i%rightFrequency==0) {
dbPasteImage(2,posSquare2[0],posSquare2[1]);
}
else {
dbPasteImage(3,posSquare2[0],posSquare2[1]);
}
showFPS();
dbSync ( );
}
}
return;
}
but I have some problems.
When I use dbSprite I obtain a strange issue.
[img]null[/img]

When I use dbPasteImage I obtain another issue. I think two print of FPS at same time.
I need only a black background color.
Any advice?
Thanks for you answers.