📄 direct3d.pas
字号:
(* 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);
{$EXTERNALSYM D3DSTATUS_CLIPUNIONALL}
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);
{$EXTERNALSYM D3DSTATUS_CLIPINTERSECTIONALL}
D3DSTATUS_DEFAULT = (
D3DSTATUS_CLIPINTERSECTIONALL or
D3DSTATUS_ZNOTVISIBLE);
{$EXTERNALSYM D3DSTATUS_DEFAULT}
(*
* Options for direct transform calls
*)
D3DTRANSFORM_CLIPPED = $00000001;
{$EXTERNALSYM D3DTRANSFORM_CLIPPED}
D3DTRANSFORM_UNCLIPPED = $00000002;
{$EXTERNALSYM D3DTRANSFORM_UNCLIPPED}
type
PD3DTransformData = ^TD3DTransformData;
_D3DTRANSFORMDATA = packed record
dwSize: DWORD;
lpIn: Pointer; (* Input vertices *)
dwInSize: DWORD; (* Stride of input vertices *)
lpOut: Pointer; (* Output vertices *)
dwOutSize: DWORD; (* Stride of output vertices *)
lpHOut: ^TD3DHVertex; (* Output homogeneous vertices *)
dwClip: DWORD; (* Clipping hint *)
dwClipIntersection: DWORD;
dwClipUnion: DWORD; (* Union of all clip flags *)
drExtent: TD3DRect; (* Extent of transformed vertices *)
end;
{$EXTERNALSYM _D3DTRANSFORMDATA}
D3DTRANSFORMDATA = _D3DTRANSFORMDATA;
{$EXTERNALSYM D3DTRANSFORMDATA}
TD3DTransformData = _D3DTRANSFORMDATA;
(*
* Structure defining position and direction properties for lighting.
*)
PD3DLightingElement = ^TD3DLightingElement;
_D3DLIGHTINGELEMENT = packed record
dvPosition: TD3DVector; (* Lightable point in model space *)
dvNormal: TD3DVector; (* Normalised unit vector *)
end;
{$EXTERNALSYM _D3DLIGHTINGELEMENT}
D3DLIGHTINGELEMENT = _D3DLIGHTINGELEMENT;
{$EXTERNALSYM D3DLIGHTINGELEMENT}
TD3DLightingElement = _D3DLIGHTINGELEMENT;
(*
* Structure defining material properties for lighting.
*)
PD3DMaterial = ^TD3DMaterial;
_D3DMATERIAL = packed record
dwSize: DWORD;
case Integer of
0: (
diffuse: TD3DColorValue; (* Diffuse color RGBA *)
ambient: TD3DColorValue; (* Ambient color RGB *)
specular: TD3DColorValue; (* Specular 'shininess' *)
emissive: TD3DColorValue; (* Emissive color RGB *)
power: TD3DValue; (* Sharpness if specular highlight *)
hTexture: TD3DTextureHandle; (* Handle to texture map *)
dwRampSize: DWORD;
);
1: (
dcvDiffuse: TD3DColorValue;
dcvAmbient: TD3DColorValue;
dcvSpecular: TD3DColorValue;
dcvEmissive: TD3DColorValue;
dvPower: TD3DValue;
);
end;
{$EXTERNALSYM _D3DMATERIAL}
D3DMATERIAL = _D3DMATERIAL;
{$EXTERNALSYM D3DMATERIAL}
TD3DMaterial = _D3DMATERIAL;
{$IFDEF DIRECT3D_VERSION_7}
PD3DMaterial7 = ^TD3DMaterial7;
_D3DMATERIAL7 = packed record
case Integer of
0: (
diffuse: TD3DColorValue; (* Diffuse color RGBA *)
ambient: TD3DColorValue; (* Ambient color RGB *)
specular: TD3DColorValue; (* Specular 'shininess' *)
emissive: TD3DColorValue; (* Emissive color RGB *)
power: TD3DValue; (* Sharpness if specular highlight *)
);
1: (
dcvDiffuse: TD3DColorValue;
dcvAmbient: TD3DColorValue;
dcvSpecular: TD3DColorValue;
dcvEmissive: TD3DColorValue;
dvPower: TD3DValue;
);
end;
{$EXTERNALSYM _D3DMATERIAL7}
D3DMATERIAL7 = _D3DMATERIAL7;
{$EXTERNALSYM D3DMATERIAL7}
TD3DMaterial7 = _D3DMATERIAL7;
{$ENDIF} // DIRECT3D_VERSION_7
{$IFDEF DIRECT3D_VERSION_LESS_8}
PD3DLightType = ^TD3DLightType;
_D3DLIGHTTYPE = (
D3DLIGHT_INVALID_0,
D3DLIGHT_POINT,
D3DLIGHT_SPOT,
D3DLIGHT_DIRECTIONAL,
// Note: The following light type (D3DLIGHT_PARALLELPOINT)
// is no longer supported from D3D for DX7 onwards.
D3DLIGHT_PARALLELPOINT
{$IFDEF DIRECT3D_VERSION_LESS_5}, // For backward compatible headers
D3DLIGHT_GLSPOT
{$ENDIF} // DIRECT3D_VERSION_LESS_5
);
{$EXTERNALSYM _D3DLIGHTTYPE}
D3DLIGHTTYPE = _D3DLIGHTTYPE;
{$EXTERNALSYM D3DLIGHTTYPE}
TD3DLightType = _D3DLIGHTTYPE;
{$ELSE}
const
D3DLIGHT_PARALLELPOINT = TD3DLightType(4);
{$EXTERNALSYM D3DLIGHT_PARALLELPOINT}
D3DLIGHT_GLSPOT = TD3DLightType(5);
{$EXTERNALSYM D3DLIGHT_GLSPOT}
type
{$ENDIF} //(DIRECT3D_VERSION < 0x0800)
(*
* Structure defining a light source and its properties.
*)
PD3DLight = ^TD3DLight;
_D3DLIGHT = packed record
dwSize: DWORD;
dltType: TD3DLightType; (* Type of light source *)
dcvColor: TD3DColorValue; (* Color of light *)
dvPosition: TD3DVector; (* Position in world space *)
dvDirection: TD3DVector; (* Direction in world space *)
dvRange: TD3DValue; (* Cutoff range *)
dvFalloff: TD3DValue; (* Falloff *)
dvAttenuation0: TD3DValue; (* Constant attenuation *)
dvAttenuation1: TD3DValue; (* Linear attenuation *)
dvAttenuation2: TD3DValue; (* Quadratic attenuation *)
dvTheta: TD3DValue; (* Inner angle of spotlight cone *)
dvPhi: TD3DValue; (* Outer angle of spotlight cone *)
end;
{$EXTERNALSYM _D3DLIGHT}
D3DLIGHT = _D3DLIGHT;
{$EXTERNALSYM D3DLIGHT}
TD3DLight = _D3DLIGHT;
{$IFDEF DIRECT3D_VERSION_7}
PD3DLight7 = ^TD3DLight7;
_D3DLIGHT7 = packed record
dltType: TD3DLightType; (* Type of light source *)
dcvDiffuse: TD3DColorValue; (* Diffuse color of light *)
dcvSpecular: TD3DColorValue;(* Specular color of light *)
dcvAmbient: TD3DColorValue; (* Ambient color of light *)
dvPosition: TD3DVector; (* Position in world space *)
dvDirection: TD3DVector; (* Direction in world space *)
dvRange: TD3DValue; (* Cutoff range *)
dvFalloff: TD3DValue; (* Falloff *)
dvAttenuation0: TD3DValue; (* Constant attenuation *)
dvAttenuation1: TD3DValue; (* Linear attenuation *)
dvAttenuation2: TD3DValue; (* Quadratic attenuation *)
dvTheta: TD3DValue; (* Inner angle of spotlight cone *)
dvPhi: TD3DValue; (* Outer angle of spotlight cone *)
end;
{$EXTERNALSYM _D3DLIGHT7}
D3DLIGHT7 = _D3DLIGHT7;
{$EXTERNALSYM D3DLIGHT7}
TD3DLight7 = _D3DLIGHT7;
{$ENDIF} // DIRECT3D_VERSION_7
{$IFDEF DIRECT3D_VERSION_5}
(*
* Structure defining a light source and its properties.
*)
(* flags bits *)
const
D3DLIGHT_ACTIVE = $00000001;
{$EXTERNALSYM D3DLIGHT_ACTIVE}
D3DLIGHT_NO_SPECULAR = $00000002;
{$EXTERNALSYM D3DLIGHT_NO_SPECULAR}
D3DLIGHT_ALL = D3DLIGHT_ACTIVE or D3DLIGHT_ACTIVE;
{$EXTERNALSYM D3DLIGHT_ALL}
(* maximum valid light range *)
D3DLIGHT_RANGE_MAX = 1.8439088915e+18; //sqrt(FLT_MAX);
{$EXTERNALSYM D3DLIGHT_RANGE_MAX}
type
PD3DLight2 = ^TD3DLight2;
_D3DLIGHT2 = packed record
dwSize: DWORD;
dltType: TD3DLightType; (* Type of light source *)
dcvColor: TD3DColorValue; (* Color of light *)
dvPosition: TD3DVector; (* Position in world space *)
dvDirection: TD3DVector; (* Direction in world space *)
dvRange: TD3DValue; (* Cutoff range *)
dvFalloff: TD3DValue; (* Falloff *)
dvAttenuation0: TD3DValue; (* Constant attenuation *)
dvAttenuation1: TD3DValue; (* Linear attenuation *)
dvAttenuation2: TD3DValue; (* Quadratic attenuation *)
dvTheta: TD3DValue; (* Inner angle of spotlight cone *)
dvPhi: TD3DValue; (* Outer angle of spotlight cone *)
dwFlags: DWORD;
end;
{$EXTERNALSYM _D3DLIGHT2}
D3DLIGHT2 = _D3DLIGHT2;
{$EXTERNALSYM D3DLIGHT2}
TD3DLight2 = _D3DLIGHT2;
{$ELSE}
PD3DLight2 = PD3DLight;
TD3DLight2 = TD3DLight;
{$ENDIF} // DIRECT3D_VERSION_5
PD3DLightData = ^TD3DLightData;
_D3DLIGHTDATA = packed record
dwSize: DWORD;
lpIn: ^TD3DLightingElement; (* Input positions and normals *)
dwInSize: DWORD; (* Stride of input elements *)
lpOut: ^TD3DTLVertex; (* Output colors *)
dwOutSize: DWORD; (* Stride of output colors *)
end;
{$EXTERNALSYM _D3DLIGHTDATA}
D3DLIGHTDATA = _D3DLIGHTDATA;
{$EXTERNALSYM D3DLIGHTDATA}
TD3DLightData = _D3DLIGHTDATA;
(*
* Before DX5, these values were in an enum called
* TD3DColorModel. This was not correct, since they are
* bit flags. A driver can surface either or both flags
* in the dcmColorModel member of D3DDEVICEDESC.
*)
type
TD3DColorModel = DWORD;
const
D3DCOLOR_MONO = 1;
{$EXTERNALSYM D3DCOLOR_MONO}
D3DCOLOR_RGB = 2;
{$EXTERNALSYM D3DCOLOR_RGB}
(*
* Options for clearing
*)
const
D3DCLEAR_TARGET = $00000001; (* Clear target surface *)
{$EXTERNALSYM D3DCLEAR_TARGET}
D3DCLEAR_ZBUFFER = $00000002; (* Clear target z buffer *)
{$EXTERNALSYM D3DCLEAR_ZBUFFER}
{$IFDEF DIRECT3D_VERSION_6}
D3DCLEAR_STENCIL = $00000004; (* Clear stencil planes *)
{$EXTERNALSYM D3DCLEAR_STENCIL}
{$ENDIF} // DIRECT3D_VERSION_6
(*
* 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
PD3DOpcode = ^TD3DOpcode;
_D3DOPCODE = (
D3DOP_INVALID_0,
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);
{$EXTERNALSYM _D3DOPCODE}
D3DOPCODE = _D3DOPCODE;
{$EXTERNALSYM D3DOPCODE}
TD3DOpcode = _D3DOPCODE;
PD3DInstruction = ^TD3DInstruction;
_D3DINSTRUCTION = packed record
bOpcode: Byte; (* Instruction opcode *)
bSize: Byte; (* Size of each instruction data unit *)
wCount: Word; (* Count of instruction data units to follow *)
end;
{$EXTERNALSYM _D3DINSTRUCTION}
D3DINSTRUCTION = _D3DINSTRUCTION;
{$EXTERNALSYM D3DINSTRUCTION}
TD3DInstruction = _D3DINSTRUCTION;
(*
* Structure for texture loads
*)
PD3DTextureLoad = ^TD3DTextureLoad;
_D3DTEXTURELOAD = packed record
hDestTexture: TD3DTextureHandle;
hSrcTexture: TD3DTextureHandle;
end;
{$EXTERNALSYM _D3DTEXTURELOAD}
D3DTEXTURELOAD = _D3DTEXTURELOAD;
{$EXTERNALSYM D3DTEXTURELOAD}
TD3DTextureLoad = _D3DTEXTURELOAD;
(*
* Structure for picking
*)
PD3DPickRecord = ^TD3DPickRecord;
_D3DPICKRECORD = packed record
bOpcode: Byte;
bPad: Byte;
dwOffset: DWORD;
dvZ: TD3DValue;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -