Archived

This topic is now archived and is closed to further replies.

CHollman82

Can someone show me how to create DD surfaces for sprites and load bitmaps into them

Recommended Posts

CHollman82    100
I know how to set up primary and back surfaces for double buffering, and how to draw a bitmap to the back surface and flip to the primary. But when I try to first draw a background bitmap to the backsurface, and then a transparent sprite, but the transparent part of the sprite effects the background also when I flip the buffers, so I get the solid white where the transparent should have been, istead of the background image behind it. I need a good example of a way to store a variable number of images to their own surfaces, and then draw the surfaces to the backbuffer using trasparency. thanks in advance, chris

Share this post


Link to post
Share on other sites
sanity    126
Sup,

are you setting the surfaces color key? Remember to assign the color key to the description which you assign to the surface and remember to set the color keys translo property to the color you wish to make transparent.

Later,

Toby.

Share this post


Link to post
Share on other sites
AndyTX    806
Can we assume that you are using DirectDraw?

If so, just make sure to clear the back buffer, draw your background image (BLIT), set the color key on your transparent one (this only needs to be done once), and blit the transparent one onto the backbuffer, MAKING SURE THAT YOU SPECIFY THE "use source color key" flag in the BLIT (look up the exact flag in the SDK). Then flip.

Share this post


Link to post
Share on other sites