Archived

This topic is now archived and is closed to further replies.

Help with Bitmaps

This topic is 5040 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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.

Share this post


Link to post
Share on other sites
<< 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]

Share this post


Link to post
Share on other sites
<< 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

Share this post


Link to post
Share on other sites