*EDIT* Ok i figured it out, sq.h was getting set to 0 after the second loop went threw one time, I do not understand Y so if anyone wants to fill me in on that then go ahead. i dont see anywhere in the code where i set sq.h to 0.
I swear ive done this before...
Code:
void GSystem::DrawBoard()
{
SDL_Rect sq;
sq.x= 0;
sq.y= 0;
sq.w= 80;
sq.h= 60;
Uint32 col= 0xFFFFFFFF;
for(int j= 0; j < 641; j+= sq.w)
{
sq.x= j;
for(int i= 0; i< 481; i+= sq.h)
{
sq.y= i;
SDL_FillRect(mVideoSurface, &sq, col);
if(i==480)
break;
}
if(j==640)
break;
}
}
It enters the first loop, then enters the socond. the first way i had it i would hit 480 and stop incrementing, this way though it makes it through, hits the IF and exits the second loop, and then continues the first loop back into the socond loop, thats when i stops incrementing. it just stays at 0 the second time threw. Any suggestions or questions?