Blt() problem
Im trying to fill the back buffer with random colors and when I use the Blt function I get an error saying this program commited an illegal operation. I went to the debug screen and it pointed an arrow where my Blt function was. Can someone just write the a Blt function for me as if you where to fill the screen so I have an example to go from? like lpddsback->Blt(the error is here some where);
please help
DDBLTFX ddbltfx;memset(&ddblfx, 0, sizeof(DDBLTFX));ddbltfx.dwSize=sizeof(ddbltfx); // Don''t know if this should be here, but maybe.ddbltfx.dwFillColor=rand()%0xFFFFFF; // if you are in 32bit modelpddsback->Blt(NULL, NULL, NULL, DDBLT_WAIT | DDBLT_COLORFILL, &ddbltfx);// That''s it
/CMN
In the function I use to fill an entire surface with a color, this is what my call to Blt looks like:
The NULL params are where you'd normally have pointers to a destination rect, a source surface, and a source rectangle. The DDBLT_COLORFILL tag tells the Blt function what the ddbltfx struct at the end is used for, as far as I know. You have to zero out the memory and initialize the size member of such a struct, and then initialize its dwFillColor with the color you wish to display. I use a macro which depends on what bit depth my program is using, to determine the actual value of the fillcolor variable in this struct.
I hope this helps.
Edited by - Redleaf on September 8, 2000 3:15:17 PM
lpdds->Blt(NULL, NULL, NULL, DDBLT_COLORFILL | DDBLT_WAIT, &ddbltfx);
The NULL params are where you'd normally have pointers to a destination rect, a source surface, and a source rectangle. The DDBLT_COLORFILL tag tells the Blt function what the ddbltfx struct at the end is used for, as far as I know. You have to zero out the memory and initialize the size member of such a struct, and then initialize its dwFillColor with the color you wish to display. I use a macro which depends on what bit depth my program is using, to determine the actual value of the fillcolor variable in this struct.
I hope this helps.
Edited by - Redleaf on September 8, 2000 3:15:17 PM
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement