What is the best way to load bitmaps into a game?

Started by
1 comment, last by jns 23 years, 9 months ago
I have been reading Windows game programming for dummies(by Andre Lamothe) and was wondering what is the best way to load bitmaps. I have seen several ways to do this. On this message board somepeople have posted their own code, Lamothe has code to do it, and i have found that DirectX has someways to do it (Direct3DX utility library). Can anyone tell me what they think the easiest/best way to load an bmp(or other picture file).
Advertisement
The easiest way to load a bitmap in Direct Draw is to include "ddutil.cpp" and "ddutil.h" to your project and use the "DDLoadBitmap" function.

BTW, if you use the D3DX utility it will load the bitmap as a D3D texture which is not the same format as a surface.

I think the Targa (.tga files) format is one of the best format around. If also supports RLE compression at all bit depths . If you want to use this you can get code from "d3dtextr.cpp" in the d3dframe directory under the d3dim samples. It loads the file as a texture but it''s easy to change. However, you have to learn pixel plotting to do this.



+AA_970+
This is not the first time I posted this ref, but here I go again:
Check out homepage tutorial on Using Custom Resources to load a TGA image as a custom resource...

(The source code is for loading an image into an OpenGL texture, but you can probably rewrite it...)

This topic is closed to new replies.

Advertisement