To compile DirectX in Dev-C++ you need include files and import libraries.
You can use the include files that come with the DirectX SDK. Copy the
****.h (for instance "d3d8.h") into the directory "c:\devc\include" (or
whereever you have Dev-C). Next you need import libraries, they're here:
http://sites.netscape.net/ptrpck/dx8libs.zip Copy any lib****.a (for
instance "libd3d8.a") into the directory "c:\devc\lib".
open "c:\devc\include\wtypes.h" and add this line to the beginning:
"typedef unsigned int *UINT_PTR;"
open "c:\devc\include\windef.h" and add this line to the beginning:
"#define HMONITOR_DECLARED"
Now you can compile DirectX programs with Dev-C++.
In the beginning of your program #include <****> what you use for instance
"#include <d3d8.h>"
For each #include put a linker option in "project settings -> additional
linker commands" that reads like "-l****" (for instance "-ld3d8", separate
with spaces).
If you want to write C++ (as opposed to C) code with DirectX put
"-fvtable-thunks" in "project settings -> additional compiler commands",
otherwise the compiler will tell you about 1000 times :-)
... and if you want your program to run faster, add this into the
"additional compiler commands" line:
"-O2 -funroll-loops -ffast-math -fomit-frame-pointer" (separate options
with spaces)
cheers
-chris
|