
|
I have checked the arithmetic and it works just fine if i don't multithread it.
This works just fine:
#include<graphics.h>
void drawrect(int l,int t,int r,int d,int col){
if(col==0)setcolor(RED);
else setcolor(BLUE);
rectangle(l,t,r,d);
}
void drawpiece(int l,int t,int r,int d,int col){
for(int i=1;i<5;i++)
drawrect(i*16+l,t,i*16+r,d,col);
}
int main()
{
initwindow(600,600,"TEST");
int px1=17,py1=17;
for(int i=0;i<10;i++,py1+=16,delay(100))
drawpiece(px1,py1,px1+14,py1+14,0);
int px2=161,py2=17;
for(int i=0;i<10;i++,py2+=16,delay(100))
drawpiece(px2,py2,px2+16,py2+14,1);
getch();
return EXIT_SUCCESS;
}
I'm really starting to think that this might be a problem from graphics.h
|
|
|
|