hello… i have written the code below for the display func…
void display()
{
char x[6][14]={ {'1','1','3','4','-','1','3','1','1','1','1','1','1','1'},
{'1','1','1','4','-','1','3','1','1','1','1','1','1','1'},
{'1','1','3','4','-','1','3','1','1','1','1','1','1','1'},
{'1','1','3','1','-','4','3','1','2','1','1','1','1','1'},
{'1','1','3','3','-','4','3','1','1','1','1','1','1','1'},
{'1','1','3','1','-','1','3','1','2','1','1','1','1','1'}
};
int i,j;
GLsizei temp1=0,temp2=0,cnt1,cnt2;
glClearColor(1,1,1,0);
glClear(GL_COLOR_BUFFER_BIT);
cnt1=(2*xwmax/AR_GRAM);
cnt2=(2*ywmax/AR_STIL);
//προσπελαση του πινακα
for (i=0;i<AR_GRAM;i++) {
for (j=0;j<AR_STIL;j++) {
if (x[i][j]='*') {
glColor3f(1,0,0);
glBegin(GL_POLYGON);
glVertex2i(temp1,temp2+cnt2);
glVertex2i(temp1,temp2);
glVertex2i(temp1,temp1+cnt1);
glVertex2i(temp1+cnt1,temp2+cnt2);
glEnd();
}
else if (x[i][j]='2'){
glColor3f(0,1,0);
glBegin(GL_POLYGON);
glVertex2i(temp1,temp2+cnt2);
glVertex2i(temp1,temp2);
glVertex2i(temp1,temp1+cnt1);
glVertex2i(temp1+cnt1,temp2+cnt2);
glEnd();
}
temp1=temp1+cnt1;
temp2=temp2+cnt2;
}
}
}
the problem is that the result is the same, independent of the array… i cannot find the problem though…
any ideas…?
thanks…