Update Bitmaps in subroutine
-
Hello, I've written a card game with all the bells and whistles, but I still have some learning to do. The problem is when I programmed it so that you see your first card, get a sound effect, a pause by the computer, then your next card, etc. Instead, you get five straight sound effects, a ton of pause, then all five cards pop up at once. m_box01.SetBitmap(face[y]); soundfx(3); Sleep(250); somewhere inbetween calling my soundfx subroutine and the Sleep function, I need to call something that will refresh the screen and show the card I displayed with SetBitmap. Something like an UpdateData or DoDataExchange :omg:kind of thing. I've made guesses until I'm blue in the face. Can anyone help? thanks! Dimenser
-
Hello, I've written a card game with all the bells and whistles, but I still have some learning to do. The problem is when I programmed it so that you see your first card, get a sound effect, a pause by the computer, then your next card, etc. Instead, you get five straight sound effects, a ton of pause, then all five cards pop up at once. m_box01.SetBitmap(face[y]); soundfx(3); Sleep(250); somewhere inbetween calling my soundfx subroutine and the Sleep function, I need to call something that will refresh the screen and show the card I displayed with SetBitmap. Something like an UpdateData or DoDataExchange :omg:kind of thing. I've made guesses until I'm blue in the face. Can anyone help? thanks! Dimenser
Call
Invalidate()
and thenUpdateWindow
.Ryan
"Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
-
Call
Invalidate()
and thenUpdateWindow
.Ryan
"Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
Thanks. UpdateWindow(); all by itself does what I wanted it to do... most of the time. I can't figure out any rhyme or reason but sometimes it doesn't work at all later in the program, even if I use Invalidate(); Because the program is so graphics intensive (transparent bitmaps on top of full screen bitmaps), Invalidate causes the screen to do a slow flash that is really unimpressive. I will fiddle with it more and see if Invalidate can be used to redraw one bitmap only or the such. thanks again, you got me on the right track. :cool: Dimenser