Archived

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

VersusReal

BMP loaders...

Recommended Posts

Is it better to write your own bmp loader for a game, or to use the DirectDraw functions? I just got Windows Game Programming for Dummies and I''m wondering which is better. Thanks!!! Open the hushed casket...

Share this post


Link to post
Share on other sites
I''d say it''s much better to write your own BMP loader. The BMP file format is very simple so writing a loader for it isn''t too much trouble at all and then at least you can say it''s your own code. I didn''t have experience writing file loaders before but I was able to put together a BMP load function just from studying the BMP data structures in the Windows API. I suggest you start from there. Look up the BITMAPFILEHEADER and BITMAPINFOHEADER data structures. All you need to know is in there.

Share this post


Link to post
Share on other sites
If you want to write your own bitmap loader, take a look at this post. One of the replyers has written quiet a big piece about loading a bitmap. Although he only tells about 24bit->16bit bitmaps it''s a start. Hope it helps.

sand Hawk

----------------
-Earth is 98% full. Please delete anybody you can.


My Site

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
There is also a code snippet on planet source code, fatty. search under "bitmap load loadbitmap", because the title is something like "load a bitmap without using the loadbitmap function".

Share this post


Link to post
Share on other sites
i''ve also put some info that i''ve been using for the past few days to write my own loader at this link along with the code i''ve written so far (use the code for whatever): http://www.killfactory.com

the sole purpose of the WindowManager.h header included is to provide an easy way to code MessageBoxes. you can strip out that code and it will compile. it''s buggy as hell, but the comments, at least should help some.

it should be noted that the _only_ files i''ve tested this with so far are 8-bit greyscale BMP files. the loader can''t yet handle compression or 24-bit bitmaps. theoretically it should work for 4, 16 & 32-bit maps too, but since when does theory work out?

-me

Share this post


Link to post
Share on other sites