Sign in to follow this  
Dogh Quch

Compilation problems!

Recommended Posts

Hail! I'm getting started in DirectX and I'm getting a strange compilation error. When I call the function DirectDrawCreateEx one of the parameters is the ID of the wished Direct Draw object version. I'm current using IID_IDirectDraw7, that is the latest one for DirectX 9, and I followed all the steps given by the book I'm using (use the ddraw.h header and declare the DDRAW.LIB) and I keep receiving the linking error code: "error LNK2020: unresolved token (0A000021) IID_IDirectDraw7". Does some one knows were I'm messing up?

Share this post


Link to post
Share on other sites
you need to include the so secret and utterly magic dxguid.lib ;)

however, just as a note, do know that DirectDraw is more or less deprecated, and people are now advised to use Direct3D for 2D instead (using ID3DXSprite if one wishes), Direct3D provides many pros with a few cons for 2D... (likely performance upgrade too, especially with newer hardware)
so when you've got a hang of DirectDraw do try 2D using Direct3D instead.
that's my friendly tip.

Share this post


Link to post
Share on other sites
Thanks Syranide, It works fine now!

My brain have serious problem working with drawing and images, that's why I'm starting slow and using just the Direct Draw. Reading the DirectX documentation I realized that Direct Draw is not current used any more and that D3d give support instead.

There is a lot of stuff to get used in directX when you only made console programs in your life!

Share this post


Link to post
Share on other sites
Yepp I totally agree with DirectDraw, very easy and pleasent, however I found out a few months ago that DirectDraw was deprecated and thought I'd try Direct3D, I was amazed by how fast I was able to start doing my own things in Direct3D (2D)... just a few days after I made my first 3D-box with lightning and all ;) (I even did my own quad-renderer for 2D after a brief look at a tutorial)

Don't rush, but if you got the time, do try Direct3D it is really fun for 2D (and 3D) and isn't really as advanced as one thinks (though little more complex than DirectDraw).

Cheers

Share this post


Link to post
Share on other sites
Just a quick comment... do what you want with DirectDraw, but if you start using it heavily and want to look at the more advanced parts of 2D graphics you'd be well advised to jump ship and head over to D3D [smile]

Two examples of this:

- Alpha blending is possible in DD7, but from what I remember of it, it was never quite as straight forward as I'd hoped. It's a fairly trivial process in D3D.

- Rotations (and general transforms) - DD7 won't rotate your sprites for you, which always annoyed me. In D3D(2D) it's not quite as easy as "full" D3D but it's a million times easier than manually rotating your DD7 pixels [grin]

hth
Jack

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this