The safest course is to re-paint the screen, even at 30fps/when nothing is changing. Secondly, will modifying the code actually make a difference to the load on the PC? The theme seems to be: if the Sudoku board hasn't changed, why bother? So, put the screen-update 'behind' the same condition which examines input. If the user instructs that a digit is to be inserted in a chosen-square (for example), and thus the appearance of the board is to be changed, then after updating the graphic(s)/sprite positions, the logic must call for a screen-update! This will be slightly more complicated if you have also changed the mouse-pointer and must update the mouse's appearance as it is moved!
Before you do this, monitor the PC's performance graphs, then perform a Before-After analysis. It'll be interesting to read the results...
1条答案
按热度按时间dfddblmv1#
The safest course is to re-paint the screen, even at 30fps/when nothing is changing.
Secondly, will modifying the code actually make a difference to the load on the PC?
The theme seems to be: if the Sudoku board hasn't changed, why bother? So, put the screen-update 'behind' the same condition which examines input. If the user instructs that a digit is to be inserted in a chosen-square (for example), and thus the appearance of the board is to be changed, then after updating the graphic(s)/sprite positions, the logic must call for a screen-update!
This will be slightly more complicated if you have also changed the mouse-pointer and must update the mouse's appearance as it is moved!
Before you do this, monitor the PC's performance graphs, then perform a Before-After analysis. It'll be interesting to read the results...
Regards =dn