Dec 13, 2011 at 7:02pm UTC
I want to draw a map of white squares using glut so I made an array
bool BackArray[10][10] ={
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 0, 1, 0, 0, 0, 0, 0, 0, 1,
1, 0, 1, 0, 1, 0, 0, 0, 0, 1,
1, 0, 1, 0, 1, 0, 0, 0, 0, 1,
1, 0, 1, 0, 1, 0, 0, 0, 0, 1,
1, 0, 1, 0, 1, 0, 0, 0, 0, 1,
1, 0, 0, 0, 1, 0, 0, 0, 0, 1,
1, 0, 1, 1, 1, 1, 1, 1, 0, 1,
1, 0, 0, 0, 0, 0, 0, 0, 0, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1};
and used a FOR loop to display it
void Background(void)
{
for (int ix = 0; ix == 9; ix ++)
{
for (int iy = 0; iy == 9; iy ++)
{
printf ("i");
if (BackArray[ix][iy] == true)
{
glColor3f(1, 1, 1);
glRectf(ix, iy, ix + 10, iy + 10);
}
}
}
}
but nothing except the avatar I made gets displayed in the window. I put in the
printf ("i");
statement to test whether the loop was working but nothing was displayed in the command window. Please help.
I'm only 14 so I've probably made some stupid mistake.