Archived

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

Loading multiple bitmaps to one surface

This topic is 5842 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

Hey, I''m curenntly using the "utils.cpp" supllied with the SDK, but I need to load quite a lot bitmaps. With the functions provided, I can only load one bitmap into a surfcae: *lpDDSurface = Utils_LoadBitmap(G.lpDD, szFileName, 0, 0); So the question is, of course, how can load multiple bitmaps into one surface? Thanks a lot...

Share this post


Link to post
Share on other sites
You will have to make on really big surface, then load each bitmap separately and blit them to that surface separately to different areas on the surface.

Basically:
  
LPDDSURFACEDESC7 target;
LPDDSURFACEDESC7 temp;

temp=LoadBitmap(bitmap1);
target->Blt(topleft,temp,...,...);
temp=LoadBitmap(bitmap2);
target->Blt(topright,temp,...,...);
temp=LoadBitmap(bitmap3);
target->Blt(bottomleft,temp,...,...);
temp=LoadBitmap(bitmap4);
target->Blt(bottomright,temp,...,...);



---
Make it work.
Make it right.
Make it fast.

Share this post


Link to post
Share on other sites
This may not be a great help, but It may be easier to write your code than trying to modify the util.cpp.
in directX7 you load each bitmap into an offscreen surface, and then you blit into the primary surface specifying the coordinates on the primary surface where you want each map to show.

Share this post


Link to post
Share on other sites