DirectX of dummies.

25 views
Skip to first unread message

JoeC

unread,
Dec 12, 2005, 3:49:12 PM12/12/05
to C++ Game Programming
Is there a realy simple tutorial that goes into the first steps of
using direcX, I have some books but when I follow thge instruction
nothing works. Is there a very simple step by step for getting started
with directX and the setting of compilers. I have tried copy a directX
program but it didn;t work and I got errors. I am not sure about
directX versions correct commands and compiler settings.

BlueRaja

unread,
Dec 12, 2005, 7:52:55 PM12/12/05
to C-Game-Pr...@googlegroups.com
I, along with most other programmers I know, would recommend LaMothe's "Tricks of the Windows Game Programming Gurus"

caseyh...@gmail.com

unread,
Dec 13, 2005, 1:04:16 AM12/13/05
to C++ Game Programming
When I first got started with DirextX I found this site very helpful,
http://www.andypike.com/tutorials/directx8/

jakob lin

unread,
Dec 13, 2005, 1:00:26 PM12/13/05
to C-Game-Pr...@googlegroups.com
dude   directx for dummies is easy.         

On 12/12/05, caseyh...@gmail.com <caseyh...@gmail.com> wrote:

When I first got started with DirextX I found this site very helpful,
http://www.andypike.com/tutorials/directx8/




--
Jakob Lin Mall

JoeC

unread,
Dec 13, 2005, 4:52:36 PM12/13/05
to C++ Game Programming
I went to that site and downloaded the first project and I still get
errors when I try to do anything with directX

c:\documents and settings\owner.root\desktop\dx project 1\main.cpp(1) :
fatal error C1083: Cannot open include file: 'd3d8.h': No such file or
directory
Error executing cl.exe.

JoeC

unread,
Dec 13, 2005, 7:01:14 PM12/13/05
to C++ Game Programming

When I use DEV C++ I get this error.


[Linker error] undefined reference to `Direct3DCreate8@4'
ld returned 1 exit status

I installed directX and still get this.

jakob lin

unread,
Dec 14, 2005, 1:30:04 AM12/14/05
to C-Game-Pr...@googlegroups.com
it woudl be better if you tell us what veriosn direct x u r using because if i told u how to do it in directx version 6  and u were using direct x 1  then it would not work .
--
Jakob Lin Mall

Vaelek

unread,
Dec 14, 2005, 9:23:08 AM12/14/05
to C++ Game Programming
That error is most likely because you have not downloaded the directx
sdk and "installed" it onto your machine. Go to this site,
http://www.microsoft.com/downloads/results.aspx?productid=&freetext=sdk&displaylang=en
and download the directx sdk and install it on your machine. Then you
can set up your project to point to the correct folders that have the
directx header and cpp files so that your programs will compile.

JoeC

unread,
Dec 14, 2005, 11:43:08 AM12/14/05
to C++ Game Programming
I down loaded and installed the program but I am still getting the sam
errors. How do I get my compiler to recognize the ddirectX libs?

JoeC

unread,
Dec 14, 2005, 9:54:12 PM12/14/05
to C++ Game Programming
#include<windows.h>
I am trying the most basic directX program and I am getting erros

#include<ddraw.h>

int WINAPI WinMain(HINSTANCE h1, HINSTANCE h2, PSTR v1, int v2){

LPDIRECTDRAW lpdd = NULL;

DirectDrawCreate(NULL, &lpdd, NULL);

return 0;
}

with VC++ I get:
main.obj : error LNK2001: unresolved external symbol
_DirectDrawCreate@12
Debug/ddraw.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.

With DEVC++:

[Linker error] undefined reference to `DirectDrawCreate@12'


How do I overcome these errors I have installed directX.

Vaelek

unread,
Dec 15, 2005, 7:31:56 AM12/15/05
to C++ Game Programming
You need to set the project settings to point to the directories where
you have installed the directx sdk files. Go to Project/Settings and
then select the C/C++ tab. Set the category to Preprocessor. Now in the
edit field for "Additional include directories" you put in the full
path to where the directx header files are installed at. Then you go to
the Link tab, select Input in the Category field and under "Additional
library path" edit field you put in the full path to where you have the
directx .lib files stored at. Under the "Object/library modules" edit
field you have to put in the name of the directx .lib files that you
are you trying to use for the project. That should fix your unresolved
external symbol errors. It is my experience that you get that error
when dealing with library files and have not set up the project to find
those library files.

This site has a good intro tutorial for D3D9.
http://www.ultimategameprogramming.com/demoDownload.php?category=DirectX&page=1

JoeC

unread,
Dec 15, 2005, 3:35:27 PM12/15/05
to C++ Game Programming
This is all great but is this for VC++ or DEV C++. I am ptetty good
with learning the language but when it comes to compilers I get pretty
lost. It took me a week to figure out how to use TransparentBlt.

jakob lin

unread,
Dec 15, 2005, 4:52:08 PM12/15/05
to C-Game-Pr...@googlegroups.com
oh boy 
--
Jakob Lin Mall

JoeC

unread,
Dec 15, 2005, 5:19:25 PM12/15/05
to C++ Game Programming
Thanks much, Ill figure it out.

JoeC

unread,
Dec 15, 2005, 8:30:24 PM12/15/05
to C++ Game Programming
Wow, thanks, it did work. It was pretty difficult to do that. I( would
like microsoft would come up with and easier way to configure their
softwars. Sorry for being stupid, doing programming can lead to
fustration and lackof paying attention.

Vaelek

unread,
Dec 16, 2005, 8:57:29 AM12/16/05
to C++ Game Programming
No need to apologize. :) It can be confusing just setting up your
compiler and a lot of tutorials dont' or can't tell you because it
depends on the compiler. :) You had mentioned in an above post that
you were using VC++ so that is the instructions I tried to give you. :)
I am glad it worked for you.

JoeC

unread,
Dec 16, 2005, 1:04:01 PM12/16/05
to C++ Game Programming
I got my litte directX program to compile run and do nothing but I
tried to copy one of the tutorials that were suggested and using VC++
is compiled but told me that it can't execute the program. I am using
the demo version of the program. I realy perfer to use dev C++ and
again not realy sure how to add the libraries. It was a challenge
getting TransparentBlt to work. It would be cool if I could start
getting an understanding of directx.

Reply all
Reply to author
Forward
0 new messages