Jump to content
  • Advertisement


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


Other picture file formats in Ddraw...

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

Guys, I didn''t see anything posted about this, but I''m sure it''s an easy question. Is there an easy way to use other picture formats (jpg, gif, etc.) besides .bmp''s to use as surfaces? The size of the .bmp''s in Bytes are enormous, and I''d rather use compressed pictues, then decompress them before putting them in a surface. Thanks, BeerNutts

Share this post

Link to post
Share on other sites
If you want to use compressed images for your games, I''d recommend PNGs. THere''s a free, multiplatform library out there called libPNG that will help out with the loading. Stay away from GIF files (legal issues).

If you want to support several formats, FreeImage (http://www.6ixsoft.com/) supports loading/saving of quite a few formats.

I suggest you avoid using standard image formats in your games and create your own. It''s not difficult, and the experience is invaluable. A basic file format could consist of something like:

ID - a character string denoting the file extension
version - version of the format (1.0, 1.1, 2.0, etc...)
BPP - color depth of the image
ImageData - actual pixel values

Once you decide on a format, you should create a converter. Use FreeImage to load various formats, extract the info you need for your format (bpp, width, height, and image data), than you could use JCalg1 or ZLib to compress it all, and finally write it to disk.

Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!