I have a bitmap being animated over a background (bmp). But it goes really slow. I included the code, can someone please check for anything that can be causing it to go sLow (I think its in the bLitter sub)

VB Code:
  1. Option Explicit
  2.     Private Type AnimationFrame
  3.         Top As Long
  4.         Left As Long
  5.     End Type
  6.  
  7.     Dim DX As New DirectX7  'dEclare DX7 object, dont forget the 'new'
  8.     Dim DD As DirectDraw7
  9.  
  10.     Dim PrimarySurface As DirectDrawSurface7 'The main surface user sEEs
  11.     Dim PrimeDesc As DDSURFACEDESC2
  12.  
  13.     Dim OSPbackGround As DirectDrawSurface7   'OffscreenPlain background
  14.     Dim BackDesc As DDSURFACEDESC2
  15.  
  16.     Dim OSPsprite As DirectDrawSurface7       'OffscreenpLain sprite
  17.     Dim SpriteDesc As DDSURFACEDESC2
  18.  
  19.     Dim Clippa As DirectDrawClipper
  20.  
  21.     Dim rPrime As RECT
  22.     Dim rBG As RECT
  23.     Dim rSprite As RECT
  24.  
  25.     Dim Frame(3) As AnimationFrame
  26.     Dim curFrame As Long
  27.     Dim GoGoGo As Boolean
  28.     Dim ReturnValue As Long
  29.     Dim Temp As Long
  30.  
  31.     Dim bBLT As Boolean     'tells whether to animaTe or not
  32.     Dim bINT As Boolean     'True if init is succesfuLL
  33.  
  34. Private Sub Form_Load()
  35.     Me.Height = 5000     'Set form height and width
  36.     Me.Width = 5000      'tHats the kid -_-
  37.    
  38.     Init_DX_Stuff        'call this sub to set all variabLes/obj
  39.    
  40.     Do While bBLT = True 'Loop while bBLT is true,
  41.         DoEvents
  42.         BitBlitter       'This is the main loop, that will animate
  43.         DoEvents
  44.     Loop
  45. End Sub
  46.  
  47. Private Sub Init_DX_Stuff()
  48.     'DX objects-
  49.         Set DD = DX.DirectDrawCreate("")
  50.         Call DD.SetCooperativeLevel(Me.hWnd, DDSCL_NORMAL)
  51.    
  52.     'Primary----
  53.         PrimeDesc.lFlags = DDSD_CAPS
  54.         PrimeDesc.ddsCaps.lCaps = DDSCAPS_PRIMARYSURFACE
  55.         Set PrimarySurface = DD.CreateSurface(PrimeDesc)
  56.        
  57.     'Background--
  58.         BackDesc.lFlags = DDSD_CAPS
  59.         BackDesc.ddsCaps.lCaps = DDSCAPS_OFFSCREENPLAIN
  60.         Set OSPbackGround = DD.CreateSurfaceFromFile(App.Path & "\bg.bmp", BackDesc)
  61.        
  62.     'Sprite------
  63.         SpriteDesc.lFlags = DDSD_CAPS
  64.         SpriteDesc.ddsCaps.lCaps = DDSCAPS_OFFSCREENPLAIN
  65.         Set OSPsprite = DD.CreateSurfaceFromFile(App.Path & "\sprite.bmp", SpriteDesc)
  66.        
  67.     'kLipper-----
  68.         Set Clippa = DD.CreateClipper(0)
  69.         Clippa.SetHWnd Me.hWnd
  70.         PrimarySurface.SetClipper Clippa
  71.        
  72.     'CreateTable-
  73.         LookUpTable
  74.        
  75.     'variabLes---
  76.         bINT = True
  77.         bBLT = True
  78.         GoGoGo = True
  79.         Form1.Show
  80. End Sub
  81.  
  82. Private Sub BitBlitter()
  83.     'Check------
  84.         If bINT = False Then Exit Sub
  85.  
  86.     'RectangLes-
  87.         Call DX.GetWindowRect(Me.hWnd, rPrime)
  88.        
  89.         rSprite.Top = Frame(curFrame).Top
  90.         rSprite.Left = Frame(curFrame).Left
  91.         rSprite.Right = rSprite.Left + 36
  92.         rSprite.Bottom = rSprite.Top + 62
  93.        
  94.         rBG.Bottom = BackDesc.lHeight
  95.         rBG.Right = BackDesc.lWidth
  96.         'rBG.Left = BackDesc.lWidth
  97.         'rBG.Top = BackDesc.lHeight
  98.        
  99.     'AnimatioN
  100.         If DX.TickCount >= Temp + 1000 / 30 Then 'Check to see if Xmilliseconds passed or not
  101.             Temp = DX.TickCount
  102.             If GoGoGo = True Then
  103.                 curFrame = curFrame + 1
  104.                 If curFrame > UBound(Frame) Then
  105.                     curFrame = UBound(Frame)
  106.                     GoGoGo = False
  107.                 End If
  108.             Else
  109.                 curFrame = curFrame - 1
  110.                 If curFrame < LBound(Frame) Then
  111.                     curFrame = LBound(Frame)
  112.                     GoGoGo = True
  113.                 End If
  114.             End If
  115.         End If
  116.        
  117.     'BlitterIt--
  118.         ReturnValue = OSPbackGround.BltFast(150, 150, OSPsprite, rSprite, DDBLTFAST_WAIT)
  119.         ReturnValue = PrimarySurface.Blt(rPrime, OSPbackGround, rBG, DDBLT_WAIT)
  120. End Sub
  121.  
  122. Private Sub LookUpTable()
  123.     Frame(0).Left = 0
  124.     Frame(1).Left = 35
  125.     Frame(2).Left = 70
  126.     Frame(3).Left = 105
  127. End Sub
  128.  
  129. Private Sub Form_Unload(Cancel As Integer)
  130.     bBLT = False
  131.     Unload Me
  132. End Sub