Direct3D.pas
上传用户:hylc_2004
上传日期:2014-01-23
资源大小:46800k
文件大小:214k
- (* TD3DPrimCaps dwSourceBlendCaps, dwDestBlendCaps *)
- D3DPBLENDCAPS_ZERO = $00000001;
- {$EXTERNALSYM D3DPBLENDCAPS_ZERO}
- D3DPBLENDCAPS_ONE = $00000002;
- {$EXTERNALSYM D3DPBLENDCAPS_ONE}
- D3DPBLENDCAPS_SRCCOLOR = $00000004;
- {$EXTERNALSYM D3DPBLENDCAPS_SRCCOLOR}
- D3DPBLENDCAPS_INVSRCCOLOR = $00000008;
- {$EXTERNALSYM D3DPBLENDCAPS_INVSRCCOLOR}
- D3DPBLENDCAPS_SRCALPHA = $00000010;
- {$EXTERNALSYM D3DPBLENDCAPS_SRCALPHA}
- D3DPBLENDCAPS_INVSRCALPHA = $00000020;
- {$EXTERNALSYM D3DPBLENDCAPS_INVSRCALPHA}
- D3DPBLENDCAPS_DESTALPHA = $00000040;
- {$EXTERNALSYM D3DPBLENDCAPS_DESTALPHA}
- D3DPBLENDCAPS_INVDESTALPHA = $00000080;
- {$EXTERNALSYM D3DPBLENDCAPS_INVDESTALPHA}
- D3DPBLENDCAPS_DESTCOLOR = $00000100;
- {$EXTERNALSYM D3DPBLENDCAPS_DESTCOLOR}
- D3DPBLENDCAPS_INVDESTCOLOR = $00000200;
- {$EXTERNALSYM D3DPBLENDCAPS_INVDESTCOLOR}
- D3DPBLENDCAPS_SRCALPHASAT = $00000400;
- {$EXTERNALSYM D3DPBLENDCAPS_SRCALPHASAT}
- D3DPBLENDCAPS_BOTHSRCALPHA = $00000800;
- {$EXTERNALSYM D3DPBLENDCAPS_BOTHSRCALPHA}
- D3DPBLENDCAPS_BOTHINVSRCALPHA = $00001000;
- {$EXTERNALSYM D3DPBLENDCAPS_BOTHINVSRCALPHA}
- (* TD3DPrimCaps dwShadeCaps *)
- D3DPSHADECAPS_COLORFLATMONO = $00000001;
- {$EXTERNALSYM D3DPSHADECAPS_COLORFLATMONO}
- D3DPSHADECAPS_COLORFLATRGB = $00000002;
- {$EXTERNALSYM D3DPSHADECAPS_COLORFLATRGB}
- D3DPSHADECAPS_COLORGOURAUDMONO = $00000004;
- {$EXTERNALSYM D3DPSHADECAPS_COLORGOURAUDMONO}
- D3DPSHADECAPS_COLORGOURAUDRGB = $00000008;
- {$EXTERNALSYM D3DPSHADECAPS_COLORGOURAUDRGB}
- D3DPSHADECAPS_COLORPHONGMONO = $00000010;
- {$EXTERNALSYM D3DPSHADECAPS_COLORPHONGMONO}
- D3DPSHADECAPS_COLORPHONGRGB = $00000020;
- {$EXTERNALSYM D3DPSHADECAPS_COLORPHONGRGB}
- D3DPSHADECAPS_SPECULARFLATMONO = $00000040;
- {$EXTERNALSYM D3DPSHADECAPS_SPECULARFLATMONO}
- D3DPSHADECAPS_SPECULARFLATRGB = $00000080;
- {$EXTERNALSYM D3DPSHADECAPS_SPECULARFLATRGB}
- D3DPSHADECAPS_SPECULARGOURAUDMONO = $00000100;
- {$EXTERNALSYM D3DPSHADECAPS_SPECULARGOURAUDMONO}
- D3DPSHADECAPS_SPECULARGOURAUDRGB = $00000200;
- {$EXTERNALSYM D3DPSHADECAPS_SPECULARGOURAUDRGB}
- D3DPSHADECAPS_SPECULARPHONGMONO = $00000400;
- {$EXTERNALSYM D3DPSHADECAPS_SPECULARPHONGMONO}
- D3DPSHADECAPS_SPECULARPHONGRGB = $00000800;
- {$EXTERNALSYM D3DPSHADECAPS_SPECULARPHONGRGB}
- D3DPSHADECAPS_ALPHAFLATBLEND = $00001000;
- {$EXTERNALSYM D3DPSHADECAPS_ALPHAFLATBLEND}
- D3DPSHADECAPS_ALPHAFLATSTIPPLED = $00002000;
- {$EXTERNALSYM D3DPSHADECAPS_ALPHAFLATSTIPPLED}
- D3DPSHADECAPS_ALPHAGOURAUDBLEND = $00004000;
- {$EXTERNALSYM D3DPSHADECAPS_ALPHAGOURAUDBLEND}
- D3DPSHADECAPS_ALPHAGOURAUDSTIPPLED = $00008000;
- {$EXTERNALSYM D3DPSHADECAPS_ALPHAGOURAUDSTIPPLED}
- D3DPSHADECAPS_ALPHAPHONGBLEND = $00010000;
- {$EXTERNALSYM D3DPSHADECAPS_ALPHAPHONGBLEND}
- D3DPSHADECAPS_ALPHAPHONGSTIPPLED = $00020000;
- {$EXTERNALSYM D3DPSHADECAPS_ALPHAPHONGSTIPPLED}
- D3DPSHADECAPS_FOGFLAT = $00040000;
- {$EXTERNALSYM D3DPSHADECAPS_FOGFLAT}
- D3DPSHADECAPS_FOGGOURAUD = $00080000;
- {$EXTERNALSYM D3DPSHADECAPS_FOGGOURAUD}
- D3DPSHADECAPS_FOGPHONG = $00100000;
- {$EXTERNALSYM D3DPSHADECAPS_FOGPHONG}
- (* TD3DPrimCaps dwTextureCaps *)
- (*
- * Perspective-correct texturing is supported
- *)
- D3DPTEXTURECAPS_PERSPECTIVE = $00000001;
- {$EXTERNALSYM D3DPTEXTURECAPS_PERSPECTIVE}
- (*
- * Power-of-2 texture dimensions are required
- *)
- D3DPTEXTURECAPS_POW2 = $00000002;
- {$EXTERNALSYM D3DPTEXTURECAPS_POW2}
- (*
- * Alpha in texture pixels is supported
- *)
- D3DPTEXTURECAPS_ALPHA = $00000004;
- {$EXTERNALSYM D3DPTEXTURECAPS_ALPHA}
- (*
- * Color-keyed textures are supported
- *)
- D3DPTEXTURECAPS_TRANSPARENCY = $00000008;
- {$EXTERNALSYM D3DPTEXTURECAPS_TRANSPARENCY}
- (*
- * obsolete, see D3DPTADDRESSCAPS_BORDER
- *)
- D3DPTEXTURECAPS_BORDER = $00000010;
- {$EXTERNALSYM D3DPTEXTURECAPS_BORDER}
- (*
- * Only square textures are supported
- *)
- D3DPTEXTURECAPS_SQUAREONLY = $00000020;
- {$EXTERNALSYM D3DPTEXTURECAPS_SQUAREONLY}
- {$IFDEF DIRECT3D_VERSION_6}
- (*
- * Texture indices are not scaled by the texture size prior
- * to interpolation.
- *)
- D3DPTEXTURECAPS_TEXREPEATNOTSCALEDBYSIZE = $00000040;
- {$EXTERNALSYM D3DPTEXTURECAPS_TEXREPEATNOTSCALEDBYSIZE}
- (*
- * Device can draw alpha from texture palettes
- *)
- D3DPTEXTURECAPS_ALPHAPALETTE = $00000080;
- {$EXTERNALSYM D3DPTEXTURECAPS_ALPHAPALETTE}
- (*
- * Device can use non-POW2 textures if:
- * 1) D3DTEXTURE_ADDRESS is set to CLAMP for this texture's stage
- * 2) D3DRS_WRAP(N) is zero for this texture's coordinates
- * 3) mip mapping is not enabled (use magnification filter only)
- *)
- D3DPTEXTURECAPS_NONPOW2CONDITIONAL = $00000100;
- {$EXTERNALSYM D3DPTEXTURECAPS_NONPOW2CONDITIONAL}
- {$ENDIF} // DIRECT3D_VERSION_6
- {$IFDEF DIRECT3D_VERSION_7}
- // 0x00000200L unused
- (*
- * Device can divide transformed texture coordinates by the
- * COUNTth texture coordinate (can do D3DTTFF_PROJECTED)
- *)
- D3DPTEXTURECAPS_PROJECTED = $00000400;
- {$EXTERNALSYM D3DPTEXTURECAPS_PROJECTED}
- (*
- * Device can do cubemap textures
- *)
- D3DPTEXTURECAPS_CUBEMAP = $00000800;
- {$EXTERNALSYM D3DPTEXTURECAPS_CUBEMAP}
- D3DPTEXTURECAPS_COLORKEYBLEND = $00001000;
- {$EXTERNALSYM D3DPTEXTURECAPS_COLORKEYBLEND}
- {$ENDIF} // DIRECT3D_VERSION_7
- (* TD3DPrimCaps dwTextureFilterCaps *)
- D3DPTFILTERCAPS_NEAREST = $00000001;
- {$EXTERNALSYM D3DPTFILTERCAPS_NEAREST}
- D3DPTFILTERCAPS_LINEAR = $00000002;
- {$EXTERNALSYM D3DPTFILTERCAPS_LINEAR}
- D3DPTFILTERCAPS_MIPNEAREST = $00000004;
- {$EXTERNALSYM D3DPTFILTERCAPS_MIPNEAREST}
- D3DPTFILTERCAPS_MIPLINEAR = $00000008;
- {$EXTERNALSYM D3DPTFILTERCAPS_MIPLINEAR}
- D3DPTFILTERCAPS_LINEARMIPNEAREST = $00000010;
- {$EXTERNALSYM D3DPTFILTERCAPS_LINEARMIPNEAREST}
- D3DPTFILTERCAPS_LINEARMIPLINEAR = $00000020;
- {$EXTERNALSYM D3DPTFILTERCAPS_LINEARMIPLINEAR}
- {$IFDEF DIRECT3D_VERSION_6}
- (* Device3 Min Filter *)
- D3DPTFILTERCAPS_MINFPOINT = $00000100;
- {$EXTERNALSYM D3DPTFILTERCAPS_MINFPOINT}
- D3DPTFILTERCAPS_MINFLINEAR = $00000200;
- {$EXTERNALSYM D3DPTFILTERCAPS_MINFLINEAR}
- D3DPTFILTERCAPS_MINFANISOTROPIC = $00000400;
- {$EXTERNALSYM D3DPTFILTERCAPS_MINFANISOTROPIC}
- (* Device3 Mip Filter *)
- D3DPTFILTERCAPS_MIPFPOINT = $00010000;
- {$EXTERNALSYM D3DPTFILTERCAPS_MIPFPOINT}
- D3DPTFILTERCAPS_MIPFLINEAR = $00020000;
- {$EXTERNALSYM D3DPTFILTERCAPS_MIPFLINEAR}
- (* Device3 Mag Filter *)
- D3DPTFILTERCAPS_MAGFPOINT = $01000000;
- {$EXTERNALSYM D3DPTFILTERCAPS_MAGFPOINT}
- D3DPTFILTERCAPS_MAGFLINEAR = $02000000;
- {$EXTERNALSYM D3DPTFILTERCAPS_MAGFLINEAR}
- D3DPTFILTERCAPS_MAGFANISOTROPIC = $04000000;
- {$EXTERNALSYM D3DPTFILTERCAPS_MAGFANISOTROPIC}
- D3DPTFILTERCAPS_MAGFAFLATCUBIC = $08000000;
- {$EXTERNALSYM D3DPTFILTERCAPS_MAGFAFLATCUBIC}
- D3DPTFILTERCAPS_MAGFGAUSSIANCUBIC = $10000000;
- {$EXTERNALSYM D3DPTFILTERCAPS_MAGFGAUSSIANCUBIC}
- {$ENDIF} // DIRECT3D_VERSION_6
- (* TD3DPrimCaps dwTextureBlendCaps *)
- D3DPTBLENDCAPS_DECAL = $00000001;
- {$EXTERNALSYM D3DPTBLENDCAPS_DECAL}
- D3DPTBLENDCAPS_MODULATE = $00000002;
- {$EXTERNALSYM D3DPTBLENDCAPS_MODULATE}
- D3DPTBLENDCAPS_DECALALPHA = $00000004;
- {$EXTERNALSYM D3DPTBLENDCAPS_DECALALPHA}
- D3DPTBLENDCAPS_MODULATEALPHA = $00000008;
- {$EXTERNALSYM D3DPTBLENDCAPS_MODULATEALPHA}
- D3DPTBLENDCAPS_DECALMASK = $00000010;
- {$EXTERNALSYM D3DPTBLENDCAPS_DECALMASK}
- D3DPTBLENDCAPS_MODULATEMASK = $00000020;
- {$EXTERNALSYM D3DPTBLENDCAPS_MODULATEMASK}
- D3DPTBLENDCAPS_COPY = $00000040;
- {$EXTERNALSYM D3DPTBLENDCAPS_COPY}
- {$IFDEF DIRECT3D_VERSION_5}
- D3DPTBLENDCAPS_ADD = $00000080;
- {$EXTERNALSYM D3DPTBLENDCAPS_ADD}
- {$ENDIF} // DIRECT3D_VERSION_5
- (* TD3DPrimCaps dwTextureAddressCaps *)
- D3DPTADDRESSCAPS_WRAP = $00000001;
- {$EXTERNALSYM D3DPTADDRESSCAPS_WRAP}
- D3DPTADDRESSCAPS_MIRROR = $00000002;
- {$EXTERNALSYM D3DPTADDRESSCAPS_MIRROR}
- D3DPTADDRESSCAPS_CLAMP = $00000004;
- {$EXTERNALSYM D3DPTADDRESSCAPS_CLAMP}
- {$IFDEF DIRECT3D_VERSION_5}
- D3DPTADDRESSCAPS_BORDER = $00000008;
- {$EXTERNALSYM D3DPTADDRESSCAPS_BORDER}
- D3DPTADDRESSCAPS_INDEPENDENTUV = $00000010;
- {$EXTERNALSYM D3DPTADDRESSCAPS_INDEPENDENTUV}
- {$ENDIF} // DIRECT3D_VERSION_5
- {$IFDEF DIRECT3D_VERSION_6}
- (* D3DDEVICEDESC dwStencilCaps *)
- D3DSTENCILCAPS_KEEP = $00000001;
- {$EXTERNALSYM D3DSTENCILCAPS_KEEP}
- D3DSTENCILCAPS_ZERO = $00000002;
- {$EXTERNALSYM D3DSTENCILCAPS_ZERO}
- D3DSTENCILCAPS_REPLACE = $00000004;
- {$EXTERNALSYM D3DSTENCILCAPS_REPLACE}
- D3DSTENCILCAPS_INCRSAT = $00000008;
- {$EXTERNALSYM D3DSTENCILCAPS_INCRSAT}
- D3DSTENCILCAPS_DECRSAT = $00000010;
- {$EXTERNALSYM D3DSTENCILCAPS_DECRSAT}
- D3DSTENCILCAPS_INVERT = $00000020;
- {$EXTERNALSYM D3DSTENCILCAPS_INVERT}
- D3DSTENCILCAPS_INCR = $00000040;
- {$EXTERNALSYM D3DSTENCILCAPS_INCR}
- D3DSTENCILCAPS_DECR = $00000080;
- {$EXTERNALSYM D3DSTENCILCAPS_DECR}
- (* D3DDEVICEDESC dwTextureOpCaps *)
- D3DTEXOPCAPS_DISABLE = $00000001;
- {$EXTERNALSYM D3DTEXOPCAPS_DISABLE}
- D3DTEXOPCAPS_SELECTARG1 = $00000002;
- {$EXTERNALSYM D3DTEXOPCAPS_SELECTARG1}
- D3DTEXOPCAPS_SELECTARG2 = $00000004;
- {$EXTERNALSYM D3DTEXOPCAPS_SELECTARG2}
- D3DTEXOPCAPS_MODULATE = $00000008;
- {$EXTERNALSYM D3DTEXOPCAPS_MODULATE}
- D3DTEXOPCAPS_MODULATE2X = $00000010;
- {$EXTERNALSYM D3DTEXOPCAPS_MODULATE2X}
- D3DTEXOPCAPS_MODULATE4X = $00000020;
- {$EXTERNALSYM D3DTEXOPCAPS_MODULATE4X}
- D3DTEXOPCAPS_ADD = $00000040;
- {$EXTERNALSYM D3DTEXOPCAPS_ADD}
- D3DTEXOPCAPS_ADDSIGNED = $00000080;
- {$EXTERNALSYM D3DTEXOPCAPS_ADDSIGNED}
- D3DTEXOPCAPS_ADDSIGNED2X = $00000100;
- {$EXTERNALSYM D3DTEXOPCAPS_ADDSIGNED2X}
- D3DTEXOPCAPS_SUBTRACT = $00000200;
- {$EXTERNALSYM D3DTEXOPCAPS_SUBTRACT}
- D3DTEXOPCAPS_ADDSMOOTH = $00000400;
- {$EXTERNALSYM D3DTEXOPCAPS_ADDSMOOTH}
- D3DTEXOPCAPS_BLENDDIFFUSEALPHA = $00000800;
- {$EXTERNALSYM D3DTEXOPCAPS_BLENDDIFFUSEALPHA}
- D3DTEXOPCAPS_BLENDTEXTUREALPHA = $00001000;
- {$EXTERNALSYM D3DTEXOPCAPS_BLENDTEXTUREALPHA}
- D3DTEXOPCAPS_BLENDFACTORALPHA = $00002000;
- {$EXTERNALSYM D3DTEXOPCAPS_BLENDFACTORALPHA}
- D3DTEXOPCAPS_BLENDTEXTUREALPHAPM = $00004000;
- {$EXTERNALSYM D3DTEXOPCAPS_BLENDTEXTUREALPHAPM}
- D3DTEXOPCAPS_BLENDCURRENTALPHA = $00008000;
- {$EXTERNALSYM D3DTEXOPCAPS_BLENDCURRENTALPHA}
- D3DTEXOPCAPS_PREMODULATE = $00010000;
- {$EXTERNALSYM D3DTEXOPCAPS_PREMODULATE}
- D3DTEXOPCAPS_MODULATEALPHA_ADDCOLOR = $00020000;
- {$EXTERNALSYM D3DTEXOPCAPS_MODULATEALPHA_ADDCOLOR}
- D3DTEXOPCAPS_MODULATECOLOR_ADDALPHA = $00040000;
- {$EXTERNALSYM D3DTEXOPCAPS_MODULATECOLOR_ADDALPHA}
- D3DTEXOPCAPS_MODULATEINVALPHA_ADDCOLOR = $00080000;
- {$EXTERNALSYM D3DTEXOPCAPS_MODULATEINVALPHA_ADDCOLOR}
- D3DTEXOPCAPS_MODULATEINVCOLOR_ADDALPHA = $00100000;
- {$EXTERNALSYM D3DTEXOPCAPS_MODULATEINVCOLOR_ADDALPHA}
- D3DTEXOPCAPS_BUMPENVMAP = $00200000;
- {$EXTERNALSYM D3DTEXOPCAPS_BUMPENVMAP}
- D3DTEXOPCAPS_BUMPENVMAPLUMINANCE = $00400000;
- {$EXTERNALSYM D3DTEXOPCAPS_BUMPENVMAPLUMINANCE}
- D3DTEXOPCAPS_DOTPRODUCT3 = $00800000;
- {$EXTERNALSYM D3DTEXOPCAPS_DOTPRODUCT3}
- (* D3DDEVICEDESC dwFVFCaps flags *)
- D3DFVFCAPS_TEXCOORDCOUNTMASK = $0000ffff; (* mask for texture coordinate count field *)
- {$EXTERNALSYM D3DFVFCAPS_TEXCOORDCOUNTMASK}
- D3DFVFCAPS_DONOTSTRIPELEMENTS = $00080000; (* Device prefers that vertex elements not be stripped *)
- {$EXTERNALSYM D3DFVFCAPS_DONOTSTRIPELEMENTS}
- {$ENDIF} // DIRECT3D_VERSION_6
- (*
- * Description for a device.
- * This is used to describe a device that is to be created or to query
- * the current device.
- *)
- type
- PD3DDeviceDesc = ^TD3DDeviceDesc;
- _D3DDeviceDesc = packed record
- dwSize: DWORD; (* Size of TD3DDeviceDesc structure *)
- dwFlags: DWORD; (* Indicates which fields have valid data *)
- dcmColorModel: TD3DColorModel; (* Color model of device *)
- dwDevCaps: DWORD; (* Capabilities of device *)
- dtcTransformCaps: TD3DTransformCaps; (* Capabilities of transform *)
- bClipping: BOOL; (* Device can do 3D clipping *)
- dlcLightingCaps: TD3DLightingCaps; (* Capabilities of lighting *)
- dpcLineCaps: TD3DPrimCaps;
- dpcTriCaps: TD3DPrimCaps;
- dwDeviceRenderBitDepth: DWORD; (* One of DDBB_8, 16, etc.. *)
- dwDeviceZBufferBitDepth: DWORD; (* One of DDBD_16, 32, etc.. *)
- dwMaxBufferSize: DWORD; (* Maximum execute buffer size *)
- dwMaxVertexCount: DWORD; (* Maximum vertex count *)
- {$IFDEF DIRECT3D_VERSION_5}
- // *** New fields for DX5 *** //
- // Width and height caps are 0 for legacy HALs.
- dwMinTextureWidth, dwMinTextureHeight : DWORD;
- dwMaxTextureWidth, dwMaxTextureHeight : DWORD;
- dwMinStippleWidth, dwMaxStippleWidth : DWORD;
- dwMinStippleHeight, dwMaxStippleHeight : DWORD;
- {$ENDIF} // DIRECT3D_VERSION_5
- {$IFDEF DIRECT3D_VERSION_6}
- // New fields for DX6
- dwMaxTextureRepeat : DWORD;
- dwMaxTextureAspectRatio : DWORD;
- dwMaxAnisotropy : DWORD;
- // Guard band that the rasterizer can accommodate
- // Screen-space vertices inside this space but outside the viewport
- // will get clipped properly.
- dvGuardBandLeft : TD3DValue;
- dvGuardBandTop : TD3DValue;
- dvGuardBandRight : TD3DValue;
- dvGuardBandBottom : TD3DValue;
- dvExtentsAdjust : TD3DValue;
- dwStencilCaps : DWORD;
- dwFVFCaps : DWORD; (* low 4 bits: 0 implies TLVERTEX only, 1..8 imply FVF aware *)
- dwTextureOpCaps : DWORD;
- wMaxTextureBlendStages : WORD;
- wMaxSimultaneousTextures : WORD;
- {$ENDIF} // DIRECT3D_VERSION_6
- end;
- {$EXTERNALSYM _D3DDeviceDesc}
- D3DDeviceDesc = _D3DDeviceDesc;
- {$EXTERNALSYM D3DDeviceDesc}
- TD3DDeviceDesc = _D3DDeviceDesc;
- {$IFDEF DIRECT3D_VERSION_7}
- PD3DDeviceDesc7 = ^TD3DDeviceDesc7;
- _D3DDeviceDesc7 = packed record
- dwDevCaps: DWORD; (* Capabilities of device *)
- dpcLineCaps: TD3DPrimCaps;
- dpcTriCaps: TD3DPrimCaps;
- dwDeviceRenderBitDepth: DWORD; (* One of DDBB_8, 16, etc.. *)
- dwDeviceZBufferBitDepth: DWORD; (* One of DDBD_16, 32, etc.. *)
- dwMinTextureWidth, dwMinTextureHeight: DWORD;
- dwMaxTextureWidth, dwMaxTextureHeight: DWORD;
- dwMaxTextureRepeat: DWORD;
- dwMaxTextureAspectRatio: DWORD;
- dwMaxAnisotropy: DWORD;
- dvGuardBandLeft: TD3DValue;
- dvGuardBandTop: TD3DValue;
- dvGuardBandRight: TD3DValue;
- dvGuardBandBottom: TD3DValue;
- dvExtentsAdjust: TD3DValue;
- dwStencilCaps: DWORD;
- dwFVFCaps: DWORD;
- dwTextureOpCaps: DWORD;
- wMaxTextureBlendStages: WORD;
- wMaxSimultaneousTextures: WORD;
- dwMaxActiveLights: DWORD;
- dvMaxVertexW: TD3DValue;
- deviceGUID: TGUID;
- wMaxUserClipPlanes: WORD;
- wMaxVertexBlendMatrices: WORD;
- dwVertexProcessingCaps: DWORD;
- dwReserved1: DWORD;
- dwReserved2: DWORD;
- dwReserved3: DWORD;
- dwReserved4: DWORD;
- end;
- {$EXTERNALSYM _D3DDeviceDesc7}
- D3DDeviceDesc7 = _D3DDeviceDesc7;
- {$EXTERNALSYM D3DDeviceDesc7}
- TD3DDeviceDesc7 = _D3DDeviceDesc7;
- {$ENDIF} // DIRECT3D_VERSION_7
- const
- D3DDEVICEDESCSIZE = SizeOf(TD3DDeviceDesc);
- {$EXTERNALSYM D3DDEVICEDESCSIZE}
- {$IFDEF DIRECT3D_VERSION_7} // There is the BUG in C++Headers
- D3DDEVICEDESC7SIZE = SizeOf(TD3DDeviceDesc7);
- {$EXTERNALSYM D3DDEVICEDESC7SIZE}
- {$ENDIF} // DIRECT3D_VERSION_7
- type
- TD3DEnumDevicesCallbackA = function (lpGuid: PGUID; // nil for the default device
- lpDeviceDescription: PAnsiChar; lpDeviceName: PAnsiChar;
- var lpD3DHWDeviceDesc: TD3DDeviceDesc;
- var lpD3DHELDeviceDesc: TD3DDeviceDesc;
- lpContext: Pointer): HResult; stdcall;
- TD3DEnumDevicesCallback = TD3DEnumDevicesCallbackA;
- {$NODEFINE TD3DEnumDevicesCallbackA}
- {$NODEFINE TD3DEnumDevicesCallback}
- {$IFDEF DIRECT3D_VERSION_7}
- TD3DEnumDevicesCallback7A = function (
- lpDeviceDescription: PAnsiChar; lpDeviceName: PAnsiChar;
- const lpD3DDeviceDesc: TD3DDeviceDesc7; lpContext: Pointer): HResult; stdcall;
- TD3DEnumDevicesCallback7 = TD3DEnumDevicesCallback7A;
- {$NODEFINE TD3DEnumDevicesCallback7A}
- {$NODEFINE TD3DEnumDevicesCallback7}
- {$ENDIF} // DIRECT3D_VERSION_7
- (* TD3DDeviceDesc dwFlags indicating valid fields *)
- const
- D3DDD_COLORMODEL = $00000001; (* dcmColorModel is valid *)
- {$EXTERNALSYM D3DDD_COLORMODEL}
- D3DDD_DEVCAPS = $00000002; (* dwDevCaps is valid *)
- {$EXTERNALSYM D3DDD_DEVCAPS}
- D3DDD_TRANSFORMCAPS = $00000004; (* dtcTransformCaps is valid *)
- {$EXTERNALSYM D3DDD_TRANSFORMCAPS}
- D3DDD_LIGHTINGCAPS = $00000008; (* dlcLightingCaps is valid *)
- {$EXTERNALSYM D3DDD_LIGHTINGCAPS}
- D3DDD_BCLIPPING = $00000010; (* bClipping is valid *)
- {$EXTERNALSYM D3DDD_BCLIPPING}
- D3DDD_LINECAPS = $00000020; (* dpcLineCaps is valid *)
- {$EXTERNALSYM D3DDD_LINECAPS}
- D3DDD_TRICAPS = $00000040; (* dpcTriCaps is valid *)
- {$EXTERNALSYM D3DDD_TRICAPS}
- D3DDD_DEVICERENDERBITDEPTH = $00000080; (* dwDeviceRenderBitDepth is valid *)
- {$EXTERNALSYM D3DDD_DEVICERENDERBITDEPTH}
- D3DDD_DEVICEZBUFFERBITDEPTH = $00000100; (* dwDeviceZBufferBitDepth is valid *)
- {$EXTERNALSYM D3DDD_DEVICEZBUFFERBITDEPTH}
- D3DDD_MAXBUFFERSIZE = $00000200; (* dwMaxBufferSize is valid *)
- {$EXTERNALSYM D3DDD_MAXBUFFERSIZE}
- D3DDD_MAXVERTEXCOUNT = $00000400; (* dwMaxVertexCount is valid *)
- {$EXTERNALSYM D3DDD_MAXVERTEXCOUNT}
- (* TD3DDeviceDesc dwDevCaps flags *)
- D3DDEVCAPS_FLOATTLVERTEX = $00000001; (* Device accepts floating point *)
- (* for post-transform vertex data *)
- {$EXTERNALSYM D3DDEVCAPS_FLOATTLVERTEX}
- D3DDEVCAPS_SORTINCREASINGZ = $00000002; (* Device needs data sorted for increasing Z*)
- {$EXTERNALSYM D3DDEVCAPS_SORTINCREASINGZ}
- D3DDEVCAPS_SORTDECREASINGZ = $00000004; (* Device needs data sorted for decreasing Z*)
- {$EXTERNALSYM D3DDEVCAPS_SORTDECREASINGZ}
- D3DDEVCAPS_SORTEXACT = $00000008; (* Device needs data sorted exactly *)
- {$EXTERNALSYM D3DDEVCAPS_SORTEXACT}
- D3DDEVCAPS_EXECUTESYSTEMMEMORY = $00000010; (* Device can use execute buffers from system memory *)
- {$EXTERNALSYM D3DDEVCAPS_EXECUTESYSTEMMEMORY}
- D3DDEVCAPS_EXECUTEVIDEOMEMORY = $00000020; (* Device can use execute buffers from video memory *)
- {$EXTERNALSYM D3DDEVCAPS_EXECUTEVIDEOMEMORY}
- D3DDEVCAPS_TLVERTEXSYSTEMMEMORY = $00000040; (* Device can use TL buffers from system memory *)
- {$EXTERNALSYM D3DDEVCAPS_TLVERTEXSYSTEMMEMORY}
- D3DDEVCAPS_TLVERTEXVIDEOMEMORY = $00000080; (* Device can use TL buffers from video memory *)
- {$EXTERNALSYM D3DDEVCAPS_TLVERTEXVIDEOMEMORY}
- D3DDEVCAPS_TEXTURESYSTEMMEMORY = $00000100; (* Device can texture from system memory *)
- {$EXTERNALSYM D3DDEVCAPS_TEXTURESYSTEMMEMORY}
- D3DDEVCAPS_TEXTUREVIDEOMEMORY = $00000200; (* Device can texture from device memory *)
- {$EXTERNALSYM D3DDEVCAPS_TEXTUREVIDEOMEMORY}
- {$IFDEF DIRECT3D_VERSION_5}
- D3DDEVCAPS_DRAWPRIMTLVERTEX = $00000400; (* Device can draw TLVERTEX primitives *)
- {$EXTERNALSYM D3DDEVCAPS_DRAWPRIMTLVERTEX}
- D3DDEVCAPS_CANRENDERAFTERFLIP = $00000800; (* Device can render without waiting for flip to complete *)
- {$EXTERNALSYM D3DDEVCAPS_CANRENDERAFTERFLIP}
- D3DDEVCAPS_TEXTURENONLOCALVIDMEM = $00001000; (* Device can texture from nonlocal video memory *)
- {$EXTERNALSYM D3DDEVCAPS_TEXTURENONLOCALVIDMEM}
- {$ENDIF} // DIRECT3D_VERSION_5
- {$IFDEF DIRECT3D_VERSION_6}
- D3DDEVCAPS_DRAWPRIMITIVES2 = $00002000; (* Device can support DrawPrimitives2 *)
- {$EXTERNALSYM D3DDEVCAPS_DRAWPRIMITIVES2}
- D3DDEVCAPS_SEPARATETEXTUREMEMORIES = $00004000; (* Device is texturing from separate memory pools *)
- {$EXTERNALSYM D3DDEVCAPS_SEPARATETEXTUREMEMORIES}
- D3DDEVCAPS_DRAWPRIMITIVES2EX = $00008000; (* Device can support Extended DrawPrimitives2 i.e. DX7 compliant driver*)
- {$EXTERNALSYM D3DDEVCAPS_DRAWPRIMITIVES2EX}
- {$ENDIF} // DIRECT3D_VERSION_6
- {$IFDEF DIRECT3D_VERSION_7}
- D3DDEVCAPS_HWTRANSFORMANDLIGHT = $00010000; (* Device can support transformation and lighting in hardware and DRAWPRIMITIVES2EX must be also *)
- {$EXTERNALSYM D3DDEVCAPS_HWTRANSFORMANDLIGHT}
- D3DDEVCAPS_CANBLTSYSTONONLOCAL = $00020000; (* Device supports a Tex Blt from system memory to non-local vidmem *)
- {$EXTERNALSYM D3DDEVCAPS_CANBLTSYSTONONLOCAL}
- D3DDEVCAPS_HWRASTERIZATION = $00080000; (* Device has HW acceleration for rasterization *)
- {$EXTERNALSYM D3DDEVCAPS_HWRASTERIZATION}
- (*
- * These are the flags in the D3DDEVICEDESC7.dwVertexProcessingCaps field
- *)
- (* device can do texgen *)
- D3DVTXPCAPS_TEXGEN = $00000001;
- {$EXTERNALSYM D3DVTXPCAPS_TEXGEN}
- (* device can do IDirect3DDevice7 colormaterialsource ops *)
- D3DVTXPCAPS_MATERIALSOURCE7 = $00000002;
- {$EXTERNALSYM D3DVTXPCAPS_MATERIALSOURCE7}
- (* device can do vertex fog *)
- D3DVTXPCAPS_VERTEXFOG = $00000004;
- {$EXTERNALSYM D3DVTXPCAPS_VERTEXFOG}
- (* device can do directional lights *)
- D3DVTXPCAPS_DIRECTIONALLIGHTS = $00000008;
- {$EXTERNALSYM D3DVTXPCAPS_DIRECTIONALLIGHTS}
- (* device can do positional lights (includes point and spot) *)
- D3DVTXPCAPS_POSITIONALLIGHTS = $00000010;
- {$EXTERNALSYM D3DVTXPCAPS_POSITIONALLIGHTS}
- (* device can do local viewer *)
- D3DVTXPCAPS_LOCALVIEWER = $00000020;
- {$EXTERNALSYM D3DVTXPCAPS_LOCALVIEWER}
- {$ENDIF} // DIRECT3D_VERSION_7
- D3DFDS_COLORMODEL = $00000001; (* Match color model *)
- {$EXTERNALSYM D3DFDS_COLORMODEL}
- D3DFDS_GUID = $00000002; (* Match guid *)
- {$EXTERNALSYM D3DFDS_GUID}
- D3DFDS_HARDWARE = $00000004; (* Match hardware/software *)
- {$EXTERNALSYM D3DFDS_HARDWARE}
- D3DFDS_TRIANGLES = $00000008; (* Match in triCaps *)
- {$EXTERNALSYM D3DFDS_TRIANGLES}
- D3DFDS_LINES = $00000010; (* Match in lineCaps *)
- {$EXTERNALSYM D3DFDS_LINES}
- D3DFDS_MISCCAPS = $00000020; (* Match primCaps.dwMiscCaps *)
- {$EXTERNALSYM D3DFDS_MISCCAPS}
- D3DFDS_RASTERCAPS = $00000040; (* Match primCaps.dwRasterCaps *)
- {$EXTERNALSYM D3DFDS_RASTERCAPS}
- D3DFDS_ZCMPCAPS = $00000080; (* Match primCaps.dwZCmpCaps *)
- {$EXTERNALSYM D3DFDS_ZCMPCAPS}
- D3DFDS_ALPHACMPCAPS = $00000100; (* Match primCaps.dwAlphaCmpCaps *)
- {$EXTERNALSYM D3DFDS_ALPHACMPCAPS}
- D3DFDS_SRCBLENDCAPS = $00000200; (* Match primCaps.dwSourceBlendCaps *)
- {$EXTERNALSYM D3DFDS_SRCBLENDCAPS}
- D3DFDS_DSTBLENDCAPS = $00000400; (* Match primCaps.dwDestBlendCaps *)
- {$EXTERNALSYM D3DFDS_DSTBLENDCAPS}
- D3DFDS_SHADECAPS = $00000800; (* Match primCaps.dwShadeCaps *)
- {$EXTERNALSYM D3DFDS_SHADECAPS}
- D3DFDS_TEXTURECAPS = $00001000; (* Match primCaps.dwTextureCaps *)
- {$EXTERNALSYM D3DFDS_TEXTURECAPS}
- D3DFDS_TEXTUREFILTERCAPS = $00002000; (* Match primCaps.dwTextureFilterCaps *)
- {$EXTERNALSYM D3DFDS_TEXTUREFILTERCAPS}
- D3DFDS_TEXTUREBLENDCAPS = $00004000; (* Match primCaps.dwTextureBlendCaps *)
- {$EXTERNALSYM D3DFDS_TEXTUREBLENDCAPS}
- D3DFDS_TEXTUREADDRESSCAPS = $00008000; (* Match primCaps.dwTextureBlendCaps *)
- {$EXTERNALSYM D3DFDS_TEXTUREADDRESSCAPS}
- (*
- * FindDevice arguments
- *)
- type
- PD3DFindDeviceSearch = ^TD3DFindDeviceSearch;
- _D3DFINDDEVICESEARCH = packed record
- dwSize: DWORD;
- dwFlags: DWORD;
- bHardware: BOOL;
- dcmColorModel: TD3DColorModel;
- guid: TGUID;
- dwCaps: DWORD;
- dpcPrimCaps: TD3DPrimCaps;
- end;
- {$EXTERNALSYM _D3DFINDDEVICESEARCH}
- D3DFINDDEVICESEARCH = _D3DFINDDEVICESEARCH;
- {$EXTERNALSYM D3DFINDDEVICESEARCH}
- TD3DFindDeviceSearch = _D3DFINDDEVICESEARCH;
- PD3DFindDeviceResult = ^TD3DFindDeviceResult;
- _D3DFINDDEVICERESULT = packed record
- dwSize: DWORD;
- guid: TGUID; (* guid which matched *)
- ddHwDesc: TD3DDeviceDesc; (* hardware TD3DDeviceDesc *)
- ddSwDesc: TD3DDeviceDesc; (* software TD3DDeviceDesc *)
- end;
- {$EXTERNALSYM _D3DFINDDEVICERESULT}
- D3DFINDDEVICERESULT = _D3DFINDDEVICERESULT;
- {$EXTERNALSYM D3DFINDDEVICERESULT}
- TD3DFindDeviceResult = _D3DFINDDEVICERESULT;
- (*
- * Description of execute buffer.
- *)
- PD3DExecuteBufferDesc = ^TD3DExecuteBufferDesc;
- _D3DExecuteBufferDesc = packed record
- dwSize: DWORD; (* size of this structure *)
- dwFlags: DWORD; (* flags indicating which fields are valid *)
- dwCaps: DWORD; (* capabilities of execute buffer *)
- dwBufferSize: DWORD; (* size of execute buffer data *)
- lpData: Pointer; (* pointer to actual data *)
- end;
- {$EXTERNALSYM _D3DExecuteBufferDesc}
- D3DExecuteBufferDesc = _D3DExecuteBufferDesc;
- {$EXTERNALSYM D3DExecuteBufferDesc}
- TD3DExecuteBufferDesc = _D3DExecuteBufferDesc;
- (* D3DEXECUTEBUFFER dwFlags indicating valid fields *)
- const
- D3DDEB_BUFSIZE = $00000001; (* buffer size valid *)
- {$EXTERNALSYM D3DDEB_BUFSIZE}
- D3DDEB_CAPS = $00000002; (* caps valid *)
- {$EXTERNALSYM D3DDEB_CAPS}
- D3DDEB_LPDATA = $00000004; (* lpData valid *)
- {$EXTERNALSYM D3DDEB_LPDATA}
- (* D3DEXECUTEBUFFER dwCaps *)
- D3DDEBCAPS_SYSTEMMEMORY = $00000001; (* buffer in system memory *)
- {$EXTERNALSYM D3DDEBCAPS_SYSTEMMEMORY}
- D3DDEBCAPS_VIDEOMEMORY = $00000002; (* buffer in device memory *)
- {$EXTERNALSYM D3DDEBCAPS_VIDEOMEMORY}
- D3DDEBCAPS_MEM = (D3DDEBCAPS_SYSTEMMEMORY or D3DDEBCAPS_VIDEOMEMORY);
- {$EXTERNALSYM D3DDEBCAPS_MEM}
- {$IFDEF DIRECT3D_VERSION_LESS_8}
- {$IFDEF DIRECT3D_VERSION_7}
- type
- PD3DDevInfo_TextureManager = ^TD3DDevInfo_TextureManager;
- _D3DDEVINFO_TEXTUREMANAGER = packed record
- bThrashing: BOOL; (* indicates if thrashing *)
- dwApproxBytesDownloaded: DWORD; (* Approximate number of bytes downloaded by texture manager *)
- dwNumEvicts: DWORD; (* number of textures evicted *)
- dwNumVidCreates: DWORD; (* number of textures created in video memory *)
- dwNumTexturesUsed: DWORD; (* number of textures used *)
- dwNumUsedTexInVid: DWORD; (* number of used textures present in video memory *)
- dwWorkingSet: DWORD; (* number of textures in video memory *)
- dwWorkingSetBytes: DWORD; (* number of bytes in video memory *)
- dwTotalManaged: DWORD; (* total number of managed textures *)
- dwTotalBytes: DWORD; (* total number of bytes of managed textures *)
- dwLastPri: DWORD; (* priority of last texture evicted *)
- end;
- {$EXTERNALSYM _D3DDEVINFO_TEXTUREMANAGER}
- D3DDEVINFO_TEXTUREMANAGER = _D3DDEVINFO_TEXTUREMANAGER;
- {$EXTERNALSYM D3DDEVINFO_TEXTUREMANAGER}
- TD3DDevInfo_TextureManager = _D3DDEVINFO_TEXTUREMANAGER;
- PD3DDevInfoTextureManager = PD3DDevInfo_TextureManager;
- TD3DDevInfoTextureManager = _D3DDEVINFO_TEXTUREMANAGER;
- PD3DDevInfo_Texturing = ^TD3DDevInfo_Texturing;
- _D3DDEVINFO_TEXTURING = packed record
- dwNumLoads: DWORD; (* counts Load() API calls *)
- dwApproxBytesLoaded: DWORD; (* Approximate number bytes loaded via Load() *)
- dwNumPreLoads: DWORD; (* counts PreLoad() API calls *)
- dwNumSet: DWORD; (* counts SetTexture() API calls *)
- dwNumCreates: DWORD; (* counts texture creates *)
- dwNumDestroys: DWORD; (* counts texture destroys *)
- dwNumSetPriorities: DWORD; (* counts SetPriority() API calls *)
- dwNumSetLODs: DWORD; (* counts SetLOD() API calls *)
- dwNumLocks: DWORD; (* counts number of texture locks *)
- dwNumGetDCs: DWORD; (* counts number of GetDCs to textures *)
- end;
- {$EXTERNALSYM _D3DDEVINFO_TEXTURING}
- D3DDEVINFO_TEXTURING = _D3DDEVINFO_TEXTURING;
- {$EXTERNALSYM D3DDEVINFO_TEXTURING}
- TD3DDevInfo_Texturing = _D3DDEVINFO_TEXTURING;
- PD3DDevInfoTexturing = PD3DDevInfo_Texturing;
- TD3DDevInfoTexturing = TD3DDevInfo_Texturing;
- {$ENDIF} // DIRECT3D_VERSION_7
- {$ENDIF} // DIRECT3D_VERSION_LESS_8
- (*==========================================================================;
- *
- *
- * File: d3d.h
- * Content: Direct3D include file
- *
- ****************************************************************************)
- // include this file content only if compiling for <=DX7 interfaces
- {$IFDEF DIRECT3D_VERSION_LESS_8}
- function D3DErrorString(Value: HResult): String;
- {$IFDEF DIRECT3D_VERSION_5}
- const
- IID_IDirect3DRampDevice: TGUID =
- (D1:$F2086B20;D2:$259F;D3:$11CF;D4:($A3,$1A,$00,$AA,$00,$B9,$33,$56));
- {$EXTERNALSYM IID_IDirect3DRampDevice}
- IID_IDirect3DRGBDevice: TGUID =
- (D1:$A4665C60;D2:$2673;D3:$11CF;D4:($A3,$1A,$00,$AA,$00,$B9,$33,$56));
- {$EXTERNALSYM IID_IDirect3DRGBDevice}
- IID_IDirect3DHALDevice: TGUID =
- (D1:$84E63dE0;D2:$46AA;D3:$11CF;D4:($81,$6F,$00,$00,$C0,$20,$15,$6E));
- {$EXTERNALSYM IID_IDirect3DHALDevice}
- IID_IDirect3DMMXDevice: TGUID =
- (D1:$881949a1;D2:$d6f3;D3:$11d0;D4:($89,$ab,$00,$a0,$c9,$05,$41,$29));
- {$EXTERNALSYM IID_IDirect3DMMXDevice}
- {$ENDIF} // DIRECT3D_VERSION_5
- {$IFDEF DIRECT3D_VERSION_6}
- IID_IDirect3DRefDevice: TGUID =
- (D1:$50936643;D2:$13e9;D3:$11d1;D4:($89,$aa,$00,$a0,$c9,$05,$41,$29));
- {$EXTERNALSYM IID_IDirect3DRefDevice}
- IID_IDirect3DNullDevice: TGUID =
- (D1:$8767df22;D2:$bacc;D3:$11d1;D4:($89,$69,$00,$a0,$c9,$06,$29,$a8));
- {$EXTERNALSYM IID_IDirect3DNullDevice}
- {$ENDIF} // DIRECT3D_VERSION_6
- {$IFDEF DIRECT3D_VERSION_7}
- IID_IDirect3DTnLHalDevice: TGUID = '{f5049e78-4861-11d2-a407-00a0c90629a8}';
- {$EXTERNALSYM IID_IDirect3DTnLHalDevice}
- {$ENDIF} // DIRECT3D_VERSION_7
- type
- IDirect3D = interface;
- {$EXTERNALSYM IDirect3D}
- {$IFDEF DIRECT3D_VERSION_5}
- IDirect3D2 = interface;
- {$ENDIF} // DIRECT3D_VERSION_5
- {$IFDEF DIRECT3D_VERSION_6}
- IDirect3D3 = interface;
- {$ENDIF} // DIRECT3D_VERSION_5
- {$IFDEF DIRECT3D_VERSION_7}
- IDirect3D7 = interface;
- {$ENDIF} // DIRECT3D_VERSION_5
- IDirect3DDevice = interface;
- {$IFDEF DIRECT3D_VERSION_5}
- IDirect3DDevice2 = interface;
- {$ENDIF} // DIRECT3D_VERSION_5
- {$IFDEF DIRECT3D_VERSION_6}
- IDirect3DDevice3 = interface;
- {$ENDIF} // DIRECT3D_VERSION_6
- {$IFDEF DIRECT3D_VERSION_7}
- IDirect3DDevice7 = interface;
- {$ENDIF} // DIRECT3D_VERSION_7
- IDirect3DExecuteBuffer = interface;
- IDirect3DLight = interface;
- IDirect3DMaterial = interface;
- {$IFDEF DIRECT3D_VERSION_5}
- IDirect3DMaterial2 = interface;
- {$ENDIF} // DIRECT3D_VERSION_5
- {$IFDEF DIRECT3D_VERSION_6}
- IDirect3DMaterial3 = interface;
- {$ENDIF} // DIRECT3D_VERSION_6
- IDirect3DTexture = interface;
- {$IFDEF DIRECT3D_VERSION_5}
- IDirect3DTexture2 = interface;
- {$ENDIF} // DIRECT3D_VERSION_5
- IDirect3DViewport = interface;
- {$IFDEF DIRECT3D_VERSION_5}
- IDirect3DViewport2 = interface;
- {$ENDIF} // DIRECT3D_VERSION_5
- {$IFDEF DIRECT3D_VERSION_6}
- IDirect3DViewport3 = interface;
- IDirect3DVertexBuffer = interface;
- {$ENDIF} // DIRECT3D_VERSION_6
- {$IFDEF DIRECT3D_VERSION_7}
- IDirect3DVertexBuffer7 = interface;
- {$ENDIF} // DIRECT3D_VERSION_7
- (*
- * Interface IID's
- *)
- IID_IDirect3D = IDirect3D;
- {$EXTERNALSYM IID_IDirect3D}
- {$IFDEF DIRECT3D_VERSION_5}
- IID_IDirect3D2 = IDirect3D2;
- {$EXTERNALSYM IID_IDirect3D2}
- {$ENDIF} // DIRECT3D_VERSION_5
- {$IFDEF DIRECT3D_VERSION_6}
- IID_IDirect3D3 = IDirect3D3;
- {$EXTERNALSYM IID_IDirect3D3}
- {$ENDIF} // DIRECT3D_VERSION_6
- {$IFDEF DIRECT3D_VERSION_7}
- IID_IDirect3D7 = IDirect3D7;
- {$EXTERNALSYM IID_IDirect3D7}
- {$ENDIF} // DIRECT3D_VERSION_7
- (*
- * Internal Guid to distinguish requested MMX from MMX being used as an RGB rasterizer
- *)
- IID_IDirect3DDevice = IDirect3DDevice;
- {$EXTERNALSYM IID_IDirect3DDevice}
- {$IFDEF DIRECT3D_VERSION_5}
- IID_IDirect3DDevice2 = IDirect3DDevice2;
- {$EXTERNALSYM IID_IDirect3DDevice2}
- {$ENDIF}
- {$IFDEF DIRECT3D_VERSION_6}
- IID_IDirect3DDevice3 = IDirect3DDevice3;
- {$EXTERNALSYM IID_IDirect3DDevice3}
- {$ENDIF}
- {$IFDEF DIRECT3D_VERSION_7}
- IID_IDirect3DDevice7 = IDirect3DDevice7;
- {$EXTERNALSYM IID_IDirect3DDevice7}
- {$ENDIF}
- IID_IDirect3DTexture = IDirect3DTexture;
- {$EXTERNALSYM IID_IDirect3DTexture}
- {$IFDEF DIRECT3D_VERSION_5}
- IID_IDirect3DTexture2 = IDirect3DTexture2;
- {$EXTERNALSYM IID_IDirect3DTexture2}
- {$ENDIF}
- IID_IDirect3DLight = IDirect3DLight;
- {$EXTERNALSYM IID_IDirect3DLight}
- IID_IDirect3DMaterial = IDirect3DMaterial;
- {$EXTERNALSYM IID_IDirect3DMaterial}
- {$IFDEF DIRECT3D_VERSION_5}
- IID_IDirect3DMaterial2 = IDirect3DMaterial2;
- {$EXTERNALSYM IID_IDirect3DMaterial2}
- {$ENDIF}
- {$IFDEF DIRECT3D_VERSION_6}
- IID_IDirect3DMaterial3 = IDirect3DMaterial3;
- {$EXTERNALSYM IID_IDirect3DMaterial3}
- {$ENDIF}
- IID_IDirect3DExecuteBuffer = IDirect3DExecuteBuffer;
- {$EXTERNALSYM IID_IDirect3DExecuteBuffer}
- IID_IDirect3DViewport = IDirect3DViewport;
- {$EXTERNALSYM IID_IDirect3DViewport}
- {$IFDEF DIRECT3D_VERSION_5}
- IID_IDirect3DViewport2 = IDirect3DViewport2;
- {$EXTERNALSYM IID_IDirect3DViewport2}
- {$ENDIF}
- {$IFDEF DIRECT3D_VERSION_6}
- IID_IDirect3DViewport3 = IDirect3DViewport3;
- {$EXTERNALSYM IID_IDirect3DViewport3}
- {$ENDIF}
- {$IFDEF DIRECT3D_VERSION_6}
- IID_IDirect3DVertexBuffer = IDirect3DVertexBuffer;
- {$EXTERNALSYM IID_IDirect3DVertexBuffer}
- {$ENDIF}
- {$IFDEF DIRECT3D_VERSION_7}
- IID_IDirect3DVertexBuffer7 = IDirect3DVertexBuffer7;
- {$EXTERNALSYM IID_IDirect3DVertexBuffer7}
- {$ENDIF}
- (*
- * Direct3D interfaces
- *)
- {$HPPEMIT 'DECLARE_DINTERFACE_TYPE(IDirect3D);'}
- IDirect3D = interface(IUnknown)
- ['{3BBA0080-2421-11CF-A31A-00AA00B93356}']
- (*** IDirect3D methods ***)
- function Initialize(lpREFIID: {REFIID} PGUID): HResult; stdcall;
- function EnumDevices(lpEnumDevicesCallback: TD3DEnumDevicesCallback;
- lpUserArg: Pointer): HResult; stdcall;
- function CreateLight(var lplpDirect3Dlight: IDirect3DLight;
- pUnkOuter: IUnknown): HResult; stdcall;
- function CreateMaterial(var lplpDirect3DMaterial: IDirect3DMaterial;
- pUnkOuter: IUnknown): HResult; stdcall;
- function CreateViewport(var lplpD3DViewport: IDirect3DViewport;
- pUnkOuter: IUnknown): HResult; stdcall;
- function FindDevice(var lpD3DFDS: TD3DFindDeviceSearch;
- var lpD3DFDR: TD3DFindDeviceResult): HResult; stdcall;
- end;
- {$IFDEF DIRECT3D_VERSION_5}
- {$HPPEMIT 'DECLARE_DINTERFACE_TYPE(IDirect3D2);'}
- {$EXTERNALSYM IDirect3D2}
- IDirect3D2 = interface(IUnknown)
- ['{6aae1ec1-662a-11d0-889d-00aa00bbb76a}']
- (*** IDirect3D2 methods ***)
- function EnumDevices(lpEnumDevicesCallback: TD3DEnumDevicesCallback;
- lpUserArg: Pointer): HResult; stdcall;
- function CreateLight(var lplpDirect3Dlight: IDirect3DLight;
- pUnkOuter: IUnknown): HResult; stdcall;
- function CreateMaterial(var lplpDirect3DMaterial2: IDirect3DMaterial2;
- pUnkOuter: IUnknown): HResult; stdcall;
- function CreateViewport(var lplpD3DViewport2: IDirect3DViewport2;
- pUnkOuter: IUnknown): HResult; stdcall;
- function FindDevice(var lpD3DFDS: TD3DFindDeviceSearch;
- var lpD3DFDR: TD3DFindDeviceResult): HResult; stdcall;
- function CreateDevice(const rclsid: TRefClsID; lpDDS: IDirectDrawSurface;
- out lplpD3DDevice2: IDirect3DDevice2): HResult; stdcall;
- end;
- {$ENDIF} // DIRECT3D_VERSION_5
- {$IFDEF DIRECT3D_VERSION_6}
- {$HPPEMIT 'DECLARE_DINTERFACE_TYPE(IDirect3D3);'}
- {$EXTERNALSYM IDirect3D3}
- IDirect3D3 = interface(IUnknown)
- ['{bb223240-e72b-11d0-a9b4-00aa00c0993e}']
- (*** IDirect3D3 methods ***)
- function EnumDevices(lpEnumDevicesCallback: TD3DEnumDevicesCallback;
- lpUserArg: pointer): HResult; stdcall;
- function CreateLight(var lplpDirect3Dlight: IDirect3DLight;
- pUnkOuter: IUnknown): HResult; stdcall;
- function CreateMaterial(var lplpDirect3DMaterial3: IDirect3DMaterial3;
- pUnkOuter: IUnknown): HResult; stdcall;
- function CreateViewport(var lplpD3DViewport3: IDirect3DViewport3;
- pUnkOuter: IUnknown): HResult; stdcall;
- function FindDevice(var lpD3DFDS: TD3DFindDeviceSearch;
- var lpD3DFDR: TD3DFindDeviceResult): HResult; stdcall;
- function CreateDevice(const rclsid: TRefClsID; lpDDS: IDirectDrawSurface4;
- out lplpD3DDevice: IDirect3DDevice3; pUnkOuter: IUnknown): HResult; stdcall;
- function CreateVertexBuffer(var lpVBDesc: TD3DVertexBufferDesc;
- var lpD3DVertexBuffer: IDirect3DVertexBuffer;
- dwFlags: DWORD; pUnkOuter: IUnknown): HResult; stdcall;
- function EnumZBufferFormats(const riidDevice: TRefClsID; lpEnumCallback:
- TD3DEnumPixelFormatsCallback; lpContext: Pointer): HResult; stdcall;
- function EvictManagedTextures : HResult; stdcall;
- end;
- {$ENDIF} // DIRECT3D_VERSION_6
- {$IFDEF DIRECT3D_VERSION_7}
- {$HPPEMIT 'DECLARE_DINTERFACE_TYPE(IDirect3D7);'}
- {$EXTERNALSYM IDirect3D7}
- IDirect3D7 = interface(IUnknown)
- ['{f5049e77-4861-11d2-a407-00a0c90629a8}']
- (*** IDirect3D7 methods ***)
- function EnumDevices(lpEnumDevicesCallback: TD3DEnumDevicesCallback7;
- lpUserArg: pointer): HResult; stdcall;
- function CreateDevice(const rclsid: TGUID; lpDDS: IDirectDrawSurface7;
- out lplpD3DDevice: IDirect3DDevice7): HResult; stdcall;
- function CreateVertexBuffer(const lpVBDesc: TD3DVertexBufferDesc;
- out lplpD3DVertexBuffer: IDirect3DVertexBuffer7;
- dwFlags: DWORD): HResult; stdcall;
- function EnumZBufferFormats(const riidDevice: TGUID; lpEnumCallback:
- TD3DEnumPixelFormatsCallback; lpContext: pointer): HResult; stdcall;
- function EvictManagedTextures : HResult; stdcall;
- end;
- {$ENDIF} // DIRECT3D_VERSION_7
- (*
- * Direct3D Device interfaces
- *)
- {$HPPEMIT 'DECLARE_DINTERFACE_TYPE(IDirect3DDevice);'}
- {$EXTERNALSYM IDirect3DDevice}
- IDirect3DDevice = interface(IUnknown)
- ['{64108800-957d-11d0-89ab-00a0c9054129}']
- (*** IDirect3DDevice methods ***)
- function Initialize(lpd3d: IDirect3D; lpGUID: PGUID;
- var lpd3ddvdesc: TD3DDeviceDesc): HResult; stdcall;
- function GetCaps(var lpD3DHWDevDesc: TD3DDeviceDesc;
- var lpD3DHELDevDesc: TD3DDeviceDesc): HResult; stdcall;
- function SwapTextureHandles(lpD3DTex1: IDirect3DTexture;
- lpD3DTex2: IDirect3DTexture): HResult; stdcall;
- function CreateExecuteBuffer(var lpDesc: TD3DExecuteBufferDesc ;
- var lplpDirect3DExecuteBuffer: IDirect3DExecuteBuffer;
- pUnkOuter: IUnknown): HResult; stdcall;
- function GetStats(var lpD3DStats: TD3DStats): HResult; stdcall;
- function Execute(lpDirect3DExecuteBuffer: IDirect3DExecuteBuffer;
- lpDirect3DViewport: IDirect3DViewport; dwFlags: DWORD): HResult; stdcall;
- function AddViewport(lpDirect3DViewport: IDirect3DViewport): HResult; stdcall;
- function DeleteViewport(lpDirect3DViewport: IDirect3DViewport): HResult; stdcall;
- function NextViewport(lpDirect3DViewport: IDirect3DViewport;
- var lplpDirect3DViewport: IDirect3DViewport; dwFlags: DWORD): HResult; stdcall;
- function Pick(lpDirect3DExecuteBuffer: IDirect3DExecuteBuffer;
- lpDirect3DViewport: IDirect3DViewport; dwFlags: DWORD;
- var lpRect: TD3DRect): HResult; stdcall;
- function GetPickRecords(var lpCount: DWORD;
- var lpD3DPickRec: TD3DPickRecord): HResult; stdcall;
- function EnumTextureFormats(lpd3dEnumTextureProc:
- TD3DEnumTextureFormatsCallback; lpArg: Pointer):
- HResult; stdcall;
- function CreateMatrix(var lpD3DMatHandle: TD3DMatrixHandle): HResult; stdcall;
- function SetMatrix(d3dMatHandle: TD3DMatrixHandle;
- var lpD3DMatrix: TD3DMatrix): HResult; stdcall;
- function GetMatrix(var lpD3DMatHandle: TD3DMatrixHandle;
- var lpD3DMatrix: TD3DMatrix): HResult; stdcall;
- function DeleteMatrix(d3dMatHandle: TD3DMatrixHandle): HResult; stdcall;
- function BeginScene: HResult; stdcall;
- function EndScene: HResult; stdcall;
- function GetDirect3D(var lpD3D: IDirect3D): HResult; stdcall;
- end;
- {$IFDEF DIRECT3D_VERSION_5}
- {$HPPEMIT 'DECLARE_DINTERFACE_TYPE(IDirect3DDevice2);'}
- {$EXTERNALSYM IDirect3DDevice2}
- IDirect3DDevice2 = interface(IUnknown)
- ['{93281501-8cf8-11d0-89ab-00a0c9054129}']
- (*** IDirect3DDevice2 methods ***)
- function GetCaps(var lpD3DHWDevDesc: TD3DDeviceDesc;
- var lpD3DHELDevDesc: TD3DDeviceDesc): HResult; stdcall;
- function SwapTextureHandles(lpD3DTex1: IDirect3DTexture2;
- lpD3DTex2: IDirect3DTexture2): HResult; stdcall;
- function GetStats(var lpD3DStats: TD3DStats): HResult; stdcall;
- function AddViewport(lpDirect3DViewport2: IDirect3DViewport2): HResult; stdcall;
- function DeleteViewport(lpDirect3DViewport: IDirect3DViewport2): HResult; stdcall;
- function NextViewport(lpDirect3DViewport: IDirect3DViewport2;
- var lplpDirect3DViewport: IDirect3DViewport2; dwFlags: DWORD):
- HResult; stdcall;
- function EnumTextureFormats(
- lpd3dEnumTextureProc: TD3DEnumTextureFormatsCallback; lpArg: Pointer):
- HResult; stdcall;
- function BeginScene: HResult; stdcall;
- function EndScene: HResult; stdcall;
- function GetDirect3D(var lpD3D: IDirect3D2): HResult; stdcall;
- (*** DrawPrimitive API ***)
- function SetCurrentViewport(lpd3dViewport2: IDirect3DViewport2)
- : HResult; stdcall;
- function GetCurrentViewport(var lplpd3dViewport2: IDirect3DViewport2)
- : HResult; stdcall;
- function SetRenderTarget(lpNewRenderTarget: IDirectDrawSurface)
- : HResult; stdcall;
- function GetRenderTarget(var lplpNewRenderTarget: IDirectDrawSurface)
- : HResult; stdcall;
- function Begin_(d3dpt: TD3DPrimitiveType; d3dvt: TD3DVertexType;
- dwFlags: DWORD): HResult; stdcall;
- function BeginIndexed(dptPrimitiveType: TD3DPrimitiveType; dvtVertexType:
- TD3DVertexType; lpvVertices: pointer; dwNumVertices: DWORD;
- dwFlags: DWORD): HResult; stdcall;
- function Vertex(lpVertexType: pointer): HResult; stdcall;
- function Index(wVertexIndex: WORD): HResult; stdcall;
- function End_(dwFlags: DWORD): HResult; stdcall;
- function GetRenderState(dwRenderStateType: TD3DRenderStateType;
- var lpdwRenderState): HResult; stdcall;
- function SetRenderState(dwRenderStateType: TD3DRenderStateType;
- dwRenderState: DWORD): HResult; stdcall;
- function GetLightState(dwLightStateType: TD3DLightStateType;
- var lpdwLightState): HResult; stdcall;
- function SetLightState(dwLightStateType: TD3DLightStateType;
- dwLightState: DWORD): HResult; stdcall;
- function SetTransform(dtstTransformStateType: TD3DTransformStateType;
- var lpD3DMatrix: TD3DMatrix): HResult; stdcall;
- function GetTransform(dtstTransformStateType: TD3DTransformStateType;
- var lpD3DMatrix: TD3DMatrix): HResult; stdcall;
- function MultiplyTransform(dtstTransformStateType: TD3DTransformStateType;
- var lpD3DMatrix: TD3DMatrix): HResult; stdcall;
- function DrawPrimitive(dptPrimitiveType: TD3DPrimitiveType;
- dvtVertexType: TD3DVertexType; var lpvVertices; dwVertexCount,
- dwFlags: DWORD): HResult; stdcall;
- function DrawIndexedPrimitive(dptPrimitiveType: TD3DPrimitiveType;
- dwVertexTypeDesc: DWORD; lpvVertices: pointer; dwVertexCount: DWORD;
- var lpwIndices: WORD; dwIndexCount, dwFlags: DWORD): HResult; stdcall;
- function SetClipStatus(var lpD3DClipStatus: TD3DClipStatus): HResult; stdcall;
- function GetClipStatus(var lpD3DClipStatus: TD3DClipStatus): HResult; stdcall;
- end;
- {$ENDIF} // DIRECT3D_VERSION_5
- {$IFDEF DIRECT3D_VERSION_6}
- {$HPPEMIT 'DECLARE_DINTERFACE_TYPE(IDirect3DDevice3);'}
- {$EXTERNALSYM IDirect3DDevice3}
- IDirect3DDevice3 = interface(IUnknown)
- ['{b0ab3b60-33d7-11d1-a981-00c04fd7b174}']
- (*** IDirect3DDevice2 methods ***)
- function GetCaps(var lpD3DHWDevDesc: TD3DDeviceDesc;
- var lpD3DHELDevDesc: TD3DDeviceDesc): HResult; stdcall;
- function GetStats(var lpD3DStats: TD3DStats): HResult; stdcall;
- function AddViewport(lpDirect3DViewport: IDirect3DViewport3): HResult; stdcall;
- function DeleteViewport(lpDirect3DViewport: IDirect3DViewport3): HResult; stdcall;
- function NextViewport(lpDirect3DViewport: IDirect3DViewport3;
- var lplpAnotherViewport: IDirect3DViewport3; dwFlags: DWORD): HResult; stdcall;
- function EnumTextureFormats(
- lpd3dEnumPixelProc: TD3DEnumPixelFormatsCallback; lpArg: Pointer):
- HResult; stdcall;
- function BeginScene: HResult; stdcall;
- function EndScene: HResult; stdcall;
- function GetDirect3D(var lpD3D: IDirect3D3): HResult; stdcall;
- function SetCurrentViewport(lpd3dViewport: IDirect3DViewport3)
- : HResult; stdcall;
- function GetCurrentViewport(var lplpd3dViewport: IDirect3DViewport3)
- : HResult; stdcall;
- function SetRenderTarget(lpNewRenderTarget: IDirectDrawSurface4)
- : HResult; stdcall;
- function GetRenderTarget(var lplpNewRenderTarget: IDirectDrawSurface4)
- : HResult; stdcall;
- function Begin_(d3dpt: TD3DPrimitiveType; dwVertexTypeDesc: DWORD;
- dwFlags: DWORD): HResult; stdcall;
- function BeginIndexed(dptPrimitiveType: TD3DPrimitiveType;
- dwVertexTypeDesc: DWORD; lpvVertices: pointer; dwNumVertices: DWORD;
- dwFlags: DWORD): HResult; stdcall;
- function Vertex(lpVertex: pointer): HResult; stdcall;
- function Index(wVertexIndex: WORD): HResult; stdcall;
- function End_(dwFlags: DWORD): HResult; stdcall;
- function GetRenderState(dwRenderStateType: TD3DRenderStateType;
- var lpdwRenderState): HResult; stdcall;
- function SetRenderState(dwRenderStateType: TD3DRenderStateType;
- dwRenderState: DWORD): HResult; stdcall;
- function GetLightState(dwLightStateType: TD3DLightStateType;
- var lpdwLightState): HResult; stdcall;
- function SetLightState(dwLightStateType: TD3DLightStateType;
- dwLightState: DWORD): HResult; stdcall;
- function SetTransform(dtstTransformStateType: TD3DTransformStateType;
- var lpD3DMatrix: TD3DMatrix): HResult; stdcall;
- function GetTransform(dtstTransformStateType: TD3DTransformStateType;
- var lpD3DMatrix: TD3DMatrix): HResult; stdcall;
- function MultiplyTransform(dtstTransformStateType: TD3DTransformStateType;
- var lpD3DMatrix: TD3DMatrix): HResult; stdcall;
- function DrawPrimitive(dptPrimitiveType: TD3DPrimitiveType;
- dwVertexTypeDesc: DWORD; const lpvVertices;
- dwVertexCount, dwFlags: DWORD): HResult; stdcall;
- function DrawIndexedPrimitive(dptPrimitiveType: TD3DPrimitiveType;
- dwVertexTypeDesc: DWORD; const lpvVertices; dwVertexCount: DWORD;
- var lpwIndices: WORD; dwIndexCount, dwFlags: DWORD): HResult; stdcall;
- function SetClipStatus(var lpD3DClipStatus: TD3DClipStatus): HResult; stdcall;
- function GetClipStatus(var lpD3DClipStatus: TD3DClipStatus): HResult; stdcall;
- function DrawPrimitiveStrided(dptPrimitiveType: TD3DPrimitiveType;
- dwVertexTypeDesc : DWORD;
- var lpVertexArray: TD3DDrawPrimitiveStridedData;
- dwVertexCount, dwFlags: DWORD): HResult; stdcall;
- function DrawIndexedPrimitiveStrided(dptPrimitiveType: TD3DPrimitiveType;
- dwVertexTypeDesc : DWORD;
- var lpVertexArray: TD3DDrawPrimitiveStridedData; dwVertexCount: DWORD;
- var lpwIndices: WORD; dwIndexCount, dwFlags: DWORD): HResult; stdcall;
- function DrawPrimitiveVB(dptPrimitiveType: TD3DPrimitiveType;
- lpd3dVertexBuffer: IDirect3DVertexBuffer;
- dwStartVertex, dwNumVertices, dwFlags: DWORD): HResult; stdcall;
- function DrawIndexedPrimitiveVB(dptPrimitiveType: TD3DPrimitiveType;
- lpd3dVertexBuffer: IDirect3DVertexBuffer; var lpwIndices: WORD;
- dwIndexCount, dwFlags: DWORD): HResult; stdcall;
- function ComputeSphereVisibility(var lpCenters: TD3DVector;
- var lpRadii: TD3DValue; dwNumSpheres, dwFlags: DWORD;
- var lpdwReturnValues: DWORD): HResult; stdcall;
- function GetTexture(dwStage: DWORD; var lplpTexture: IDirect3DTexture2)
- : HResult; stdcall;
- function SetTexture(dwStage: DWORD; lplpTexture: IDirect3DTexture2)
- : HResult; stdcall;
- function GetTextureStageState(dwStage: DWORD;
- dwState: TD3DTextureStageStateType; var lpdwValue: DWORD): HResult; stdcall;
- function SetTextureStageState(dwStage: DWORD;
- dwState: TD3DTextureStageStateType; lpdwValue: DWORD): HResult; stdcall;
- function ValidateDevice(var lpdwExtraPasses: DWORD): HResult; stdcall;
- end;
- {$ENDIF} // DIRECT3D_VERSION_6
- {$IFDEF DIRECT3D_VERSION_7}
- {$HPPEMIT 'DECLARE_DINTERFACE_TYPE(IDirect3DDevice7);'}
- {$EXTERNALSYM IDirect3DDevice7}
- IDirect3DDevice7 = interface(IUnknown)
- ['{f5049e79-4861-11d2-a407-00a0c90629a8}']
- (*** IDirect3DDevice7 methods ***)
- function GetCaps(out lpD3DDevDesc: TD3DDeviceDesc7): HResult; stdcall;
- function EnumTextureFormats(lpd3dEnumPixelProc: TD3DEnumPixelFormatsCallback; lpArg: Pointer): HResult; stdcall;
- function BeginScene: HResult; stdcall;
- function EndScene: HResult; stdcall;
- function GetDirect3D(out lpD3D: IDirect3D7): HResult; stdcall;
- function SetRenderTarget(lpNewRenderTarget: IDirectDrawSurface7; dwFlags: DWORD): HResult; stdcall;
- function GetRenderTarget(out lplpRenderTarget: IDirectDrawSurface7): HResult; stdcall;
- function Clear(dwCount: DWORD; lpRects: PD3DRect; dwFlags, dwColor: DWORD; dvZ: TD3DValue; dwStencil: DWORD): HResult; stdcall;
- function SetTransform(dtstTransformStateType: TD3DTransformStateType;
- const lpD3DMatrix: TD3DMatrix): HResult; stdcall;
- function GetTransform(dtstTransformStateType: TD3DTransformStateType;
- out lpD3DMatrix: TD3DMatrix): HResult; stdcall;
- function SetViewport(const lpViewport: TD3DViewport7): HResult; stdcall;
- function MultiplyTransform(dtstTransformStateType: TD3DTransformStateType;
- const lpD3DMatrix: TD3DMatrix): HResult; stdcall;
- function GetViewport(out lpViewport: TD3DViewport7): HResult; stdcall;
- function SetMaterial(const lpMaterial: TD3DMaterial7): HResult; stdcall;
- function GetMaterial(out lpMaterial: TD3DMaterial7): HResult; stdcall;
- function SetLight(dwLightIndex: DWORD; const lpLight: TD3DLight7): HResult; stdcall;
- function GetLight(dwLightIndex: DWORD; out lpLight: TD3DLight7): HResult; stdcall;
- function SetRenderState(dwRenderStateType: TD3DRenderStateType; dwRenderState: DWORD): HResult; stdcall;
- function GetRenderState(dwRenderStateType: TD3DRenderStateType; out dwRenderState: DWORD): HResult; stdcall;
- function BeginStateBlock : HResult; stdcall;
- function EndStateBlock(out lpdwBlockHandle: DWORD): HResult; stdcall;
- function PreLoad(lpddsTexture: IDirectDrawSurface7): HResult; stdcall;
- function DrawPrimitive(dptPrimitiveType: TD3DPrimitiveType;
- dwVertexTypeDesc: DWORD; const lpvVertices;
- dwVertexCount, dwFlags: DWORD): HResult; stdcall;
- function DrawIndexedPrimitive(dptPrimitiveType: TD3DPrimitiveType;
- dwVertexTypeDesc: DWORD; const lpvVertices; dwVertexCount: DWORD;
- const lpwIndices; dwIndexCount, dwFlags: DWORD): HResult; stdcall;
- function SetClipStatus(const lpD3DClipStatus: TD3DClipStatus): HResult; stdcall;
- function GetClipStatus(out lpD3DClipStatus: TD3DClipStatus): HResult; stdcall;
- function DrawPrimitiveStrided(dptPrimitiveType: TD3DPrimitiveType;
- dwVertexTypeDesc : DWORD;
- const lpVertexArray: TD3DDrawPrimitiveStridedData;
- dwVertexCount, dwFlags: DWORD): HResult; stdcall;
- function DrawIndexedPrimitiveStrided(dptPrimitiveType: TD3DPrimitiveType;
- dwVertexTypeDesc : DWORD;
- const lpVertexArray: TD3DDrawPrimitiveStridedData; dwVertexCount: DWORD;
- var lpwIndices: WORD; dwIndexCount, dwFlags: DWORD): HResult; stdcall;
- function DrawPrimitiveVB(dptPrimitiveType: TD3DPrimitiveType;
- lpd3dVertexBuffer: IDirect3DVertexBuffer7;
- dwStartVertex, dwNumVertices, dwFlags: DWORD): HResult; stdcall;
- function DrawIndexedPrimitiveVB(dptPrimitiveType: TD3DPrimitiveType;
- lpd3dVertexBuffer: IDirect3DVertexBuffer7; dwStartVertex, dwNumVertices: DWORD;
- var lpwIndices: WORD; dwIndexCount, dwFlags: DWORD): HResult; stdcall;
- function ComputeSphereVisibility(const lpCenters: TD3DVector;
- var lpRadii: TD3DValue; dwNumSpheres, dwFlags: DWORD;
- var lpdwReturnValues: DWORD): HResult; stdcall;
- function GetTexture(dwStage: DWORD; out lplpTexture: IDirectDrawSurface7): HResult; stdcall;
- function SetTexture(dwStage: DWORD; lpTexture: IDirectDrawSurface7): HResult; stdcall;
- function GetTextureStageState(dwStage: DWORD;
- dwState: TD3DTextureStageStateType; out lpdwValue: DWORD): HResult; stdcall;
- function SetTextureStageState(dwStage: DWORD;
- dwState: TD3DTextureStageStateType; lpdwValue: DWORD): HResult; stdcall;
- function ValidateDevice(out lpdwExtraPasses: DWORD): HResult; stdcall;
- function ApplyStateBlock(dwBlockHandle: DWORD): HResult; stdcall;
- function CaptureStateBlock(dwBlockHandle: DWORD): HResult; stdcall;
- function DeleteStateBlock(dwBlockHandle: DWORD): HResult; stdcall;
- function CreateStateBlock(d3dsbType: TD3DStateBlockType; out lpdwBlockHandle: DWORD): HResult; stdcall;
- function Load(lpDestTex: IDirectDrawSurface7; lpDestPoint: PPoint;
- lpSrcTex: IDirectDrawSurface7; lprcSrcRect: PRect; dwFlags: DWORD): HResult; stdcall;
- function LightEnable(dwLightIndex: DWORD; bEnable: BOOL): HResult; stdcall;
- function GetLightEnable(dwLightIndex: DWORD; out bEnable: BOOL): HResult; stdcall;
- function SetClipPlane(dwIndex: DWORD; pPlaneEquation: PD3DValue): HResult; stdcall;
- function GetClipPlane(dwIndex: DWORD; pPlaneEquation: PD3DValue): HResult; stdcall;
- function GetInfo(dwDevInfoID: DWORD; pDevInfoStruct: Pointer; dwSize: DWORD): HResult; stdcall;
- end;
- {$ENDIF} // DIRECT3D_VERSION_7
- (*
- * Execute Buffer interface
- *)
- {$HPPEMIT 'DECLARE_DINTERFACE_TYPE(IDirect3DExecuteBuffer);'}
- {$EXTERNALSYM IDirect3DExecuteBuffer}
- IDirect3DExecuteBuffer = interface(IUnknown)
- ['{4417C145-33AD-11CF-816F-0000C020156E}']
- (*** IDirect3DExecuteBuffer methods ***)
- function Initialize(lpDirect3DDevice: IDirect3DDevice;
- var lpDesc: TD3DExecuteBufferDesc): HResult; stdcall;
- function Lock(var lpDesc: TD3DExecuteBufferDesc): HResult; stdcall;
- function Unlock: HResult; stdcall;
- function SetExecuteData(var lpData: TD3DExecuteData): HResult; stdcall;
- function GetExecuteData(var lpData: TD3DExecuteData): HResult; stdcall;
- function Validate(var lpdwOffset: DWORD; lpFunc: TD3DValidateCallback;
- lpUserArg: Pointer; dwReserved: DWORD): HResult; stdcall;
- (*** Warning! Optimize is defined differently in the header files
- and the online documentation ***)
- function Optimize(dwFlags: DWORD): HResult; stdcall;
- end;
- (*
- * Light interfaces
- *)
- {$HPPEMIT 'DECLARE_DINTERFACE_TYPE(IDirect3DLight);'}
- {$EXTERNALSYM IDirect3DLight}
- IDirect3DLight = interface(IUnknown)
- ['{4417C142-33AD-11CF-816F-0000C020156E}']
- (*** IDirect3DLight methods ***)
- function Initialize(lpDirect3D: IDirect3D): HResult; stdcall;
- function SetLight(var lpLight: TD3DLight2): HResult; stdcall;
- function GetLight(var lpLight: TD3DLight2): HResult; stdcall;
- end;
- (*
- * Material interfaces
- *)
- {$HPPEMIT 'DECLARE_DINTERFACE_TYPE(IDirect3DMaterial);'}
- {$EXTERNALSYM IDirect3DMaterial}
- IDirect3DMaterial = interface(IUnknown)
- ['{4417C144-33AD-11CF-816F-0000C020156E}']
- (*** IDirect3DMaterial methods ***)
- function Initialize(lpDirect3D: IDirect3D): HResult; stdcall;
- function SetMaterial(var lpMat: TD3DMaterial): HResult; stdcall;
- function GetMaterial(var lpMat: TD3DMaterial): HResult; stdcall;
- function GetHandle(lpDirect3DDevice: IDirect3DDevice;
- var lpHandle: TD3DMaterialHandle): HResult; stdcall;
- function Reserve: HResult; stdcall;
- function Unreserve: HResult; stdcall;
- end;
- {$IFDEF DIRECT3D_VERSION_5}
- {$HPPEMIT 'DECLARE_DINTERFACE_TYPE(IDirect3DMaterial2);'}
- {$EXTERNALSYM IDirect3DMaterial2}
- IDirect3DMaterial2 = interface(IUnknown)
- ['{93281503-8cf8-11d0-89ab-00a0c9054129}']
- (*** IDirect3DMaterial2 methods ***)
- function SetMaterial(var lpMat: TD3DMaterial): HResult; stdcall;
- function GetMaterial(var lpMat: TD3DMaterial): HResult; stdcall;
- function GetHandle(lpDirect3DDevice: IDirect3DDevice2;
- var lpHandle: TD3DMaterialHandle): HResult; stdcall;
- end;
- {$ENDIF} // DIRECT3D_VERSION_5
- {$IFDEF DIRECT3D_VERSION_6}
- {$HPPEMIT 'DECLARE_DINTERFACE_TYPE(IDirect3DMaterial3);'}
- {$EXTERNALSYM IDirect3DMaterial3}
- IDirect3DMaterial3 = interface(IUnknown)
- ['{ca9c46f4-d3c5-11d1-b75a-00600852b312}']
- (*** IDirect3DMaterial2 methods ***)
- function SetMaterial(var lpMat: TD3DMaterial): HResult; stdcall;
- function GetMaterial(var lpMat: TD3DMaterial): HResult; stdcall;
- function GetHandle(lpDirect3DDevice: IDirect3DDevice3;
- var lpHandle: TD3DMaterialHandle): HResult; stdcall;
- end;
- {$ENDIF} // DIRECT3D_VERSION_6
- (*
- * Texture interfaces
- *)
- {$HPPEMIT 'DECLARE_DINTERFACE_TYPE(IDirect3DTexture);'}
- {$EXTERNALSYM IDirect3DTexture}
- IDirect3DTexture = interface(IUnknown)
- ['{2CDCD9E0-25A0-11CF-A31A-00AA00B93356}']
- (*** IDirect3DTexture methods ***)
- function Initialize(lpD3DDevice: IDirect3DDevice;
- lpDDSurface: IDirectDrawSurface): HResult; stdcall;
- function GetHandle(lpDirect3DDevice: IDirect3DDevice;
- var lpHandle: TD3DTextureHandle): HResult; stdcall;
- function PaletteChanged(dwStart: DWORD; dwCount: DWORD): HResult; stdcall;
- function Load(lpD3DTexture: IDirect3DTexture): HResult; stdcall;
- function Unload: HResult; stdcall;
- end;
- {$IFDEF DIRECT3D_VERSION_5}
- {$HPPEMIT 'DECLARE_DINTERFACE_TYPE(IDirect3DTexture2);'}
- {$EXTERNALSYM IDirect3DTexture2}
- IDirect3DTexture2 = interface(IUnknown)
- ['{93281502-8cf8-11d0-89ab-00a0c9054129}']
- (*** IDirect3DTexture2 methods ***)
- function GetHandle(lpDirect3DDevice: IDirect3DDevice2;
- var lpHandle: TD3DTextureHandle): HResult; stdcall;
- function PaletteChanged(dwStart: DWORD; dwCount: DWORD): HResult; stdcall;
- function Load(lpD3DTexture: IDirect3DTexture2): HResult; stdcall;
- end;
- {$ENDIF} // DIRECT3D_VERSION_5
- (*
- * Viewport interfaces
- *)
- {$HPPEMIT 'DECLARE_DINTERFACE_TYPE(IDirect3DViewport);'}
- {$EXTERNALSYM IDirect3DViewport}
- IDirect3DViewport = interface(IUnknown)
- ['{4417C146-33AD-11CF-816F-0000C020156E}']
- (*** IDirect3DViewport methods ***)
- function Initialize(lpDirect3D: IDirect3D): HResult; stdcall;
- function GetViewport(out lpData: TD3DViewport): HResult; stdcall;
- function SetViewport(const lpData: TD3DViewport): HResult; stdcall;
- function TransformVertices(dwVertexCount: DWORD;
- const lpData: TD3DTransformData; dwFlags: DWORD;
- out lpOffscreen: DWORD): HResult; stdcall;
- function LightElements(dwElementCount: DWORD;
- var lpData: TD3DLightData): HResult; stdcall;
- function SetBackground(hMat: TD3DMaterialHandle): HResult; stdcall;
- function GetBackground(out hMat: TD3DMaterialHandle): HResult; stdcall;
- function SetBackgroundDepth(lpDDSurface: IDirectDrawSurface):
- HResult; stdcall;
- function GetBackgroundDepth(out lplpDDSurface: IDirectDrawSurface;
- out lpValid: BOOL): HResult; stdcall;
- function Clear(dwCount: DWORD; const lpRects: TD3DRect; dwFlags: DWORD):
- HResult; stdcall;
- function AddLight(lpDirect3DLight: IDirect3DLight): HResult; stdcall;
- function DeleteLight(lpDirect3DLight: IDirect3DLight): HResult; stdcall;
- function NextLight(lpDirect3DLight: IDirect3DLight;
- out lplpDirect3DLight: IDirect3DLight; dwFlags: DWORD): HResult; stdcall;
- end;
- {$IFDEF DIRECT3D_VERSION_5}
- {$HPPEMIT 'DECLARE_DINTERFACE_TYPE(IDirect3DViewport2);'}
- {$EXTERNALSYM IDirect3DViewport2}
- IDirect3DViewport2 = interface(IUnknown)
- ['{93281500-8cf8-11d0-89ab-00a0c9054129}']
- (*** IDirect3DViewport2 methods ***)
- function Initialize(lpDirect3D: IDirect3D): HResult; stdcall;
- function GetViewport(out lpData: TD3DViewport): HResult; stdcall;
- function SetViewport(const lpData: TD3DViewport): HResult; stdcall;
- function TransformVertices(dwVertexCount: DWORD;
- const lpData: TD3DTransformData; dwFlags: DWORD;
- out lpOffscreen: DWORD): HResult; stdcall;
- function LightElements(dwElementCount: DWORD;
- var lpData: TD3DLightData): HResult; stdcall;
- function SetBackground(hMat: TD3DMaterialHandle): HResult; stdcall;
- function GetBackground(out hMat: TD3DMaterialHandle): HResult; stdcall;
- function SetBackgroundDepth(lpDDSurface: IDirectDrawSurface):
- HResult; stdcall;
- function GetBackgroundDepth(out lplpDDSurface: IDirectDrawSurface;
- out lpValid: BOOL): HResult; stdcall;
- function Clear(dwCount: DWORD; const lpRects: TD3DRect; dwFlags: DWORD):
- HResult; stdcall;
- function AddLight(lpDirect3DLight: IDirect3DLight): HResult; stdcall;
- function DeleteLight(lpDirect3DLight: IDirect3DLight): HResult; stdcall;
- function NextLight(lpDirect3DLight: IDirect3DLight;
- out lplpDirect3DLight: IDirect3DLight; dwFlags: DWORD): HResult; stdcall;
- (*** IDirect3DViewport2 methods ***)
- function GetViewport2(out lpData: TD3DViewport2): HResult; stdcall;
- function SetViewport2(const lpData: TD3DViewport2): HResult; stdcall;
- end;
- {$ENDIF} // DIRECT3D_VERSION_5
- {$IFDEF DIRECT3D_VERSION_6}
- {$HPPEMIT 'DECLARE_DINTERFACE_TYPE(IDirect3DViewport3);'}
- {$EXTERNALSYM IDirect3DViewport3}
- IDirect3DViewport3 = interface(IUnknown)
- ['{b0ab3b61-33d7-11d1-a981-00c04fd7b174}']
- (*** IDirect3DViewport3 methods ***)
- function Initialize(lpDirect3D: IDirect3D): HResult; stdcall;
- function GetViewport(out lpData: TD3DViewport): HResult; stdcall;
- function SetViewport(const lpData: TD3DViewport): HResult; stdcall;
- function TransformVertices(dwVertexCount: DWORD;
- const lpData: TD3DTransformData; dwFlags: DWORD;
- out lpOffscreen: DWORD): HResult; stdcall;
- function LightElements(dwElementCount: DWORD;
- var lpData: TD3DLightData): HResult; stdcall;
- function SetBackground(hMat: TD3DMaterialHandle): HResult; stdcall;
- function GetBackground(var hMat: TD3DMaterialHandle): HResult; stdcall;
- function SetBackgroundDepth(
- lpDDSurface: IDirectDrawSurface): HResult; stdcall;
- function GetBackgroundDepth(out lplpDDSurface: IDirectDrawSurface;
- out lpValid: BOOL): HResult; stdcall;
- function Clear(dwCount: DWORD; const lpRects: TD3DRect; dwFlags: DWORD):
- HResult; stdcall;
- function AddLight(lpDirect3DLight: IDirect3DLight): HResult; stdcall;
- function DeleteLight(lpDirect3DLight: IDirect3DLight): HResult; stdcall;
- function NextLight(lpDirect3DLight: IDirect3DLight;
- out lplpDirect3DLight: IDirect3DLight; dwFlags: DWORD): HResult; stdcall;
- function GetViewport2(out lpData: TD3DViewport2): HResult; stdcall;
- function SetViewport2(const lpData: TD3DViewport2): HResult; stdcall;
- function SetBackgroundDepth2(
- lpDDSurface: IDirectDrawSurface4): HResult; stdcall;
- function GetBackgroundDepth2(out lplpDDSurface: IDirectDrawSurface4;
- out lpValid: BOOL): HResult; stdcall;
- function Clear2(dwCount: DWORD; const lpRects: TD3DRect; dwFlags: DWORD;
- dwColor: DWORD; dvZ: TD3DValue; dwStencil: DWORD): HResult; stdcall;
- end;
- {$ENDIF} // DIRECT3D_VERSION_6
- {$IFDEF DIRECT3D_VERSION_6}
- {$HPPEMIT 'DECLARE_DINTERFACE_TYPE(IDirect3DVertexBuffer);'}
- {$EXTERNALSYM IDirect3DVertexBuffer}
- IDirect3DVertexBuffer = interface(IUnknown)
- ['{7a503555-4a83-11d1-a5db-00a0c90367f8}']
- (*** IDirect3DVertexBuffer methods ***)
- function Lock(dwFlags: DWORD; var lplpData: pointer; var lpdwSize: DWORD)
- : HResult; stdcall;
- function Unlock : HResult; stdcall;
- function ProcessVertices(dwVertexOp, dwDestIndex, dwCount: DWORD;
- lpSrcBuffer: IDirect3DVertexBuffer; dwSrcIndex: DWORD;
- lpD3DDevice: IDirect3DDevice3; dwFlags: DWORD): HResult; stdcall;
- function GetVertexBufferDesc(var lpVBDesc: TD3DVertexBufferDesc): HResult; stdcall;
- function Optimize(lpD3DDevice: IDirect3DDevice3; dwFlags: DWORD): HResult; stdcall;
- end;
- {$ENDIF} // DIRECT3D_VERSION_6
- {$IFDEF DIRECT3D_VERSION_7}
- {$HPPEMIT 'DECLARE_DINTERFACE_TYPE(IDirect3DVertexBuffer7);'}
- {$EXTERNALSYM IDirect3DVertexBuffer7}
- IDirect3DVertexBuffer7 = interface(IUnknown)
- ['{f5049e7d-4861-11d2-a407-00a0c90629a8}']
- (*** IDirect3DVertexBuffer methods ***)
- function Lock(dwFlags: DWORD; out lplpData: Pointer; out lpdwSize: DWORD): HResult; stdcall;
- function Unlock : HResult; stdcall;
- function ProcessVertices(dwVertexOp, dwDestIndex, dwCount: DWORD;
- lpSrcBuffer: IDirect3DVertexBuffer7; dwSrcIndex: DWORD;
- lpD3DDevice: IDirect3DDevice7; dwFlags: DWORD): HResult; stdcall;
- function GetVertexBufferDesc(out lpVBDesc: TD3DVertexBufferDesc): HResult; stdcall;
- function Optimize(lpD3DDevice: IDirect3DDevice7; dwFlags: DWORD): HResult; stdcall;
- function ProcessVerticesStrided(dwVertexOp, dwDestIndex, dwCount: DWORD;
- lpVertexArray: TD3DDrawPrimitiveStridedData; dwVertexTypeDesc: DWORD;
- lpD3DDevice: IDirect3DDevice7; dwFlags: DWORD): HResult; stdcall;
- end;
- {$ENDIF} // DIRECT3D_VERSION_7
- {$IFDEF DIRECT3D_VERSION_5}
- const
- (****************************************************************************
- *
- * Flags for IDirect3DDevice::NextViewport
- *
- ****************************************************************************)
- (*
- * Return the next viewport
- *)
- D3DNEXT_NEXT = $00000001;
- {$EXTERNALSYM D3DNEXT_NEXT}
- (*
- * Return the first viewport
- *)
- D3DNEXT_HEAD = $00000002;
- {$EXTERNALSYM D3DNEXT_HEAD}
- (*
- * Return the last viewport
- *)
- D3DNEXT_TAIL = $00000004;
- {$EXTERNALSYM D3DNEXT_TAIL}
- (****************************************************************************
- *
- * Flags for DrawPrimitive/DrawIndexedPrimitive
- * Also valid for Begin/BeginIndexed
- * Also valid for VertexBuffer::CreateVertexBuffer
- ****************************************************************************)
- (*
- * Wait until the device is ready to draw the primitive
- * This will cause DP to not return DDERR_WASSTILLDRAWING
- *)
- D3DDP_WAIT = $00000001;
- {$EXTERNALSYM D3DDP_WAIT}
- {$IFDEF DIRECT3D_VERSION_LESS_6}
- (*
- * Hint that it is acceptable to render the primitive out of order.
- *)
- D3DDP_OUTOFORDER = $00000002;
- {$EXTERNALSYM D3DDP_OUTOFORDER}
- {$ENDIF} // DIRECT3D_VERSION_LESS_6
- (*
- * Hint that the primitives have been clipped by the application.
- *)
- D3DDP_DONOTCLIP = $00000004;
- {$EXTERNALSYM D3DDP_DONOTCLIP}
- (*
- * Hint that the extents need not be updated.
- *)
- D3DDP_DONOTUPDATEEXTENTS = $00000008;
- {$EXTERNALSYM D3DDP_DONOTUPDATEEXTENTS}
- {$ENDIF} // DIRECT3D_VERSION_5
- {$IFDEF DIRECT3D_VERSION_6}
- (*
- * Hint that the lighting should not be applied on vertices.
- *)
- D3DDP_DONOTLIGHT = $00000010;
- {$EXTERNALSYM D3DDP_DONOTLIGHT}
- {$ENDIF} // DIRECT3D_VERSION_6
- (*
- * Direct3D Errors
- * DirectDraw error codes are used when errors not specified here.
- *)
- const
- MAKE_DDHRESULT = HResult($88760000);
- {$EXTERNALSYM MAKE_DDHRESULT}
- D3D_OK = DD_OK;
- {$EXTERNALSYM D3D_OK}
- D3DERR_BADMAJORVERSION = MAKE_DDHRESULT + 700;
- {$EXTERNALSYM D3DERR_BADMAJORVERSION}
- D3DERR_BADMINORVERSION = MAKE_DDHRESULT + 701;
- {$EXTERNALSYM D3DERR_BADMINORVERSION}
- {$IFDEF DIRECT3D_VERSION_5}
- (*
- * An invalid device was requested by the application.
- *)
- D3DERR_INVALID_DEVICE = MAKE_DDHRESULT + 705;
- {$EXTERNALSYM D3DERR_INVALID_DEVICE}
- D3DERR_INITFAILED = MAKE_DDHRESULT + 706;
- {$EXTERNALSYM D3DERR_INITFAILED}
- (*
- * SetRenderTarget attempted on a device that was
- * QI'd off the render target.
- *)
- D3DERR_DEVICEAGGREGATED = MAKE_DDHRESULT + 707;
- {$EXTERNALSYM D3DERR_DEVICEAGGREGATED}
- {$ENDIF} // DIRECT3D_VERSION_5
- D3DERR_EXECUTE_CREATE_FAILED = MAKE_DDHRESULT + 710;
- {$EXTERNALSYM D3DERR_EXECUTE_CREATE_FAILED}
- D3DERR_EXECUTE_DESTROY_FAILED = MAKE_DDHRESULT + 711;
- {$EXTERNALSYM D3DERR_EXECUTE_DESTROY_FAILED}
- D3DERR_EXECUTE_LOCK_FAILED = MAKE_DDHRESULT + 712;
- {$EXTERNALSYM D3DERR_EXECUTE_LOCK_FAILED}
- D3DERR_EXECUTE_UNLOCK_FAILED = MAKE_DDHRESULT + 713;
- {$EXTERNALSYM D3DERR_EXECUTE_UNLOCK_FAILED}
- D3DERR_EXECUTE_LOCKED = MAKE_DDHRESULT + 714;
- {$EXTERNALSYM D3DERR_EXECUTE_LOCKED}
- D3DERR_EXECUTE_NOT_LOCKED = MAKE_DDHRESULT + 715;
- {$EXTERNALSYM D3DERR_EXECUTE_NOT_LOCKED}
- D3DERR_EXECUTE_FAILED = MAKE_DDHRESULT + 716;
- {$EXTERNALSYM D3DERR_EXECUTE_FAILED}
- D3DERR_EXECUTE_CLIPPED_FAILED = MAKE_DDHRESULT + 717;
- {$EXTERNALSYM D3DERR_EXECUTE_CLIPPED_FAILED}
- D3DERR_TEXTURE_NO_SUPPORT = MAKE_DDHRESULT + 720;
- {$EXTERNALSYM D3DERR_TEXTURE_NO_SUPPORT}
- D3DERR_TEXTURE_CREATE_FAILED = MAKE_DDHRESULT + 721;
- {$EXTERNALSYM D3DERR_TEXTURE_CREATE_FAILED}
- D3DERR_TEXTURE_DESTROY_FAILED = MAKE_DDHRESULT + 722;
- {$EXTERNALSYM D3DERR_TEXTURE_DESTROY_FAILED}
- D3DERR_TEXTURE_LOCK_FAILED = MAKE_DDHRESULT + 723;
- {$EXTERNALSYM D3DERR_TEXTURE_LOCK_FAILED}
- D3DERR_TEXTURE_UNLOCK_FAILED = MAKE_DDHRESULT + 724;
- {$EXTERNALSYM D3DERR_TEXTURE_UNLOCK_FAILED}
- D3DERR_TEXTURE_LOAD_FAILED = MAKE_DDHRESULT + 725;
- {$EXTERNALSYM D3DERR_TEXTURE_LOAD_FAILED}
- D3DERR_TEXTURE_SWAP_FAILED = MAKE_DDHRESULT + 726;
- {$EXTERNALSYM D3DERR_TEXTURE_SWAP_FAILED}
- D3DERR_TEXTURE_LOCKED = MAKE_DDHRESULT + 727;
- {$EXTERNALSYM D3DERR_TEXTURE_LOCKED}
- D3DERR_TEXTURE_NOT_LOCKED = MAKE_DDHRESULT + 728;
- {$EXTERNALSYM D3DERR_TEXTURE_NOT_LOCKED}
- D3DERR_TEXTURE_GETSURF_FAILED = MAKE_DDHRESULT + 729;
- {$EXTERNALSYM D3DERR_TEXTURE_GETSURF_FAILED}
- D3DERR_MATRIX_CREATE_FAILED = MAKE_DDHRESULT + 730;
- {$EXTERNALSYM D3DERR_MATRIX_CREATE_FAILED}
- D3DERR_MATRIX_DESTROY_FAILED = MAKE_DDHRESULT + 731;
- {$EXTERNALSYM D3DERR_MATRIX_DESTROY_FAILED}
- D3DERR_MATRIX_SETDATA_FAILED = MAKE_DDHRESULT + 732;
- {$EXTERNALSYM D3DERR_MATRIX_SETDATA_FAILED}
- D3DERR_MATRIX_GETDATA_FAILED = MAKE_DDHRESULT + 733;
- {$EXTERNALSYM D3DERR_MATRIX_GETDATA_FAILED}
- D3DERR_SETVIEWPORTDATA_FAILED = MAKE_DDHRESULT + 734;
- {$EXTERNALSYM D3DERR_SETVIEWPORTDATA_FAILED}
- {$IFDEF DIRECT3D_VERSION_5}
- D3DERR_INVALIDCURRENTVIEWPORT = MAKE_DDHRESULT + 735;
- {$EXTERNALSYM D3DERR_INVALIDCURRENTVIEWPORT}
- D3DERR_INVALIDPRIMITIVETYPE = MAKE_DDHRESULT + 736;
- {$EXTERNALSYM D3DERR_INVALIDPRIMITIVETYPE}
- D3DERR_INVALIDVERTEXTYPE = MAKE_DDHRESULT + 737;
- {$EXTERNALSYM D3DERR_INVALIDVERTEXTYPE}
- D3DERR_TEXTURE_BADSIZE = MAKE_DDHRESULT + 738;
- {$EXTERNALSYM D3DERR_TEXTURE_BADSIZE}
- D3DERR_INVALIDRAMPTEXTURE = MAKE_DDHRESULT + 739;
- {$EXTERNALSYM D3DERR_INVALIDRAMPTEXTURE}
- {$ENDIF} // DIRECT3D_VERSION_5
- D3DERR_MATERIAL_CREATE_FAILED = MAKE_DDHRESULT + 740;
- {$EXTERNALSYM D3DERR_MATERIAL_CREATE_FAILED}
- D3DERR_MATERIAL_DESTROY_FAILED = MAKE_DDHRESULT + 741;
- {$EXTERNALSYM D3DERR_MATERIAL_DESTROY_FAILED}
- D3DERR_MATERIAL_SETDATA_FAILED = MAKE_DDHRESULT + 742;
- {$EXTERNALSYM D3DERR_MATERIAL_SETDATA_FAILED}
- D3DERR_MATERIAL_GETDATA_FAILED = MAKE_DDHRESULT + 743;
- {$EXTERNALSYM D3DERR_MATERIAL_GETDATA_FAILED}
- {$IFDEF DIRECT3D_VERSION_5}
- D3DERR_INVALIDPALETTE = MAKE_DDHRESULT + 744;
- {$EXTERNALSYM D3DERR_INVALIDPALETTE}
- D3DERR_ZBUFF_NEEDS_SYSTEMMEMORY = MAKE_DDHRESULT + 745;
- {$EXTERNALSYM D3DERR_ZBUFF_NEEDS_SYSTEMMEMORY}
- D3DERR_ZBUFF_NEEDS_VIDEOMEMORY = MAKE_DDHRESULT + 746;
- {$EXTERNALSYM D3DERR_ZBUFF_NEEDS_VIDEOMEMORY}
- D3DERR_SURFACENOTINVIDMEM = MAKE_DDHRESULT + 747;
- {$EXTERNALSYM D3DERR_SURFACENOTINVIDMEM}
- {$ENDIF} // DIRECT3D_VERSION_5
- D3DERR_LIGHT_SET_FAILED = MAKE_DDHRESULT + 750;
- {$EXTERNALSYM D3DERR_LIGHT_SET_FAILED}
- {$IFDEF DIRECT3D_VERSION_5}
- D3DERR_LIGHTHASVIEWPORT = MAKE_DDHRESULT + 751;
- {$EXTERNALSYM D3DERR_LIGHTHASVIEWPORT}
- D3DERR_LIGHTNOTINTHISVIEWPORT = MAKE_DDHRESULT + 752;
- {$EXTERNALSYM D3DERR_LIGHTNOTINTHISVIEWPORT}
- {$ENDIF} // DIRECT3D_VERSION_5
- D3DERR_SCENE_IN_SCENE = MAKE_DDHRESULT + 760;
- {$EXTERNALSYM D3DERR_SCENE_IN_SCENE}
- D3DERR_SCENE_NOT_IN_SCENE = MAKE_DDHRESULT + 761;
- {$EXTERNALSYM D3DERR_SCENE_NOT_IN_SCENE}
- D3DERR_SCENE_BEGIN_FAILED = MAKE_DDHRESULT + 762;
- {$EXTERNALSYM D3DERR_SCENE_BEGIN_FAILED}
- D3DERR_SCENE_END_FAILED = MAKE_DDHRESULT + 763;
- {$EXTERNALSYM D3DERR_SCENE_END_FAILED}
- {$IFDEF DIRECT3D_VERSION_5}
- D3DERR_INBEGIN = MAKE_DDHRESULT + 770;
- {$EXTERNALSYM D3DERR_INBEGIN}
- D3DERR_NOTINBEGIN = MAKE_DDHRESULT + 771;
- {$EXTERNALSYM D3DERR_NOTINBEGIN}
- D3DERR_NOVIEWPORTS = MAKE_DDHRESULT + 772;
- {$EXTERNALSYM D3DERR_NOVIEWPORTS}
- D3DERR_VIEWPORTDATANOTSET = MAKE_DDHRESULT + 773;
- {$EXTERNALSYM D3DERR_VIEWPORTDATANOTSET}
- D3DERR_VIEWPORTHASNODEVICE = MAKE_DDHRESULT + 774;
- {$EXTERNALSYM D3DERR_VIEWPORTHASNODEVICE}
- D3DERR_NOCURRENTVIEWPORT = MAKE_DDHRESULT + 775;
- {$EXTERNALSYM D3DERR_NOCURRENTVIEWPORT}
- {$ENDIF} // DIRECT3D_VERSION_5
- {$IFDEF DIRECT3D_VERSION_6}
- D3DERR_INVALIDVERTEXFORMAT = MAKE_DDHRESULT + 2048;
- {$EXTERNALSYM D3DERR_INVALIDVERTEXFORMAT}
- (*
- * Attempted to CreateTexture on a surface that had a color key
- *)
- D3DERR_COLORKEYATTACHED = MAKE_DDHRESULT + 2050;
- {$EXTERNALSYM D3DERR_COLORKEYATTACHED}
- D3DERR_VERTEXBUFFEROPTIMIZED = MAKE_DDHRESULT + 2060;
- {$EXTERNALSYM D3DERR_VERTEXBUFFEROPTIMIZED}
- D3DERR_VBUF_CREATE_FAILED = MAKE_DDHRESULT + 2061;
- {$EXTERNALSYM D3DERR_VBUF_CREATE_FAILED}
- D3DERR_VERTEXBUFFERLOCKED = MAKE_DDHRESULT + 2062;
- {$EXTERNALSYM D3DERR_VERTEXBUFFERLOCKED}
- D3DERR_ZBUFFER_NOTPRESENT = MAKE_DDHRESULT + 2070;
- {$EXTERNALSYM D3DERR_ZBUFFER_NOTPRESENT}
- D3DERR_STENCILBUFFER_NOTPRESENT = MAKE_DDHRESULT + 2071;
- {$EXTERNALSYM D3DERR_STENCILBUFFER_NOTPRESENT}
- D3DERR_WRONGTEXTUREFORMAT = MAKE_DDHRESULT + 2072;
- {$EXTERNALSYM D3DERR_WRONGTEXTUREFORMAT}
- D3DERR_UNSUPPORTEDCOLOROPERATION = MAKE_DDHRESULT + 2073;
- {$EXTERNALSYM D3DERR_UNSUPPORTEDCOLOROPERATION}
- D3DERR_UNSUPPORTEDCOLORARG = MAKE_DDHRESULT + 2074;
- {$EXTERNALSYM D3DERR_UNSUPPORTEDCOLORARG}
- D3DERR_UNSUPPORTEDALPHAOPERATION = MAKE_DDHRESULT + 2075;
- {$EXTERNALSYM D3DERR_UNSUPPORTEDALPHAOPERATION}
- D3DERR_UNSUPPORTEDALPHAARG = MAKE_DDHRESULT + 2076;
- {$EXTERNALSYM D3DERR_UNSUPPORTEDALPHAARG}
- D3DERR_TOOMANYOPERATIONS = MAKE_DDHRESULT + 2077;
- {$EXTERNALSYM D3DERR_TOOMANYOPERATIONS}
- D3DERR_CONFLICTINGTEXTUREFILTER = MAKE_DDHRESULT + 2078;
- {$EXTERNALSYM D3DERR_CONFLICTINGTEXTUREFILTER}
- D3DERR_UNSUPPORTEDFACTORVALUE = MAKE_DDHRESULT + 2079;
- {$EXTERNALSYM D3DERR_UNSUPPORTEDFACTORVALUE}
- D3DERR_CONFLICTINGRENDERSTATE = MAKE_DDHRESULT + 2081;
- {$EXTERNALSYM D3DERR_CONFLICTINGRENDERSTATE}
- D3DERR_UNSUPPORTEDTEXTUREFILTER = MAKE_DDHRESULT + 2082;
- {$EXTERNALSYM D3DERR_UNSUPPORTEDTEXTUREFILTER}
- D3DERR_TOOMANYPRIMITIVES = MAKE_DDHRESULT + 2083;
- {$EXTERNALSYM D3DERR_TOOMANYPRIMITIVES}
- D3DERR_INVALIDMATRIX = MAKE_DDHRESULT + 2084;
- {$EXTERNALSYM D3DERR_INVALIDMATRIX}
- D3DERR_TOOMANYVERTICES = MAKE_DDHRESULT + 2085;
- {$EXTERNALSYM D3DERR_TOOMANYVERTICES}
- D3DERR_CONFLICTINGTEXTUREPALETTE = MAKE_DDHRESULT + 2086;
- {$EXTERNALSYM D3DERR_CONFLICTINGTEXTUREPALETTE}
- {$ENDIF} // DIRECT3D_VERSION_6
- {$IFDEF DIRECT3D_VERSION_7}
- D3DERR_INVALIDSTATEBLOCK = MAKE_DDHRESULT + 2100;
- {$EXTERNALSYM D3DERR_INVALIDSTATEBLOCK}
- D3DERR_INBEGINSTATEBLOCK = MAKE_DDHRESULT + 2101;
- {$EXTERNALSYM D3DERR_INBEGINSTATEBLOCK}
- D3DERR_NOTINBEGINSTATEBLOCK = MAKE_DDHRESULT + 2102;
- {$EXTERNALSYM D3DERR_NOTINBEGINSTATEBLOCK}
- {$ENDIF} // DIRECT3D_VERSION_7
- {$ENDIF} // DIRECT3D_VERSION_LESS_8
- procedure DisableFPUExceptions;
- procedure EnableFPUExceptions;
- {$IFNDEF EXCLUDE_DXFILE_FROM_DIRECT3D}
- (***************************************************************************
- *
- * Copyright (C) 1998-1999 Microsoft Corporation. All Rights Reserved.
- *
- * File: dxfile.h
- *
- * Content: DirectX File public header file
- *
- ***************************************************************************)
- var
- DXFileDLL : HMODULE;
- function DXFileErrorString(Value: HResult): string;
- type
- TDXFileFormat = (
- DXFILEFORMAT_BINARY,
- DXFILEFORMAT_TEXT,
- DXFILEFORMAT_COMPRESSED
- );
- TDXFileLoadOptions = (
- DXFILELOAD_FROMFILE,
- DXFILELOAD_FROMRESOURCE,
- DXFILELOAD_FROMMEMORY,
- DXFILELOAD_INVALID_3,
- DXFILELOAD_FROMSTREAM,
- DXFILELOAD_INVALID_5,
- DXFILELOAD_INVALID_6,
- DXFILELOAD_INVALID_7,
- DXFILELOAD_FROMURL
- );
- PDXFileLoadResource = ^TDXFileLoadResource;
- TDXFileLoadResource = packed record
- hModule: HModule;
- lpName: PAnsiChar;
- lpType: PAnsiChar;
- end;
- PDXFileLoadMemory = ^TDXFileLoadMemory;
- TDXFileLoadMemory = packed record
- lpMemory: Pointer;
- dSize: DWORD;
- end;
- (*
- * DirectX File object types.
- *)
- IDirectXFile = interface;
- IDirectXFileEnumObject = interface;
- IDirectXFileSaveObject = interface;
- IDirectXFileObject = interface;
- IDirectXFileData = interface;
- IDirectXFileDataReference = interface;
- IDirectXFileBinary = interface;
- (*
- * DirectX File interfaces.
- *)
- IDirectXFile = interface(IUnknown)
- ['{3d82ab40-62da-11cf-ab39-0020af71e433}']
- function CreateEnumObject(pvSource: Pointer;
- dwLoadOptions: TDXFileLoadOptions;
- var ppEnumObj: IDirectXFileEnumObject): HResult; stdcall;
- function CreateSaveObject(szFileName: PChar; dwFileFormat: TDXFileFormat;
- var ppSaveObj: IDirectXFileSaveObject): HResult; stdcall;
- function RegisterTemplates(pvData: Pointer; cbSize: DWORD): HResult; stdcall;
- end;
- IDirectXFileEnumObject = interface(IUnknown)
- ['{3d82ab41-62da-11cf-ab39-0020af71e433}']
- function GetNextDataObject(var ppDataObj: IDirectXFileData): HResult; stdcall;
- function GetDataObjectById
- (const rguid: TGUID; var ppDataObj: IDirectXFileData): HResult; stdcall;
- function GetDataObjectByName
- (szName: PChar; var ppDataObj: IDirectXFileData): HResult; stdcall;
- end;
- IDirectXFileSaveObject = interface(IUnknown)
- ['{3d82ab42-62da-11cf-ab39-0020af71e433}']
- function SaveTemplates
- (cTemplates: DWORD; var ppguidTemplates: PGUID): HResult; stdcall;
- function CreateDataObject(const rguidTemplate: TGUID; szName: PChar;
- pguid: PGUID; cbSize: DWORD; pvData: Pointer;
- var ppDataObj: IDirectXFileData): HResult; stdcall;
- function SaveData(pDataObj: IDirectXFileData): HResult; stdcall;
- end;
- IDirectXFileObject = interface(IUnknown)
- ['{3d82ab43-62da-11cf-ab39-0020af71e433}']
- function GetName(pstrNameBuf: PChar; var dwBufLen: DWORD): HResult; stdcall;
- function GetId(var pGuidBuf: TGUID): HResult; stdcall;
- end;
- IDirectXFileData = interface(IDirectXFileObject)
- ['{3d82ab44-62da-11cf-ab39-0020af71e433}']
- function GetData
- (szMember: PChar; var pcbSize: DWORD; var ppvData: Pointer): HResult; stdcall;
- function GetType(var ppguid: PGUID): HResult; stdcall;
- function GetNextObject(var ppChildObj: IDirectXFileObject): HResult; stdcall;
- function AddDataObject(pDataObj: IDirectXFileData): HResult; stdcall;
- function AddDataReference(szRef: PChar; pguidRef: PGUID): HResult; stdcall;
- function AddBinaryObject(szName: PChar; pguid: PGUID; szMimeType: PChar;
- pvData: Pointer; cbSize: DWORD): HResult; stdcall;
- end;
- IDirectXFileDataReference = interface(IDirectXFileObject)
- ['{3d82ab45-62da-11cf-ab39-0020af71e433}']
- function Resolve(var ppDataObj: IDirectXFileData): HResult; stdcall;
- end;
- IDirectXFileBinary = interface(IDirectXFileObject)
- ['{3d82ab46-62da-11cf-ab39-0020af71e433}']
- function GetSize(var pcbSize: DWORD): HResult; stdcall;
- function GetMimeType(var pszMimeType: PChar): HResult; stdcall;
- function Read(pvData: Pointer; cbSize: DWORD; pcbRead: PDWORD{?}): HResult; stdcall;
- end;
- const
- (*
- * DirectXFile Object Class Id (for CoCreateInstance())
- *)
- CLSID_CDirectXFile: TGUID =
- (D1:$4516ec43;D2:$8f20;D3:$11d0;D4:($9b,$6d,$00,$00,$c0,$78,$1b,$c3));
- (*
- * DirectX File Interface GUIDs.
- *)
- type
- IID_IDirectXFile = IDirectXFile;
- IID_IDirectXFileEnumObject = IDirectXFileEnumObject;
- IID_IDirectXFileSaveObject = IDirectXFileSaveObject;
- IID_IDirectXFileObject = IDirectXFileObject;
- IID_IDirectXFileData = IDirectXFileData;
- IID_IDirectXFileDataReference = IDirectXFileDataReference;
- IID_IDirectXFileBinary = IDirectXFileBinary;
- (*
- * DirectX File Header template's GUID.
- *)
- const
- TID_DXFILEHeader: TGUID =
- (D1:$3d82ab43;D2:$62da;D3:$11cf;D4:($ab,$39,$00,$20,$af,$71,$e4,$33));
- (*
- * DirectX File errors.
- *)
- const
- DXFILE_OK = 0;
- DXFILEERR_BADOBJECT = MAKE_DDHRESULT or 850;
- DXFILEERR_BADVALUE = MAKE_DDHRESULT or 851;
- DXFILEERR_BADTYPE = MAKE_DDHRESULT or 852;
- DXFILEERR_BADSTREAMHANDLE = MAKE_DDHRESULT or 853;
- DXFILEERR_BADALLOC = MAKE_DDHRESULT or 854;
- DXFILEERR_NOTFOUND = MAKE_DDHRESULT or 855;
- DXFILEERR_NOTDONEYET = MAKE_DDHRESULT or 856;
- DXFILEERR_FILENOTFOUND = MAKE_DDHRESULT or 857;
- DXFILEERR_RESOURCENOTFOUND = MAKE_DDHRESULT or 858;
- DXFILEERR_URLNOTFOUND = MAKE_DDHRESULT or 859;
- DXFILEERR_BADRESOURCE = MAKE_DDHRESULT or 860;
- DXFILEERR_BADFILETYPE = MAKE_DDHRESULT or 861;
- DXFILEERR_BADFILEVERSION = MAKE_DDHRESULT or 862;
- DXFILEERR_BADFILEFLOATSIZE = MAKE_DDHRESULT or 863;
- DXFILEERR_BADFILECOMPRESSIONTYPE = MAKE_DDHRESULT or 864;
- DXFILEERR_BADFILE = MAKE_DDHRESULT or 865;
- DXFILEERR_PARSEERROR = MAKE_DDHRESULT or 866;
- DXFILEERR_NOTEMPLATE = MAKE_DDHRESULT or 867;
- DXFILEERR_BADARRAYSIZE = MAKE_DDHRESULT or 868;
- DXFILEERR_BADDATAREFERENCE = MAKE_DDHRESULT or 869;
- DXFILEERR_INTERNALERROR = MAKE_DDHRESULT or 870;
- DXFILEERR_NOMOREOBJECTS = MAKE_DDHRESULT or 871;
- DXFILEERR_BADINTRINSICS = MAKE_DDHRESULT or 872;
- DXFILEERR_NOMORESTREAMHANDLES = MAKE_DDHRESULT or 873;
- DXFILEERR_NOMOREDATA = MAKE_DDHRESULT or 874;
- DXFILEERR_BADCACHEFILE = MAKE_DDHRESULT or 875;
- DXFILEERR_NOINTERNET = MAKE_DDHRESULT or 876;
- (*
- * API for creating IDirectXFile interface.
- *)
- var
- DirectXFileCreate : function
- (out lplpDirectXFile: IDirectXFile): HResult; stdcall;
- (* D3DRM XFile templates in binary form *)
- const
- D3DRM_XTEMPLATES: array [0..3214] of Byte = (
- $78, $6f, $66, $20, $30, $33, $30, $32, $62,
- $69, $6e, $20, $30, $30, $36, $34, $1f, 0, $1,
- 0, $6, 0, 0, 0, $48, $65, $61, $64, $65,
- $72, $a, 0, $5, 0, $43, $ab, $82, $3d, $da,
- $62, $cf, $11, $ab, $39, 0, $20, $af, $71, $e4,
- $33, $28, 0, $1, 0, $5, 0, 0, 0, $6d,
- $61, $6a, $6f, $72, $14, 0, $28, 0, $1, 0,
- $5, 0, 0, 0, $6d, $69, $6e, $6f, $72, $14,
- 0, $29, 0, $1, 0, $5, 0, 0, 0, $66,
- $6c, $61, $67, $73, $14, 0, $b, 0, $1f, 0,
- $1, 0, $6, 0, 0, 0, $56, $65, $63, $74,
- $6f, $72, $a, 0, $5, 0, $5e, $ab, $82, $3d,
- $da, $62, $cf, $11, $ab, $39, 0, $20, $af, $71,
- $e4, $33, $2a, 0, $1, 0, $1, 0, 0, 0,
- $78, $14, 0, $2a, 0, $1, 0, $1, 0, 0,
- 0, $79, $14, 0, $2a, 0, $1, 0, $1, 0,
- 0, 0, $7a, $14, 0, $b, 0, $1f, 0, $1,
- 0, $8, 0, 0, 0, $43, $6f, $6f, $72, $64,
- $73, $32, $64, $a, 0, $5, 0, $44, $3f, $f2,
- $f6, $86, $76, $cf, $11, $8f, $52, 0, $40, $33,
- $35, $94, $a3, $2a, 0, $1, 0, $1, 0, 0,
- 0, $75, $14, 0, $2a, 0, $1, 0, $1, 0,
- 0, 0, $76, $14, 0, $b, 0, $1f, 0, $1,
- 0, $9, 0, 0, 0, $4d, $61, $74, $72, $69,
- $78, $34, $78, $34, $a, 0, $5, 0, $45, $3f,
- $f2, $f6, $86, $76, $cf, $11, $8f, $52, 0, $40,
- $33, $35, $94, $a3, $34, 0, $2a, 0, $1, 0,
- $6, 0, 0, 0, $6d, $61, $74, $72, $69, $78,
- $e, 0, $3, 0, $10, 0, 0, 0, $f, 0,
- $14, 0, $b, 0, $1f, 0, $1, 0, $9, 0,
- 0, 0, $43, $6f, $6c, $6f, $72, $52, $47, $42,
- $41, $a, 0, $5, 0, $e0, $44, $ff, $35, $7c,
- $6c, $cf, $11, $8f, $52, 0, $40, $33, $35, $94,
- $a3, $2a, 0, $1, 0, $3, 0, 0, 0, $72,
- $65, $64, $14, 0, $2a, 0, $1, 0, $5, 0,
- 0, 0, $67, $72, $65, $65, $6e, $14, 0, $2a,
- 0, $1, 0, $4, 0, 0, 0, $62, $6c, $75,
- $65, $14, 0, $2a, 0, $1, 0, $5, 0, 0,
- 0, $61, $6c, $70, $68, $61, $14, 0, $b, 0,
- $1f, 0, $1, 0, $8, 0, 0, 0, $43, $6f,
- $6c, $6f, $72, $52, $47, $42, $a, 0, $5, 0,
- $81, $6e, $e1, $d3, $35, $78, $cf, $11, $8f, $52,
- 0, $40, $33, $35, $94, $a3, $2a, 0, $1, 0,
- $3, 0, 0, 0, $72, $65, $64, $14, 0, $2a,
- 0, $1, 0, $5, 0, 0, 0, $67, $72, $65,
- $65, $6e, $14, 0, $2a, 0, $1, 0, $4, 0,
- 0, 0, $62, $6c, $75, $65, $14, 0, $b, 0,
- $1f, 0, $1, 0, $c, 0, 0, 0, $49, $6e,
- $64, $65, $78, $65, $64, $43, $6f, $6c, $6f, $72,
- $a, 0, $5, 0, $20, $b8, $30, $16, $42, $78,
- $cf, $11, $8f, $52, 0, $40, $33, $35, $94, $a3,
- $29, 0, $1, 0, $5, 0, 0, 0, $69, $6e,
- $64, $65, $78, $14, 0, $1, 0, $9, 0, 0,
- 0, $43, $6f, $6c, $6f, $72, $52, $47, $42, $41,
- $1, 0, $a, 0, 0, 0, $69, $6e, $64, $65,
- $78, $43, $6f, $6c, $6f, $72, $14, 0, $b, 0,
- $1f, 0, $1, 0, $7, 0, 0, 0, $42, $6f,
- $6f, $6c, $65, $61, $6e, $a, 0, $5, 0, $a0,
- $a6, $7d, $53, $37, $ca, $d0, $11, $94, $1c, 0,
- $80, $c8, $c, $fa, $7b, $29, 0, $1, 0, $9,
- 0, 0, 0, $74, $72, $75, $65, $66, $61, $6c,
- $73, $65, $14, 0, $b, 0, $1f, 0, $1, 0,
- $9, 0, 0, 0, $42, $6f, $6f, $6c, $65, $61,
- $6e, $32, $64, $a, 0, $5, 0, $63, $ae, $85,
- $48, $e8, $78, $cf, $11, $8f, $52, 0, $40, $33,
- $35, $94, $a3, $1, 0, $7, 0, 0, 0, $42,
- $6f, $6f, $6c, $65, $61, $6e, $1, 0, $1, 0,
- 0, 0, $75, $14, 0, $1, 0, $7, 0, 0,
- 0, $42, $6f, $6f, $6c, $65, $61, $6e, $1, 0,
- $1, 0, 0, 0, $76, $14, 0, $b, 0, $1f,
- 0, $1, 0, $c, 0, 0, 0, $4d, $61, $74,
- $65, $72, $69, $61, $6c, $57, $72, $61, $70, $a,
- 0, $5, 0, $60, $ae, $85, $48, $e8, $78, $cf,
- $11, $8f, $52, 0, $40, $33, $35, $94, $a3, $1,
- 0, $7, 0, 0, 0, $42, $6f, $6f, $6c, $65,
- $61, $6e, $1, 0, $1, 0, 0, 0, $75, $14,
- 0, $1, 0, $7, 0, 0, 0, $42, $6f, $6f,
- $6c, $65, $61, $6e, $1, 0, $1, 0, 0, 0,
- $76, $14, 0, $b, 0, $1f, 0, $1, 0, $f,
- 0, 0, 0, $54, $65, $78, $74, $75, $72, $65,
- $46, $69, $6c, $65, $6e, $61, $6d, $65, $a, 0,
- $5, 0, $e1, $90, $27, $a4, $10, $78, $cf, $11,
- $8f, $52, 0, $40, $33, $35, $94, $a3, $31, 0,
- $1, 0, $8, 0, 0, 0, $66, $69, $6c, $65,
- $6e, $61, $6d, $65, $14, 0, $b, 0, $1f, 0,
- $1, 0, $8, 0, 0, 0, $4d, $61, $74, $65,
- $72, $69, $61, $6c, $a, 0, $5, 0, $4d, $ab,
- $82, $3d, $da, $62, $cf, $11, $ab, $39, 0, $20,
- $af, $71, $e4, $33, $1, 0, $9, 0, 0, 0,
- $43, $6f, $6c, $6f, $72, $52, $47, $42, $41, $1,
- 0, $9, 0, 0, 0, $66, $61, $63, $65, $43,
- $6f, $6c, $6f, $72, $14, 0, $2a, 0, $1, 0,
- $5, 0, 0, 0, $70, $6f, $77, $65, $72, $14,
- 0, $1, 0, $8, 0, 0, 0, $43, $6f, $6c,
- $6f, $72, $52, $47, $42, $1, 0, $d, 0, 0,
- 0, $73, $70, $65, $63, $75, $6c, $61, $72, $43,
- $6f, $6c, $6f, $72, $14, 0, $1, 0, $8, 0,
- 0, 0, $43, $6f, $6c, $6f, $72, $52, $47, $42,
- $1, 0, $d, 0, 0, 0, $65, $6d, $69, $73,
- $73, $69, $76, $65, $43, $6f, $6c, $6f, $72, $14,
- 0, $e, 0, $12, 0, $12, 0, $12, 0, $f,
- 0, $b, 0, $1f, 0, $1, 0, $8, 0, 0,
- 0, $4d, $65, $73, $68, $46, $61, $63, $65, $a,
- 0, $5, 0, $5f, $ab, $82, $3d, $da, $62, $cf,
- $11, $ab, $39, 0, $20, $af, $71, $e4, $33, $29,
- 0, $1, 0, $12, 0, 0, 0, $6e, $46, $61,
- $63, $65, $56, $65, $72, $74, $65, $78, $49, $6e,
- $64, $69, $63, $65, $73, $14, 0, $34, 0, $29,
- 0, $1, 0, $11, 0, 0, 0, $66, $61, $63,
- $65, $56, $65, $72, $74, $65, $78, $49, $6e, $64,
- $69, $63, $65, $73, $e, 0, $1, 0, $12, 0,
- 0, 0, $6e, $46, $61, $63, $65, $56, $65, $72,
- $74, $65, $78, $49, $6e, $64, $69, $63, $65, $73,
- $f, 0, $14, 0, $b, 0, $1f, 0, $1, 0,
- $d, 0, 0, 0, $4d, $65, $73, $68, $46, $61,
- $63, $65, $57, $72, $61, $70, $73, $a, 0, $5,
- 0, $c0, $c5, $1e, $ed, $a8, $c0, $d0, $11, $94,
- $1c, 0, $80, $c8, $c, $fa, $7b, $29, 0, $1,
- 0, $f, 0, 0, 0, $6e, $46, $61, $63, $65,
- $57, $72, $61, $70, $56, $61, $6c, $75, $65, $73,
- $14, 0, $34, 0, $1, 0, $9, 0, 0, 0,
- $42, $6f, $6f, $6c, $65, $61, $6e, $32, $64, $1,
- 0, $e, 0, 0, 0, $66, $61, $63, $65, $57,
- $72, $61, $70, $56, $61, $6c, $75, $65, $73, $e,
- 0, $1, 0, $f, 0, 0, 0, $6e, $46, $61,
- $63, $65, $57, $72, $61, $70, $56, $61, $6c, $75,
- $65, $73, $f, 0, $14, 0, $b, 0, $1f, 0,
- $1, 0, $11, 0, 0, 0, $4d, $65, $73, $68,
- $54, $65, $78, $74, $75, $72, $65, $43, $6f, $6f,
- $72, $64, $73, $a, 0, $5, 0, $40, $3f, $f2,
- $f6, $86, $76, $cf, $11, $8f, $52, 0, $40, $33,
- $35, $94, $a3, $29, 0, $1, 0, $e, 0, 0,
- 0, $6e, $54, $65, $78, $74, $75, $72, $65, $43,
- $6f, $6f, $72, $64, $73, $14, 0, $34, 0, $1,
- 0, $8, 0, 0, 0, $43, $6f, $6f, $72, $64,
- $73, $32, $64, $1, 0, $d, 0, 0, 0, $74,
- $65, $78, $74, $75, $72, $65, $43, $6f, $6f, $72,
- $64, $73, $e, 0, $1, 0, $e, 0, 0, 0,
- $6e, $54, $65, $78, $74, $75, $72, $65, $43, $6f,
- $6f, $72, $64, $73, $f, 0, $14, 0, $b, 0,
- $1f, 0, $1, 0, $10, 0, 0, 0, $4d, $65,
- $73, $68, $4d, $61, $74, $65, $72, $69, $61, $6c,
- $4c, $69, $73, $74, $a, 0, $5, 0, $42, $3f,
- $f2, $f6, $86, $76, $cf, $11, $8f, $52, 0, $40,
- $33, $35, $94, $a3, $29, 0, $1, 0, $a, 0,
- 0, 0, $6e, $4d, $61, $74, $65, $72, $69, $61,
- $6c, $73, $14, 0, $29, 0, $1, 0, $c, 0,
- 0, 0, $6e, $46, $61, $63, $65, $49, $6e, $64,
- $65, $78, $65, $73, $14, 0, $34, 0, $29, 0,
- $1, 0, $b, 0, 0, 0, $66, $61, $63, $65,
- $49, $6e, $64, $65, $78, $65, $73, $e, 0, $1,
- 0, $c, 0, 0, 0, $6e, $46, $61, $63, $65,
- $49, $6e, $64, $65, $78, $65, $73, $f, 0, $14,
- 0, $e, 0, $1, 0, $8, 0, 0, 0, $4d,
- $61, $74, $65, $72, $69, $61, $6c, $f, 0, $b,
- 0, $1f, 0, $1, 0, $b, 0, 0, 0, $4d,
- $65, $73, $68, $4e, $6f, $72, $6d, $61, $6c, $73,
- $a, 0, $5, 0, $43, $3f, $f2, $f6, $86, $76,
- $cf, $11, $8f, $52, 0, $40, $33, $35, $94, $a3,
- $29, 0, $1, 0, $8, 0, 0, 0, $6e, $4e,
- $6f, $72, $6d, $61, $6c, $73, $14, 0, $34, 0,
- $1, 0, $6, 0, 0, 0, $56, $65, $63, $74,
- $6f, $72, $1, 0, $7, 0, 0, 0, $6e, $6f,
- $72, $6d, $61, $6c, $73, $e, 0, $1, 0, $8,
- 0, 0, 0, $6e, $4e, $6f, $72, $6d, $61, $6c,
- $73, $f, 0, $14, 0, $29, 0, $1, 0, $c,
- 0, 0, 0, $6e, $46, $61, $63, $65, $4e, $6f,
- $72, $6d, $61, $6c, $73, $14, 0, $34, 0, $1,
- 0, $8, 0, 0, 0, $4d, $65, $73, $68, $46,
- $61, $63, $65, $1, 0, $b, 0, 0, 0, $66,
- $61, $63, $65, $4e, $6f, $72, $6d, $61, $6c, $73,
- $e, 0, $1, 0, $c, 0, 0, 0, $6e, $46,
- $61, $63, $65, $4e, $6f, $72, $6d, $61, $6c, $73,
- $f, 0, $14, 0, $b, 0, $1f, 0, $1, 0,
- $10, 0, 0, 0, $4d, $65, $73, $68, $56, $65,
- $72, $74, $65, $78, $43, $6f, $6c, $6f, $72, $73,
- $a, 0, $5, 0, $21, $b8, $30, $16, $42, $78,
- $cf, $11, $8f, $52, 0, $40, $33, $35, $94, $a3,
- $29, 0, $1, 0, $d, 0, 0, 0, $6e, $56,
- $65, $72, $74, $65, $78, $43, $6f, $6c, $6f, $72,
- $73, $14, 0, $34, 0, $1, 0, $c, 0, 0,
- 0, $49, $6e, $64, $65, $78, $65, $64, $43, $6f,
- $6c, $6f, $72, $1, 0, $c, 0, 0, 0, $76,
- $65, $72, $74, $65, $78, $43, $6f, $6c, $6f, $72,
- $73, $e, 0, $1, 0, $d, 0, 0, 0, $6e,
- $56, $65, $72, $74, $65, $78, $43, $6f, $6c, $6f,
- $72, $73, $f, 0, $14, 0, $b, 0, $1f, 0,
- $1, 0, $4, 0, 0, 0, $4d, $65, $73, $68,
- $a, 0, $5, 0, $44, $ab, $82, $3d, $da, $62,
- $cf, $11, $ab, $39, 0, $20, $af, $71, $e4, $33,
- $29, 0, $1, 0, $9, 0, 0, 0, $6e, $56,
- $65, $72, $74, $69, $63, $65, $73, $14, 0, $34,
- 0, $1, 0, $6, 0, 0, 0, $56, $65, $63,
- $74, $6f, $72, $1, 0, $8, 0, 0, 0, $76,
- $65, $72, $74, $69, $63, $65, $73, $e, 0, $1,
- 0, $9, 0, 0, 0, $6e, $56, $65, $72, $74,
- $69, $63, $65, $73, $f, 0, $14, 0, $29, 0,
- $1, 0, $6, 0, 0, 0, $6e, $46, $61, $63,
- $65, $73, $14, 0, $34, 0, $1, 0, $8, 0,
- 0, 0, $4d, $65, $73, $68, $46, $61, $63, $65,
- $1, 0, $5, 0, 0, 0, $66, $61, $63, $65,
- $73, $e, 0, $1, 0, $6, 0, 0, 0, $6e,
- $46, $61, $63, $65, $73, $f, 0, $14, 0, $e,
- 0, $12, 0, $12, 0, $12, 0, $f, 0, $b,
- 0, $1f, 0, $1, 0, $14, 0, 0, 0, $46,
- $72, $61, $6d, $65, $54, $72, $61, $6e, $73, $66,
- $6f, $72, $6d, $4d, $61, $74, $72, $69, $78, $a,
- 0, $5, 0, $41, $3f, $f2, $f6, $86, $76, $cf,
- $11, $8f, $52, 0, $40, $33, $35, $94, $a3, $1,
- 0, $9, 0, 0, 0, $4d, $61, $74, $72, $69,
- $78, $34, $78, $34, $1, 0, $b, 0, 0, 0,
- $66, $72, $61, $6d, $65, $4d, $61, $74, $72, $69,
- $78, $14, 0, $b, 0, $1f, 0, $1, 0, $5,
- 0, 0, 0, $46, $72, $61, $6d, $65, $a, 0,
- $5, 0, $46, $ab, $82, $3d, $da, $62, $cf, $11,
- $ab, $39, 0, $20, $af, $71, $e4, $33, $e, 0,
- $12, 0, $12, 0, $12, 0, $f, 0, $b, 0,
- $1f, 0, $1, 0, $9, 0, 0, 0, $46, $6c,
- $6f, $61, $74, $4b, $65, $79, $73, $a, 0, $5,
- 0, $a9, $46, $dd, $10, $5b, $77, $cf, $11, $8f,
- $52, 0, $40, $33, $35, $94, $a3, $29, 0, $1,
- 0, $7, 0, 0, 0, $6e, $56, $61, $6c, $75,
- $65, $73, $14, 0, $34, 0, $2a, 0, $1, 0,
- $6, 0, 0, 0, $76, $61, $6c, $75, $65, $73,
- $e, 0, $1, 0, $7, 0, 0, 0, $6e, $56,
- $61, $6c, $75, $65, $73, $f, 0, $14, 0, $b,
- 0, $1f, 0, $1, 0, $e, 0, 0, 0, $54,
- $69, $6d, $65, $64, $46, $6c, $6f, $61, $74, $4b,
- $65, $79, $73, $a, 0, $5, 0, $80, $b1, $6,
- $f4, $3b, $7b, $cf, $11, $8f, $52, 0, $40, $33,
- $35, $94, $a3, $29, 0, $1, 0, $4, 0, 0,
- 0, $74, $69, $6d, $65, $14, 0, $1, 0, $9,
- 0, 0, 0, $46, $6c, $6f, $61, $74, $4b, $65,
- $79, $73, $1, 0, $6, 0, 0, 0, $74, $66,
- $6b, $65, $79, $73, $14, 0, $b, 0, $1f, 0,
- $1, 0, $c, 0, 0, 0, $41, $6e, $69, $6d,
- $61, $74, $69, $6f, $6e, $4b, $65, $79, $a, 0,
- $5, 0, $a8, $46, $dd, $10, $5b, $77, $cf, $11,
- $8f, $52, 0, $40, $33, $35, $94, $a3, $29, 0,
- $1, 0, $7, 0, 0, 0, $6b, $65, $79, $54,
- $79, $70, $65, $14, 0, $29, 0, $1, 0, $5,
- 0, 0, 0, $6e, $4b, $65, $79, $73, $14, 0,
- $34, 0, $1, 0, $e, 0, 0, 0, $54, $69,
- $6d, $65, $64, $46, $6c, $6f, $61, $74, $4b, $65,
- $79, $73, $1, 0, $4, 0, 0, 0, $6b, $65,
- $79, $73, $e, 0, $1, 0, $5, 0, 0, 0,
- $6e, $4b, $65, $79, $73, $f, 0, $14, 0, $b,
- 0, $1f, 0, $1, 0, $10, 0, 0, 0, $41,
- $6e, $69, $6d, $61, $74, $69, $6f, $6e, $4f, $70,
- $74, $69, $6f, $6e, $73, $a, 0, $5, 0, $c0,
- $56, $bf, $e2, $f, $84, $cf, $11, $8f, $52, 0,
- $40, $33, $35, $94, $a3, $29, 0, $1, 0, $a,
- 0, 0, 0, $6f, $70, $65, $6e, $63, $6c, $6f,
- $73, $65, $64, $14, 0, $29, 0, $1, 0, $f,
- 0, 0, 0, $70, $6f, $73, $69, $74, $69, $6f,
- $6e, $71, $75, $61, $6c, $69, $74, $79, $14, 0,
- $b, 0, $1f, 0, $1, 0, $9, 0, 0, 0,
- $41, $6e, $69, $6d, $61, $74, $69, $6f, $6e, $a,
- 0, $5, 0, $4f, $ab, $82, $3d, $da, $62, $cf,
- $11, $ab, $39, 0, $20, $af, $71, $e4, $33, $e,
- 0, $12, 0, $12, 0, $12, 0, $f, 0, $b,
- 0, $1f, 0, $1, 0, $c, 0, 0, 0, $41,
- $6e, $69, $6d, $61, $74, $69, $6f, $6e, $53, $65,
- $74, $a, 0, $5, 0, $50, $ab, $82, $3d, $da,
- $62, $cf, $11, $ab, $39, 0, $20, $af, $71, $e4,
- $33, $e, 0, $1, 0, $9, 0, 0, 0, $41,
- $6e, $69, $6d, $61, $74, $69, $6f, $6e, $f, 0,
- $b, 0, $1f, 0, $1, 0, $a, 0, 0, 0,
- $49, $6e, $6c, $69, $6e, $65, $44, $61, $74, $61,
- $a, 0, $5, 0, $a0, $ee, $23, $3a, $b1, $94,
- $d0, $11, $ab, $39, 0, $20, $af, $71, $e4, $33,
- $e, 0, $1, 0, $6, 0, 0, 0, $42, $49,
- $4e, $41, $52, $59, $f, 0, $b, 0, $1f, 0,
- $1, 0, $3, 0, 0, 0, $55, $72, $6c, $a,
- 0, $5, 0, $a1, $ee, $23, $3a, $b1, $94, $d0,
- $11, $ab, $39, 0, $20, $af, $71, $e4, $33, $29,
- 0, $1, 0, $5, 0, 0, 0, $6e, $55, $72,
- $6c, $73, $14, 0, $34, 0, $31, 0, $1, 0,
- $4, 0, 0, 0, $75, $72, $6c, $73, $e, 0,
- $1, 0, $5, 0, 0, 0, $6e, $55, $72, $6c,
- $73, $f, 0, $14, 0, $b, 0, $1f, 0, $1,
- 0, $f, 0, 0, 0, $50, $72, $6f, $67, $72,
- $65, $73, $73, $69, $76, $65, $4d, $65, $73, $68,
- $a, 0, $5, 0, $60, $c3, $63, $8a, $7d, $99,
- $d0, $11, $94, $1c, 0, $80, $c8, $c, $fa, $7b,
- $e, 0, $1, 0, $3, 0, 0, 0, $55, $72,
- $6c, $13, 0, $1, 0, $a, 0, 0, 0, $49,
- $6e, $6c, $69, $6e, $65, $44, $61, $74, $61, $f,
- 0, $b, 0, $1f, 0, $1, 0, $4, 0, 0,
- 0, $47, $75, $69, $64, $a, 0, $5, 0, $e0,
- $90, $27, $a4, $10, $78, $cf, $11, $8f, $52, 0,
- $40, $33, $35, $94, $a3, $29, 0, $1, 0, $5,
- 0, 0, 0, $64, $61, $74, $61, $31, $14, 0,
- $28, 0, $1, 0, $5, 0, 0, 0, $64, $61,
- $74, $61, $32, $14, 0, $28, 0, $1, 0, $5,
- 0, 0, 0, $64, $61, $74, $61, $33, $14, 0,
- $34, 0, $2d, 0, $1, 0, $5, 0, 0, 0,
- $64, $61, $74, $61, $34, $e, 0, $3, 0, $8,
- 0, 0, 0, $f, 0, $14, 0, $b, 0, $1f,
- 0, $1, 0, $e, 0, 0, 0, $53, $74, $72,
- $69, $6e, $67, $50, $72, $6f, $70, $65, $72, $74,
- $79, $a, 0, $5, 0, $e0, $21, $f, $7f, $e1,
- $bf, $d1, $11, $82, $c0, 0, $a0, $c9, $69, $72,
- $71, $31, 0, $1, 0, $3, 0, 0, 0, $6b,
- $65, $79, $14, 0, $31, 0, $1, 0, $5, 0,
- 0, 0, $76, $61, $6c, $75, $65, $14, 0, $b,
- 0, $1f, 0, $1, 0, $b, 0, 0, 0, $50,
- $72, $6f, $70, $65, $72, $74, $79, $42, $61, $67,
- $a, 0, $5, 0, $e1, $21, $f, $7f, $e1, $bf,
- $d1, $11, $82, $c0, 0, $a0, $c9, $69, $72, $71,
- $e, 0, $1, 0, $e, 0, 0, 0, $53, $74,
- $72, $69, $6e, $67, $50, $72, $6f, $70, $65, $72,
- $74, $79, $f, 0, $b, 0, $1f, 0, $1, 0,
- $e, 0, 0, 0, $45, $78, $74, $65, $72, $6e,
- $61, $6c, $56, $69, $73, $75, $61, $6c, $a, 0,
- $5, 0, $a0, $6a, $11, $98, $ba, $bd, $d1, $11,
- $82, $c0, 0, $a0, $c9, $69, $72, $71, $1, 0,
- $4, 0, 0, 0, $47, $75, $69, $64, $1, 0,
- $12, 0, 0, 0, $67, $75, $69, $64, $45, $78,
- $74, $65, $72, $6e, $61, $6c, $56, $69, $73, $75,
- $61, $6c, $14, 0, $e, 0, $12, 0, $12, 0,
- $12, 0, $f, 0, $b, 0);
- {$ENDIF}
- implementation
- {$IFDEF DIRECT3D_VERSION_LESS_8}
- {$IFDEF DIRECT3D_VERSION_7}
- function D3DFVF_TEXCOORDSIZE3(CoordIndex: DWORD): DWORD;
- begin
- Result := (D3DFVF_TEXTUREFORMAT3 shl (CoordIndex*2 + 16));
- end;
- function D3DFVF_TEXCOORDSIZE2(CoordIndex: DWORD): DWORD;
- begin
- Result := (D3DFVF_TEXTUREFORMAT2);
- end;
- function D3DFVF_TEXCOORDSIZE4(CoordIndex: DWORD): DWORD;
- begin
- Result := (D3DFVF_TEXTUREFORMAT4 shl (CoordIndex*2 + 16));
- end;
- function D3DFVF_TEXCOORDSIZE1(CoordIndex: DWORD): DWORD;
- begin
- Result := (D3DFVF_TEXTUREFORMAT1 shl (CoordIndex*2 + 16));
- end;
- {$ENDIF} // DIRECT3D_VERSION_7
- {$ENDIF} // DIRECT3D_VERSION_LESS_8
- function D3DVal(val: variant): Single;
- begin
- Result := val;
- end;
- function D3DDivide(a, b: double): Single;
- begin
- Result := a / b;
- end;
- function D3DMultiply(a, b: double): Single;
- begin
- Result := a * b;
- end;
- // #define CI_GETALPHA(ci) ((ci) >> 24)
- function CI_GETALPHA(ci: DWORD): DWORD;
- begin
- Result := ci shr 24;
- end;
- // #define CI_GETINDEX(ci) (((ci) >> 8) & 0xffff)
- function CI_GETINDEX(ci: DWORD): DWORD;
- begin
- Result := (ci shr 8) and $ffff;
- end;
- // #define CI_GETFRACTION(ci) ((ci) & 0xff)
- function CI_GETFRACTION(ci: DWORD): DWORD;
- begin
- Result := ci and $ff;
- end;
- // #define CI_ROUNDINDEX(ci) CI_GETINDEX((ci) + 0x80)
- function CI_ROUNDINDEX(ci: DWORD): DWORD;
- begin
- Result := CI_GETINDEX(ci + $80);
- end;
- // #define CI_MASKALPHA(ci) ((ci) & 0xffffff)
- function CI_MASKALPHA(ci: DWORD): DWORD;
- begin
- Result := ci and $ffffff;
- end;
- // #define CI_MAKE(a, i, f) (((a) << 24) | ((i) << 8) | (f))
- function CI_MAKE(a,i,f: DWORD): DWORD;
- begin
- Result := (a shl 24) or (i shl 8) or f;
- end;
- // #define RGBA_GETALPHA(rgb) ((rgb) >> 24)
- function RGBA_GETALPHA(rgb: TD3DColor): DWORD;
- begin
- Result := rgb shr 24;
- end;
- // #define RGBA_GETRED(rgb) (((rgb) >> 16) & 0xff)
- function RGBA_GETRED(rgb: TD3DColor): DWORD;
- begin
- Result := (rgb shr 16) and $ff;
- end;
- // #define RGBA_GETGREEN(rgb) (((rgb) >> 8) & 0xff)
- function RGBA_GETGREEN(rgb: TD3DColor): DWORD;
- begin
- Result := (rgb shr 8) and $ff;
- end;
- // #define RGBA_GETBLUE(rgb) ((rgb) & 0xff)
- function RGBA_GETBLUE(rgb: TD3DColor): DWORD;
- begin
- Result := rgb and $ff;
- end;
- // #define RGBA_MAKE(r, g, b, a) ((TD3DColor) (((a) << 24) | ((r) << 16) | ((g) << 8) | (b)))
- function RGBA_MAKE(r, g, b, a: DWORD): TD3DColor;
- begin
- Result := (a shl 24) or (r shl 16) or (g shl 8) or b;
- end;
- // #define D3DRGB(r, g, b)
- // (0xff000000L | (((long)((r) * 255)) << 16) | (((long)((g) * 255)) << 8) | (long)((b) * 255))
- function D3DRGB(r, g, b: Single): TD3DColor;
- begin
- Result := $ff000000 or DWORD(Round(r * 255) shl 16)
- or DWORD(Round(g * 255) shl 8)
- or DWORD(Round(b * 255));
- end;
- // #define D3DRGBA(r, g, b, a)
- // ( (((long)((a) * 255)) << 24) | (((long)((r) * 255)) << 16)
- // | (((long)((g) * 255)) << 8) | (long)((b) * 255)
- // )
- function D3DRGBA(r, g, b, a: Single): TD3DColor;
- begin
- Result := DWORD(Round(a * 255) shl 24) or DWORD(Round(r * 255) shl 16)
- or DWORD(Round(g * 255) shl 8)
- or DWORD(Round(b * 255));
- end;
- // #define RGB_GETRED(rgb) (((rgb) >> 16) & 0xff)
- function RGB_GETRED(rgb: TD3DColor): DWORD;
- begin
- Result := (rgb shr 16) and $ff;
- end;
- // #define RGB_GETGREEN(rgb) (((rgb) >> 8) & 0xff)
- function RGB_GETGREEN(rgb: TD3DColor): DWORD;
- begin
- Result := (rgb shr 8) and $ff;
- end;
- // #define RGB_GETBLUE(rgb) ((rgb) & 0xff)
- function RGB_GETBLUE(rgb: TD3DColor): DWORD;
- begin
- Result := rgb and $ff;
- end;
- // #define RGBA_SETALPHA(rgba, x) (((x) << 24) | ((rgba) & 0x00ffffff))
- function RGBA_SETALPHA(rgba: TD3DColor; x: DWORD): TD3DColor;
- begin
- Result := (x shl 24) or (rgba and $00ffffff);
- end;
- // #define RGB_MAKE(r, g, b) ((TD3DColor) (((r) << 16) | ((g) << 8) | (b)))
- function RGB_MAKE(r, g, b: DWORD): TD3DColor;
- begin
- Result := (r shl 16) or (g shl 8) or b;
- end;
- // #define RGBA_TORGB(rgba) ((TD3DColor) ((rgba) & 0xffffff))
- function RGBA_TORGB(rgba: TD3DColor): TD3DColor;
- begin
- Result := rgba and $00ffffff;
- end;
- // #define RGB_TORGBA(rgb) ((TD3DColor) ((rgb) | 0xff000000))
- function RGB_TORGBA(rgb: TD3DColor): TD3DColor;
- begin
- Result := rgb or $ff000000;
- end;
- function D3DSTATE_OVERRIDE(StateType: DWORD): DWORD;
- begin
- Result := StateType + D3DSTATE_OVERRIDE_BIAS;
- end;
- function D3DTRIFLAG_STARTFLAT(len: DWORD): DWORD;
- begin
- if not (len in [1..29]) then len := 0;
- Result := len;
- end;
- // #define D3DRENDERSTATE_STIPPLEPATTERN(y) (D3DRENDERSTATE_STIPPLEPATTERN00 + (y))
- function D3DRENDERSTATE_STIPPLEPATTERN(y: Integer): TD3DRenderStateType;
- begin
- Result := TD3DRenderStateType(Ord(D3DRENDERSTATE_STIPPLEPATTERN00) + y);
- end;
- // Addition and subtraction
- function VectorAdd(const v1, v2: TD3DVector): TD3DVector;
- begin
- Result.x := v1.x+v2.x;
- Result.y := v1.y+v2.y;
- Result.z := v1.z+v2.z;
- end;
- function VectorSub(const v1, v2: TD3DVector): TD3DVector;
- begin
- Result.x := v1.x-v2.x;
- Result.y := v1.y-v2.y;
- Result.z := v1.z-v2.z;
- end;
- // Scalar multiplication and division
- function VectorMulS(const v: TD3DVector; s: TD3DValue): TD3DVector;
- begin
- Result.x := v.x*s;
- Result.y := v.y*s;
- Result.z := v.z*s;
- end;
- function VectorDivS(const v: TD3DVector; s: TD3DValue): TD3DVector;
- begin
- Result.x := v.x/s;
- Result.y := v.y/s;
- Result.z := v.z/s;
- end;
- // Memberwise multiplication and division
- function VectorMul(const v1, v2: TD3DVector): TD3DVector;
- begin
- Result.x := v1.x*v2.x;
- Result.y := v1.y*v2.y;
- Result.z := v1.z*v2.z;
- end;
- function VectorDiv(const v1, v2: TD3DVector): TD3DVector;
- begin
- Result.x := v1.x/v2.x;
- Result.y := v1.y/v2.y;
- Result.z := v1.z/v2.z;
- end;
- // Vector dominance
- function VectorSmaller(v1, v2: TD3DVector): boolean;
- begin
- result := (v1.x < v2.x) and (v1.y < v2.y) and (v1.z < v2.z);
- end;
- function VectorSmallerEqual(v1, v2: TD3DVector): boolean;
- begin
- result := (v1.x <= v2.x) and (v1.y <= v2.y) and (v1.z <= v2.z);
- end;
- // Bitwise equality
- function VectorEqual(v1, v2: TD3DVector): boolean;
- begin
- result := (v1.x = v2.x) and (v1.y = v2.y) and (v1.z = v2.z);
- end;
- // Length-related functions
- function VectorSquareMagnitude(v: TD3DVector): TD3DValue;
- begin
- result := (v.x*v.x) + (v.y*v.y) + (v.z*v.z);
- end;
- function VectorMagnitude(v: TD3DVector): TD3DValue;
- begin
- result := sqrt((v.x*v.x) + (v.y*v.y) + (v.z*v.z));
- end;
- // Returns vector with same direction and unit length
- function VectorNormalize(const v: TD3DVector): TD3DVector;
- begin
- result := VectorDivS(v,VectorMagnitude(v));
- end;
- // Return min/max component of the input vector
- function VectorMin(v: TD3DVector): TD3DValue;
- var
- ret : TD3DValue;
- begin
- ret := v.x;
- if (v.y < ret) then ret := v.y;
- if (v.z < ret) then ret := v.z;
- Result := ret;
- end;
- function VectorMax(v: TD3DVector): TD3DValue;
- var
- ret : TD3DValue;
- begin
- ret := v.x;
- if (ret < v.y) then ret := v.y;
- if (ret < v.z) then ret := v.z;
- Result := ret;
- end;
- // Return memberwise min/max of input vectors
- function VectorMinimize(const v1, v2: TD3DVector): TD3DVector;
- begin
- if v1.x < v2.x then Result.x := v1.x else Result.x := v2.x;
- if v1.y < v2.y then Result.y := v1.y else Result.y := v2.y;
- if v1.z < v2.z then Result.z := v1.z else Result.z := v2.z;
- end;
- function VectorMaximize(const v1, v2: TD3DVector): TD3DVector;
- begin
- if v1.x > v2.x then Result.x := v1.x else Result.x := v2.x;
- if v1.y > v2.y then Result.y := v1.y else Result.y := v2.y;
- if v1.z > v2.z then Result.z := v1.z else Result.z := v2.z;
- end;
- // Dot and cross product
- function VectorDotProduct(v1, v2: TD3DVector): TD3DValue;
- begin
- Result := (v1.x*v2.x) + (v1.y * v2.y) + (v1.z*v2.z);
- end;
- function VectorCrossProduct(const v1, v2: TD3DVector): TD3DVector;
- begin
- Result.x := (v1.y*v2.z) - (v1.z*v2.y);
- Result.y := (v1.z*v2.x) - (v1.x*v2.z);
- Result.z := (v1.x*v2.y) - (v1.y*v2.x);
- end;
- procedure DisableFPUExceptions;
- var
- FPUControlWord: Word;
- asm
- FSTCW FPUControlWord;
- OR FPUControlWord, $4 + $1; { Divide by zero + invalid operation }
- FLDCW FPUControlWord;
- end;
- procedure EnableFPUExceptions;
- var
- FPUControlWord: Word;
- asm
- FSTCW FPUControlWord;
- AND FPUControlWord, $FFFF - $4 - $1; { Divide by zero + invalid operation }
- FLDCW FPUControlWord;
- end;
- {$IFDEF DIRECT3D_VERSION_LESS_8}
- function D3DErrorString(Value: HResult): String; //Full description not available yet
- begin
- case Value of
- D3D_OK: Result := 'No error';
- D3DERR_BADMAJORVERSION: Result := 'D3DERR_BADMAJORVERSION';
- D3DERR_BADMINORVERSION: Result := 'D3DERR_BADMINORVERSION';
- {$IFDEF DIRECT3D_VERSION_5}
- D3DERR_INVALID_DEVICE: Result := 'D3DERR_INITFAILED';
- D3DERR_INITFAILED: Result := 'D3DERR_INITFAILED';
- D3DERR_DEVICEAGGREGATED: Result := 'D3DERR_DEVICEAGGREGATED';
- {$ENDIF} // DIRECT3D_VERSION_5
- D3DERR_EXECUTE_CREATE_FAILED: Result := 'D3DERR_EXECUTE_CREATE_FAILED';
- D3DERR_EXECUTE_DESTROY_FAILED: Result := 'D3DERR_EXECUTE_DESTROY_FAILED';
- D3DERR_EXECUTE_LOCK_FAILED: Result := 'D3DERR_EXECUTE_LOCK_FAILED';
- D3DERR_EXECUTE_UNLOCK_FAILED: Result := 'D3DERR_EXECUTE_UNLOCK_FAILED';
- D3DERR_EXECUTE_LOCKED: Result := 'D3DERR_EXECUTE_LOCKED';
- D3DERR_EXECUTE_NOT_LOCKED: Result := 'D3DERR_EXECUTE_NOT_LOCKED';
- D3DERR_EXECUTE_FAILED: Result := 'D3DERR_EXECUTE_FAILED';
- D3DERR_EXECUTE_CLIPPED_FAILED: Result := 'D3DERR_EXECUTE_CLIPPED_FAILED';
- D3DERR_TEXTURE_NO_SUPPORT: Result := 'D3DERR_TEXTURE_NO_SUPPORT';
- D3DERR_TEXTURE_CREATE_FAILED: Result := 'D3DERR_TEXTURE_CREATE_FAILED';
- D3DERR_TEXTURE_DESTROY_FAILED: Result := 'D3DERR_TEXTURE_DESTROY_FAILED';
- D3DERR_TEXTURE_LOCK_FAILED: Result := 'D3DERR_TEXTURE_LOCK_FAILED';
- D3DERR_TEXTURE_UNLOCK_FAILED: Result := 'D3DERR_TEXTURE_UNLOCK_FAILED';
- D3DERR_TEXTURE_LOAD_FAILED: Result := 'D3DERR_TEXTURE_LOAD_FAILED';
- D3DERR_TEXTURE_SWAP_FAILED: Result := 'D3DERR_TEXTURE_SWAP_FAILED';
- D3DERR_TEXTURE_LOCKED: Result := 'D3DERR_TEXTURELOCKED';
- D3DERR_TEXTURE_NOT_LOCKED: Result := 'D3DERR_TEXTURE_NOT_LOCKED';
- D3DERR_TEXTURE_GETSURF_FAILED: Result := 'D3DERR_TEXTURE_GETSURF_FAILED';
- D3DERR_MATRIX_CREATE_FAILED: Result := 'D3DERR_MATRIX_CREATE_FAILED';
- D3DERR_MATRIX_DESTROY_FAILED: Result := 'D3DERR_MATRIX_DESTROY_FAILED';
- D3DERR_MATRIX_SETDATA_FAILED: Result := 'D3DERR_MATRIX_SETDATA_FAILED';
- D3DERR_MATRIX_GETDATA_FAILED: Result := 'D3DERR_MATRIX_GETDATA_FAILED';
- D3DERR_SETVIEWPORTDATA_FAILED: Result := 'D3DERR_SETVIEWPORTDATA_FAILED';
- {$IFDEF DIRECT3D_VERSION_5}
- D3DERR_INVALIDCURRENTVIEWPORT: Result := 'D3DERR_INVALIDCURRENTVIEWPORT';
- D3DERR_INVALIDPRIMITIVETYPE: Result := 'D3DERR_INVALIDPRIMITIVETYPE';
- D3DERR_INVALIDVERTEXTYPE: Result := 'D3DERR_INVALIDVERTEXTYPE';
- D3DERR_TEXTURE_BADSIZE: Result := 'D3DERR_TEXTURE_BADSIZE';
- D3DERR_INVALIDRAMPTEXTURE: Result := 'D3DERR_INVALIDRAMPTEXTURE';
- {$ENDIF} // DIRECT3D_VERSION_5
- D3DERR_MATERIAL_CREATE_FAILED: Result := 'D3DERR_MATERIAL_CREATE_FAILED';
- D3DERR_MATERIAL_DESTROY_FAILED: Result := 'D3DERR_MATERIAL_DESTROY_FAILED';
- D3DERR_MATERIAL_SETDATA_FAILED: Result := 'D3DERR_MATERIAL_SETDATA_FAILED';
- D3DERR_MATERIAL_GETDATA_FAILED: Result := 'D3DERR_MATERIAL_GETDATA_FAILED';
- {$IFDEF DIRECT3D_VERSION_5}
- D3DERR_INVALIDPALETTE: Result := 'D3DERR_INVALIDPALETTE';
- D3DERR_ZBUFF_NEEDS_SYSTEMMEMORY: Result := 'D3DERR_ZBUFF_NEEDS_SYSTEMMEMORY';
- D3DERR_ZBUFF_NEEDS_VIDEOMEMORY: Result := 'D3DERR_ZBUFF_NEEDS_VIDEOMEMORY';
- D3DERR_SURFACENOTINVIDMEM: Result := 'D3DERR_SURFACENOTINVIDMEM';
- {$ENDIF} // DIRECT3D_VERSION_5
- D3DERR_LIGHT_SET_FAILED: Result := 'D3DERR_LIGHT_SET_FAILED';
- {$IFDEF DIRECT3D_VERSION_5}
- D3DERR_LIGHTHASVIEWPORT: Result := 'D3DERR_LIGHTHASVIEWPORT';
- D3DERR_LIGHTNOTINTHISVIEWPORT: Result := 'D3DERR_LIGHTNOTINTHISVIEWPORT';
- {$ENDIF} // DIRECT3D_VERSION_5
- D3DERR_SCENE_IN_SCENE: Result := 'D3DERR_SCENE_IN_SCENE';
- D3DERR_SCENE_NOT_IN_SCENE: Result := 'D3DERR_SCENE_NOT_IN_SCENE';
- D3DERR_SCENE_BEGIN_FAILED: Result := 'D3DERR_SCENE_BEGIN_FAILED';
- D3DERR_SCENE_END_FAILED: Result := 'D3DERR_SCENE_END_FAILED';
- {$IFDEF DIRECT3D_VERSION_5}
- D3DERR_INBEGIN: Result := 'D3DERR_INBEGIN';
- D3DERR_NOTINBEGIN: Result := 'D3DERR_NOTINBEGIN';
- D3DERR_NOVIEWPORTS: Result := 'D3DERR_NOVIEWPORTS';
- D3DERR_VIEWPORTDATANOTSET: Result := 'D3DERR_VIEWPORTDATANOTSET';
- D3DERR_VIEWPORTHASNODEVICE: Result := 'D3DERR_VIEWPORTHASNODEVICE';
- D3DERR_NOCURRENTVIEWPORT: Result := 'D3DERR_NOCURRENTVIEWPORT';
- {$ENDIF} // DIRECT3D_VERSION_5
- {$IFDEF DIRECT3D_VERSION_6}
- D3DERR_INVALIDVERTEXFORMAT: Result := 'D3DERR_INVALIDVERTEXFORMAT';
- D3DERR_COLORKEYATTACHED: Result := 'D3DERR_COLORKEYATTACHED';
- D3DERR_VERTEXBUFFEROPTIMIZED: Result := 'D3DERR_VERTEXBUFFEROPTIMIZED';
- D3DERR_VBUF_CREATE_FAILED: Result := 'D3DERR_VBUF_CREATE_FAILED';
- D3DERR_VERTEXBUFFERLOCKED: Result := 'D3DERR_VERTEXBUFFERLOCKED';
- D3DERR_ZBUFFER_NOTPRESENT: Result := 'D3DERR_ZBUFFER_NOTPRESENT';
- D3DERR_STENCILBUFFER_NOTPRESENT: Result := 'D3DERR_STENCILBUFFER_NOTPRESENT';
- D3DERR_WRONGTEXTUREFORMAT: Result := 'D3DERR_WRONGTEXTUREFORMAT';
- D3DERR_UNSUPPORTEDCOLOROPERATION: Result := 'D3DERR_UNSUPPORTEDCOLOROPERATION';
- D3DERR_UNSUPPORTEDCOLORARG: Result := 'D3DERR_UNSUPPORTEDCOLORARG';
- D3DERR_UNSUPPORTEDALPHAOPERATION: Result := 'D3DERR_UNSUPPORTEDALPHAOPERATION';
- D3DERR_UNSUPPORTEDALPHAARG: Result := 'D3DERR_UNSUPPORTEDALPHAARG';
- D3DERR_TOOMANYOPERATIONS: Result := 'D3DERR_TOOMANYOPERATIONS';
- D3DERR_CONFLICTINGTEXTUREFILTER: Result := 'D3DERR_CONFLICTINGTEXTUREFILTER';
- D3DERR_UNSUPPORTEDFACTORVALUE: Result := 'D3DERR_UNSUPPORTEDFACTORVALUE';
- D3DERR_CONFLICTINGRENDERSTATE: Result := 'D3DERR_CONFLICTINGRENDERSTATE';
- D3DERR_UNSUPPORTEDTEXTUREFILTER: Result := 'D3DERR_UNSUPPORTEDTEXTUREFILTER';
- D3DERR_TOOMANYPRIMITIVES: Result := 'D3DERR_TOOMANYPRIMITIVES';
- D3DERR_INVALIDMATRIX: Result := 'D3DERR_INVALIDMATRIX';
- D3DERR_TOOMANYVERTICES: Result := 'D3DERR_TOOMANYVERTICES';
- D3DERR_CONFLICTINGTEXTUREPALETTE: Result := 'D3DERR_CONFLICTINGTEXTUREPALETTE';
- {$ENDIF} // DIRECT3D_VERSION_6
- {$IFDEF DIRECT3D_VERSION_7}
- D3DERR_INVALIDSTATEBLOCK: Result := 'D3DERR_INVALIDSTATEBLOCK';
- D3DERR_INBEGINSTATEBLOCK: Result := 'D3DERR_INBEGINSTATEBLOCK';
- D3DERR_NOTINBEGINSTATEBLOCK: Result := 'D3DERR_NOTINBEGINSTATEBLOCK';
- {$ENDIF} // DIRECT3D_VERSION_7
- else Result := 'Unrecognized Error';
- end;
- end;
- {$ENDIF} // DIRECT3D_VERSION_LESS_8
- {$IFNDEF EXCLUDE_DXFILE_FROM_DIRECT3D}
- function DXFileErrorString(Value: HResult): string;
- begin
- case Value of
- DXFILE_OK: Result := 'Command completed successfully. Equivalent to DD_OK.';
- DXFILEERR_BADVALUE: Result := 'Parameter is invalid.';
- DXFILEERR_BADTYPE: Result := 'Object type is invalid.';
- DXFILEERR_BADALLOC: Result := 'Memory allocation failed.';
- DXFILEERR_NOTFOUND: Result := 'Object could not be found.';
- DXFILEERR_FILENOTFOUND: Result := 'File could not be found.';
- DXFILEERR_RESOURCENOTFOUND: Result := 'Resource could not be found.';
- DXFILEERR_URLNOTFOUND: Result := 'URL could not be found.';
- DXFILEERR_BADRESOURCE: Result := 'Resource is invalid.';
- DXFILEERR_BADFILETYPE: Result := 'File is not a DirectX file.';
- DXFILEERR_BADFILEVERSION: Result := 'File version is not valid.';
- DXFILEERR_BADFILEFLOATSIZE: Result := 'Floating-point size is invalid.';
- DXFILEERR_BADFILE: Result := 'File is invalid.';
- DXFILEERR_PARSEERROR: Result := 'File could not be parsed.';
- DXFILEERR_BADARRAYSIZE: Result := 'Array size is invalid.';
- DXFILEERR_BADDATAREFERENCE: Result := 'Data reference is invalid.';
- DXFILEERR_NOMOREOBJECTS: Result := 'All objects have been enumerated.';
- DXFILEERR_NOMOREDATA: Result := 'No further data is available.';
- else Result := 'Unrecognized Error';
- end;
- end;
- initialization
- begin
- DisableFPUExceptions;
- DXFileDLL := LoadLibrary('D3DXOF.DLL');
- DirectXFileCreate := GetProcAddress(DXFileDLL,'DirectXFileCreate');
- end;
- finalization
- begin
- FreeLibrary(DXFileDLL);
- end;
- {$ENDIF}
- end.