Sign in to follow this  
Nahrix

Lost in the beginnings of DirectX

Recommended Posts

Nahrix    237
Hey guys, here's a newbie chiming in. I'm a C++ programmer using Visual C++ 6. When it comes to using terms that are relevant to the C++ standard, such as 'templates' or 'pointers', I know exactly what you're talking about. However, I've never programmed using an API before, and I wanted to use DirectX to draw some basic 2D sprites on a screen instead of asterisks and whatnot. The problem I'm having, however, is that every source of information I run into starts talking about Direct3D, and what vertices, pipelines, and shaders are, etc. I really just want to get my feet into the shallow end before I go crazy trying to make some off-the-wall 3D game engine. I'm just a poor little ignorant programmer, trying to figure out how to get anything to work at all :) What I've done so far is installl the Feb 2005 SDK (Debug), and managed to run the first 2 sample tutorial files provided by it. That in itself is quite the pain, since every time I want to do it, I have to create a new Win32 app, open the cpp file, compile it, go to project options -> link tab -> input -> add dxguid.lib and d3dx.lib, click ok, link and build the .exe, then run it. Whew. Even after that, when I tried to run the third sample tutorial by the SDK, doing what I wrote above (I was just seeing if I -could- compile them, as simply reading the comments in the first and second tutorial cpp files didn't prove enough to help me out at all), I got these error messages: Matrices.obj : error LNK2001: unresolved external symbol _D3DXMatrixPerspectiveFovLH@20 Matrices.obj : error LNK2001: unresolved external symbol _D3DXMatrixLookAtLH@16 Matrices.obj : error LNK2001: unresolved external symbol _D3DXMatrixRotationY@8 Matrices.obj : error LNK2001: unresolved external symbol __imp__timeGetTime@0 All I can say is that I'm in over my head, but I can't see where the shallow end is. Is there any information you wonderful fellows can provide me? I would be greatly appreciative. Thank you in advance.

Share this post


Link to post
Share on other sites
Evil Steve    2017
The February 2005 SDK doesn't support VC6 (It's untested, so some stuff may work), the latest version that does is the October 2004 SDK, and even then you need the extras package. I suspect that's the cause of your linker errors.

Share this post


Link to post
Share on other sites
darookie    1441
Seems as if you are missing some libraries that need to be linked.
The linker errors are not due to the lacking VC6 suppot so far (otherwise the _timeGetTime reference wouldn't be missing). You need to add the libraries for the functions that the linker complaints about. The easiest way to slove this is to look up the functions in MSDN and add the library hey need in your linker settings (the lib is listed at the bottom of the function description).
[edit]
Try D3DX9.lib for release and D3DX9d.lib for debug builds along with Winmm.lib for timeGetTime.
[/edit]

Share this post


Link to post
Share on other sites
Nahrix    237
Okay, I'll look into that. I do, however, still have the primary problem of not even being able to understand the tutorial files, nor knowing where some tutorials exist that don't involve anything more advanced than I can handle. C++ is all I know.

Is it even possible to learn DirectX without prior knowledge in I-don't-know-what?

Share this post


Link to post
Share on other sites
choffstein    1090
Well, teaching myself DirectX right now, I know exactly how you feel. It is quite possibly one of the most confusing things ever. Teaching myself GBA programming was easier than this mumbo jumbo. Slowly, though, it is starting to make sense. I think its one of those things where you have to shovel down the first couple of bites, and hope you understand as you force yourself to stare at more and more code.

Share this post


Link to post
Share on other sites
Stevieboy    238
Check out Kevin Harris's codesampler website.


http://www.codesampler.com/

He's got examples there and an online book for D3D basics, (you'll have to look around for it).

also
http://www.drunkenhyena.com/cgi-bin/dx9.pl

and

http://www.andypike.com/home.asp



edit;
first of all though make sure you are using the right versions of things, as mentioned, if you are using vc6 the latest directx sdk you will be able to use is October 2004, and you'll need to link to the library in the extras folder first.

Share this post


Link to post
Share on other sites
Marmin    523
http://www.gamedev.net/community/forums/topic.asp?topic_id=301048

I've learned a lot from these tutorials, what I did was take a tutorial code and build from there.

greetz,
M.

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