Problem with a DirectDraw function
Hello, I am currently writing a small graphical engine with DirectDraw. I have made a function which loads a bitmap in a Structure. After some testing I have found that the structure was successfully filled. I have also checked documentation about blitting in the DirectX documentation and I am confident that I understand it`s principiles.
I was intending to fill draw on an offscreen surface and then blit on it. The problem is that I don''t know how to transfer the bitmap''s struct buffer to an offscreen surface ( which is already created ).
Can anybody help me ?
WHO DO THEYTHINK THEY'REFOOLING : YOU ?
Hi Bleakcabal,
Assuming the surface and bitmap are of the same bit depth....
You need to pass a DDSURFACEDESC to the surface's lock() function to retrieve a pointer to the memory where the surface resides (this will be returned in lpSurface in the DDSURFACEDESC struct).
Once you have this pointer, you can memcpy() etc. just like you would with any other data.
Remember to Unlock() the surface when your finished otherwise direct draw won't be able to access it for blt()'s etc.
--
Rah
Edited by - Rah on 2/24/00 2:17:44 PM
Assuming the surface and bitmap are of the same bit depth....
You need to pass a DDSURFACEDESC to the surface's lock() function to retrieve a pointer to the memory where the surface resides (this will be returned in lpSurface in the DDSURFACEDESC struct).
Once you have this pointer, you can memcpy() etc. just like you would with any other data.
Remember to Unlock() the surface when your finished otherwise direct draw won't be able to access it for blt()'s etc.
--
Rah
Edited by - Rah on 2/24/00 2:17:44 PM
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement