?? d3dx9.pas
字號:
{******************************************************************************}
{* *}
{* Copyright (C) Microsoft Corporation. All Rights Reserved. *}
{* *}
{* File: d3dx9.h, d3dx9anim.h, d3dx9core.h, d3dx9effect.h, *}
{* d3dx9math.h, d3dx9math.inl, d3dx9mesh.h, d3dx9shader.h, *}
{* d3dx9shape.h, d3dx9tex.h *}
{* *}
{* Content: Direct3DX 9.0 headers *}
{* *}
{* Direct3DX 9.0 Delphi adaptation by Alexey Barkovoy *}
{* E-Mail: clootie@reactor.ru *}
{* *}
{* Modified: 27-Apr-2003 *}
{* *}
{* Latest version can be downloaded from: *}
{* http://clootie.narod.ru/delphi *}
{* *}
{* This File contains only Direct3DX 9.0 Definitions. *}
{* If you want to use previous versions - use D3DX.pas and D3DX8.pas *}
{* *}
{******************************************************************************)
{ }
{ Obtained through: Joint Endeavour of Delphi Innovators (Project JEDI) }
{ }
{ The contents of this file are used with permission, subject to the Mozilla }
{ Public License Version 1.1 (the "License"); you may not use this file except }
{ in compliance with the License. You may obtain a copy of the License at }
{ http://www.mozilla.org/MPL/MPL-1.1.html }
{ }
{ Software distributed under the License is distributed on an "AS IS" basis, }
{ WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for }
{ the specific language governing rights and limitations under the License. }
{ }
{ Alternatively, the contents of this file may be used under the terms of the }
{ GNU Lesser General Public License (the "LGPL License"), in which case the }
{ provisions of the LGPL License are applicable instead of those above. }
{ If you wish to allow use of your version of this file only under the terms }
{ of the LGPL License and not to allow others to use your version of this file }
{ under the MPL, indicate your decision by deleting the provisions above and }
{ replace them with the notice and other provisions required by the LGPL }
{ License. If you do not delete the provisions above, a recipient may use }
{ your version of this file under either the MPL or the LGPL License. }
{ }
{ For more information about the LGPL: http://www.gnu.org/copyleft/lesser.html }
{ }
{******************************************************************************}
// Original source contained in "D3DX9.par"
{$I DirectX.inc}
unit D3DX9;
interface
// Remove "dot" below to link with debug version of D3DX9
// (only in JEDI or TMT pascal version)
{.$DEFINE DEBUG}
// Remove "dot" below to link with separate DLL's (one DLL per part of D3DX9 API)
// instead of monolithic "all-in-one" version of D3DX9
{.$DEFINE D3DX_SEPARATE}
// Remove "dot" below to link with Tim Baumgarten D3D9.pas
// note: it currently has bugged definition of D3DMATRIX (on 27-Apr-2003)
{.$DEFINE DXG_COMPAT}
(*$HPPEMIT '#include "d3dx9.h"' *)
(*$HPPEMIT '#include "dxfile.h"' *)
// Do not emit "hpp" files to C++Builder
{$NOINCLUDE DXFile}
(*$HPPEMIT 'namespace D3dx9' *)
(*$HPPEMIT '{' *)
uses
Windows,
ActiveX,
SysUtils,
{$IFDEF DXG_COMPAT}D3D9{$ELSE}Direct3D9{$ENDIF},
DXFile;
const
//////////// DLL export definitions ///////////////////////////////////////
d3dx9dll ={$IFDEF DEBUG} 'd3dx9d.dll'{$ELSE} 'D3DX9ab.dll'{$ENDIF};
{$IFDEF DEBUG}{$UNDEF D3DX_SEPARATE}{$ENDIF}
d3dx9mathDLL = {$IFDEF D3DX_SEPARATE}'d3dx9abMath.dll'{$ELSE}d3dx9dll{$ENDIF};
d3dx9coreDLL = {$IFDEF D3DX_SEPARATE}'d3dx9abCore.dll'{$ELSE}d3dx9dll{$ENDIF};
d3dx9shaderDLL = {$IFDEF D3DX_SEPARATE}'d3dx9abShader.dll'{$ELSE}d3dx9dll{$ENDIF};
d3dx9effectDLL = {$IFDEF D3DX_SEPARATE}'d3dx9abEffect.dll'{$ELSE}d3dx9dll{$ENDIF};
d3dx9meshDLL = {$IFDEF D3DX_SEPARATE}'d3dx9abMesh.dll'{$ELSE}d3dx9dll{$ENDIF};
d3dx9shapesDLL = {$IFDEF D3DX_SEPARATE}'d3dx9abShapes.dll'{$ELSE}d3dx9dll{$ENDIF};
d3dx9texDLL = {$IFDEF D3DX_SEPARATE}'d3dx9abTex.dll'{$ELSE}d3dx9dll{$ENDIF};
d3dx9animDLL = {$IFDEF D3DX_SEPARATE}'d3dx9abAnim.dll'{$ELSE}d3dx9dll{$ENDIF};
{$IFNDEF COMPILER6_UP}
type
PPointer = ^Pointer;
PPAnsiChar = ^PAnsiChar;
{$ENDIF}
//////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) Microsoft Corporation. All Rights Reserved.
//
// File: d3dx9.h
// Content: D3DX utility library
//
//////////////////////////////////////////////////////////////////////////////
const
// #define D3DX_DEFAULT ULONG_MAX
// #define D3DX_DEFAULT ((UINT) -1)
D3DX_DEFAULT = Cardinal(-1);
{$EXTERNALSYM D3DX_DEFAULT}
// #define D3DX_DEFAULT_NONPOW2 ((UINT) -2)
D3DX_DEFAULT_NONPOW2 = Cardinal(-2);
{$EXTERNALSYM D3DX_DEFAULT_NONPOW2}
var
// #define D3DX_DEFAULT_FLOAT FLT_MAX
// Forced to define as 'var' cos pascal compiler treats all consts as Double
D3DX_DEFAULT_FLOAT: Single = 3.402823466e+38; // max single value
{$EXTERNALSYM D3DX_DEFAULT_FLOAT}
type
_D3DXERR = HResult;
{$EXTERNALSYM _D3DXERR}
{$IFDEF DXG_COMPAT}
const
MAKE_D3DHRESULT_R = MAKE_D3DHRESULT;
{$ENDIF}
const
D3DXERR_CANNOTMODIFYINDEXBUFFER = HResult(MAKE_D3DHRESULT_R or 2900);
{$EXTERNALSYM D3DXERR_CANNOTMODIFYINDEXBUFFER}
D3DXERR_INVALIDMESH = HResult(MAKE_D3DHRESULT_R or 2901);
{$EXTERNALSYM D3DXERR_INVALIDMESH}
D3DXERR_CANNOTATTRSORT = HResult(MAKE_D3DHRESULT_R or 2902);
{$EXTERNALSYM D3DXERR_CANNOTATTRSORT}
D3DXERR_SKINNINGNOTSUPPORTED = HResult(MAKE_D3DHRESULT_R or 2903);
{$EXTERNALSYM D3DXERR_SKINNINGNOTSUPPORTED}
D3DXERR_TOOMANYINFLUENCES = HResult(MAKE_D3DHRESULT_R or 2904);
D3DXERR_INVALIDDATA = HResult(MAKE_D3DHRESULT_R or 2905);
{$EXTERNALSYM D3DXERR_INVALIDDATA}
D3DXERR_LOADEDMESHASNODATA = HResult(MAKE_D3DHRESULT_R or 2906);
{$EXTERNALSYM D3DXERR_LOADEDMESHASNODATA}
D3DXERR_DUPLICATENAMEDFRAGMENT = HResult(MAKE_D3DHRESULT_R or 2907);
{$EXTERNALSYM D3DXERR_DUPLICATENAMEDFRAGMENT}
//////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) Microsoft Corporation. All Rights Reserved.
//
// File: d3dx9math.h
// Content: D3DX math types and functions
//
//////////////////////////////////////////////////////////////////////////////
//===========================================================================
//
// General purpose utilities
//
//===========================================================================
const
D3DX_PI: Single = 3.141592654;
{$EXTERNALSYM D3DX_PI}
D3DX_1BYPI: Single = 0.318309886;
{$EXTERNALSYM D3DX_1BYPI}
//#define D3DXToRadian( degree ) ((degree) * (D3DX_PI / 180.0f))
function D3DXToRadian(Degree: Single): Single;
{$EXTERNALSYM D3DXToRadian}
//#define D3DXToDegree( radian ) ((radian) * (180.0f / D3DX_PI))
function D3DXToDegree(Radian: Single): Single;
{$EXTERNALSYM D3DXToDegree}
//===========================================================================
//
// 16 bit floating point numbers
//
//===========================================================================
const
D3DX_16F_DIG = 3; // # of decimal digits of precision
{$EXTERNALSYM D3DX_16F_DIG}
D3DX_16F_EPSILON = 4.8875809e-4; // smallest such that 1.0 + epsilon <> 1.0
{$EXTERNALSYM D3DX_16F_EPSILON}
D3DX_16F_MANT_DIG = 11; // # of bits in mantissa
{$EXTERNALSYM D3DX_16F_MANT_DIG}
D3DX_16F_MAX = 6.550400e+004; // max value
{$EXTERNALSYM D3DX_16F_MAX}
D3DX_16F_MAX_10_EXP = 4; // max decimal exponent
{$EXTERNALSYM D3DX_16F_MAX_10_EXP}
D3DX_16F_MAX_EXP = 15; // max binary exponent
{$EXTERNALSYM D3DX_16F_MAX_EXP}
D3DX_16F_MIN = 6.1035156e-5; // min positive value
{$EXTERNALSYM D3DX_16F_MIN}
D3DX_16F_MIN_10_EXP = -4; // min decimal exponent
{$EXTERNALSYM D3DX_16F_MIN_10_EXP}
D3DX_16F_MIN_EXP = -12; // min binary exponent
{$EXTERNALSYM D3DX_16F_MIN_EXP}
D3DX_16F_RADIX = 2; // exponent radix
{$EXTERNALSYM D3DX_16F_RADIX}
D3DX_16F_ROUNDS = 1; // addition rounding: near
{$EXTERNALSYM D3DX_16F_ROUNDS}
type
(*$HPPEMIT 'typedef D3DXFLOAT16 TD3DXFloat16;' *)
(*$HPPEMIT 'typedef D3DXFLOAT16 *PD3DXFloat16;' *)
PD3DXFloat16 = ^TD3DXFloat16;
{$EXTERNALSYM PD3DXFloat16}
TD3DXFloat16 = packed record
value: Word;
end;
{$NODEFINE TD3DXFloat16}
// Some pascal equalents of C++ class functions & operators
const D3DXFloat16Zero: TD3DXFloat16 = (value:0); // 0
function D3DXFloat16(value: Single): TD3DXFloat16;
function D3DXFloat16Equal(const v1, v2: TD3DXFloat16): Boolean;
function D3DXFloat16ToFloat(value: TD3DXFloat16): Single;
//===========================================================================
//
// Vectors
//
//===========================================================================
//--------------------------
// 2D Vector
//--------------------------
type
(*$HPPEMIT 'typedef D3DXVECTOR2 TD3DXVector2;' *)
(*$HPPEMIT 'typedef D3DXVECTOR2 *PD3DXVector2;' *)
PD3DXVector2 = ^TD3DXVector2;
{$EXTERNALSYM PD3DXVector2}
TD3DXVector2 = packed record
x, y: Single;
end;
{$NODEFINE TD3DXVector2}
// Some pascal equalents of C++ class functions & operators
const D3DXVector2Zero: TD3DXVector2 = (x:0; y:0); // (0,0)
function D3DXVector2(_x, _y: Single): TD3DXVector2;
function D3DXVector2Equal(const v1, v2: TD3DXVector2): Boolean;
//--------------------------
// 2D Vector (16 bit)
//--------------------------
type
(*$HPPEMIT 'typedef D3DXVECTOR2_16F TD3DXVector2_16F;' *)
(*$HPPEMIT 'typedef D3DXVECTOR2_16F *PD3DXVector2_16F;' *)
PD3DXVector2_16F = ^TD3DXVector2_16F;
{$EXTERNALSYM PD3DXVector2_16F}
TD3DXVector2_16F = packed record
x, y: TD3DXFloat16;
end;
{$NODEFINE TD3DXVector2_16F}
// Some pascal equalents of C++ class functions & operators
const D3DXVector2_16fZero: TD3DXVector2_16F = (x:(value:0); y:(value:0)); // (0,0)
function D3DXVector2_16F(_x, _y: TD3DXFloat16): TD3DXVector2_16F;
function D3DXVector2_16fEqual(const v1, v2: TD3DXVector2_16F): Boolean;
function D3DXVector2_16fFromVector2(const v: TD3DXVector2): TD3DXVector2_16f;
function D3DXVector2FromVector2_16f(const v: TD3DXVector2_16f): TD3DXVector2;
//--------------------------
// 3D Vector
//--------------------------
type
(*$HPPEMIT 'typedef D3DXVECTOR3 TD3DXVector3;' *)
(*$HPPEMIT 'typedef D3DXVECTOR3 *PD3DXVector3;' *)
PD3DXVector3 = ^TD3DXVector3;
{$EXTERNALSYM PD3DXVector3}
TD3DXVector3 = TD3DVector;
{$NODEFINE TD3DXVector3}
// Some pascal equalents of C++ class functions & operators
const D3DXVector3Zero: TD3DXVector3 = (x:0; y:0; z:0); // (0,0,0)
function D3DXVector3(_x, _y, _z: Single): TD3DXVector3;
function D3DXVector3Equal(const v1, v2: TD3DXVector3): Boolean;
//--------------------------
// 3D Vector (16 bit)
//--------------------------
type
(*$HPPEMIT 'typedef D3DXVECTOR3_16F TD3DXVector3_16F;' *)
(*$HPPEMIT 'typedef D3DXVECTOR3_16F *PD3DXVector3_16F;' *)
PD3DXVector3_16F = ^TD3DXVector3_16F;
{$EXTERNALSYM PD3DXVector3}
TD3DXVector3_16F = packed record
x, y, z: TD3DXFloat16;
end;
{$NODEFINE TD3DXVector3_16F}
// Some pascal equalents of C++ class functions & operators
const D3DXVector3_16fZero: TD3DXVector3_16F = (x:(value:0); y:(value:0); z:(value:0)); // (0,0,0)
function D3DXVector3_16F(_x, _y, _z: TD3DXFloat16): TD3DXVector3_16F;
function D3DXVector3_16fEqual(const v1, v2: TD3DXVector3_16F): Boolean;
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -