Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Thread of questions
#18
np, I've got a bit of spare time right now.

Umm, yes, anything you blit to the backbuffer will be sent to the screen on every execution of the gameloop.

Ambientiger Wrote:The line
Code:
' Blit the backbuffer
Call DD_PrimarySurf.Blt(rec_pos, DD_BackBuffer, rec, DDBLT_WAIT)
in the gameloop is the bit responsible for taking a rectangle the size of rec from the BackBuffer and showing it on the monitor in the rectangle rec_pos.

If you follow the code through Sub GameLoop you'll notice calls to each of the Blit Subs (BlitTile, BlitPlayer etc), each of these subs builds up the map layer by layer onto the backbuffer, then the line of code above sort of picks it all up and slaps it on the screen.

The main associations with the surface are made in Sub InitDirectX then the code above uses this bit -
Code:
' Get the rect to blit to
        Call DX.GetWindowRect(frmMirage.picScreen.hWnd, rec_pos)
        With rec_pos
            .Bottom = .top + ((MAX_MAPY + 1) * PIC_Y)
            .Right = .Left + ((MAX_MAPX + 1) * PIC_X)
        End With
to know where to put the image from the backbuffer.
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)