Archived

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

BenB

Loading multiple bitmaps to one surface

Recommended Posts

BenB    122
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
CaptainJester    523
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
OB1st    122
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