Archived

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

jns

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

Recommended Posts

jns    122
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).

Share this post


Link to post
Share on other sites
+AA_970+    122
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+

Share this post


Link to post
Share on other sites
baskuenen    124
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...)

Share this post


Link to post
Share on other sites