JonasE
04-05-2005, 07:09 AM
I just switched the rendering mode from BitBlt to DirectDraw for my tile engine, but now it flickers quite badly when the map is scrolled. Can anybody help me please? I'm really new at all this DirectX programming. Also, I tried using a backbuffer... it didn't work... Still flickers... This is the code to create graphics to a picturebox ==>
Private Sub DrawSurface()
Dim Dest As Rectangle
Try
BackSurface.ColorFill(Color.Blue)
BackSurface.DrawFast(0, 0, MapSurface, Map.Rect, DrawFastFlags.Wait)
Catch ex As SurfaceLostException
InitializeSurface()
End Try
Dest = New Rectangle(PointToScreen(Me.picMain.Location), Me.picMain.Size)
FrontSurface.Draw(Dest, BackSurface, DrawFlags.DoNotWait)
End Sub
Private Sub DrawSurface()
Dim Dest As Rectangle
Try
BackSurface.ColorFill(Color.Blue)
BackSurface.DrawFast(0, 0, MapSurface, Map.Rect, DrawFastFlags.Wait)
Catch ex As SurfaceLostException
InitializeSurface()
End Try
Dest = New Rectangle(PointToScreen(Me.picMain.Location), Me.picMain.Size)
FrontSurface.Draw(Dest, BackSurface, DrawFlags.DoNotWait)
End Sub