Results 1 to 2 of 2

Thread: Why is this DX function so SLOW?

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Dec 2001
    Location
    Great White North, ey?
    Posts
    202

    Unhappy Why is this DX function so SLOW?

    Hi, here is what I use to make my animation in my DX game. But it SLOWS down my game a LOT. Does anybody know whats wrong.

    THanks.

    Private Sub tmrEXP_Timer()

    Dim t As Long

    t = Timer

    Do
    DoEvents

    Call DD_CreateSurfFromFile(App.Path & "\exp1.bmp", Expanim, BackBufDesc, 36, 42)

    Loop Until Timer > t + 0.1

    Call DD_CreateSurfFromFile(App.Path & "\exp2.bmp", Expanim, BackBufDesc, 36, 42)

    Do
    DoEvents
    Loop Until Timer > t + 0.2

    Call DD_CreateSurfFromFile(App.Path & "\exp3.bmp", Expanim, BackBufDesc, 36, 42)

    Do
    DoEvents
    Loop Until Timer > t + 0.3

    Call DD_CreateSurfFromFile(App.Path & "\exp3.bmp", Expanim, BackBufDesc, 36, 42)

    Do
    DoEvents
    Loop Until Timer > t + 0.4
    End Sub

  2. #2
    Good Ol' Platypus Sastraxi's Avatar
    Join Date
    Jan 2000
    Location
    Ontario, Canada
    Posts
    5,134
    How about loading all the surfaces at the start and then blitting the individual pieces down.
    File access is kind of slow (for real-time graphics that is!)
    All contents of the above post that aren't somebody elses are mine, not the property of some media corporation.
    (Just a heads-up)

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