Jump to content

  • Log In with Google      Sign In   
  • Create Account

loading a bitmap


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
4 replies to this topic

#1 lshadow   Members   -  Reputation: 123

Posted 08 September 1999 - 08:22 AM

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.


Sponsor:

#2 Zenroth   Members   -  Reputation: 127

Posted 07 September 1999 - 03:59 PM

try in the szbitmap[] gb.bmp
the samples load from resource files alot of times.

#3 lshadow   Members   -  Reputation: 123

Posted 07 September 1999 - 05:56 PM

Thanks Zenroth...
it worked with -
szbitmap[] = "gb.bmp"

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


#4 Zenroth   Members   -  Reputation: 127

Posted 07 September 1999 - 06:40 PM

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.

#5 lshadow   Members   -  Reputation: 123

Posted 08 September 1999 - 08:22 AM

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.




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS