Skip to main content
gamedev.net
🔒 Locked

Loading Bitmap Files into DirectDraw

Started by Myopic Rhino Feb 17, 2001 at 1:38 PM 5 replies 1.3k views
Indica
Indica
Argh im very stuck. Ive been trying to follow a tutorial to show me how to create a surface to put my sprites into. The CreateBitmapSurface function within this tutorial gives me a compiler error: :\Program Files\Microsoft Visual Studio\MyProjects\Game\Scr\directDraw.cpp(122) : error C2440: '=' : cannot convert from 'void *' to 'struct HBITMAP__ *'
Conversion from 'void*' to pointer to non-'void' requires an explicit cast

and im stuck...

I admit im a noob, but this game im writting needs to work, otherwise my degree will be void D:

Any help would be great

thx Indica

[edit] Sorry i should probably state im using vc++ 6 and directX8

[edited by - Indica on February 26, 2003 12:31:30 PM]
bjmumblingmiles
bjmumblingmiles
myBitmap = (HBITMAP)LoadImage(blah blah)

This is called casting. It changes (well, not really) the type of an object to another type you need to work with. Its a very useful and necessary programming practice to learn.

Brian J
Brian J
load_bitmap_file
load_bitmap_file
now how are you supposed to display the bitmap once it''s on the surface?
Neonate
Neonate
It doesn't work for me, after calling
CreateBitmapSurface(Tile0, "c:\\gamedev\\gfx\\tile2.bmp", 64, 64);
Tile0 remains NULL

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.