Thread: 903 Screen updating issue
View Single Post
Old 10-21-2011, 02:05 PM   #1
Junior Member
mtt began at the beginning.
Posts: 4
Karma: 10
Join Date: Oct 2011
Device: PocketBook Pro 903
Screen updating issue

Hi guys,

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?
mtt is offline   Reply With Quote