Archived

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

Kelendil

24 bit bitmaps & DirectX 5

Recommended Posts

Here''s the deal. I have a C++ project to make for my Project/Graphics Programming class. The project I decided to make is a very basic Zelda engine. We do not have any DirectX lessons in these class but I still want to use it for my engine. (The course is mainly on MFC) I already did a basic tile engine in Visual Basic. My only problem is with using DirectX. Since they only have DirectX 5 at school, I''m only allowed to use that. My main problem right now is loading 24bits bitmaps into a DirectX surface. Can anyone point me to a good web tutorial or book that explains that? In the WGPFD book, they only show how to use 8bit bitmaps. There is a part on loading 24bit bitmaps on a directdraw surface but it appears all green when I blit it to the screen... I really don''t have much time to do that project. Any help would really be appreciated.

Share this post


Link to post
Share on other sites
A really easy function you can use is DDLoadBitmap

LPDIRECTDRAW lpdd;
//Initialize Direct Draw
LPDIRECTDRAWSURFACE surface = DDLoadBitmap(lpdd, "filename.bmp", 0, 0);

This function creates the offscreen surface and loads the bmp into it

also there is DDReLoadBitmap, if you've already created the surface:

DDReLoadBitmap(surface, "filename.bmp");

The files, ddutil.h/.cpp, that contain these functions are somewhere in the DirectX SDK, if you have trouble finding them, email me and I will send them to you.
Good luck making Zelda

Edited by - atcdevil on November 4, 2001 10:36:36 PM

Share this post


Link to post
Share on other sites