DirectX 9 SDK for Borland C++ Builder
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Victor Chen
introduction:
DirectX 9 SDK for Borland C++ Builder, release date: 2004-07-20
This software development kit (SDK) is converted from original Microsoft DirectX 9 SDK.
This SDK supports Borland C++ Builder only, search Microsoft's homepage for other versions.
Post message at the forum of my homepage if you have any problems.
Copyright:
DirectX 9 SDK: Copyright (C) Microsoft Corp.
DirectX 9 SDK for Borland C++ Builder: Copyright (C) Victor Chen,
The original DirectX 9 SDK and the DirectX 9 SDK for Borland C++ Builder are freewares, no payment needed.
Contents:
DX9SDK: DirectX 9 SDK
SAMPLES: Examples
These samples including:
* Direct3D D3D, display three-dimensional still and moving graphics and images.
* DirectInput Keyboard, mouse, joystic, force-feed and other terminal devices
* DirectMusic Play music with some effect.
* DirectPlay Network transmission for network online games, chat system, etc.
* DirectShow Play and record audio and video media files, VCD, DVD etc.
* DirectSound Play and record audio files.
* Misc Any other miscellaneous programs
* Demos A full 3D game demo.
Total 179 C++ Builder samples.
These programs are modified from the samples of original Microsoft DirectX 9 SDK.
* Why no DirectDraw samples?
a) DirectDraw is not supported after DirectX 7 by Microsoft, DirectX 9 keeps the version 7 of DirectDraw.
b) There are some DirectDraw samples come with BCB in the folder C:\Program Files\Borland\CBuilder6\Examples\DDraw
c) All DirectDraw function can use Direct3D instead, and D3D provides many more powerful functions (alpha, rotation ...)
Installation:
1.Unpack the downloaded file with WinRAR 3 or newer WinRAR version.
2.BCB menu: Project -> Options, in the page Directories/Conditionals:
Click the "..." button at the right of "Include path", add the full path of "Include" folder of DirectX 9 SDK, and move to the top of the path list.
Click the "..." button at the right of "Library path", add the full path of "Lib" folder of DirectX 9 SDK, and move to the top of the path list.
Notes:
1. STRICT: either Visual C++ or Borland C++ needs this defination for compiling DirectX programs,
Project -> Options -> Directories/Conditionals:
Add STRICT to the list by click the "..." button at the right of "Conditional defines"
2. EInvalidOp: EInvalidOp Exceptions may throwed during debug programs, because of the difference of floating point error treatments by Borland's and Microsoft's compiler.
Resolvent: Write the following line in the beginning of WinMain function:
D3DFPExOff(); //no EInvalidOp exception throwed if any floating point error occured, included in
3. ntdll.DbgBreakPoint: if stopped at ntdll.DbgBreakPoint frequently during debug you program, and 200 more times F9 key (C++ Builder) or F5 key (Visual C++) pressed to skip this breakpoint, this affect only debugger, it's no harm to the .exe file, and is not an error, if the .exe file run directly not using any debugger, it never stopped at this ntdll.DbgBreakPoint.
Resolvent:
a) Do nothing, this is not an error, and no debug need or I care nothing about this.
b) If you don't want stop at ntdll.DbgBreakPoint during debug you program, write the follwing line in the beginning of you WinMain function:
VictorNtDllINT3(); //No stop at ntdll.DbgBreakPoint during debugging, included in
4. enum: the enum data are treated as int by Microsoft, but Borland treat these data as char,short,or long by value ranges, so the sizeof these data may not the same, if a program depends on the sizeof enum, this can result in erros.
Resolvent:
Project -> Options -> Compiler, select "Treat enum type as ints." in the "Compiling" options.
5. MFC: if compiles MFC program, select BCB menu: Project -> Options,
a) Advanced Compiler: select "MFC compatibility"
b) Directories/Conditionals:
add $(BCB)\include\mfc by click "..." button at the right of "Include path"
add $(BCB)\lib\Psdk by click "..." button at the right of "Library path"
c) Write the following lines in the main .cpp file:
#ifdef _DEBUG
# pragma link "nafxcwd.lib"
#else
# pragma link "nafxcw.lib"
#endif
Use these settings, you can compile stand-alone .exe files, no MFC dlls needed.
6.Some DirectShow examples need Windows Media Format SDK 7, not included in MS DirectX 9 SDK,
I not provide this SDK too, this version of SDK is not supported by Microsoft, newer Windows Media Format SDK: WMFSDK9 is available.
7.strmbase.lib and strmbasd.lib:
strmbasd.lib is the debug version of strmbase.lib.
Unpack the file downloaded to the folder \DX9BCB\SAMPLES\DirectShow\BaseClasses instead of the old files.
Write the following lines in the main .cpp file
#ifdef _DEBUG
# pragma link "strmbasd.lib"
#else
# pragma link "strmbase.lib"
#endif
8.Read the readme.txt file of every sample.
Modified files:
1. File: SAMPLES\Common\Src\dxutil.cpp
Function: DXUtil_GetDXSDKMediaPathCch
Before: get data file path from the registry.
After: get data file path from global variable: _DxAppDataPath
Function: DXUtil_SetDXSDKMediaPathCch
New function, set the path of data file, instead of read from the registry.
2. Project: SAMPLES\Direct3D\VCLFog\
Before: MFC program
After: VCL program
3. All other projects: keep the original codes as possible, modified only for compatible reasion.
--------------------next---------------------
阅读(1482) | 评论(0) | 转发(0) |