Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Update Bitmaps in subroutine

Update Bitmaps in subroutine

Scheduled Pinned Locked Moved C / C++ / MFC
helpgame-devquestionannouncementlearning
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    Dimenser
    wrote on last edited by
    #1

    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

    R 1 Reply Last reply
    0
    • D 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

      R Offline
      R Offline
      Ryan Binns
      wrote on last edited by
      #2

      Call Invalidate() and then UpdateWindow.

      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"

      D 1 Reply Last reply
      0
      • R Ryan Binns

        Call Invalidate() and then UpdateWindow.

        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"

        D Offline
        D Offline
        Dimenser
        wrote on last edited by
        #3

        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

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups