Loading Bitmaps

Started by
4 comments, last by Erick 24 years, 3 months ago
Hidi Ho I was wondering how all of you load in your bitmaps in DirectDraw ??? Do you ever use CreateSurfaceFromFile. I am learning DX in C++ as I used to program it in VB. In VB you can simply create a surface from file. Is there a reason why you would not do this in C++ ??? Thanks Erick
Advertisement
I''m doing it the other way (that is described in the Inside DirectX-Book/Sample source). I don''t want my surfaces to be pendant of the bitmap''s size.
You can use the LoadBitmap function in the ddutil.cpp file in the DD samples. You need to know the height and width, but if you don''t you can calculate it from the file size.

Breakaway Games

Former Microsoft XNA and Xbox MVP | Check out my blog for random ramblings on game development

Calculate it from the file size?!?

That's risky. A bitmap that's 100x200 pixels will have the same file size as a bitmap that's 200x100 pixels.

Mason McCuskey
Spin Studios - home of Quaternion, 2000 GDC Indie Games Fest Finalist!
www.spin-studios.com

Edited by - mason on 1/26/00 12:00:20 PM
Founder, Cuttlefish Industries
The Cuttlefish Engine lets anyone develop great games for iPad, iPhone, Android, WP7, the web, and more!
I use my own handcoded bitmap loading routines. since i load the graphics from one big file ("resource file", as explained in one of the articles on here) its really no point of trying to use the functions in ddutil.cpp.
I find the microsoft utilities too shitty, if you don''t mind the word. I use my own bmp, tga and jpeg reader.

Dance with me......

http://members.xoom.com/CJdeVos/index.htm

This topic is closed to new replies.

Advertisement