Given my limited understanding what happens below should be that whenever they left click their mouse the x and y position should be updated. However, when run x and y always default back to 0. However, when you debug it and put a breakpoint on the sprintf for when the left mouse button has been clicked it works as expected. Any theories? Am I missing something obvious? Thanks in advance.
dbShowMouse();
char string[70];
int temp=0;
int xPosition,yPosition;
while ( LoopGDK ( ) )
{
if(dbMouseClick()==1)
{
temp=1;
xPosition=dbMouseMoveX();
yPosition=dbMouseMoveY();
sprintf(string,"X: %d Y: %d",xPosition,yPosition);
}
if(temp==0)
{
sprintf(string,"Mouse click: %d",dbMouseClick());
}
dbCenterText(237,247,string);
if ( dbEscapeKey ( ) )
break;
dbSync ();
dbCLS(dbRGB(0,0,0));
}
Charles Thompson