I'm writing game for PocketBook. Now my prototype simply use GSensor to move a square.
In an infinite loop, I'm filling squares with WHITE color (for erase square filled in prevous step) and BLACK (drawing current square position):
/* some calculations here*/
FillArea(old_x, old_y, 20, 20, WHITE);
FillArea(cur_x, cur_y, 20, 20, BLACK);
/* DynamicUpdateBW for minimal area covering whole updated area */
DynamicUpdateBW(mini(cur_x, old_x), mini(cur_y, old_y), maxi(cur_x + 20, old_x + 20) - mini(cur_x, old_x), maxi(cur_y + 20, old_y + 20) - mini(cur_y, old_y));
Everything is ok with drawing square in new position, but erasing old-position square doesn't work, even if I invert colors (white&black instead of B&W).
I noticed that:
* everything is ok, if square moves very,very slow.
* everything is ok, when I'm using PartialUpdateBW(), but this function is *very* slow.
I tried to use threads (for calculations and drawing or for calculations and erasing, using old-positions queue), but with no success...:/
Could anyone help?