Results 1 to 3 of 3

Thread: directdraw blitting problem~!

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Dec 2002
    Posts
    17

    Unhappy directdraw blitting problem~!

    I set my display mode in direct draw to:
    dd.SetDisplayMode 1024, 768, 32, 0, DDSDM_DEFAULT

    But when I blit, there are weird pictures or "sprite trails" showing up in parts of the screen, but this does not happen if I set it to 16-bit, then again I dont want to use 16 bit, so anyone know how to fix this problem?
    thanx........

  2. #2
    Addicted Member
    Join Date
    Aug 2002
    Location
    Baltimore, MD
    Posts
    230
    Without seeing exactly what you're doing there's not much we can do to help you.

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Dec 2002
    Posts
    17
    ok........................

    this is the code for the game for now....when I display my image, I have weird pictures or "sprite trails" while in 32 bit for display mode. But Works fine in 16 bit. Problem?
    __________________________________________________
    Public Sub Init()
    Set dd = dx.DirectDrawCreate("")
    dd.SetCooperativeLevel Me.hWnd, DDSCL_FULLSCREEN Or DDSCL_EXCLUSIVE Or DDSCL_ALLOWREBOOT
    dd.SetDisplayMode 1024, 768, 32, 0, DDSDM_DEFAULT

    Dim dsPrimary As DDSURFACEDESC2
    Dim caps As DDSCAPS2
    dsPrimary.lFlags = DDSD_CAPS Or DDSD_BACKBUFFERCOUNT
    dsPrimary.ddscaps.lCaps = DDSCAPS_COMPLEX Or DDSCAPS_FLIP Or DDSCAPS_PRIMARYSURFACE
    dsPrimary.lBackBufferCount = 1
    Set Primary = dd.CreateSurface(dsPrimary)


    caps.lCaps = DDSCAPS_BACKBUFFER
    Set BackBuffer = Primary.GetAttachedSurface(caps)

    Dim dssprite As DDSURFACEDESC2
    dssprite.lFlags = DDSD_CAPS Or DDSD_WIDTH Or DDSD_HEIGHT
    dssprite.ddscaps.lCaps = DDSCAPS_OFFSCREENPLAIN
    dssprite.lWidth = 200
    dssprite.lHeight = 200
    Set sprite = dd.CreateSurfaceFromFile("c:\Documents and Settings\Anantha Metta\Desktop\mw1.bmp", dssprite)

    Dim SrcRect As RECT
    Dim DestRect As RECT


    With SrcRect
    .Bottom = 200
    .Left = 0
    .Right = 200
    .Top = 0
    End With

    With DestRect
    .Bottom = 200
    .Left = 0
    .Right = 200
    .Top = 0
    End With

    Dim ck As DDCOLORKEY
    ck.low = RGB(255, 255, 255)
    ck.high = RGB(255, 255, 255)
    sprite.SetColorKey DDCKEY_SRCBLT, ck

    BackBuffer.Blt DestRect, sprite, SrcRect, DDBLT_KEYSRC Or DDBLT_WAIT

    Primary.Flip Nothing, DDFLIP_WAIT


    End Sub

    Private Sub Form_Click()
    Unload Me
    End Sub

    Private Sub Form_Load()
    Call Init
    End Sub
    _________________________________________________

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