Skip to main content
GameDev.net gamedev.net
🔒 Locked

InvalidateRect()

Started by KingMXF Dec 20, 2002 at 12:42 AM 1 replies 400+ views
Original Post
KingMXF
KingMXF
I have invalidateRect in my winmain loop... and it allows me to change the position of my bitmap.... Lets say... i have a bitmap blitted on the screen... and i hit the spacebar... it moves that same bitmap 10 pixels to the right... however NOW there are two bitmaps on the screen... i wish to be able to move the bitmap to the right 10 pixels and delete the original one... how do i do that???
LoneStranger
LoneStranger
You need to InvalidateRect with the original coordinates of the bitmap, as well as the new coordinates.

Invalidate should only be called when the onscreen data changes, ie, something moves or the score changes. It shouldn''t be called every cycle through the loop, so I don''t know why you have it in your winmain.

£§
£§
KingMXF
KingMXF
okay, well to be honest that is where people told me to put it, and its the only place where it works... i''ve tried other areas... either way my question wasn''t answered.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.