DDraw Blitting And Strange RECT values
Hi,
I have a OFFSCREEN surface to which I have drawn a bitmap. I then use Blt to copy the bitmap from the off-screen surface to the back-buffer, which I then flip to the primary surface.
My problem is that I seem to lose the last few columns and rows from the bitmap during the blitting. Now the bitmap routine draws the bitmap correctly, because I''ve checked, and the RECTs I use for the blitting are very simple.
I draw the bitmap onto the off-screen surface at 0,0,40,40. I then blit this to the back buffer using a destination RECT of 0,0,40,40.
The only way I can get the correct sized bitmap using the Blt is to add anything from 1 to 4 in the RECT.right/RECT.bottom calculations.
Is there a specific size of RECTs that Blt will work with? Does anyone know what the problem could be?
Many thanks in advance for your help.
Regards,
Mike
The Blt code uses the DirectDraw Blt function.
First I draw bitmap of 40,40 pixels to the offscreen buffer at position 0,0. This part uses my own DrawBitmap function which works fine because when I draw to the primary surface it draw correctly.
I then setup to RECT structs, dst and src. The values of these structures are the same. So the src will be 0,0,40,40 and dst is the same.
I then use DirectDraw Blt using the offscreen buffer as the source. Then I flip the back buffer to the primary and its is here I find some columns/rows missing.
The only blitting function I use is DDs Blt.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement