Results 1 to 5 of 5

Thread: [Resolved] Too slow (BitBlt)

Threaded View

  1. #1

    Thread Starter
    Fanatic Member McCain's Avatar
    Join Date
    Jan 2002
    Location
    Sweden/Denmark
    Posts
    802

    [Resolved] Too slow (BitBlt)

    Is there any way I can speed this up?

    VB Code:
    1. Private Sub GameLoop()
    2.     Do Until boolPlay = False
    3.         DoEvents
    4.         intX1 = intX1 + 5 * intLevel
    5.         intY1 = intY1 + 5 * intLevel
    6.         'put the background on the form
    7.         RetVal = BitBlt(Me.hDC, 0, 0, picBack.ScaleWidth, picBack.ScaleHeight, picBack.hDC, 0, 0, SRCCOPY)
    8.         'picBuffer.Cls
    9.        
    10.         'put the sprite on the form
    11.         RetVal = BitBlt(Me.hDC, intX1, intY1, 67, 79, picSprite.hDC, 67, 0, SRCAND)
    12.         RetVal = BitBlt(Me.hDC, intX1, intY1, 67, 79, picSprite.hDC, 0, 0, SRCPAINT)
    13.    
    14.         'copy the buffer to the form
    15.         'RetVal = BitBlt(Me.hDC, 0, 0, picBuffer.ScaleWidth, picBuffer.ScaleHeight, picBuffer.hDC, 0, 0, SRCCOPY)
    16.         frmMeteor.Refresh
    17.     Loop
    18. End Sub

    I used to use a buffer but that only slowed it down even more...
    Last edited by McCain; Feb 17th, 2003 at 07:12 PM.
    Never argue with fools, they will only drag you down to their level, and beat you with experience.

    Q: How do you tell an experienced hacker from a novice?
    A: The latter thinks there's 1000 bytes in a kilobyte, while the former is sure there's 1024 meters in a kilometer

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width