For Loop Help
*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...
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?
Uint32 col= 0xFFFFFFFF;
for(int j= 0; j < 641; j+= sq.w)
for(int i= 0; i< 481; i+= sq.h)
SDL_FillRect(mVideoSurface, &sq, col);
Remove the if statements and change the numbers in the for loops back to 640 and 480.
"through" is the word you were looking for back there, not "threw".