Jump to content
  • Advertisement
Sign in to follow this  
Fjoergyn

[DirectDraw] Drawing two different Bitmaps

This topic is 3883 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
Advertisement
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
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!