Jump to content

Getting refresh to work properly


Guest clivewilliams

Recommended Posts

Guest clivewilliams

New SPV developer alert! Just starting to get to grips with the SDK - have hit a slight problem that people might be able to give me a few pointers with. I'm writing (my first SPV prog!) a little reversi program - so far so good, can paint the board, can capture key sequences to move a cursor around, etc. (writing the game itself should be quite easy compared to figuring out that lot!).

My problem is when I move my cursor from one board cell to another (highlighted in another colour), the screen doesn't refresh correctly. If I go to the home screen then return, forcing a repaint, the screen displays correctly, and indeed it displays correctly when it first starts up. But it won't automatically repaint itself, bless it.

My code is based on an amalgam of the SDK's KeyTest app for capturing key strokes and DrawingText (essentially the screen is drawn by PolyLine, Polygon and Ellipse calls). Probably quite a buggy amalgam, as I'm learning about the event model as I go. I've tried various things:

- Squirting WM_PAINT events everywhere

- ShowWindow/UpdateWindow... etc

... but nothing. Any pointers/clues from anyone?

Cheers,

Clive

Link to comment
Share on other sites

Guest Arisme

If you're using GDI (which seems to be the case :wink:) you can force a redraw with UpdateWindow or InvalidateRect - be sure to have your drawing code processed in the WM_PAINT management (in a "smart" way to avoid intensive flickering)

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.