Using Compressed Bitmaps
I found a bitmap loader that I''m trying to use for a 2D project/ However, it seems that it only works for uncompressed bitmaps. are there any programs for decompressing bitmaps or do I need to get down and dirty and mess with RLE compression. Thanx for any answers.
With great power comes great reponsibility.
If this game is only targetting windows, it would probably be easiest to use the windows LoadImage function with the LR_LOADFROMFILE flag.
If you need crossplatform compatibility, you'll have to write your own. This article at codeproject has an implementation that you can base yours on. Download the code and check out ximabmp.cpp. You can't stick it straight in though, it uses some custom classes that you'll have to remove first.
EDIT: ximabmp.cpp, not xwimabmp.cpp
[edited by - Melekor on March 22, 2004 9:52:26 PM]
If you need crossplatform compatibility, you'll have to write your own. This article at codeproject has an implementation that you can base yours on. Download the code and check out ximabmp.cpp. You can't stick it straight in though, it uses some custom classes that you'll have to remove first.
EDIT: ximabmp.cpp, not xwimabmp.cpp
[edited by - Melekor on March 22, 2004 9:52:26 PM]
THanx for the resonse. I was just wonderin. The code I found for the bitmap loader was basically the code in NeHe Opengl tutorial encapsulated into a class. Even though his example works with the bmp he gives, does it work with compressed pics? If so, how does it do it? or do you have to add that funtionality your self? Thanx again.
Just use a pre-made image loader like DevIL (OpenIL) or something similar. Link it in, point it at your image files (whatever the format) and go. Nothing could be easier.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement