Skip to main content
gamedev.net
🔒 Locked

Loading multiple bitmaps to one surface

Started by BenB Dec 14, 2001 at 1:42 PM 2 replies 450+ views
Original Post
BenB
BenB
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...
CaptainJester
CaptainJester
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.
"None of us learn in a vacuum; we all stand on the shoulders of giants such as Wirth and Knuth and thousands of others. Lend your shoulders to building the future!" - Michael Abrash[JavaGaming.org][The Java Tutorial][Slick][LWJGL][
xyzzy00
xyzzy00
Or.. just create your big texture, and then call D3DXLoadSurfaceFromSurface for each image you want to load, each time giving a different destination subrect.

xyzzy
OB1st
OB1st
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.

I would love going home to M7, but I can't detect black holes.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.