// H to Pas Converter Ver.0.17.0.20
//     Date : 6 6 1999
//   Source : d3dtypes.h

unit d3dtypes;

{$X+}{$Z4}

interface

uses Windows, ddraw;

(*==========================================================================;
 *
 *  Copyright (C) 1995-1998 Microsoft Corporation.  All Rights Reserved.
 *
 *  File:   d3dtypes.h
 *  Content:    Direct3D types include file
 *
 ***************************************************************************)



const
  DIRECT3D_VERSION	= $0700;



(* D3DVALUE is the fundamental Direct3D fractional data type *)

type
  D3DVALUE	= Single;
  LPD3DVALUE	= ^Single;

type
  D3DFIXED	= LongInt;


const
(*
 * Flags for Enumerate functions
 *)

(*
 * Stop the enumeration
 *)
  D3DENUMRET_CANCEL	= DDENUMRET_CANCEL;

(*
 * Continue the enumeration
 *)
  D3DENUMRET_OK	= DDENUMRET_OK;

type
  LPD3DVALIDATECALLBACK =   function (lpUserArg: Pointer; dwOffset: DWORD): HRESULT; stdcall;
  LPD3DENUMTEXTUREFORMATSCALLBACK =   function (lpDdsd: LPDDSURFACEDESC; lpContext: Pointer): HRESULT; stdcall;
  LPD3DENUMPIXELFORMATSCALLBACK =   function (lpDDPixFmt: LPDDPIXELFORMAT; lpContext: Pointer): HRESULT; stdcall;

  D3DCOLOR	= DWORD;
  LPD3DCOLOR	= ^DWORD;

  D3DMATERIALHANDLE	= DWORD;
  LPD3DMATERIALHANDLE	= ^DWORD;
  D3DTEXTUREHANDLE	= DWORD;
  LPD3DTEXTUREHANDLE	= ^DWORD;
  D3DMATRIXHANDLE	= DWORD;
  LPD3DMATRIXHANDLE	= ^DWORD;

  LPD3DCOLORVALUE	= ^D3DCOLORVALUE;
  D3DCOLORVALUE = record
	case Integer of
	0: (
	  r	: D3DVALUE;
	  g	: D3DVALUE;
	  b	: D3DVALUE;
	  a	: D3DVALUE;
	);
	1: (
	  dvR	: D3DVALUE;
	  dvG	: D3DVALUE;
	  dvB	: D3DVALUE;
	  dvA	: D3DVALUE;
	);
  end;

  LPD3DRECT	= ^D3DRECT;
  D3DRECT = record
	case Integer of
	0: (
	  x1	: LongInt;
	  y1	: LongInt;
	  x2	: LongInt;
	  y2	: LongInt;
	);
	1: (
	  lX1	: LongInt;
	  lY1	: LongInt;
	  lX2	: LongInt;
	  lY2	: LongInt;
	);
  end;

  LPD3DVECTOR	= ^D3DVECTOR;
  D3DVECTOR = record
	case Integer of
	0: (
	  x	: D3DVALUE;
	  y	: D3DVALUE;
	  z	: D3DVALUE;
	);
	1: (
	  dvX	: D3DVALUE;
	  dvY	: D3DVALUE;
	  dvZ	: D3DVALUE;
	);
  end;

(*
 * Vertex data types supported in an ExecuteBuffer.
 *)

(*
 * Homogeneous vertices
 *)

  LPD3DHVERTEX	= ^D3DHVERTEX;
  D3DHVERTEX = record
	dwFlags	: DWORD;	(* Homogeneous clipping flags *)
	case Integer of
	0: (
	  hx	: D3DVALUE;
	  hy	: D3DVALUE;
	  hz	: D3DVALUE;
	);
	1: (
	  dvHX	: D3DVALUE;
	  dvHY	: D3DVALUE;
	  dvHZ	: D3DVALUE;
	);
  end;

(*
 * Transformed/lit vertices
 *)
  LPD3DTLVERTEX	= ^D3DTLVERTEX;
  D3DTLVERTEX = record
// Error :  #if ( DIRECT3D_VERSION >= 0x0500 )
// Error :  #if ( defined __cplusplus ) && ( defined D3D_OVERLOADS )
// Error :  _D3DTLVERTEX ( ) (* { } *)
// Error :  _D3DTLVERTEX ( const D3DVECTOR & v , Single _rhw , D3DCOLOR _color , D3DCOLOR _specular , Single _tu , Single _tv )
	(* { sx = v.x ; sy = v.y ; sz = v.z ; rhw = _rhw ;
          color = _color; specular = _specular;
          tu = _tu; tv = _tv;
        } *)
	case Integer of
	0: (
	  sx	: D3DVALUE;
	  sy	: D3DVALUE;
	  sz	: D3DVALUE;
	  rhw	: D3DVALUE;
	  color	: D3DCOLOR;
	  specular	: D3DCOLOR;
	  tu	: D3DVALUE;
	  tv	: D3DVALUE;
	);
	1: (
	  dvSX	: D3DVALUE;
	  dvSY	: D3DVALUE;
	  dvSZ	: D3DVALUE;
	  dvRHW	: D3DVALUE;
	  dcColor	: D3DCOLOR;
	  dcSpecular	: D3DCOLOR;
	  dvTU	: D3DVALUE;
	  dvTV	: D3DVALUE;
	);
  end;

(*
 * Untransformed/lit vertices
 *)
  LPD3DLVERTEX	= ^D3DLVERTEX;
  D3DLVERTEX = record
// Error :  #if ( DIRECT3D_VERSION >= 0x0500 )
// Error :  #if ( defined __cplusplus ) && ( defined D3D_OVERLOADS )
// Error :  _D3DLVERTEX ( ) (* { } *)
// Error :  _D3DLVERTEX ( const D3DVECTOR & v , D3DCOLOR _color , D3DCOLOR _specular , Single _tu , Single _tv )
	(* { x = v.x ; y = v.y ; z = v.z ; dwReserved = 0 ;
          color = _color; specular = _specular;
          tu = _tu; tv = _tv;
        } *)
//{$ENDIF}
//{$ENDIF}(* DIRECT3D_VERSION >= 0x0500 *)
	case Integer of
	0: (
	  x	: D3DVALUE;
	  y	: D3DVALUE;
	  z	: D3DVALUE;
	  dwReserved	: DWORD;
	  color	: D3DCOLOR;
	  specular	: D3DCOLOR;
	  tu	: D3DVALUE;
	  tv	: D3DVALUE;
	);
	1: (
	  dvX	: D3DVALUE;
	  dvY	: D3DVALUE;
	  dvZ	: D3DVALUE;
	  Unknown1_4:  DWORD;
	  dcColor	: D3DCOLOR;
	  dcSpecular	: D3DCOLOR;
	  dvTU	: D3DVALUE;
	  dvTV	: D3DVALUE;
	);
  end;

(*
 * Untransformed/unlit vertices
 *)

  LPD3DVERTEX	= ^D3DVERTEX;
  D3DVERTEX = record
// Error :  #if ( DIRECT3D_VERSION >= 0x0500 )
// Error :  #if ( defined __cplusplus ) && ( defined D3D_OVERLOADS )
// Error :  _D3DVERTEX ( ) (* { } *)
// Error :  _D3DVERTEX ( const D3DVECTOR & v , const D3DVECTOR & n , Single _tu , Single _tv )
	(* { x = v.x ; y = v.y ; z = v.z ;
          nx = n.x; ny = n.y; nz = n.z;
          tu = _tu; tv = _tv;
        } *)
//{$ENDIF}
//{$ENDIF}(* DIRECT3D_VERSION >= 0x0500 *)
	case Integer of
	0: (
	  x	: D3DVALUE;
	  y	: D3DVALUE;
	  z	: D3DVALUE;
	  nx	: D3DVALUE;
	  ny	: D3DVALUE;
	  nz	: D3DVALUE;
	  tu	: D3DVALUE;
	  tv	: D3DVALUE;
	);
	1: (
	  dvX	: D3DVALUE;
	  dvY	: D3DVALUE;
	  dvZ	: D3DVALUE;
	  dvNX	: D3DVALUE;
	  dvNY	: D3DVALUE;
	  dvNZ	: D3DVALUE;
	  dvTU	: D3DVALUE;
	  dvTV	: D3DVALUE;
	);
  end;


(*
 * Matrix, viewport, and tranformation structures and definitions.
 *)

  LPD3DMATRIX	= ^D3DMATRIX;


  D3DMATRIX = record
// Error :  #if ( DIRECT3D_VERSION >= 0x0500 )
// Error :  #if ( defined __cplusplus ) && ( defined D3D_OVERLOADS )
// Error :  struct {
//{$ENDIF}

//{$ENDIF}(* DIRECT3D_VERSION >= 0x0500 *)
// Error :  D3DVALUE _11 , _12 , _13 , _14 ;
// Error :  D3DVALUE _21 , _22 , _23 , _24 ;
// Error :  D3DVALUE _31 , _32 , _33 , _34 ;
// Error :  D3DVALUE _41 , _42 , _43 , _44 ;

// Error :  #if ( DIRECT3D_VERSION >= 0x0500 )
// Error :  #if ( defined __cplusplus ) && ( defined D3D_OVERLOADS )
// Error :  } ;
// Error :  _D3DMATRIX ( ) (* { } *)
// Error :  _D3DMATRIX ( D3DVALUE _m00 , D3DVALUE _m01 , D3DVALUE _m02 , D3DVALUE _m03 , D3DVALUE _m10 , D3DVALUE _m11 , D3DVALUE _m12 , D3DVALUE _m13 , D3DVALUE _m20 , D3DVALUE _m21 , D3DVALUE _m22 , D3DVALUE _m23 , D3DVALUE _m30 , D3DVALUE _m31 , D3DVALUE _m32 , D3DVALUE _m33 )
	(* {
                m[0][0] = _m00; m[0][1] = _m01; m[0][2] = _m02; m[0][3] = _m03;
                m[1][0] = _m10; m[1][1] = _m11; m[1][2] = _m12; m[1][3] = _m13;
                m[2][0] = _m20; m[2][1] = _m21; m[2][2] = _m22; m[2][3] = _m23;
                m[3][0] = _m30; m[3][1] = _m31; m[3][2] = _m32; m[3][3] = _m33;
        } *)

// Error :  D3DVALUE & operator ( ) ( Integer iRow , Integer iColumn ) (* { return m[iRow][iColumn] ; } *)
// Error :  const D3DVALUE & operator ( ) ( Integer iRow , Integer iColumn ) const (* { return m[iRow][iColumn] ; } *)
// Error :  #if ( DIRECT3D_VERSION >= 0x0600 )
// Error :  friend _D3DMATRIX operator* ( const _D3DMATRIX & , const _D3DMATRIX & ) ;
//{$ENDIF}(* DIRECT3D_VERSION >= 0x0600 *)
//{$ENDIF}
//{$ENDIF}(* DIRECT3D_VERSION >= 0x0500 *)
	  case Integer of
      1: (_11,_12,_13,_14, _21,_22,_23,_24, _31,_32,_33,_34, _41,_42,_43,_44: D3DVALUE);
      2: (_m00,_m01,_m02,_m03, _m10,_m11,_m12,_m13, _m20,_m21,_m22,_m23, _m30,_m31,_m32,_m33: D3DVALUE);
  end;

// Error :  #if ( defined __cplusplus ) && ( defined D3D_OVERLOADS )
// Error :  #include " d3dvec.inl "
//{$ENDIF}

  LPD3DVIEWPORT	= ^D3DVIEWPORT;
  D3DVIEWPORT = record
	dwSize	: DWORD;
	dwX	: DWORD;
	dwY	: DWORD;	(* Top left *)
	dwWidth	: DWORD;
	dwHeight	: DWORD;	(* Dimensions *)
	dvScaleX	: D3DVALUE;	(* Scale homogeneous to screen *)
	dvScaleY	: D3DVALUE;	(* Scale homogeneous to screen *)
	dvMaxX	: D3DVALUE;	(* Min/max homogeneous x coord *)
	dvMaxY	: D3DVALUE;	(* Min/max homogeneous y coord *)
	dvMinZ	: D3DVALUE;
	dvMaxZ	: D3DVALUE;	(* Min/max homogeneous z coord *)
  end;

// Error :  #if ( DIRECT3D_VERSION >= 0x0500 )
  LPD3DVIEWPORT2	= ^D3DVIEWPORT2;
  D3DVIEWPORT2 = record
	dwSize	: DWORD;
	dwX	: DWORD;
	dwY	: DWORD;	(* Viewport Top left *)
	dwWidth	: DWORD;
	dwHeight	: DWORD;	(* Viewport Dimensions *)
	dvClipX	: D3DVALUE;	(* Top left of clip volume *)
	dvClipY	: D3DVALUE;
	dvClipWidth	: D3DVALUE;	(* Clip Volume Dimensions *)
	dvClipHeight	: D3DVALUE;
	dvMinZ	: D3DVALUE;	(* Min/max of clip Volume *)
	dvMaxZ	: D3DVALUE;
  end;
//{$ENDIF}(* DIRECT3D_VERSION >= 0x0500 *)

// Error :  #if ( DIRECT3D_VERSION >= 0x0700 )
  LPD3DVIEWPORT7	= ^D3DVIEWPORT7;
  D3DVIEWPORT7 = record
	dwX	: DWORD;
	dwY	: DWORD;	(* Viewport Top left *)
	dwWidth	: DWORD;
	dwHeight	: DWORD;	(* Viewport Dimensions *)
	dvMinZ	: D3DVALUE;	(* Min/max of clip Volume *)
	dvMaxZ	: D3DVALUE;
  end;
//{$ENDIF}(* DIRECT3D_VERSION >= 0x0700 *)

(*
 * Values for clip fields.
 *)

// Error :  #if ( DIRECT3D_VERSION >= 0x0700 )

// Max number of user clipping planes, supported in D3D.
const
  D3DMAXUSERCLIPPLANES	= 32;

// These bits could be ORed together to use with D3DRENDERSTATE_CLIPPLANEENABLE
//
  D3DCLIPPLANE0	= $00000001;
  D3DCLIPPLANE1	= $00000002;
  D3DCLIPPLANE2	= $00000004;
  D3DCLIPPLANE3	= $00000008;
  D3DCLIPPLANE4	= $00000010;
  D3DCLIPPLANE5	= $00000020;

//{$ENDIF}(* DIRECT3D_VERSION >= 0x0700 *)

  D3DCLIP_LEFT	= $00000001;
  D3DCLIP_RIGHT	= $00000002;
  D3DCLIP_TOP	= $00000004;
  D3DCLIP_BOTTOM	= $00000008;
  D3DCLIP_FRONT	= $00000010;
  D3DCLIP_BACK	= $00000020;
  D3DCLIP_GEN0	= $00000040;
  D3DCLIP_GEN1	= $00000080;
  D3DCLIP_GEN2	= $00000100;
  D3DCLIP_GEN3	= $00000200;
  D3DCLIP_GEN4	= $00000400;
  D3DCLIP_GEN5	= $00000800;

(*
 * Values for d3d status.
 *)
  D3DSTATUS_CLIPUNIONLEFT	= D3DCLIP_LEFT;
  D3DSTATUS_CLIPUNIONRIGHT	= D3DCLIP_RIGHT;
  D3DSTATUS_CLIPUNIONTOP	= D3DCLIP_TOP;
  D3DSTATUS_CLIPUNIONBOTTOM	= D3DCLIP_BOTTOM;
  D3DSTATUS_CLIPUNIONFRONT	= D3DCLIP_FRONT;
  D3DSTATUS_CLIPUNIONBACK	= D3DCLIP_BACK;
  D3DSTATUS_CLIPUNIONGEN0	= D3DCLIP_GEN0;
  D3DSTATUS_CLIPUNIONGEN1	= D3DCLIP_GEN1;
  D3DSTATUS_CLIPUNIONGEN2	= D3DCLIP_GEN2;
  D3DSTATUS_CLIPUNIONGEN3	= D3DCLIP_GEN3;
  D3DSTATUS_CLIPUNIONGEN4	= D3DCLIP_GEN4;
  D3DSTATUS_CLIPUNIONGEN5	= D3DCLIP_GEN5;

  D3DSTATUS_CLIPINTERSECTIONLEFT	= $00001000;
  D3DSTATUS_CLIPINTERSECTIONRIGHT	= $00002000;
  D3DSTATUS_CLIPINTERSECTIONTOP	= $00004000;
  D3DSTATUS_CLIPINTERSECTIONBOTTOM	= $00008000;
  D3DSTATUS_CLIPINTERSECTIONFRONT	= $00010000;
  D3DSTATUS_CLIPINTERSECTIONBACK	= $00020000;
  D3DSTATUS_CLIPINTERSECTIONGEN0	= $00040000;
  D3DSTATUS_CLIPINTERSECTIONGEN1	= $00080000;
  D3DSTATUS_CLIPINTERSECTIONGEN2	= $00100000;
  D3DSTATUS_CLIPINTERSECTIONGEN3	= $00200000;
  D3DSTATUS_CLIPINTERSECTIONGEN4	= $00400000;
  D3DSTATUS_CLIPINTERSECTIONGEN5	= $00800000;
  D3DSTATUS_ZNOTVISIBLE	= $01000000;
(* Do not use 0x80000000 for any status flags in future as it is reserved *)

  D3DSTATUS_CLIPUNIONALL	= ( D3DSTATUS_CLIPUNIONLEFT or D3DSTATUS_CLIPUNIONRIGHT or
         D3DSTATUS_CLIPUNIONTOP or D3DSTATUS_CLIPUNIONBOTTOM or D3DSTATUS_CLIPUNIONFRONT or
         D3DSTATUS_CLIPUNIONBACK or D3DSTATUS_CLIPUNIONGEN0 or D3DSTATUS_CLIPUNIONGEN1 or
         D3DSTATUS_CLIPUNIONGEN2 or D3DSTATUS_CLIPUNIONGEN3 or D3DSTATUS_CLIPUNIONGEN4 or
         D3DSTATUS_CLIPUNIONGEN5 );

  D3DSTATUS_CLIPINTERSECTIONALL	= ( D3DSTATUS_CLIPINTERSECTIONLEFT or D3DSTATUS_CLIPINTERSECTIONRIGHT or
         D3DSTATUS_CLIPINTERSECTIONTOP or D3DSTATUS_CLIPINTERSECTIONBOTTOM or D3DSTATUS_CLIPINTERSECTIONFRONT or
         D3DSTATUS_CLIPINTERSECTIONBACK or D3DSTATUS_CLIPINTERSECTIONGEN0 or D3DSTATUS_CLIPINTERSECTIONGEN1 or
         D3DSTATUS_CLIPINTERSECTIONGEN2 or D3DSTATUS_CLIPINTERSECTIONGEN3 or D3DSTATUS_CLIPINTERSECTIONGEN4 or
         D3DSTATUS_CLIPINTERSECTIONGEN5 );

  D3DSTATUS_DEFAULT	= ( D3DSTATUS_CLIPINTERSECTIONALL or D3DSTATUS_ZNOTVISIBLE );


(*
 * Options for direct transform calls
 *)
  D3DTRANSFORM_CLIPPED	= $00000001;
  D3DTRANSFORM_UNCLIPPED	= $00000002;

type
  LPD3DTRANSFORMDATA	= ^D3DTRANSFORMDATA;
  D3DTRANSFORMDATA = record
	dwSize	: DWORD;
	lpIn	: Pointer;	(* Input vertices *)
	dwInSize	: DWORD;	(* Stride of input vertices *)
	lpOut	: Pointer;	(* Output vertices *)
	dwOutSize	: DWORD;	(* Stride of output vertices *)
	lpHOut	: LPD3DHVERTEX;	(* Output homogeneous vertices *)
	dwClip	: DWORD;	(* Clipping hint *)
	dwClipIntersection	: DWORD;
	dwClipUnion	: DWORD;	(* Union of all clip flags *)
	drExtent	: D3DRECT;	(* Extent of transformed vertices *)
  end;

(*
 * Structure defining position and direction properties for lighting.
 *)
  LPD3DLIGHTINGELEMENT	= ^D3DLIGHTINGELEMENT;
  D3DLIGHTINGELEMENT = record
	dvPosition	: D3DVECTOR;	(* Lightable point in model space *)
	dvNormal	: D3DVECTOR;	(* Normalised unit vector *)
  end;

(*
 * Structure defining material properties for lighting.
 *)
  LPD3DMATERIAL	= ^D3DMATERIAL;
  D3DMATERIAL = record
	dwSize	: DWORD;
	case Integer of
	0: (
	  diffuse	: D3DCOLORVALUE;
	  ambient	: D3DCOLORVALUE;
	  specular	: D3DCOLORVALUE;
	  emissive	: D3DCOLORVALUE;
	  power	: D3DVALUE;
	  hTexture	: D3DTEXTUREHANDLE;
	  dwRampSize	: DWORD;
	);
	1: (
	  dcvDiffuse	: D3DCOLORVALUE;
	  dcvAmbient	: D3DCOLORVALUE;
	  dcvSpecular	: D3DCOLORVALUE;
	  dcvEmissive	: D3DCOLORVALUE;
	  dvPower	: D3DVALUE;
	);
  end;

// Error :  #if ( DIRECT3D_VERSION >= 0x0700 )

  LPD3DMATERIAL7	= ^D3DMATERIAL7;
  D3DMATERIAL7 = record
	case Integer of
	0: (
	  diffuse	: D3DCOLORVALUE;
	  ambient	: D3DCOLORVALUE;
	  specular	: D3DCOLORVALUE;
	  emissive	: D3DCOLORVALUE;
	  power	: D3DVALUE;
	);
	1: (
	  dcvDiffuse	: D3DCOLORVALUE;
	  dcvAmbient	: D3DCOLORVALUE;
	  dcvSpecular	: D3DCOLORVALUE;
	  dcvEmissive	: D3DCOLORVALUE;
	  dvPower	: D3DVALUE;
	);
  end;

//{$ENDIF}(* DIRECT3D_VERSION >= 0x0700 *)

// Note: The following light type (D3DLIGHT_PARALLELPOINT)
// is no longer supported from D3D for DX7 onwards.
// Error :  #if ( DIRECT3D_VERSION < 0x0500 ) // For backward compatible headers
//{$ENDIF}
  D3DLIGHTTYPE = (
	D3DLIGHTTYPE_Unknown0,
	D3DLIGHT_POINT,
	D3DLIGHT_SPOT,
	D3DLIGHT_DIRECTIONAL,
	D3DLIGHT_PARALLELPOINT,
	D3DLIGHT_GLSPOT
	// Error : D3DLIGHT_FORCE_DWORD = 0x7fffffff
  );

(*
 * Structure defining a light source and its properties.
 *)
  LPD3DLIGHT	= ^D3DLIGHT;
  D3DLIGHT = record
	dwSize	: DWORD;
	dltType	: D3DLIGHTTYPE;	(* Type of light source *)
	dcvColor	: D3DCOLORVALUE;	(* Color of light *)
	dvPosition	: D3DVECTOR;	(* Position in world space *)
	dvDirection	: D3DVECTOR;	(* Direction in world space *)
	dvRange	: D3DVALUE;	(* Cutoff range *)
	dvFalloff	: D3DVALUE;	(* Falloff *)
	dvAttenuation0	: D3DVALUE;	(* Constant attenuation *)
	dvAttenuation1	: D3DVALUE;	(* Linear attenuation *)
	dvAttenuation2	: D3DVALUE;	(* Quadratic attenuation *)
	dvTheta	: D3DVALUE;	(* Inner angle of spotlight cone *)
	dvPhi	: D3DVALUE;	(* Outer angle of spotlight cone *)
  end;

// Error :  #if ( DIRECT3D_VERSION >= 0x0700 )

  LPD3DLIGHT7	= ^D3DLIGHT7;
  D3DLIGHT7 = record
	dltType	: D3DLIGHTTYPE;	(* Type of light source *)
	dcvDiffuse	: D3DCOLORVALUE;	(* Diffuse color of light *)
	dcvSpecular	: D3DCOLORVALUE;	(* Specular color of light *)
	dcvAmbient	: D3DCOLORVALUE;	(* Ambient color of light *)
	dvPosition	: D3DVECTOR;	(* Position in world space *)
	dvDirection	: D3DVECTOR;	(* Direction in world space *)
	dvRange	: D3DVALUE;	(* Cutoff range *)
	dvFalloff	: D3DVALUE;	(* Falloff *)
	dvAttenuation0	: D3DVALUE;	(* Constant attenuation *)
	dvAttenuation1	: D3DVALUE;	(* Linear attenuation *)
	dvAttenuation2	: D3DVALUE;	(* Quadratic attenuation *)
	dvTheta	: D3DVALUE;	(* Inner angle of spotlight cone *)
	dvPhi	: D3DVALUE;	(* Outer angle of spotlight cone *)
  end;

//{$ENDIF}(* DIRECT3D_VERSION >= 0x0700 *)

// Error :  #if ( DIRECT3D_VERSION >= 0x0500 )
(*
 * Structure defining a light source and its properties.
 *)

(* flags bits *)
const
  D3DLIGHT_ACTIVE	= $00000001;
  D3DLIGHT_NO_SPECULAR	= $00000002;
  D3DLIGHT_ALL	= ( D3DLIGHT_ACTIVE or D3DLIGHT_NO_SPECULAR );

(* maximum valid light range *)
// Error :  #define D3DLIGHT_RANGE_MAX ( ( Single ) sqrt ( FLT_MAX ) )

type
  LPD3DLIGHT2	= ^D3DLIGHT2;
  D3DLIGHT2 = record
	dwSize	: DWORD;
	dltType	: D3DLIGHTTYPE;	(* Type of light source *)
	dcvColor	: D3DCOLORVALUE;	(* Color of light *)
	dvPosition	: D3DVECTOR;	(* Position in world space *)
	dvDirection	: D3DVECTOR;	(* Direction in world space *)
	dvRange	: D3DVALUE;	(* Cutoff range *)
	dvFalloff	: D3DVALUE;	(* Falloff *)
	dvAttenuation0	: D3DVALUE;	(* Constant attenuation *)
	dvAttenuation1	: D3DVALUE;	(* Linear attenuation *)
	dvAttenuation2	: D3DVALUE;	(* Quadratic attenuation *)
	dvTheta	: D3DVALUE;	(* Inner angle of spotlight cone *)
	dvPhi	: D3DVALUE;	(* Outer angle of spotlight cone *)
	dwFlags	: DWORD;
  end;

//{$ENDIF}(* DIRECT3D_VERSION >= 0x0500 *)
  LPD3DLIGHTDATA	= ^D3DLIGHTDATA;
  D3DLIGHTDATA = record
	dwSize	: DWORD;
	lpIn	: LPD3DLIGHTINGELEMENT;	(* Input positions and normals *)
	dwInSize	: DWORD;	(* Stride of input elements *)
	lpOut	: LPD3DTLVERTEX;	(* Output colors *)
	dwOutSize	: DWORD;	(* Stride of output colors *)
  end;

// Error :  #if ( DIRECT3D_VERSION >= 0x0500 )
(*
 * Before DX5, these values were in an enum called
 * D3DCOLORMODEL. This was not correct, since they are
 * bit flags. A driver can surface either or both flags
 * in the dcmColorModel member of D3DDEVICEDESC.
 *)
const
  D3DCOLOR_MONO	= 1;
  D3DCOLOR_RGB	= 2;

type
  D3DCOLORMODEL	= DWORD;
//{$ENDIF}(* DIRECT3D_VERSION >= 0x0500 *)

(*
 * Options for clearing
 *)
const
  D3DCLEAR_TARGET	= $00000001;	(* Clear target surface *)
  D3DCLEAR_ZBUFFER	= $00000002;	(* Clear target z buffer *)
// Error :  #if ( DIRECT3D_VERSION >= 0x0600 )
  D3DCLEAR_STENCIL	= $00000004;	(* Clear stencil planes *)
//{$ENDIF}(* DIRECT3D_VERSION >= 0x0600 *)

(*
 * Execute buffers are allocated via Direct3D.  These buffers may then
 * be filled by the application with instructions to execute along with
 * vertex data.
 *)

(*
 * Supported op codes for execute instructions.
 *)
type
// Error :  #if ( DIRECT3D_VERSION >= 0x0500 )
//{$ENDIF}(* DIRECT3D_VERSION >= 0x0500 *)
  D3DOPCODE = (
	D3DOPCODE_Unknown0,
	D3DOP_POINT,
	D3DOP_LINE,
	D3DOP_TRIANGLE,
	D3DOP_MATRIXLOAD,
	D3DOP_MATRIXMULTIPLY,
	D3DOP_STATETRANSFORM,
	D3DOP_STATELIGHT,
	D3DOP_STATERENDER,
	D3DOP_PROCESSVERTICES,
	D3DOP_TEXTURELOAD,
	D3DOP_EXIT,
	D3DOP_BRANCHFORWARD,
	D3DOP_SPAN,
	D3DOP_SETSTATUS
	// Error : D3DOP_FORCE_DWORD = 0x7fffffff
  );

  LPD3DINSTRUCTION	= ^D3DINSTRUCTION;
  D3DINSTRUCTION = record
	bOpcode	: BYTE;	(* Instruction opcode *)
	bSize	: BYTE;	(* Size of each instruction data unit *)
	wCount	: WORD;	(* Count of instruction data units to follow *)
  end;

(*
 * Structure for texture loads
 *)
  LPD3DTEXTURELOAD	= ^D3DTEXTURELOAD;
  D3DTEXTURELOAD = record
	hDestTexture	: D3DTEXTUREHANDLE;
	hSrcTexture	: D3DTEXTUREHANDLE;
  end;

(*
 * Structure for picking
 *)
  LPD3DPICKRECORD	= ^D3DPICKRECORD;
  D3DPICKRECORD = record
	bOpcode	: BYTE;
	bPad	: BYTE;
	dwOffset	: DWORD;
	dvZ	: D3DVALUE;
  end;

(*
 * The following defines the rendering states which can be set in the
 * execute buffer.
 *)

// Error :  #if ( DIRECT3D_VERSION >= 0x0500 )
//{$ENDIF}(* DIRECT3D_VERSION >= 0x0500 *)
  D3DSHADEMODE = (
	D3DSHADEMODE_Unknown0,
	D3DSHADE_FLAT,
	D3DSHADE_GOURAUD,
	D3DSHADE_PHONG
	// Error : D3DSHADE_FORCE_DWORD = 0x7fffffff
  );

// Error :  #if ( DIRECT3D_VERSION >= 0x0500 )
//{$ENDIF}(* DIRECT3D_VERSION >= 0x0500 *)
  D3DFILLMODE = (
	D3DFILLMODE_Unknown0,
	D3DFILL_POINT,
	D3DFILL_WIREFRAME,
	D3DFILL_SOLID
	// Error : D3DFILL_FORCE_DWORD = 0x7fffffff
  );

  D3DLINEPATTERN = record
	wRepeatFactor	: WORD;
	wLinePattern	: WORD;
  end;

// Error :  #if ( DIRECT3D_VERSION >= 0x0500 )
//{$ENDIF}(* DIRECT3D_VERSION >= 0x0500 *)
  D3DTEXTUREFILTER = (
	D3DTEXTUREFILTER_Unknown0,
	D3DFILTER_NEAREST,
	D3DFILTER_LINEAR,
	D3DFILTER_MIPNEAREST,
	D3DFILTER_MIPLINEAR,
	D3DFILTER_LINEARMIPNEAREST,
	D3DFILTER_LINEARMIPLINEAR
	// Error : D3DFILTER_FORCE_DWORD = 0x7fffffff
  );

// Error :  #if ( DIRECT3D_VERSION >= 0x0500 )
//{$ENDIF}(* DIRECT3D_VERSION >= 0x0500 *)
  D3DBLEND = (
	D3DBLEND_Unknown0,
	D3DBLEND_ZERO,
	D3DBLEND_ONE,
	D3DBLEND_SRCCOLOR,
	D3DBLEND_INVSRCCOLOR,
	D3DBLEND_SRCALPHA,
	D3DBLEND_INVSRCALPHA,
	D3DBLEND_DESTALPHA,
	D3DBLEND_INVDESTALPHA,
	D3DBLEND_DESTCOLOR,
	D3DBLEND_INVDESTCOLOR,
	D3DBLEND_SRCALPHASAT,
	D3DBLEND_BOTHSRCALPHA,
	D3DBLEND_BOTHINVSRCALPHA
	// Error : D3DBLEND_FORCE_DWORD = 0x7fffffff
  );

// Error :  #if ( DIRECT3D_VERSION >= 0x0500 )
//{$ENDIF}(* DIRECT3D_VERSION >= 0x0500 *)
  D3DTEXTUREBLEND = (
	D3DTEXTUREBLEND_Unknown0,
	D3DTBLEND_DECAL,
	D3DTBLEND_MODULATE,
	D3DTBLEND_DECALALPHA,
	D3DTBLEND_MODULATEALPHA,
	D3DTBLEND_DECALMASK,
	D3DTBLEND_MODULATEMASK,
	D3DTBLEND_COPY,
	D3DTBLEND_ADD
	// Error : D3DTBLEND_FORCE_DWORD = 0x7fffffff
  );

// Error :  #if ( DIRECT3D_VERSION >= 0x0500 )
//{$ENDIF}(* DIRECT3D_VERSION >= 0x0500 *)
  D3DTEXTUREADDRESS = (
	D3DTEXTUREADDRESS_Unknown0,
	D3DTADDRESS_WRAP,
	D3DTADDRESS_MIRROR,
	D3DTADDRESS_CLAMP,
	D3DTADDRESS_BORDER
	// Error : D3DTADDRESS_FORCE_DWORD = 0x7fffffff
  );

// Error :  #if ( DIRECT3D_VERSION >= 0x0500 )
//{$ENDIF}(* DIRECT3D_VERSION >= 0x0500 *)
  D3DCULL = (
	D3DCULL_Unknown0,
	D3DCULL_NONE,
	D3DCULL_CW,
	D3DCULL_CCW
	// Error : D3DCULL_FORCE_DWORD = 0x7fffffff
  );

// Error :  #if ( DIRECT3D_VERSION >= 0x0500 )
//{$ENDIF}(* DIRECT3D_VERSION >= 0x0500 *)
  D3DCMPFUNC = (
	D3DCMPFUNC_Unknown0,
	D3DCMP_NEVER,
	D3DCMP_LESS,
	D3DCMP_EQUAL,
	D3DCMP_LESSEQUAL,
	D3DCMP_GREATER,
	D3DCMP_NOTEQUAL,
	D3DCMP_GREATEREQUAL,
	D3DCMP_ALWAYS
	// Error : D3DCMP_FORCE_DWORD = 0x7fffffff
  );

// Error :  #if ( DIRECT3D_VERSION >= 0x0600 )
  D3DSTENCILOP = (
	D3DSTENCILOP_Unknown0,
	D3DSTENCILOP_KEEP,
	D3DSTENCILOP_ZERO,
	D3DSTENCILOP_REPLACE,
	D3DSTENCILOP_INCRSAT,
	D3DSTENCILOP_DECRSAT,
	D3DSTENCILOP_INVERT,
	D3DSTENCILOP_INCR,
	D3DSTENCILOP_DECR
	// Error : D3DSTENCILOP_FORCE_DWORD = 0x7fffffff
  );
//{$ENDIF}(* DIRECT3D_VERSION >= 0x0600 *)

// Error :  #if ( DIRECT3D_VERSION >= 0x0500 )
//{$ENDIF}(* DIRECT3D_VERSION >= 0x0500 *)
  D3DFOGMODE = (
	D3DFOG_NONE,
	D3DFOG_EXP,
	D3DFOG_EXP2,
	D3DFOG_LINEAR
	// Error : D3DFOG_FORCE_DWORD = 0x7fffffff
  );

// Error :  #if ( DIRECT3D_VERSION >= 0x0600 )
  D3DZBUFFERTYPE = (
	D3DZB_FALSE,
	D3DZB_TRUE,
	D3DZB_USEW
	// Error : D3DZB_FORCE_DWORD = 0x7fffffff
  );
//{$ENDIF}(* DIRECT3D_VERSION >= 0x0600 *)

// Error :  #if ( DIRECT3D_VERSION >= 0x0500 )
  D3DANTIALIASMODE = (
	D3DANTIALIAS_NONE,
	D3DANTIALIAS_SORTDEPENDENT,
	D3DANTIALIAS_SORTINDEPENDENT
	// Error : D3DANTIALIAS_FORCE_DWORD = 0x7fffffff
  );

// Vertex types supported by Direct3D
  D3DVERTEXTYPE = (
	D3DVERTEXTYPE_Unknown0,
	D3DVT_VERTEX,
	D3DVT_LVERTEX,
	D3DVT_TLVERTEX
	// Error : D3DVT_FORCE_DWORD = 0x7fffffff
  );

// Primitives supported by draw-primitive API
  D3DPRIMITIVETYPE = (
	D3DPRIMITIVETYPE_Unknown0,
	D3DPT_POINTLIST,
	D3DPT_LINELIST,
	D3DPT_LINESTRIP,
	D3DPT_TRIANGLELIST,
	D3DPT_TRIANGLESTRIP,
	D3DPT_TRIANGLEFAN
	// Error : D3DPT_FORCE_DWORD = 0x7fffffff
  );

//{$ENDIF}(* DIRECT3D_VERSION >= 0x0500 *)
(*
 * Amount to add to a state to generate the override for that state.
 *)
const
  D3DSTATE_OVERRIDE_BIAS	= 256;

(*
 * A state which sets the override flag for the specified state type.
 *)
// Error :  #define D3DSTATE_OVERRIDE ( type ) ( D3DRENDERSTATETYPE ) ( ( ( DWORD ) ( type ) + D3DSTATE_OVERRIDE_BIAS ) )

type
// Error :  #if ( DIRECT3D_VERSION >= 0x0700 )
//{$ENDIF}(* DIRECT3D_VERSION >= 0x0700 *)
// Error :  #if ( DIRECT3D_VERSION >= 0x0500 )
//{$ENDIF}(* DIRECT3D_VERSION >= 0x0500 *)
  D3DTRANSFORMSTATETYPE = (
	D3DTRANSFORMSTATETYPE_Unknown0,
	D3DTRANSFORMSTATE_WORLD,
	D3DTRANSFORMSTATE_VIEW,
	D3DTRANSFORMSTATE_PROJECTION,
	D3DTRANSFORMSTATE_WORLD1,
	D3DTRANSFORMSTATE_WORLD2,
	D3DTRANSFORMSTATE_WORLD3,
	D3DTRANSFORMSTATETYPE_Unknown7,
	D3DTRANSFORMSTATETYPE_Unknown8,
	D3DTRANSFORMSTATETYPE_Unknown9,
	D3DTRANSFORMSTATETYPE_Unknown10,
	D3DTRANSFORMSTATETYPE_Unknown11,
	D3DTRANSFORMSTATETYPE_Unknown12,
	D3DTRANSFORMSTATETYPE_Unknown13,
	D3DTRANSFORMSTATETYPE_Unknown14,
	D3DTRANSFORMSTATETYPE_Unknown15,
	D3DTRANSFORMSTATE_TEXTURE0,
	D3DTRANSFORMSTATE_TEXTURE1,
	D3DTRANSFORMSTATE_TEXTURE2,
	D3DTRANSFORMSTATE_TEXTURE3,
	D3DTRANSFORMSTATE_TEXTURE4,
	D3DTRANSFORMSTATE_TEXTURE5,
	D3DTRANSFORMSTATE_TEXTURE6,
	D3DTRANSFORMSTATE_TEXTURE7
	// Error : D3DTRANSFORMSTATE_FORCE_DWORD = 0x7fffffff
  );

// Error :  #if ( DIRECT3D_VERSION >= 0x0600 )
//{$ENDIF}(* DIRECT3D_VERSION >= 0x0600 *)
// Error :  #if ( DIRECT3D_VERSION >= 0x0500 )
//{$ENDIF}(* DIRECT3D_VERSION >= 0x0500 *)
  D3DLIGHTSTATETYPE = (
	D3DLIGHTSTATETYPE_Unknown0,
	D3DLIGHTSTATE_MATERIAL,
	D3DLIGHTSTATE_AMBIENT,
	D3DLIGHTSTATE_COLORMODEL,
	D3DLIGHTSTATE_FOGMODE,
	D3DLIGHTSTATE_FOGSTART,
	D3DLIGHTSTATE_FOGEND,
	D3DLIGHTSTATE_FOGDENSITY,
	D3DLIGHTSTATE_COLORVERTEX
	// Error : D3DLIGHTSTATE_FORCE_DWORD = 0x7fffffff
  );

// Error :  #if ( DIRECT3D_VERSION >= 0x0500 )
//{$ENDIF}(* DIRECT3D_VERSION >= 0x0500 *)
// Error :  #if ( DIRECT3D_VERSION >= 0x0700 )
// Error :  D3DRENDERSTATE_FOGSTART = 36 , (* Fog start (for both vertex and pixel fog) *)
// Error :   function #if( >= 0x0500 )
const
    D3DRENDERSTATE_TEXTUREHANDLE      = 1;    // Texture handle for legacy interfaces (Texture;Texture2) */
    D3DRENDERSTATE_ANTIALIAS          = 2;    // D3DANTIALIASMODE */
    D3DRENDERSTATE_TEXTUREADDRESS     = 3;    // D3DTEXTUREADDRESS  */
    D3DRENDERSTATE_TEXTUREPERSPECTIVE = 4;    // TRUE for perspective correction */
    D3DRENDERSTATE_WRAPU          = 5;    // TRUE for wrapping in u */
    D3DRENDERSTATE_WRAPV          = 6;    // TRUE for wrapping in v */
    D3DRENDERSTATE_ZENABLE            = 7;    // D3DZBUFFERTYPE (or TRUE/FALSE for legacy) */
    D3DRENDERSTATE_FILLMODE           = 8;    // D3DFILL_MODE        */
    D3DRENDERSTATE_SHADEMODE          = 9;    // D3DSHADEMODE */
    D3DRENDERSTATE_LINEPATTERN        = 10;   // D3DLINEPATTERN */
    D3DRENDERSTATE_MONOENABLE         = 11;   // TRUE to enable mono rasterization */
    D3DRENDERSTATE_ROP2               = 12;   // ROP2 */
    D3DRENDERSTATE_PLANEMASK          = 13;   // DWORD physical plane mask */
    D3DRENDERSTATE_ZWRITEENABLE       = 14;   // TRUE to enable z writes */
    D3DRENDERSTATE_ALPHATESTENABLE    = 15;   // TRUE to enable alpha tests */
    D3DRENDERSTATE_LASTPIXEL          = 16;   // TRUE for last-pixel on lines */
    D3DRENDERSTATE_TEXTUREMAG         = 17;   // D3DTEXTUREFILTER */
    D3DRENDERSTATE_TEXTUREMIN         = 18;   // D3DTEXTUREFILTER */
    D3DRENDERSTATE_SRCBLEND           = 19;   // D3DBLEND */
    D3DRENDERSTATE_DESTBLEND          = 20;   // D3DBLEND */
    D3DRENDERSTATE_TEXTUREMAPBLEND    = 21;   // D3DTEXTUREBLEND */
    D3DRENDERSTATE_CULLMODE           = 22;   // D3DCULL */
    D3DRENDERSTATE_ZFUNC              = 23;   // D3DCMPFUNC */
    D3DRENDERSTATE_ALPHAREF           = 24;   // D3DFIXED */
    D3DRENDERSTATE_ALPHAFUNC          = 25;   // D3DCMPFUNC */
    D3DRENDERSTATE_DITHERENABLE       = 26;   // TRUE to enable dithering */
//#if(DIRECT3D_VERSION >= 0x0500)
    D3DRENDERSTATE_ALPHABLENDENABLE   = 27;   // TRUE to enable alpha blending */
//#endif // DIRECT3D_VERSION >= 0x0500 */
    D3DRENDERSTATE_FOGENABLE          = 28;   // TRUE to enable fog */
    D3DRENDERSTATE_SPECULARENABLE     = 29;   // TRUE to enable specular */
    D3DRENDERSTATE_ZVISIBLE           = 30;   // TRUE to enable z checking */
    D3DRENDERSTATE_SUBPIXEL           = 31;   // TRUE to enable subpixel correction */
    D3DRENDERSTATE_SUBPIXELX          = 32;   // TRUE to enable correction in X only */
    D3DRENDERSTATE_STIPPLEDALPHA      = 33;   // TRUE to enable stippled alpha */
    D3DRENDERSTATE_FOGCOLOR           = 34;   // D3DCOLOR */
    D3DRENDERSTATE_FOGTABLEMODE       = 35;   // D3DFOGMODE */
    D3DRENDERSTATE_FOGTABLESTART      = 36;   // Fog table start    */
    D3DRENDERSTATE_FOGTABLEEND        = 37;   // Fog table end      */
    D3DRENDERSTATE_FOGTABLEDENSITY    = 38;   // Fog table density  */
//#if(DIRECT3D_VERSION >= 0x0700)
    D3DRENDERSTATE_FOGSTART           = 36;   // Fog start (for both vertex and pixel fog) */
    D3DRENDERSTATE_FOGEND             = 37;   // Fog end      */
    D3DRENDERSTATE_FOGDENSITY         = 38;   // Fog density  */
//#endif // DIRECT3D_VERSION >= 0x0700 */
    D3DRENDERSTATE_STIPPLEENABLE      = 39;   // TRUE to enable stippling */

  D3DRENDERSTATE_EDGEANTIALIAS = 40 ; (* TRUE to enable edge antialiasing *)
  D3DRENDERSTATE_COLORKEYENABLE = 41 ; (* TRUE to enable source colorkeyed textures *)
  D3DRENDERSTATE_BORDERCOLOR = 43 ; (* Border color for texturing w/border *)
  D3DRENDERSTATE_TEXTUREADDRESSU = 44 ; (* Texture addressing mode for U coordinate *)
  D3DRENDERSTATE_TEXTUREADDRESSV = 45 ; (* Texture addressing mode for V coordinate *)
  D3DRENDERSTATE_MIPMAPLODBIAS = 46 ; (* D3DVALUE Mipmap LOD bias *)
  D3DRENDERSTATE_ZBIAS = 47 ; (* LONG Z bias *)
  D3DRENDERSTATE_RANGEFOGENABLE = 48 ; (* Enables range-based fog *)
  D3DRENDERSTATE_ANISOTROPY = 49 ; (* Max. anisotropy. 1 = no anisotropy *)
  //#endif (* DIRECT3D_VERSION >= 0x0500 *)
  D3DRENDERSTATE_FLUSHBATCH = 50 ;
  (* Explicit flush for DP batching (DX5 Only) *)
  //#if ( DIRECT3D_VERSION >= 0x0600 )
  D3DRENDERSTATE_TRANSLUCENTSORTINDEPENDENT = 51 ; (* BOOL enable sort-independent transparency *)
  D3DRENDERSTATE_STENCILENABLE = 52 ; (* BOOL enable/disable stenciling *)
  D3DRENDERSTATE_STENCILFAIL = 53 ; (* D3DSTENCILOP to do if stencil test fails *)
  D3DRENDERSTATE_STENCILZFAIL = 54 ; (* D3DSTENCILOP to do if stencil test passes and Z test fails *)
  D3DRENDERSTATE_STENCILPASS = 55 ; (* D3DSTENCILOP to do if both stencil and Z tests pass *)
  D3DRENDERSTATE_STENCILFUNC = 56 ; (* D3DCMPFUNC fn.  Stencil Test passes if ((ref & mask) stencilfn (stencil & mask)) is true *)
  D3DRENDERSTATE_STENCILREF = 57 ; (* Reference value used in stencil test *)
  D3DRENDERSTATE_STENCILMASK = 58 ; (* Mask value used in stencil test *)
  D3DRENDERSTATE_STENCILWRITEMASK = 59 ; (* Write mask applied to values written to stencil buffer *)
  D3DRENDERSTATE_TEXTUREFACTOR = 60 ; (* D3DCOLOR used for multi-texture blend *)
  //#endif (* DIRECT3D_VERSION >= 0x0600 *)
  D3DRENDERSTATE_STIPPLEPATTERN00 = 64 ; (* Stipple pattern 01...  *)
  D3DRENDERSTATE_STIPPLEPATTERN01 = 65 ;
  D3DRENDERSTATE_STIPPLEPATTERN02 = 66 ;
  D3DRENDERSTATE_STIPPLEPATTERN03 = 67 ;
  D3DRENDERSTATE_STIPPLEPATTERN04 = 68 ;
  D3DRENDERSTATE_STIPPLEPATTERN05 = 69 ;
  D3DRENDERSTATE_STIPPLEPATTERN06 = 70 ;
  D3DRENDERSTATE_STIPPLEPATTERN07 = 71 ;
  D3DRENDERSTATE_STIPPLEPATTERN08 = 72 ;
  D3DRENDERSTATE_STIPPLEPATTERN09 = 73 ;
  D3DRENDERSTATE_STIPPLEPATTERN10 = 74 ;
  D3DRENDERSTATE_STIPPLEPATTERN11 = 75 ;
  D3DRENDERSTATE_STIPPLEPATTERN12 = 76 ;
  D3DRENDERSTATE_STIPPLEPATTERN13 = 77 ;
  D3DRENDERSTATE_STIPPLEPATTERN14 = 78 ;
  D3DRENDERSTATE_STIPPLEPATTERN15 = 79 ;
  D3DRENDERSTATE_STIPPLEPATTERN16 = 80 ;
  D3DRENDERSTATE_STIPPLEPATTERN17 = 81 ;
  D3DRENDERSTATE_STIPPLEPATTERN18 = 82 ;
  D3DRENDERSTATE_STIPPLEPATTERN19 = 83 ;
  D3DRENDERSTATE_STIPPLEPATTERN20 = 84 ;
  D3DRENDERSTATE_STIPPLEPATTERN21 = 85 ;
  D3DRENDERSTATE_STIPPLEPATTERN22 = 86 ;
  D3DRENDERSTATE_STIPPLEPATTERN23 = 87 ;
  D3DRENDERSTATE_STIPPLEPATTERN24 = 88 ;
  D3DRENDERSTATE_STIPPLEPATTERN25 = 89 ;
  D3DRENDERSTATE_STIPPLEPATTERN26 = 90 ;
  D3DRENDERSTATE_STIPPLEPATTERN27 = 91 ;
  D3DRENDERSTATE_STIPPLEPATTERN28 = 92 ;
  D3DRENDERSTATE_STIPPLEPATTERN29 = 93 ;
  D3DRENDERSTATE_STIPPLEPATTERN30 = 94 ;
  D3DRENDERSTATE_STIPPLEPATTERN31 = 95 ;
  //#if ( DIRECT3D_VERSION >= 0x0600 ) (*      * 128 values [128; 255] are reserved for texture coordinate wrap flags.      * These are constructed with the D3DWRAP_U and D3DWRAP_V macros. Using      * a flags word preserves forward compatibility with texture coordinates      * that are >2D.      *)
  D3DRENDERSTATE_WRAP0 = 128 ; (* wrap for 1st texture coord. set *)
  D3DRENDERSTATE_WRAP1 = 129 ; (* wrap for 2nd texture coord. set *)
  D3DRENDERSTATE_WRAP2 = 130 ; (* wrap for 3rd texture coord. set *)
  D3DRENDERSTATE_WRAP3 = 131 ; (* wrap for 4th texture coord. set *)
  D3DRENDERSTATE_WRAP4 = 132 ; (* wrap for 5th texture coord. set *)
  D3DRENDERSTATE_WRAP5 = 133 ; (* wrap for 6th texture coord. set *)
  D3DRENDERSTATE_WRAP6 = 134 ; (* wrap for 7th texture coord. set *)
  D3DRENDERSTATE_WRAP7 = 135 ; (* wrap for 8th texture coord. set *)
  //#endif (* DIRECT3D_VERSION >= 0x0600 *)
  //#if ( DIRECT3D_VERSION >= 0x0700 )
  D3DRENDERSTATE_CLIPPING = 136 ;
  D3DRENDERSTATE_LIGHTING = 137 ;
  D3DRENDERSTATE_EXTENTS = 138 ;
  D3DRENDERSTATE_AMBIENT = 139 ;
  D3DRENDERSTATE_FOGVERTEXMODE = 140 ;
  D3DRENDERSTATE_COLORVERTEX = 141 ;
  D3DRENDERSTATE_LOCALVIEWER = 142 ;
  D3DRENDERSTATE_NORMALIZENORMALS = 143 ;
  D3DRENDERSTATE_COLORKEYBLENDENABLE = 144 ;
  D3DRENDERSTATE_DIFFUSEMATERIALSOURCE = 145 ;
  D3DRENDERSTATE_SPECULARMATERIALSOURCE = 146 ;
  D3DRENDERSTATE_AMBIENTMATERIALSOURCE = 147 ;
  D3DRENDERSTATE_EMISSIVEMATERIALSOURCE = 148 ;
  D3DRENDERSTATE_VERTEXBLEND = 151 ;
  D3DRENDERSTATE_CLIPPLANEENABLE = 152 ;
  //#endif (* DIRECT3D_VERSION >= 0x0700 *)
  //#if ( DIRECT3D_VERSION >= 0x0500 )
  D3DRENDERSTATE_FORCE_DWORD = $7fffffff ;
  //(* force 32-bit size enum *) #endif
  (* DIRECT3D_VERSION >= 0x0500 *)

type

  D3DRENDERSTATETYPE = Integer;

// Values for material source
type
  D3DMATERIALCOLORSOURCE = (
	D3DMCS_MATERIAL,
	D3DMCS_COLOR1,
	D3DMCS_COLOR2
	// Error : D3DMCS_FORCE_DWORD = 0x7fffffff
  );


// Error :  #if ( DIRECT3D_VERSION >= 0x0500 )
// For back-compatibility with legacy compilations
const
  D3DRENDERSTATE_BLENDENABLE	= D3DRENDERSTATE_ALPHABLENDENABLE;
//{$ENDIF}(* DIRECT3D_VERSION >= 0x0500 *)

// Error :  #if ( DIRECT3D_VERSION >= 0x0600 )

// Bias to apply to the texture coordinate set to apply a wrap to.
  D3DRENDERSTATE_WRAPBIAS	= 128;

(* Flags to construct the WRAP render states *)
  D3DWRAP_U	= $00000001;
  D3DWRAP_V	= $00000002;

//{$ENDIF}(* DIRECT3D_VERSION >= 0x0600 *)

// Error :  #if ( DIRECT3D_VERSION >= 0x0700 )

(* Flags to construct the WRAP render states for 1D thru 4D texture coordinates *)
  D3DWRAPCOORD_0	= $00000001;	// same as D3DWRAP_U
  D3DWRAPCOORD_1	= $00000002;	// same as D3DWRAP_V
  D3DWRAPCOORD_2	= $00000004;
  D3DWRAPCOORD_3	= $00000008;

//{$ENDIF}(* DIRECT3D_VERSION >= 0x0700 *)

// Error :  #define D3DRENDERSTATE_STIPPLEPATTERN ( y ) ( D3DRENDERSTATE_STIPPLEPATTERN00 + ( y ) )

type
  LPD3DSTATE	= ^D3DSTATE;
  D3DSTATE = record
	case Integer of
	0: (
	  dtstTransformStateType	: D3DTRANSFORMSTATETYPE;
	  dwArg	: array[0..0] of DWORD;
	);
	1: (
	  dlstLightStateType	: D3DLIGHTSTATETYPE;
	  dvArg	: array[0..0] of D3DVALUE;
	);
	2: (
	  drstRenderStateType	: D3DRENDERSTATETYPE;
	);
  end;

(*
 * Operation used to load matrices
 * hDstMat = hSrcMat
 *)
  LPD3DMATRIXLOAD	= ^D3DMATRIXLOAD;
  D3DMATRIXLOAD = record
	hDestMatrix	: D3DMATRIXHANDLE;	(* Destination matrix *)
	hSrcMatrix	: D3DMATRIXHANDLE;	(* Source matrix *)
  end;

(*
 * Operation used to multiply matrices
 * hDstMat = hSrcMat1 * hSrcMat2
 *)
  LPD3DMATRIXMULTIPLY	= ^D3DMATRIXMULTIPLY;
  D3DMATRIXMULTIPLY = record
	hDestMatrix	: D3DMATRIXHANDLE;	(* Destination matrix *)
	hSrcMatrix1	: D3DMATRIXHANDLE;	(* First source matrix *)
	hSrcMatrix2	: D3DMATRIXHANDLE;	(* Second source matrix *)
  end;

(*
 * Operation used to transform and light vertices.
 *)
  LPD3DPROCESSVERTICES	= ^D3DPROCESSVERTICES;
  D3DPROCESSVERTICES = record
	dwFlags	: DWORD;	(* Do we transform or light or just copy? *)
	wStart	: WORD;	(* Index to first vertex in source *)
	wDest	: WORD;	(* Index to first vertex in local buffer *)
	dwCount	: DWORD;	(* Number of vertices to be processed *)
	dwReserved	: DWORD;	(* Must be zero *)
  end;

const
  D3DPROCESSVERTICES_TRANSFORMLIGHT	= $00000000;
  D3DPROCESSVERTICES_TRANSFORM	= $00000001;
  D3DPROCESSVERTICES_COPY	= $00000002;
  D3DPROCESSVERTICES_OPMASK	= $00000007;

  D3DPROCESSVERTICES_UPDATEEXTENTS	= $00000008;
  D3DPROCESSVERTICES_NOCOLOR	= $00000010;


// Error :  #if ( DIRECT3D_VERSION >= 0x0600 )


(*
 * State enumerants for per-stage texture processing.
 *)
type
// Error :  #if ( DIRECT3D_VERSION >= 0x0700 )
//{$ENDIF}(* DIRECT3D_VERSION >= 0x0700 *)
  D3DTEXTURESTAGESTATETYPE = (
	D3DTEXTURESTAGESTATETYPE_Unknown0,
	D3DTSS_COLOROP,
	D3DTSS_COLORARG1,
	D3DTSS_COLORARG2,
	D3DTSS_ALPHAOP,
	D3DTSS_ALPHAARG1,
	D3DTSS_ALPHAARG2,
	D3DTSS_BUMPENVMAT00,
	D3DTSS_BUMPENVMAT01,
	D3DTSS_BUMPENVMAT10,
	D3DTSS_BUMPENVMAT11,
	D3DTSS_TEXCOORDINDEX,
	D3DTSS_ADDRESS,
	D3DTSS_ADDRESSU,
	D3DTSS_ADDRESSV,
	D3DTSS_BORDERCOLOR,
	D3DTSS_MAGFILTER,
	D3DTSS_MINFILTER,
	D3DTSS_MIPFILTER,
	D3DTSS_MIPMAPLODBIAS,
	D3DTSS_MAXMIPLEVEL,
	D3DTSS_MAXANISOTROPY,
	D3DTSS_BUMPENVLSCALE,
	D3DTSS_BUMPENVLOFFSET,
	D3DTSS_TEXTURETRANSFORMFLAGS
	// Error : D3DTSS_FORCE_DWORD = 0x7fffffff
  );

(*
 * Enumerations for COLOROP and ALPHAOP texture blending operations set in
 * texture processing stage controls in D3DRENDERSTATE.
 *)
// Control

// Modulate

// Add
// Arg1 + Arg2 - Arg1*Arg2
// = Arg1 + (1-Arg1)*Arg2

// Linear alpha blend: Arg1*(Alpha) + Arg2*(1-Alpha)
// Linear alpha blend with pre-multiplied arg1 input: Arg1 + Arg2*(1-Alpha)

// Specular mapping
// COLOROP only
// COLOROP only
// COLOROP only
// COLOROP only

// Bump mapping
// This can do either diffuse or specular bump mapping with correct input.
// Performs the function (Arg1.R*Arg2.R + Arg1.G*Arg2.G + Arg1.B*Arg2.B)
// where each component has been scaled and offset to make it signed.
// The result is replicated into all four (including alpha) channels.
// This is a valid COLOROP only.

  D3DTEXTUREOP = (
	D3DTEXTUREOP_Unknown0,
	D3DTOP_DISABLE,
	D3DTOP_SELECTARG1,
	D3DTOP_SELECTARG2,
	D3DTOP_MODULATE,
	D3DTOP_MODULATE2X,
	D3DTOP_MODULATE4X,
	D3DTOP_ADD,
	D3DTOP_ADDSIGNED,
	D3DTOP_ADDSIGNED2X,
	D3DTOP_SUBTRACT,
	D3DTOP_ADDSMOOTH,
	D3DTOP_BLENDDIFFUSEALPHA,
	D3DTOP_BLENDTEXTUREALPHA,
	D3DTOP_BLENDFACTORALPHA,
	D3DTOP_BLENDTEXTUREALPHAPM,
	D3DTOP_BLENDCURRENTALPHA,
	D3DTOP_PREMODULATE,
	D3DTOP_MODULATEALPHA_ADDCOLOR,
	D3DTOP_MODULATECOLOR_ADDALPHA,
	D3DTOP_MODULATEINVALPHA_ADDCOLOR,
	D3DTOP_MODULATEINVCOLOR_ADDALPHA,
	D3DTOP_BUMPENVMAP,
	D3DTOP_BUMPENVMAPLUMINANCE,
	D3DTOP_DOTPRODUCT3
	// Error : D3DTOP_FORCE_DWORD = 0x7fffffff
  );

(*
 * Values for COLORARG1,2 and ALPHAARG1,2 texture blending operations
 * set in texture processing stage controls in D3DRENDERSTATE.
 *)
const
  D3DTA_SELECTMASK	= $0000000f;	// mask for arg selector
  D3DTA_DIFFUSE	= $00000000;	// select diffuse color
  D3DTA_CURRENT	= $00000001;	// select result of previous stage
  D3DTA_TEXTURE	= $00000002;	// select texture color
  D3DTA_TFACTOR	= $00000003;	// select RENDERSTATE_TEXTUREFACTOR
// Error :  #if ( DIRECT3D_VERSION >= 0x0700 )
  D3DTA_SPECULAR	= $00000004;	// select specular color
//{$ENDIF}(* DIRECT3D_VERSION >= 0x0700 *)
  D3DTA_COMPLEMENT	= $00000010;	// take 1.0 - x
  D3DTA_ALPHAREPLICATE	= $00000020;	// replicate alpha to color components


(*
 *  IDirect3DTexture2 State Filter Types
 *)
type
// Error :  #if ( DIRECT3D_VERSION >= 0x0700 )
//{$ENDIF}(* DIRECT3D_VERSION >= 0x0700 *)
  D3DTEXTUREMAGFILTER = (
	D3DTEXTUREMAGFILTER_Unknown0,
	D3DTFG_POINT,
	D3DTFG_LINEAR,
	D3DTFG_FLATCUBIC,
	D3DTFG_GAUSSIANCUBIC,
	D3DTFG_ANISOTROPIC
	// Error : D3DTFG_FORCE_DWORD = 0x7fffffff
  );

  D3DTEXTUREMINFILTER = (
	D3DTEXTUREMINFILTER_Unknown0,
	D3DTFN_POINT,
	D3DTFN_LINEAR,
	D3DTFN_ANISOTROPIC
	// Error : D3DTFN_FORCE_DWORD = 0x7fffffff
  );

  D3DTEXTUREMIPFILTER = (
	D3DTEXTUREMIPFILTER_Unknown0,
	D3DTFP_NONE,
	D3DTFP_POINT,
	D3DTFP_LINEAR
	// Error : D3DTFP_FORCE_DWORD = 0x7fffffff
  );

//{$ENDIF}(* DIRECT3D_VERSION >= 0x0600 *)

(*
 * Triangle flags
 *)

(*
 * Tri strip and fan flags.
 * START loads all three vertices
 * EVEN and ODD load just v3 with even or odd culling
 * START_FLAT contains a count from 0 to 29 that allows the
 * whole strip or fan to be culled in one hit.
 * e.g. for a quad len = 1
 *)
const
  D3DTRIFLAG_START	= $00000000;
// Error :  #define D3DTRIFLAG_STARTFLAT ( len ) ( len ) (* 0 < len < 30 *)
  D3DTRIFLAG_ODD	= $0000001e;
  D3DTRIFLAG_EVEN	= $0000001f;

(*
 * Triangle edge flags
 * enable edges for wireframe or antialiasing
 *)
  D3DTRIFLAG_EDGEENABLE1	= $00000100;	(* v0-v1 edge *)
  D3DTRIFLAG_EDGEENABLE2	= $00000200;	(* v1-v2 edge *)
  D3DTRIFLAG_EDGEENABLE3	= $00000400;	(* v2-v0 edge *)
  D3DTRIFLAG_EDGEENABLETRIANGLE	= ( D3DTRIFLAG_EDGEENABLE1 or D3DTRIFLAG_EDGEENABLE2 or
         D3DTRIFLAG_EDGEENABLE3 );

(*
 * Primitive structures and related defines.  Vertex offsets are to types
 * D3DVERTEX, D3DLVERTEX, or D3DTLVERTEX.
 *)

(*
 * Triangle list primitive structure
 *)
type
  LPD3DTRIANGLE	= ^D3DTRIANGLE;
  D3DTRIANGLE = record
	case Integer of
	0: (
	  v1	: WORD;
	  v2	: WORD;
	  v3	: WORD;
	  wFlags	: WORD;
	);
	1: (
	  wV1	: WORD;
	  wV2	: WORD;
	  wV3	: WORD;
	);
  end;

(*
 * Line list structure.
 * The instruction count defines the number of line segments.
 *)
  LPD3DLINE	= ^D3DLINE;
  D3DLINE = record
	case Integer of
	0: (
	  v1	: WORD;
	  v2	: WORD;
	);
	1: (
	  wV1	: WORD;
	  wV2	: WORD;
	);
  end;

(*
 * Span structure
 * Spans join a list of points with the same y value.
 * If the y value changes, a new span is started.
 *)
  LPD3DSPAN	= ^D3DSPAN;
  D3DSPAN = record
	wCount	: WORD;	(* Number of spans *)
	wFirst	: WORD;	(* Index to first vertex *)
  end;

(*
 * Point structure
 *)
  LPD3DPOINT	= ^D3DPOINT;
  D3DPOINT = record
	wCount	: WORD;	(* number of points     *)
	wFirst	: WORD;	(* index to first vertex    *)
  end;


(*
 * Forward branch structure.
 * Mask is logically anded with the driver status mask
 * if the result equals 'value', the branch is taken.
 *)
  LPD3DBRANCH	= ^D3DBRANCH;
  D3DBRANCH = record
	dwMask	: DWORD;	(* Bitmask against D3D status *)
	dwValue	: DWORD;
	bNegate	: BOOL;	(* TRUE to negate comparison *)
	dwOffset	: DWORD;	(* How far to branch forward (0 for exit)*)
  end;

(*
 * Status used for set status instruction.
 * The D3D status is initialised on device creation
 * and is modified by all execute calls.
 *)
  LPD3DSTATUS	= ^D3DSTATUS;
  D3DSTATUS = record
	dwFlags	: DWORD;	(* Do we set extents or status *)
	dwStatus	: DWORD;	(* D3D status *)
	drExtent	: D3DRECT;
  end;

const
  D3DSETSTATUS_STATUS	= $00000001;
  D3DSETSTATUS_EXTENTS	= $00000002;
  D3DSETSTATUS_ALL	= ( D3DSETSTATUS_STATUS or D3DSETSTATUS_EXTENTS );

// Error :  #if ( DIRECT3D_VERSION >= 0x0500 )
type
  LPD3DCLIPSTATUS	= ^D3DCLIPSTATUS;
  D3DCLIPSTATUS = record
	dwFlags	: DWORD;	(* Do we set 2d extents, 3D extents or status *)
	dwStatus	: DWORD;	(* Clip status *)
	minx, maxx	: Single;	(* X extents *)
	miny, maxy	: Single;	(* Y extents *)
	minz, maxz	: Single;	(* Z extents *)
  end;

const
  D3DCLIPSTATUS_STATUS	= $00000001;
  D3DCLIPSTATUS_EXTENTS2	= $00000002;
  D3DCLIPSTATUS_EXTENTS3	= $00000004;

//{$ENDIF}(* DIRECT3D_VERSION >= 0x0500 *)
(*
 * Statistics structure
 *)
type
  LPD3DSTATS	= ^D3DSTATS;
  D3DSTATS = record
	dwSize	: DWORD;
	dwTrianglesDrawn	: DWORD;
	dwLinesDrawn	: DWORD;
	dwPointsDrawn	: DWORD;
	dwSpansDrawn	: DWORD;
	dwVerticesProcessed	: DWORD;
  end;

(*
 * Execute options.
 * When calling using D3DEXECUTE_UNCLIPPED all the primitives
 * inside the buffer must be contained within the viewport.
 *)
const
  D3DEXECUTE_CLIPPED	= $00000001;
  D3DEXECUTE_UNCLIPPED	= $00000002;

type
  LPD3DEXECUTEDATA	= ^D3DEXECUTEDATA;
  D3DEXECUTEDATA = record
	dwSize	: DWORD;
	dwVertexOffset	: DWORD;
	dwVertexCount	: DWORD;
	dwInstructionOffset	: DWORD;
	dwInstructionLength	: DWORD;
	dwHVertexOffset	: DWORD;
	dsStatus	: D3DSTATUS;	(* Status after execute *)
  end;

(*
 * Palette flags.
 * This are or'ed with the peFlags in the PALETTEENTRYs passed to DirectDraw.
 *)
const
  D3DPAL_FREE	= $00;	(* Renderer may use this entry freely *)
  D3DPAL_READONLY	= $40;	(* Renderer may not set this entry *)
  D3DPAL_RESERVED	= $80;	(* Renderer may not use this entry *)


// Error :  #if ( DIRECT3D_VERSION >= 0x0600 )

type
  LPD3DVERTEXBUFFERDESC	= ^D3DVERTEXBUFFERDESC;
  D3DVERTEXBUFFERDESC = record
	dwSize	: DWORD;
	dwCaps	: DWORD;
	dwFVF	: DWORD;
	dwNumVertices	: DWORD;
  end;

const
  D3DVBCAPS_SYSTEMMEMORY	= $00000800;
  D3DVBCAPS_WRITEONLY	= $00010000;
  D3DVBCAPS_OPTIMIZED	= $80000000;
  D3DVBCAPS_DONOTCLIP	= $00000001;

(* Vertex Operations for ProcessVertices *)
  D3DVOP_LIGHT	= $00000400;
  D3DVOP_TRANSFORM	= $00000001;
  D3DVOP_CLIP	= $00000004;
  D3DVOP_EXTENTS	= $00000008;

(* The maximum number of vertices user can pass to any d3d
   drawing function or to create vertex buffer with
*)
  D3DMAXNUMVERTICES	= (( 1 shl 16 ) - 1 );
(* The maximum number of primitives user can pass to any d3d
   drawing function.
*)
  D3DMAXNUMPRIMITIVES	= (( 1 shl 16 ) - 1 );

// Error :  #if ( DIRECT3D_VERSION >= 0x0700 )

(* Bits for dwFlags in ProcessVertices call *)
  D3DPV_DONOTCOPYDATA	= $00000001;

//{$ENDIF}(* DIRECT3D_VERSION >= 0x0700 *)
//-------------------------------------------------------------------

// Flexible vertex format bits
//
  D3DFVF_RESERVED0	= $001;
  D3DFVF_POSITION_MASK	= $00E;
  D3DFVF_XYZ	= $002;
  D3DFVF_XYZRHW	= $004;
// Error :  #if ( DIRECT3D_VERSION >= 0x0700 )
  D3DFVF_XYZB1	= $006;
  D3DFVF_XYZB2	= $008;
  D3DFVF_XYZB3	= $00a;
  D3DFVF_XYZB4	= $00c;
  D3DFVF_XYZB5	= $00e;
//{$ENDIF}(* DIRECT3D_VERSION >= 0x0700 *)
  D3DFVF_NORMAL	= $010;
  D3DFVF_RESERVED1	= $020;
  D3DFVF_DIFFUSE	= $040;
  D3DFVF_SPECULAR	= $080;

  D3DFVF_TEXCOUNT_MASK	= $f00;
  D3DFVF_TEXCOUNT_SHIFT	= 8;
  D3DFVF_TEX0	= $000;
  D3DFVF_TEX1	= $100;
  D3DFVF_TEX2	= $200;
  D3DFVF_TEX3	= $300;
  D3DFVF_TEX4	= $400;
  D3DFVF_TEX5	= $500;
  D3DFVF_TEX6	= $600;
  D3DFVF_TEX7	= $700;
  D3DFVF_TEX8	= $800;

  D3DFVF_RESERVED2	= $f000;	// 4 reserved bits

  D3DFVF_VERTEX	= ( D3DFVF_XYZ or D3DFVF_NORMAL or D3DFVF_TEX1 );
  D3DFVF_LVERTEX	= ( D3DFVF_XYZ or D3DFVF_RESERVED1 or D3DFVF_DIFFUSE or D3DFVF_SPECULAR or
         D3DFVF_TEX1 );
  D3DFVF_TLVERTEX	= ( D3DFVF_XYZRHW or D3DFVF_DIFFUSE or D3DFVF_SPECULAR or D3DFVF_TEX1
         );

type
  D3DDP_PTRSTRIDE = record
	lpvData	: Pointer;
	dwStride	: DWORD;
  end;

const
  D3DDP_MAXTEXCOORD	= 8;

type
  LPD3DDRAWPRIMITIVESTRIDEDDATA	= ^D3DDRAWPRIMITIVESTRIDEDDATA;
  D3DDRAWPRIMITIVESTRIDEDDATA = record
	position	: D3DDP_PTRSTRIDE;
	normal	: D3DDP_PTRSTRIDE;
	diffuse	: D3DDP_PTRSTRIDE;
	specular	: D3DDP_PTRSTRIDE;
	textureCoords	: array[0..D3DDP_MAXTEXCOORD-1] of D3DDP_PTRSTRIDE;
  end;
//---------------------------------------------------------------------
// ComputeSphereVisibility return values
//
const
  D3DVIS_INSIDE_FRUSTUM	= 0;
  D3DVIS_INTERSECT_FRUSTUM	= 1;
  D3DVIS_OUTSIDE_FRUSTUM	= 2;
  D3DVIS_INSIDE_LEFT	= 0;
  D3DVIS_INTERSECT_LEFT	= $00000004;
  D3DVIS_OUTSIDE_LEFT	= $00000008;
  D3DVIS_INSIDE_RIGHT	= 0;
  D3DVIS_INTERSECT_RIGHT	= $00000010;
  D3DVIS_OUTSIDE_RIGHT	= $00000020;
  D3DVIS_INSIDE_TOP	= 0;
  D3DVIS_INTERSECT_TOP	= $00000040;
  D3DVIS_OUTSIDE_TOP	= $00000080;
  D3DVIS_INSIDE_BOTTOM	= 0;
  D3DVIS_INTERSECT_BOTTOM	= $00000100;
  D3DVIS_OUTSIDE_BOTTOM	= $00000200;
  D3DVIS_INSIDE_NEAR	= 0;
  D3DVIS_INTERSECT_NEAR	= $00000400;
  D3DVIS_OUTSIDE_NEAR	= $00000800;
  D3DVIS_INSIDE_FAR	= 0;
  D3DVIS_INTERSECT_FAR	= $00001000;
  D3DVIS_OUTSIDE_FAR	= $00002000;

  D3DVIS_MASK_FRUSTUM	= $00000003;
  D3DVIS_MASK_LEFT	= $0000000C;
  D3DVIS_MASK_RIGHT	= $00000030;
  D3DVIS_MASK_TOP	= $000000C0;
  D3DVIS_MASK_BOTTOM	= $00000300;
  D3DVIS_MASK_NEAR	= $00000C00;
  D3DVIS_MASK_FAR	= $00003000;

//{$ENDIF}(* DIRECT3D_VERSION >= 0x0600 *)

// Error :  #if ( DIRECT3D_VERSION >= 0x0700 )

  D3DDEVINFOID_TEXTUREMANAGER	= 1;
  D3DDEVINFOID_D3DTEXTUREMANAGER	= 2;

// The D3DVERTEXBLENDFLAGS type is used with D3DRENDERSTATE_VERTEXBLEND state.
//
type
  D3DVERTEXBLENDFLAGS = (
	D3DVBLEND_DISABLE,
	D3DVBLEND_1WEIGHT,
	D3DVBLEND_2WEIGHTS,
	D3DVBLEND_3WEIGHTS
  );

  D3DTEXTURETRANSFORMFLAGS = (
	D3DTTFF_DISABLE,
	D3DTTFF_COUNT1,
	D3DTTFF_COUNT2,
	D3DTTFF_COUNT3,
	D3DTTFF_COUNT4,
	D3DTEXTURETRANSFORMFLAGS_Unknown5,
	D3DTEXTURETRANSFORMFLAGS_Unknown6,
	D3DTEXTURETRANSFORMFLAGS_Unknown7,
	D3DTEXTURETRANSFORMFLAGS_Unknown8,
	D3DTEXTURETRANSFORMFLAGS_Unknown9,
	D3DTEXTURETRANSFORMFLAGS_Unknown10,
	D3DTEXTURETRANSFORMFLAGS_Unknown11,
	D3DTEXTURETRANSFORMFLAGS_Unknown12,
	D3DTEXTURETRANSFORMFLAGS_Unknown13,
	D3DTEXTURETRANSFORMFLAGS_Unknown14,
	D3DTEXTURETRANSFORMFLAGS_Unknown15,
	D3DTEXTURETRANSFORMFLAGS_Unknown16,
	D3DTEXTURETRANSFORMFLAGS_Unknown17,
	D3DTEXTURETRANSFORMFLAGS_Unknown18,
	D3DTEXTURETRANSFORMFLAGS_Unknown19,
	D3DTEXTURETRANSFORMFLAGS_Unknown20,
	D3DTEXTURETRANSFORMFLAGS_Unknown21,
	D3DTEXTURETRANSFORMFLAGS_Unknown22,
	D3DTEXTURETRANSFORMFLAGS_Unknown23,
	D3DTEXTURETRANSFORMFLAGS_Unknown24,
	D3DTEXTURETRANSFORMFLAGS_Unknown25,
	D3DTEXTURETRANSFORMFLAGS_Unknown26,
	D3DTEXTURETRANSFORMFLAGS_Unknown27,
	D3DTEXTURETRANSFORMFLAGS_Unknown28,
	D3DTEXTURETRANSFORMFLAGS_Unknown29,
	D3DTEXTURETRANSFORMFLAGS_Unknown30,
	D3DTEXTURETRANSFORMFLAGS_Unknown31,
	D3DTEXTURETRANSFORMFLAGS_Unknown32,
	D3DTEXTURETRANSFORMFLAGS_Unknown33,
	D3DTEXTURETRANSFORMFLAGS_Unknown34,
	D3DTEXTURETRANSFORMFLAGS_Unknown35,
	D3DTEXTURETRANSFORMFLAGS_Unknown36,
	D3DTEXTURETRANSFORMFLAGS_Unknown37,
	D3DTEXTURETRANSFORMFLAGS_Unknown38,
	D3DTEXTURETRANSFORMFLAGS_Unknown39,
	D3DTEXTURETRANSFORMFLAGS_Unknown40,
	D3DTEXTURETRANSFORMFLAGS_Unknown41,
	D3DTEXTURETRANSFORMFLAGS_Unknown42,
	D3DTEXTURETRANSFORMFLAGS_Unknown43,
	D3DTEXTURETRANSFORMFLAGS_Unknown44,
	D3DTEXTURETRANSFORMFLAGS_Unknown45,
	D3DTEXTURETRANSFORMFLAGS_Unknown46,
	D3DTEXTURETRANSFORMFLAGS_Unknown47,
	D3DTEXTURETRANSFORMFLAGS_Unknown48,
	D3DTEXTURETRANSFORMFLAGS_Unknown49,
	D3DTEXTURETRANSFORMFLAGS_Unknown50,
	D3DTEXTURETRANSFORMFLAGS_Unknown51,
	D3DTEXTURETRANSFORMFLAGS_Unknown52,
	D3DTEXTURETRANSFORMFLAGS_Unknown53,
	D3DTEXTURETRANSFORMFLAGS_Unknown54,
	D3DTEXTURETRANSFORMFLAGS_Unknown55,
	D3DTEXTURETRANSFORMFLAGS_Unknown56,
	D3DTEXTURETRANSFORMFLAGS_Unknown57,
	D3DTEXTURETRANSFORMFLAGS_Unknown58,
	D3DTEXTURETRANSFORMFLAGS_Unknown59,
	D3DTEXTURETRANSFORMFLAGS_Unknown60,
	D3DTEXTURETRANSFORMFLAGS_Unknown61,
	D3DTEXTURETRANSFORMFLAGS_Unknown62,
	D3DTEXTURETRANSFORMFLAGS_Unknown63,
	D3DTEXTURETRANSFORMFLAGS_Unknown64,
	D3DTEXTURETRANSFORMFLAGS_Unknown65,
	D3DTEXTURETRANSFORMFLAGS_Unknown66,
	D3DTEXTURETRANSFORMFLAGS_Unknown67,
	D3DTEXTURETRANSFORMFLAGS_Unknown68,
	D3DTEXTURETRANSFORMFLAGS_Unknown69,
	D3DTEXTURETRANSFORMFLAGS_Unknown70,
	D3DTEXTURETRANSFORMFLAGS_Unknown71,
	D3DTEXTURETRANSFORMFLAGS_Unknown72,
	D3DTEXTURETRANSFORMFLAGS_Unknown73,
	D3DTEXTURETRANSFORMFLAGS_Unknown74,
	D3DTEXTURETRANSFORMFLAGS_Unknown75,
	D3DTEXTURETRANSFORMFLAGS_Unknown76,
	D3DTEXTURETRANSFORMFLAGS_Unknown77,
	D3DTEXTURETRANSFORMFLAGS_Unknown78,
	D3DTEXTURETRANSFORMFLAGS_Unknown79,
	D3DTEXTURETRANSFORMFLAGS_Unknown80,
	D3DTEXTURETRANSFORMFLAGS_Unknown81,
	D3DTEXTURETRANSFORMFLAGS_Unknown82,
	D3DTEXTURETRANSFORMFLAGS_Unknown83,
	D3DTEXTURETRANSFORMFLAGS_Unknown84,
	D3DTEXTURETRANSFORMFLAGS_Unknown85,
	D3DTEXTURETRANSFORMFLAGS_Unknown86,
	D3DTEXTURETRANSFORMFLAGS_Unknown87,
	D3DTEXTURETRANSFORMFLAGS_Unknown88,
	D3DTEXTURETRANSFORMFLAGS_Unknown89,
	D3DTEXTURETRANSFORMFLAGS_Unknown90,
	D3DTEXTURETRANSFORMFLAGS_Unknown91,
	D3DTEXTURETRANSFORMFLAGS_Unknown92,
	D3DTEXTURETRANSFORMFLAGS_Unknown93,
	D3DTEXTURETRANSFORMFLAGS_Unknown94,
	D3DTEXTURETRANSFORMFLAGS_Unknown95,
	D3DTEXTURETRANSFORMFLAGS_Unknown96,
	D3DTEXTURETRANSFORMFLAGS_Unknown97,
	D3DTEXTURETRANSFORMFLAGS_Unknown98,
	D3DTEXTURETRANSFORMFLAGS_Unknown99,
	D3DTEXTURETRANSFORMFLAGS_Unknown100,
	D3DTEXTURETRANSFORMFLAGS_Unknown101,
	D3DTEXTURETRANSFORMFLAGS_Unknown102,
	D3DTEXTURETRANSFORMFLAGS_Unknown103,
	D3DTEXTURETRANSFORMFLAGS_Unknown104,
	D3DTEXTURETRANSFORMFLAGS_Unknown105,
	D3DTEXTURETRANSFORMFLAGS_Unknown106,
	D3DTEXTURETRANSFORMFLAGS_Unknown107,
	D3DTEXTURETRANSFORMFLAGS_Unknown108,
	D3DTEXTURETRANSFORMFLAGS_Unknown109,
	D3DTEXTURETRANSFORMFLAGS_Unknown110,
	D3DTEXTURETRANSFORMFLAGS_Unknown111,
	D3DTEXTURETRANSFORMFLAGS_Unknown112,
	D3DTEXTURETRANSFORMFLAGS_Unknown113,
	D3DTEXTURETRANSFORMFLAGS_Unknown114,
	D3DTEXTURETRANSFORMFLAGS_Unknown115,
	D3DTEXTURETRANSFORMFLAGS_Unknown116,
	D3DTEXTURETRANSFORMFLAGS_Unknown117,
	D3DTEXTURETRANSFORMFLAGS_Unknown118,
	D3DTEXTURETRANSFORMFLAGS_Unknown119,
	D3DTEXTURETRANSFORMFLAGS_Unknown120,
	D3DTEXTURETRANSFORMFLAGS_Unknown121,
	D3DTEXTURETRANSFORMFLAGS_Unknown122,
	D3DTEXTURETRANSFORMFLAGS_Unknown123,
	D3DTEXTURETRANSFORMFLAGS_Unknown124,
	D3DTEXTURETRANSFORMFLAGS_Unknown125,
	D3DTEXTURETRANSFORMFLAGS_Unknown126,
	D3DTEXTURETRANSFORMFLAGS_Unknown127,
	D3DTEXTURETRANSFORMFLAGS_Unknown128,
	D3DTEXTURETRANSFORMFLAGS_Unknown129,
	D3DTEXTURETRANSFORMFLAGS_Unknown130,
	D3DTEXTURETRANSFORMFLAGS_Unknown131,
	D3DTEXTURETRANSFORMFLAGS_Unknown132,
	D3DTEXTURETRANSFORMFLAGS_Unknown133,
	D3DTEXTURETRANSFORMFLAGS_Unknown134,
	D3DTEXTURETRANSFORMFLAGS_Unknown135,
	D3DTEXTURETRANSFORMFLAGS_Unknown136,
	D3DTEXTURETRANSFORMFLAGS_Unknown137,
	D3DTEXTURETRANSFORMFLAGS_Unknown138,
	D3DTEXTURETRANSFORMFLAGS_Unknown139,
	D3DTEXTURETRANSFORMFLAGS_Unknown140,
	D3DTEXTURETRANSFORMFLAGS_Unknown141,
	D3DTEXTURETRANSFORMFLAGS_Unknown142,
	D3DTEXTURETRANSFORMFLAGS_Unknown143,
	D3DTEXTURETRANSFORMFLAGS_Unknown144,
	D3DTEXTURETRANSFORMFLAGS_Unknown145,
	D3DTEXTURETRANSFORMFLAGS_Unknown146,
	D3DTEXTURETRANSFORMFLAGS_Unknown147,
	D3DTEXTURETRANSFORMFLAGS_Unknown148,
	D3DTEXTURETRANSFORMFLAGS_Unknown149,
	D3DTEXTURETRANSFORMFLAGS_Unknown150,
	D3DTEXTURETRANSFORMFLAGS_Unknown151,
	D3DTEXTURETRANSFORMFLAGS_Unknown152,
	D3DTEXTURETRANSFORMFLAGS_Unknown153,
	D3DTEXTURETRANSFORMFLAGS_Unknown154,
	D3DTEXTURETRANSFORMFLAGS_Unknown155,
	D3DTEXTURETRANSFORMFLAGS_Unknown156,
	D3DTEXTURETRANSFORMFLAGS_Unknown157,
	D3DTEXTURETRANSFORMFLAGS_Unknown158,
	D3DTEXTURETRANSFORMFLAGS_Unknown159,
	D3DTEXTURETRANSFORMFLAGS_Unknown160,
	D3DTEXTURETRANSFORMFLAGS_Unknown161,
	D3DTEXTURETRANSFORMFLAGS_Unknown162,
	D3DTEXTURETRANSFORMFLAGS_Unknown163,
	D3DTEXTURETRANSFORMFLAGS_Unknown164,
	D3DTEXTURETRANSFORMFLAGS_Unknown165,
	D3DTEXTURETRANSFORMFLAGS_Unknown166,
	D3DTEXTURETRANSFORMFLAGS_Unknown167,
	D3DTEXTURETRANSFORMFLAGS_Unknown168,
	D3DTEXTURETRANSFORMFLAGS_Unknown169,
	D3DTEXTURETRANSFORMFLAGS_Unknown170,
	D3DTEXTURETRANSFORMFLAGS_Unknown171,
	D3DTEXTURETRANSFORMFLAGS_Unknown172,
	D3DTEXTURETRANSFORMFLAGS_Unknown173,
	D3DTEXTURETRANSFORMFLAGS_Unknown174,
	D3DTEXTURETRANSFORMFLAGS_Unknown175,
	D3DTEXTURETRANSFORMFLAGS_Unknown176,
	D3DTEXTURETRANSFORMFLAGS_Unknown177,
	D3DTEXTURETRANSFORMFLAGS_Unknown178,
	D3DTEXTURETRANSFORMFLAGS_Unknown179,
	D3DTEXTURETRANSFORMFLAGS_Unknown180,
	D3DTEXTURETRANSFORMFLAGS_Unknown181,
	D3DTEXTURETRANSFORMFLAGS_Unknown182,
	D3DTEXTURETRANSFORMFLAGS_Unknown183,
	D3DTEXTURETRANSFORMFLAGS_Unknown184,
	D3DTEXTURETRANSFORMFLAGS_Unknown185,
	D3DTEXTURETRANSFORMFLAGS_Unknown186,
	D3DTEXTURETRANSFORMFLAGS_Unknown187,
	D3DTEXTURETRANSFORMFLAGS_Unknown188,
	D3DTEXTURETRANSFORMFLAGS_Unknown189,
	D3DTEXTURETRANSFORMFLAGS_Unknown190,
	D3DTEXTURETRANSFORMFLAGS_Unknown191,
	D3DTEXTURETRANSFORMFLAGS_Unknown192,
	D3DTEXTURETRANSFORMFLAGS_Unknown193,
	D3DTEXTURETRANSFORMFLAGS_Unknown194,
	D3DTEXTURETRANSFORMFLAGS_Unknown195,
	D3DTEXTURETRANSFORMFLAGS_Unknown196,
	D3DTEXTURETRANSFORMFLAGS_Unknown197,
	D3DTEXTURETRANSFORMFLAGS_Unknown198,
	D3DTEXTURETRANSFORMFLAGS_Unknown199,
	D3DTEXTURETRANSFORMFLAGS_Unknown200,
	D3DTEXTURETRANSFORMFLAGS_Unknown201,
	D3DTEXTURETRANSFORMFLAGS_Unknown202,
	D3DTEXTURETRANSFORMFLAGS_Unknown203,
	D3DTEXTURETRANSFORMFLAGS_Unknown204,
	D3DTEXTURETRANSFORMFLAGS_Unknown205,
	D3DTEXTURETRANSFORMFLAGS_Unknown206,
	D3DTEXTURETRANSFORMFLAGS_Unknown207,
	D3DTEXTURETRANSFORMFLAGS_Unknown208,
	D3DTEXTURETRANSFORMFLAGS_Unknown209,
	D3DTEXTURETRANSFORMFLAGS_Unknown210,
	D3DTEXTURETRANSFORMFLAGS_Unknown211,
	D3DTEXTURETRANSFORMFLAGS_Unknown212,
	D3DTEXTURETRANSFORMFLAGS_Unknown213,
	D3DTEXTURETRANSFORMFLAGS_Unknown214,
	D3DTEXTURETRANSFORMFLAGS_Unknown215,
	D3DTEXTURETRANSFORMFLAGS_Unknown216,
	D3DTEXTURETRANSFORMFLAGS_Unknown217,
	D3DTEXTURETRANSFORMFLAGS_Unknown218,
	D3DTEXTURETRANSFORMFLAGS_Unknown219,
	D3DTEXTURETRANSFORMFLAGS_Unknown220,
	D3DTEXTURETRANSFORMFLAGS_Unknown221,
	D3DTEXTURETRANSFORMFLAGS_Unknown222,
	D3DTEXTURETRANSFORMFLAGS_Unknown223,
	D3DTEXTURETRANSFORMFLAGS_Unknown224,
	D3DTEXTURETRANSFORMFLAGS_Unknown225,
	D3DTEXTURETRANSFORMFLAGS_Unknown226,
	D3DTEXTURETRANSFORMFLAGS_Unknown227,
	D3DTEXTURETRANSFORMFLAGS_Unknown228,
	D3DTEXTURETRANSFORMFLAGS_Unknown229,
	D3DTEXTURETRANSFORMFLAGS_Unknown230,
	D3DTEXTURETRANSFORMFLAGS_Unknown231,
	D3DTEXTURETRANSFORMFLAGS_Unknown232,
	D3DTEXTURETRANSFORMFLAGS_Unknown233,
	D3DTEXTURETRANSFORMFLAGS_Unknown234,
	D3DTEXTURETRANSFORMFLAGS_Unknown235,
	D3DTEXTURETRANSFORMFLAGS_Unknown236,
	D3DTEXTURETRANSFORMFLAGS_Unknown237,
	D3DTEXTURETRANSFORMFLAGS_Unknown238,
	D3DTEXTURETRANSFORMFLAGS_Unknown239,
	D3DTEXTURETRANSFORMFLAGS_Unknown240,
	D3DTEXTURETRANSFORMFLAGS_Unknown241,
	D3DTEXTURETRANSFORMFLAGS_Unknown242,
	D3DTEXTURETRANSFORMFLAGS_Unknown243,
	D3DTEXTURETRANSFORMFLAGS_Unknown244,
	D3DTEXTURETRANSFORMFLAGS_Unknown245,
	D3DTEXTURETRANSFORMFLAGS_Unknown246,
	D3DTEXTURETRANSFORMFLAGS_Unknown247,
	D3DTEXTURETRANSFORMFLAGS_Unknown248,
	D3DTEXTURETRANSFORMFLAGS_Unknown249,
	D3DTEXTURETRANSFORMFLAGS_Unknown250,
	D3DTEXTURETRANSFORMFLAGS_Unknown251,
	D3DTEXTURETRANSFORMFLAGS_Unknown252,
	D3DTEXTURETRANSFORMFLAGS_Unknown253,
	D3DTEXTURETRANSFORMFLAGS_Unknown254,
	D3DTEXTURETRANSFORMFLAGS_Unknown255,
	D3DTTFF_PROJECTED
	// Error : D3DTTFF_FORCE_DWORD = 0x7fffffff
  );

// Macros to set texture coordinate format bits in the FVF id

const
  D3DFVF_TEXTUREFORMAT2	= 0;	// Two floating point values
  D3DFVF_TEXTUREFORMAT1	= 3;	// One floating point value
  D3DFVF_TEXTUREFORMAT3	= 1;	// Three floating point values
  D3DFVF_TEXTUREFORMAT4	= 2;	// Four floating point values



//{$ENDIF}(* DIRECT3D_VERSION >= 0x0700 *)

// Error :  #pragma pack ( )
//{$ENDIF}(* _D3DTYPES_H_ *)


implementation

// Error :  #define D3DVALP ( val , prec ) ( ( Single ) ( val ) )
// Error :  #define D3DVAL ( val ) ( ( Single ) ( val ) )
// Error :  #define D3DDivide ( a , b ) ( Single ) ( ( double ) ( a ) / ( double ) ( b ) )
// Error :  #define D3DMultiply ( a , b ) ( ( a )* ( b ) )
(*
 * Format of CI colors is
 *  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 *  |    alpha      |         color index           |   fraction    |
 *  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 *)
// Error :  #define CI_GETALPHA ( ci ) ( ( ci ) >> 24 )
// Error :  #define CI_GETINDEX ( ci ) ( ( ( ci ) >> 8 ) & 0xffff )
// Error :  #define CI_GETFRACTION ( ci ) ( ( ci ) & 0xff )
// Error :  #define CI_ROUNDINDEX ( ci ) CI_GETINDEX ( ( ci ) + 0x80 )
// Error :  #define CI_MASKALPHA ( ci ) ( ( ci ) & 0xffffff )
// Error :  #define CI_MAKE ( a , i , f ) ( ( ( a ) << 24 ) | ( ( i ) << 8 ) | ( f ) )

(*
 * Format of RGBA colors is
 *  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 *  |    alpha      |      red      |     green     |     blue      |
 *  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 *)
// Error :  #define RGBA_GETALPHA ( rgb ) ( ( rgb ) >> 24 )
// Error :  #define RGBA_GETRED ( rgb ) ( ( ( rgb ) >> 16 ) & 0xff )
// Error :  #define RGBA_GETGREEN ( rgb ) ( ( ( rgb ) >> 8 ) & 0xff )
// Error :  #define RGBA_GETBLUE ( rgb ) ( ( rgb ) & 0xff )
// Error :  #define RGBA_MAKE ( r , g , b , a ) ( ( D3DCOLOR ) ( ( ( a ) << 24 ) | ( ( r ) << 16 ) | ( ( g ) << 8 ) | ( b ) ) )

(* D3DRGB and D3DRGBA may be used as initialisers for D3DCOLORs
 * The float values must be in the range 0..1
 *)
// Error :  #define D3DRGB ( r , g , b ) ( 0xff000000L | ( ( ( LongInt ) ( ( r ) *255 ) ) << 16 ) | ( ( ( LongInt ) ( ( g ) *255 ) ) << 8 ) | ( LongInt ) ( ( b ) *255 ) )
// Error :  #define D3DRGBA ( r , g , b , a ) ( ( ( ( LongInt ) ( ( a ) *255 ) ) << 24 ) | ( ( ( LongInt ) ( ( r ) *255 ) ) << 16 ) | ( ( ( LongInt ) ( ( g ) *255 ) ) << 8 ) | ( LongInt ) ( ( b ) *255 ) )

(*
 * Format of RGB colors is
 *  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 *  |    ignored    |      red      |     green     |     blue      |
 *  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 *)
// Error :  #define RGB_GETRED ( rgb ) ( ( ( rgb ) >> 16 ) & 0xff )
// Error :  #define RGB_GETGREEN ( rgb ) ( ( ( rgb ) >> 8 ) & 0xff )
// Error :  #define RGB_GETBLUE ( rgb ) ( ( rgb ) & 0xff )
// Error :  #define RGBA_SETALPHA ( rgba , x ) ( ( ( x ) << 24 ) | ( ( rgba ) & 0x00ffffff ) )
// Error :  #define RGB_MAKE ( r , g , b ) ( ( D3DCOLOR ) ( ( ( r ) << 16 ) | ( ( g ) << 8 ) | ( b ) ) )
// Error :  #define RGBA_TORGB ( rgba ) ( ( D3DCOLOR ) ( ( rgba ) & 0xffffff ) )
// Error :  #define RGB_TORGBA ( rgb ) ( ( D3DCOLOR ) ( ( rgb ) | 0xff000000 ) )

// Error :  #if ( DIRECT3D_VERSION >= 0x0500 )
// Error :  #if ( defined __cplusplus ) && ( defined D3D_OVERLOADS )

// Error :  public:

// =====================================
// Constructors
// =====================================

// Error :  _D3DVECTOR ( ) (* { } *)
// Error :  _D3DVECTOR ( D3DVALUE f ) ;
// Error :  _D3DVECTOR ( D3DVALUE _x , D3DVALUE _y , D3DVALUE _z ) ;
// Error :  _D3DVECTOR ( const D3DVALUE f[3] ) ;

// =====================================
// Access grants
// =====================================

// Error :  const D3DVALUE & operator[] ( Integer i ) const ;
// Error :  D3DVALUE & operator[] ( Integer i ) ;

// =====================================
// Assignment operators
// =====================================

// Error :  _D3DVECTOR & operator + = ( const _D3DVECTOR & v ) ;
// Error :  _D3DVECTOR & operator - = ( const _D3DVECTOR & v ) ;
// Error :  _D3DVECTOR & operator *= ( const _D3DVECTOR & v ) ;
// Error :  _D3DVECTOR & operator / = ( const _D3DVECTOR & v ) ;
// Error :  _D3DVECTOR & operator *= ( D3DVALUE s ) ;
// Error :  _D3DVECTOR & operator / = ( D3DVALUE s ) ;

// =====================================
// Unary operators
// =====================================

// Error :  friend _D3DVECTOR operator + ( const _D3DVECTOR & v ) ;
// Error :  friend _D3DVECTOR operator - ( const _D3DVECTOR & v ) ;


// =====================================
// Binary operators
// =====================================

// Addition and subtraction
// Error :  friend _D3DVECTOR operator + ( const _D3DVECTOR & v1 , const _D3DVECTOR & v2 ) ;
// Error :  friend _D3DVECTOR operator - ( const _D3DVECTOR & v1 , const _D3DVECTOR & v2 ) ;
// Scalar multiplication and division
// Error :  friend _D3DVECTOR operator* ( const _D3DVECTOR & v , D3DVALUE s ) ;
// Error :  friend _D3DVECTOR operator* ( D3DVALUE s , const _D3DVECTOR & v ) ;
// Error :  friend _D3DVECTOR operator / ( const _D3DVECTOR & v , D3DVALUE s ) ;
// Memberwise multiplication and division
// Error :  friend _D3DVECTOR operator* ( const _D3DVECTOR & v1 , const _D3DVECTOR & v2 ) ;
// Error :  friend _D3DVECTOR operator / ( const _D3DVECTOR & v1 , const _D3DVECTOR & v2 ) ;

// Vector dominance
// Error :  friend Integer operator < ( const _D3DVECTOR & v1 , const _D3DVECTOR & v2 ) ;
// Error :  friend Integer operator <= ( const _D3DVECTOR & v1 , const _D3DVECTOR & v2 ) ;

// Bitwise equality
// Error :  friend Integer operator == ( const _D3DVECTOR & v1 , const _D3DVECTOR & v2 ) ;

// Length-related functions
// Error :  friend D3DVALUE SquareMagnitude ( const _D3DVECTOR & v ) ;
// Error :  friend D3DVALUE Magnitude ( const _D3DVECTOR & v ) ;

// Returns vector with same direction and unit length
// Error :  friend _D3DVECTOR Normalize ( const _D3DVECTOR & v ) ;

// Return min/max component of the input vector
// Error :  friend D3DVALUE Min ( const _D3DVECTOR & v ) ;
// Error :  friend D3DVALUE Max ( const _D3DVECTOR & v ) ;

// Return memberwise min/max of input vectors
// Error :  friend _D3DVECTOR Minimize ( const _D3DVECTOR & v1 , const _D3DVECTOR & v2 ) ;
// Error :  friend _D3DVECTOR Maximize ( const _D3DVECTOR & v1 , const _D3DVECTOR & v2 ) ;

// Dot and cross product
// Error :  friend D3DVALUE DotProduct ( const _D3DVECTOR & v1 , const _D3DVECTOR & v2 ) ;
// Error :  friend _D3DVECTOR CrossProduct ( const _D3DVECTOR & v1 , const _D3DVECTOR & v2 ) ;

// Error :  #define D3DFVF_TEXCOORDSIZE3 ( CoordIndex ) ( D3DFVF_TEXTUREFORMAT3 << ( CoordIndex *2 + 16 ) )
// Error :  #define D3DFVF_TEXCOORDSIZE2 ( CoordIndex ) ( D3DFVF_TEXTUREFORMAT2 )
// Error :  #define D3DFVF_TEXCOORDSIZE4 ( CoordIndex ) ( D3DFVF_TEXTUREFORMAT4 << ( CoordIndex *2 + 16 ) )
// Error :  #define D3DFVF_TEXCOORDSIZE1 ( CoordIndex ) ( D3DFVF_TEXTUREFORMAT1 << ( CoordIndex *2 + 16 ) )

end.
