loading a bitmap

Started by
3 comments, last by lshadow 24 years, 7 months ago
try in the szbitmap[] gb.bmp
the samples load from resource files alot of times.
Advertisement
Thanks Zenroth...
it worked with -
szbitmap[] = "gb.bmp"

I don't know why but I had to add .bmp

Working on: DoP
Its because the code in ddutil looks directly at the file name it doesnt add a .bmp extension. The reason youll see just szbitmap[] ="whatever"; in the sdk is because, "whatever" is a bmp stored in the exe as a resource file without the bmp extension. Try it youll see what i mean.
I'm trying to load a bitmap using the same technique that the samples that come with directx use. Examples 4 and 5 do it this same way, and when I run them they work. But when I write my own program I get the DDLoad Bitmap FAILED and I can't figure out why. Here is the code and declarations.

LPDIRECTDRAW4 glpdd;
LPDIRECTDRAWSURFACE4 glpdds1;
static char szbitmap[] "gb";

glpdds1 = DDLoadBitmap(glpdd,szbitmap,0,0);
if(glpdds1 == NULL)
return InitFail(hw,hr,"DDLoadBitmap
FAILED");

"gb" is gb.bmp - 640x480 256 colors.
All help is appreciated. Thanks.

Working on: DoP
Well I tried it as a resource and I still got the same error. It loads the icon file fine, but for some reason it can't load the bitmap.
Working on: DoP

This topic is closed to new replies.

Advertisement