⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 d3dx8.pas

📁 雷神之锤2(Quake2)Delphi源码
💻 PAS
📖 第 1 页 / 共 5 页
字号:

function D3DXAssembleShaderFromFileW(pSrcFile : PWideChar; Flags : LongWord; ppConstants, ppCompiledShader, ppCompilationErrors : PID3DXBuffer) : HResult; stdcall; overload;
function D3DXAssembleShaderFromFileW(pSrcFile : PWideChar; Flags : LongWord; out ppConstants, ppCompiledShader, ppCompilationErrors : ID3DXBuffer) : HResult; stdcall; overload;

{$IFDEF UNICODE}
function D3DXAssembleShaderFromFile(pSrcFile : PWideChar; Flags : LongWord; ppConstants, ppCompiledShader, ppCompilationErrors : PID3DXBuffer) : HResult; stdcall; overload;
function D3DXAssembleShaderFromFile(pSrcFile : PWideChar; Flags : LongWord; out ppConstants, ppCompiledShader, ppCompilationErrors : ID3DXBuffer) : HResult; stdcall; overload;
{$ELSE}
function D3DXAssembleShaderFromFile(pSrcFile : PAnsiChar; Flags : LongWord; ppConstants, ppCompiledShader, ppCompilationErrors : PID3DXBuffer) : HResult; stdcall; overload;
function D3DXAssembleShaderFromFile(pSrcFile : PAnsiChar; Flags : LongWord; out ppConstants, ppCompiledShader, ppCompilationErrors : ID3DXBuffer) : HResult; stdcall; overload;
{$ENDIF}


function D3DXAssembleShader(const pSrcData : Pointer; SrcDataLen : Cardinal; Flags : LongWord; ppConstants, ppCompiledShader, ppCompilationErrors : PID3DXBuffer) : HResult; stdcall; overload;
function D3DXAssembleShader(const pSrcData : Pointer; SrcDataLen : Cardinal; Flags : LongWord; out ppConstants, ppCompiledShader, ppCompilationErrors : ID3DXBuffer) : HResult; stdcall; overload;


///////////////////////////////////////////////////////////////////////////
// Misc APIs:
///////////////////////////////////////////////////////////////////////////


//-------------------------------------------------------------------------
// D3DXGetFVFVertexSize:
// ---------------------
// Returns the size (in bytes) of a vertex for a given FVF.
//-------------------------------------------------------------------------

function D3DXGetFVFVertexSize(FVF : LongWord) : Cardinal; stdcall;


//-------------------------------------------------------------------------
// D3DXGetErrorString:
// ------------------
// Returns the error string for given an hresult.  Interprets all D3DX and
// D3D hresults.
//
// Parameters:
//  hr
//      The error code to be deciphered.
//  pBuffer
//      Pointer to the buffer to be filled in.
//  BufferLen
//      Count of characters in buffer.  Any error message longer than this
//      length will be truncated to fit.
//-------------------------------------------------------------------------
function D3DXGetErrorStringA(hr : HResult; pBuffer : PAnsiChar; const BufferLen : Cardinal) : HResult; stdcall;
function D3DXGetErrorStringW(hr : HResult; pBuffer : PWideChar; const BufferLen : Cardinal) : HResult; stdcall;

{$IFDEF UNICODE}
function D3DXGetErrorString(hr : HResult; pBuffer : PWideChar; const BufferLen : Cardinal) : HResult; stdcall;
{$ELSE}
function D3DXGetErrorString(hr : HResult; pBuffer : PAnsiChar; const BufferLen : Cardinal) : HResult; stdcall;
{$ENDIF}


///////////////////////////////////////////////////////////////////////////
//
//  Copyright (C) 1999 Microsoft Corporation.  All Rights Reserved.
//
//  File:       d3dx8effect.h
//  Content:    D3DX effect types and functions
//
///////////////////////////////////////////////////////////////////////////

type
  _D3DXPARAMETERTYPE = (
    D3DXPT_DWORD        {= 0},
    D3DXPT_FLOAT        {= 1},
    D3DXPT_VECTOR       {= 2},
    D3DXPT_MATRIX       {= 3},
    D3DXPT_TEXTURE      {= 4},
    D3DXPT_VERTEXSHADER {= 5},
    D3DXPT_PIXELSHADER  {= 6},
    D3DXPT_CONSTANT     {= 7}
  ); {_D3DXPARAMETERTYPE}
  D3DXPARAMETERTYPE = _D3DXPARAMETERTYPE;
  TD3DXParameterType = _D3DXPARAMETERTYPE;

type
  PD3DXEffect_Desc = ^TD3DXEffect_Desc;
  TD3DXEffect_Desc = packed record
    Parameters : Cardinal;
    Techniques : Cardinal;
    Usage      : LongWord;
  end;
  PD3DXEffectDesc = ^TD3DXEffectDesc;
  TD3DXEffectDesc = TD3DXEffect_Desc;


  PD3DXParameter_Desc = ^TD3DXParameter_Desc;
  TD3DXParameter_Desc = packed record
    Name  : LongWord;
    _Type : TD3DXParameterType;
  end;
  PD3DXParameterDesc = ^TD3DXParameterDesc;
  TD3DXParameterDesc = TD3DXParameter_Desc;


  PD3DXTechnique_Desc = ^TD3DXTechnique_Desc;
  TD3DXTechnique_Desc = packed record
    Name   : LongWord;
    Passes : Cardinal;
  end;
  PD3DXTechniqueDesc = ^TD3DXTechniqueDesc;
  TD3DXTechniqueDesc = TD3DXTechnique_Desc;


  PD3DXPass_Desc = ^TD3DXPass_Desc;
  TD3DXPass_Desc = packed record
    Name : LongWord;
  end;
  PD3DXPassDesc = ^TD3DXPassDesc;
  TD3DXPassDesc = TD3DXPass_Desc;



//////////////////////////////////////////////////////////////////////////////
// ID3DXTechnique ////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////

  ID3DXTechnique = interface(IUnknown)
    ['{A00F378D-AF79-4917-907E-4D635EE63844}']
    // ID3DXTechnique
    function GetDevice(out ppDevice : IDirect3DDevice8) : HResult; stdcall;
    function GetDesc(out pDesc : TD3DXTechniqueDesc) : HResult; stdcall;
    function GetPassDesc(const Index : Cardinal; out pDesc : TD3DXPassDesc) : HResult; stdcall;

    function IsParameterUsed(const dwName : LongWord) : BOOL; stdcall;

    function Validate : HResult; stdcall;
    function _Begin(out pPasses : Cardinal) : HResult; stdcall;
    function Pass(const Index: Cardinal) : HResult; stdcall;
    function _End : HResult; stdcall;
  end;


//////////////////////////////////////////////////////////////////////////////
// ID3DXEffect ///////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////


  ID3DXEffect = interface(IUnknown)
    ['{281BBDD4-AEDF-4907-8650-E79CDFD45165}']
    // ID3DXEffect
    function GetDevice(out ppDevice : IDirect3DDevice8) : HResult; stdcall;
    function GetDesc(out pDesc : TD3DXEffectDesc) : HResult; stdcall;

    function GetParameterDesc(const Index : Cardinal; out pDesc : TD3DXParameterDesc) : HResult; stdcall;
    function GetTechniqueDesc(const Index : Cardinal; out pDesc : TD3DXTechniqueDesc) : HResult; stdcall;

    function SetDword(const Name : Cardinal; const dw : LongWord) : HResult; stdcall;
    function GetDword(const Name : Cardinal; out pdw : LongWord) : HResult; stdcall;
    function SetFloat(const Name : Cardinal; const f : Single) : HResult; stdcall;
    function GetFloat(const Name : Cardinal; out pf : Single): HResult; stdcall;
    function SetVector(const Name : Cardinal; const pVector : TD3DXVector4) : HResult; stdcall;
    function GetVector(const Name : Cardinal; out pVector : TD3DXVector4) : HResult; stdcall;
    function SetMatrix(const Name : Cardinal; var pMatrix : TD3DXMatrix) : HResult; stdcall;
    function GetMatrix(const Name : Cardinal; out pMatrix : TD3DXMatrix) : HResult; stdcall;
    function SetTexture(const Name : Cardinal; const pTexture : IDirect3DBasetexture8) : HResult; stdcall;
    function GetTexture(const Name : Cardinal; pTexture : IDirect3DBasetexture8) : HResult; stdcall;
    function SetVertexShader(const Name : LongWord; const Handle : LongWord) : HResult; stdcall;
    function GetVertexShader(const Name : LongWord; out Handle : LongWord) : HResult; stdcall;
    function SetPixelShader(const Name : LongWord; const Handle : LongWord) : HResult; stdcall;
    function GetPixelShader(const Name : LongWord; out Handle : LongWord) : HResult; stdcall;

    function GetTechnique(const Name : Cardinal; out ppTechnique : ID3DXTechnique) : HResult; stdcall;
    function CloneEffect(const pDevice : IDirect3DDevice8; const Usage : LongWord; out ppEffect: ID3DXEffect) : HResult; stdcall;
  end;



//////////////////////////////////////////////////////////////////////////////
// APIs //////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////



//----------------------------------------------------------------------------
// D3DXCompileEffect:
// ------------------
// Compiles an ascii effect description into a binary form usable by
// D3DXCreateEffect.
//
// Parameters:
//  pSrcFile
//      Name of the file containing the ascii effect description
//  pSrcData
//      Pointer to ascii effect description
//  SrcDataSize
//      Size of the effect description in bytes
//  ppCompiledEffect
//      Returns a buffer containing compiled effect.
//  ppCompilationErrors
//      Returns a buffer containing any error messages which occurred during
//      compile.  Or NULL if you do not care about the error messages.
//
//----------------------------------------------------------------------------


function D3DXCompileEffectFromFileA(var pSrcFile : PAnsiChar; ppCompiledEffect, ppCompilationErrors : PID3DXBuffer) : HResult; stdcall; overload;
function D3DXCompileEffectFromFileA(var pSrcFile : PAnsiChar; out ppCompiledEffect, ppCompilationErrors : ID3DXBuffer) : HResult; stdcall; overload;

function D3DXCompileEffectFromFileW(var pSrcFile : PWideChar; ppCompiledEffect, ppCompilationErrors : PID3DXBuffer) : HResult; stdcall; overload;
function D3DXCompileEffectFromFileW(var pSrcFile : PWideChar; out ppCompiledEffect, ppCompilationErrors : ID3DXBuffer) : HResult; stdcall; overload;

{$IFDEF UNICODE}
function D3DXCompileEffectFromFile(var pSrcFile : PWideChar; ppCompiledEffect, ppCompilationErrors : PID3DXBuffer) : HResult; stdcall; overload;
function D3DXCompileEffectFromFile(var pSrcFile : PWideChar; out ppCompiledEffect, ppCompilationErrors : ID3DXBuffer) : HResult; stdcall; overload;
{$ELSE}
function D3DXCompileEffectFromFile(var pSrcFile : PAnsiChar; ppCompiledEffect, ppCompilationErrors : PID3DXBuffer) : HResult; stdcall; overload;
function D3DXCompileEffectFromFile(var pSrcFile : PAnsiChar; out ppCompiledEffect, ppCompilationErrors : ID3DXBuffer) : HResult; stdcall; overload;
{$ENDIF}

function D3DXCompileEffect(const pSrcData : Pointer; const SrcDataSize : Cardinal; ppCompiledEffect, ppCompilationErrors : PID3DXBuffer) : HResult; stdcall; overload;
function D3DXCompileEffect(const pSrcData : Pointer; const SrcDataSize : Cardinal; out ppCompiledEffect, ppCompilationErrors : ID3DXBuffer) : HResult; stdcall; overload;


//----------------------------------------------------------------------------
// D3DXCreateEffect:
// -----------------
// Creates an effect object, given compiled binary effect data
//
// Parameters:
//  pDevice
//      Pointer to the device to be used.
//  pCompiledEffect
//      Pointer to compiled effect data
//  CompiledEffectSize
//      Size of compiled effect data in bytes
//  Usage
//      Allows the specification of D3DUSAGE_SOFTWAREPROCESSING
//  ppEffect
//      Returns the created effect object
//----------------------------------------------------------------------------


function D3DXCreateEffect(const pDevice : IDirect3DDevice8; const pCompiledEffect : Pointer; const CompiledEffectSize : Cardinal; const Usage : LongWord; out ppEffect : ID3DXEffect) : HResult; stdcall;

//////////////////////////////////////////////////////////////////////////////
//
//  Copyright (C) 1998 Microsoft Corporation.  All Rights Reserved.
//
//  File:       d3dx8mesh.h
//  Content:    D3DX mesh types and functions
//
//////////////////////////////////////////////////////////////////////////////

type
  TD3DXMesh = LongWord;

const
  D3DXMESH_32BIT		  = $001; // If set, then use 32 bit indices, if not set use 16 bit indices. 32BIT meshes currently not supported on ID3DXSkinMesh object
  D3DXMESH_DONOTCLIP              = $002; // Use D3DUSAGE_DONOTCLIP for VB & IB.
  D3D

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -