Sign in to follow this  

[DirectDraw] Drawing two different Bitmaps

This topic is 3660 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

ok, here's the deal: Im struggling drawing two diffrent Bitmaps on my Surface. I can darw the same Bitmap twice ... wow ... but i cant manage do darw two diffrent ones...
//-----------------------------
LPDIRECTDRAWSURFACE7	lpddsBitmap;
//...
lpddsBitmap = DDLoadBitmap(lpDirectDraw, "test.bmp", 32, 32);
//...
SetRect(&rectbitmap, x, y, x+32, y+32);
lpddsBack->Blt(&rectbitmap, lpddsBitmap, NULL, DDBLT_WAIT | DDBLT_KEYSRC, NULL);
SetRect(&rectbitmap, 100, 100, 132, 132);
lpddsBack->Blt(&rectbitmap, lpddsBitmap, NULL, DDBLT_WAIT | DDBLT_KEYSRC, NULL);
while(lpddsPrimary->Flip(NULL, DDFLIP_WAIT) != DD_OK); 
//------------------------------


this works fine ... i got a stationary Bitmap and one i can move around. Now I want to change the sorcefile of the stationary one ... i tried everything _I_ can think of and googled for about half an hour... Can u guys give ma a hint? [Edited by - Fjoergyn on December 4, 2007 5:08:46 PM]

Share this post


Link to post
Share on other sites
What did you try, and what went wrong during those tries?

Oh, and just to be sure, are you loading images before you draw them each time, or are you just loading them once (which you should)? Just a small detail that some beginners mess up with. :)

Share this post


Link to post
Share on other sites
if the other bitmap you are mentioning is not a part of the "test.bmp", you need to declare another LPDIRECTDRAWSURFACE7 variable and load separately. So it should look something like this.


//-----------------------------
LPDIRECTDRAWSURFACE7 lpddsBitmap1;
LPDIRECTDRAWSURFACE7 lpddsBitmap2;

//Initialization
lpddsBitmap1 = DDLoadBitmap(lpDirectDraw, "test.bmp", 32, 32);
lpddsBitmap2 = DDLoadBitmap(lpDirectDraw, "test2.bmp", 32, 32); // Use the file location of the second bitmap in place of "test2.bmp"

//... Render using two different surfaces.



Share this post


Link to post
Share on other sites

This topic is 3660 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this