Introduction
This page describes which additional files you will need and actions you should take to compile
fusion DirectX projects between
Borland C++Builder and
Borland Delphi.
More precisely this article describes steps you should take to inject ObjectPascal DirectX code in
C++Bulder projects. Final result can be seen in
Nitro Font renderer sample.
Article is written based on C++Builder 5 IDE.
What additional files do you need?
- C++Builder library pack
[ CBuilder_D3Dxx_libs.zip:
Direct3D 8.0b version /
Direct3D 8.1 version /
Direct3D 9.0 version ]
- Direct3D headers for Delphi - small version. Or you can download whole version which
includes D3DX8 helper DLL's noted below
[ Clootie_DirectXxx_Small.zip:
for DirectX 8.0b /
for DirectX 8.1 /
for DirectX 9.0 ]
- DLL needed for both Delphi and C++ Builder, to use D3DX8 functionality
[ Clootie_DXxx_dlls.zip:
for DirectX 8.0b /
for DirectX 8.1 /
for DirectX 9.0 ]
It's recommended to place these DLLs in Windows system directory.
- Original DirectX SDK include files / and samples source /
[ can be downloaded here ]
- Final result ;-)
At least for ObjectPascal source code and font binary file (DirectX 8.x sample).
[ Nitro Font renderer sample ]
Actions
As base C++ project we will take Text3D sample from MS DirectX 8.0 SDK and make it use Delphi
TNitroFont font renderer class instead of CD3DFont C++ class.
Pre-Actions
- Copy original MS DirectX 8.0 SDK sample to directory structure described in:
C++ Builder special actions in "How to compile ObjectPascal DirectX examples"
just like any ObjectPascal sample (this is needed so we can used "fixed relative paths"
in project options).
- Copy 'Common\inc' and 'Common\scr' directories from MS DirectX 8.0 SDK
'Samples\Multimedia' directory - or you will need to modify "Include Path"
in C++Builder project options later to point where D3D sample framework source code is.
- Convert MS VC sample to use with C++Builder as desribed
here and try to compiler it.
- Close project in C++Builder.
Main actions
- As C++Builder VC convertion wizard genarated wrong project options flags for ObjectPascal
compiler you should modify them. So not opening project in C++Builder IDE open BPR project
file in any text editor (like notepad), find <PFLAGS> entity and modify it to:
<PFLAGS value="-$YD -$W -$O- -v -JPHNE -M"/>. After what you could open project
in C++Builder.
- Copy NitroFnt.pas in Text3D sample directory and add it to project.
- In text3d.cpp source you will need to add '#include "NitroFnt.hpp";' and
make modifications to source what you would like. Instead you can just copy/paste source
from already modified text3d.cpp from provided sample code.
- Under 'Project\Options\"Directories / Conditionals"' tab you
should add:
in "Include Path": '($BCB)\include\vcl;..\..\Headers' -
for ObjectPascal RTL/VCL pregenerated inc files and ObjectPascal DirectX headers
in "Library Path": '($BCB)\lib\obj;..\..\Headers' -
for ObjectPascal RTL/VCL precompiled obj files and ObjectPascal DirectX headers.
- Copy 'text.fnt' binary font file to Release subdirectory.
- Push Compile button!
|
|