Final WordDirectDraw programmers looking to migrate to the new API will have hopefully gained some useful insight into the inner workings of Direct3D. While it isn't hard to rewrite the ID3DXSprite routines, there is a lot of mundane work to do so you might as well take advantage of my mundane work. The discussed techniques are incorporated in the demo program. Further Reading
AcknowledgementsThanks to Mario Knezovic (mario.knezovic@bonespark.com) for helping me with this article. Mario provided the inclusive-exclusive explanation to this problem. (I thought Microsoft's rectangles were incorrectly implemented but this is not the case.) About the DemoDownload d3dblit.zip to obtain the demo (and source code) for this article. The demo draws six sprites to show off the blitting techniques discussed in this article. These images are arranged like so
The sprites are
Compare sprites 1 to 4 with the original bitmap in sprites.bmp. Tip: use [Alt] + [Print Screen] to copy the active window and then paste the image into any Windows paint program. Tools like zoom make it easier to compare images. Sprites 5 and 6 show off the effects available in Blit: scaling, rotation, and colour modulation. |