1

I'm reversing an old DirectX 7 game and I noticed that it sometimes uses Blt and BltFast but at other times, it locks the directdraw surface and directly writes to GPU VRAM. Why did developers take the latter approach? Not only is it slower (since all rendering is done in the CPU) but it's also much more difficult. According to WINE, this practice was quite common. Game developers would use a combination of locking, blitting and GetDC/ReleaseDC.

user16797
  • 21
  • 2

1 Answers1

4

The existing rendering capabilities of the hardware may not always suit your needs, so sometimes you just have to paint the pixels yourself.

So, your question boils down to "why allow direct VRAM access when you can always paint the pixels in RAM and then have them Blted from RAM to VRAM?"

The answer is that back in the nineties we did not have the vast amounts of RAM that we have at our disposal today, so allocating a chunk of RAM as large as the VRAM was not always possible, or was not always the best option. (Memory allocation can have a huge toll, especially if other memory has to be swapped out to disk for that to happen.)

Mike Nakis
  • 32,003
  • 7
  • 76
  • 111