Hey

ive got a problem working with 13h mode ::sigh:: i now its old but still a good way to learn very basic graphic things anyway.

Im working on a screensaver...(its supposed to be a clock)

anyway ill post the code and explain my prob

Code:

int wijzers()
{
struct time t;
float pi=6.2831854,hoek_sec,hoek_min,begin=-1.57079635;
int x,y,r,sec,min,i=1;
while(!kbhit()){
gettime(&t);
sec=t.ti_sec;
min=t.ti_min;
/*SECONDs*/
hoek_sec=0.10471975666666666666666666666667*sec;
for(r=0;r<98;r++){
x=cos(hoek_sec+begin)*r*1.2+160;
y=sin(hoek_sec+begin)*r+100;
setpix(14,x,y);
}
for(r=0;r<98;r++){
x=cos(hoek_sec+begin)*r*1.2+160;
y=sin(hoek_sec+begin)*r+100;
setpix(0,x,y);
}
/*MINUTEs*/
hoek_min=0.10471975666666666666666666666667*min;
for(r=0;r<98;r++){
x=cos(hoek_min+begin)*r*1.2+160;
y=sin(hoek_min+begin)*r+100;
setpix(14,x,y);
}
for(r=0;r<98;r++){
x=cos(hoek_min+begin)*r*1.2+160;
y=sin(hoek_min+begin)*r+100;
setpix(0,x,y);
}
}
return 0;
}

so this function-and some others- should draw something like a watch. But if you look close at my code ull see that i keep updating the screen with setpix.

Now i want to update the second thing only on a whole second and the minute thing after one minute.Because now the clock keeps updating and updating, thus u get flickering screens,lines,pixels etc...

so actually i need a thing to determine wether a number is a whole number or not.

---thought i saw such a thread be4 :whole number:but couldnt find it with search thing on board--

PS: if its not clear what i just wrote say so because ive got the feeling that my english is kinda sh$$ty

::edit::

sry bout the sucky code writing (indentations) guess i still cant work with ctrl-C and ctrl-V