Help with Bitmaps

Started by
2 comments, last by QzarBaron 20 years, 2 months ago
I was working on my bitmap engine based on Andre LaMothe''s book tricks of the windows game programming gurus. Now i got to the bitmap loading and rendering work of my engine and relised there has to be an easier way. Now i was looking and Andre''s way of doing it and relised how much work was involved and then looked at a tutorial on gamedev and they did it under 100 lines of code. What i want to do is load a bitmap. and then render it to an offscreen surface in DirectDraw. Im using 16 bit here. I want to look for methods of doing it that are not very complicated(possibly Win32 functions). I already have the code to initialize DDraw and create the offscreen surfaces.
"Go on get out last words are for fools who have not said enough already." -- Karl Marx
Advertisement
<< What i want to do is load a bitmap. and then render it to an offscreen surface in DirectDraw. >>

Easiest way to do it, my way

Megaman GDI Version | EXE
Megaman DDraw version | EXE

This is probably the bare minimum you need (uses DirectDraw 1.0, you can change the version number to update) with DDLoadBitmap from the ddutil.cpp | .h which comes with DX 6.1 SDK. If you need these, here they are

ddutil.cpp | ddutil.h

Mine uses resources, but DDLoadBitmap also works with files.

LaMothe recommends in his first Tricks book for a beginner to stick with DirectDraw (which ended with DX 7), but you can learn DX 9 / D3D and do 2D sprites that way as well.

Phil P

[edited by - PhilVaz on February 22, 2004 8:19:54 PM]
Thanx vaz but i have a question. i use 8.1 with all the DirectDraw stuff. So if i create an offscreen surface 7.0 will DDLoadbitmap work with those surfaces. Or would i have to use old versions of the surfaces.
"Go on get out last words are for fools who have not said enough already." -- Karl Marx
<< So if i create an offscreen surface 7.0 will DDLoadbitmap work with those surfaces. >>

Good question, looking at ddutil.cpp looks like it uses the original DirectDraw 1.0 interface. So you might have to edit ddutil.cpp itself to refer to version 7, or find a newer version of ddutil.cpp possibly in DX 7 SDK ? I''m using DX 6.1 SDK since it came with LaMothe''s first edition of Tricks.

The way to load/display 2d sprites today is with DX 9 / D3D which I''m told is even easier to set up than DDraw.

Phil P

This topic is closed to new replies.

Advertisement