📄 d3dx8.pas
字号:
// Left multiply the current matrix with the computed translation
// matrix. (transformation is about the local origin of the object)
function TranslateLocal(x, y, z: Single): HResult; stdcall;
// Obtain the current matrix at the top of the stack
function GetTop: PD3DXMatrix; stdcall;
end;
type
IID_ID3DXMatrixStack = ID3DXMatrixStack;
{$EXTERNALSYM IID_ID3DXMatrixStack}
function D3DXCreateMatrixStack(Flags: DWord; out Stack: ID3DXMatrixStack): HResult; stdcall; external d3dx8dll;
{$EXTERNALSYM D3DXCreateMatrixStack}
///////////////////////////////////////////////////////////////////////////
//
// Copyright (C) Microsoft Corporation. All Rights Reserved.
//
// File: d3dx8core.h
// Content: D3DX core types and functions
//
///////////////////////////////////////////////////////////////////////////
type
///////////////////////////////////////////////////////////////////////////
// ID3DXBuffer:
// ------------
// The buffer object is used by D3DX to return arbitrary size data.
//
// GetBufferPointer -
// Returns a pointer to the beginning of the buffer.
//
// GetBufferSize -
// Returns the size of the buffer, in bytes.
///////////////////////////////////////////////////////////////////////////
PID3DXBuffer = ^ID3DXBuffer;
{$HPPEMIT 'DECLARE_DINTERFACE_TYPE(ID3DXBuffer);'}
{$EXTERNALSYM ID3DXBuffer}
ID3DXBuffer = interface(IUnknown)
['{932E6A7E-C68E-45dd-A7BF-53D19C86DB1F}']
// ID3DXBuffer
function GetBufferPointer: Pointer; stdcall;
function GetBufferSize: DWord; stdcall;
end;
///////////////////////////////////////////////////////////////////////////
// ID3DXFont:
// ----------
// Font objects contain the textures and resources needed to render
// a specific font on a specific device.
//
// Begin -
// Prepartes device for drawing text. This is optional.. if DrawText
// is called outside of Begin/End, it will call Begin and End for you.
//
// DrawText -
// Draws formatted text on a D3D device. Some parameters are
// surprisingly similar to those of GDI's DrawText function. See GDI
// documentation for a detailed description of these parameters.
//
// End -
// Restores device state to how it was when Begin was called.
//
// OnLostDevice, OnResetDevice -
// Call OnLostDevice() on this object before calling Reset() on the
// device, so that this object can release any stateblocks and video
// memory resources. After Reset(), the call OnResetDevice().
//
///////////////////////////////////////////////////////////////////////////
{$HPPEMIT 'DECLARE_DINTERFACE_TYPE(ID3DXFont);'}
{$EXTERNALSYM ID3DXFont}
ID3DXFont = interface(IUnknown)
['{89FAD6A5-024D-49af-8FE7-F51123B85E25}']
// ID3DXFont
function GetDevice(out ppDevice: IDirect3DDevice8): HResult; stdcall;
function GetLogFont(out pLogFont: TLogFont): HResult; stdcall;
function _Begin: HResult; stdcall;
function DrawTextA(pString: PAnsiChar; Count: Integer; const pRect: TRect; Format: DWord; Color: TD3DColor): Integer; stdcall;
function DrawTextW(pString: PWideChar; Count: Integer; const pRect: TRect; Format: DWord; Color: TD3DColor): Integer; stdcall;
function _End: HResult; stdcall;
function OnLostDevice: HResult; stdcall;
function OnResetDevice: HResult; stdcall;
end;
function D3DXCreateFont(pDevice: IDirect3DDevice8; hFont: HFONT;
out ppFont: ID3DXFont): HResult; stdcall; external d3dx8dll;
{$EXTERNALSYM D3DXCreateFont}
function D3DXCreateFontIndirect(pDevice: IDirect3DDevice8;
const pLogFont: TLogFont; out ppFont: ID3DXFont): HResult; stdcall; external d3dx8dll;
{$EXTERNALSYM D3DXCreateFontIndirect}
///////////////////////////////////////////////////////////////////////////
// ID3DXSprite:
// ------------
// This object intends to provide an easy way to drawing sprites using D3D.
//
// Begin -
// Prepares device for drawing sprites
//
// Draw, DrawAffine, DrawTransform -
// Draws a sprite in screen-space. Before transformation, the sprite is
// the size of SrcRect, with its top-left corner at the origin (0,0).
// The color and alpha channels are modulated by Color.
//
// End -
// Restores device state to how it was when Begin was called.
//
// OnLostDevice, OnResetDevice -
// Call OnLostDevice() on this object before calling Reset() on the
// device, so that this object can release any stateblocks and video
// memory resources. After Reset(), the call OnResetDevice().
///////////////////////////////////////////////////////////////////////////
type
{$HPPEMIT 'DECLARE_DINTERFACE_TYPE(ID3DXSprite);'}
{$EXTERNALSYM ID3DXSprite}
ID3DXSprite = interface(IUnknown)
['{13D69D15-F9B0-4e0f-B39E-C91EB33F6CE7}']
// ID3DXSprite
function GetDevice(out ppDevice: IDirect3DDevice8): HResult; stdcall;
function _Begin: HResult; stdcall;
function Draw(pSrcTexture: IDirect3DTexture8; pSrcRect: PRect;
pScaling, pRotationCenter: PD3DXVector2; Rotation: Single;
pTranslation: PD3DXVector2; Color: TD3DColor): HResult; stdcall;
function DrawTransform(pSrcTexture: IDirect3DTexture8; pSrcRect: PRect;
const pTransform: TD3DXMatrix; Color: TD3DColor): HResult; stdcall;
function _End: HResult; stdcall;
function OnLostDevice: HResult; stdcall;
function OnResetDevice: HResult; stdcall;
end;
function D3DXCreateSprite(ppDevice: IDirect3DDevice8;
out ppSprite: ID3DXSprite): HResult; stdcall; external d3dx8dll;
{$EXTERNALSYM D3DXCreateSprite}
///////////////////////////////////////////////////////////////////////////
// ID3DXRenderToSurface:
// ---------------------
// This object abstracts rendering to surfaces. These surfaces do not
// necessarily need to be render targets. If they are not, a compatible
// render target is used, and the result copied into surface at end scene.
//
// BeginScene, EndScene -
// Call BeginScene() and EndScene() at the beginning and ending of your
// scene. These calls will setup and restore render targets, viewports,
// etc..
//
// OnLostDevice, OnResetDevice -
// Call OnLostDevice() on this object before calling Reset() on the
// device, so that this object can release any stateblocks and video
// memory resources. After Reset(), the call OnResetDevice().
///////////////////////////////////////////////////////////////////////////
type
PD3DXRTSDesc = ^TD3DXRTSDesc;
_D3DXRTS_DESC = packed record
Width: LongWord;
Height: LongWord;
Format: TD3DFormat;
DepthStencil: BOOL;
DepthStencilFormat: TD3DFormat;
end {_D3DXRTS_DESC};
{$EXTERNALSYM _D3DXRTS_DESC}
D3DXRTS_DESC = _D3DXRTS_DESC;
{$EXTERNALSYM D3DXRTS_DESC}
TD3DXRTSDesc = _D3DXRTS_DESC;
{$HPPEMIT 'DECLARE_DINTERFACE_TYPE(ID3DXRenderToSurface);'}
{$EXTERNALSYM ID3DXRenderToSurface}
ID3DXRenderToSurface = interface(IUnknown)
['{82DF5B90-E34E-496e-AC1C-62117A6A5913}']
// ID3DXRenderToSurface
function GetDevice(out ppDevice: IDirect3DDevice8): HResult; stdcall;
function GetDesc(out pDesc: TD3DXRTSDesc): HResult; stdcall;
function BeginScene(pSurface: IDirect3DSurface8; pViewport: PD3DViewport8): HResult; stdcall;
function EndScene: HResult; stdcall;
function OnLostDevice: HResult; stdcall;
function OnResetDevice: HResult; stdcall;
end;
function D3DXCreateRenderToSurface(ppDevice: IDirect3DDevice8;
Width: LongWord;
Height: LongWord;
Format: TD3DFormat;
DepthStencil: BOOL;
DepthStencilFormat: TD3DFormat;
out ppRenderToSurface: ID3DXRenderToSurface): HResult; stdcall; external d3dx8dll;
{$EXTERNALSYM D3DXCreateRenderToSurface}
///////////////////////////////////////////////////////////////////////////
// ID3DXRenderToEnvMap:
// --------------------
// This object abstracts rendering to environment maps. These surfaces
// do not necessarily need to be render targets. If they are not, a
// compatible render target is used, and the result copied into the
// environment map at end scene.
//
// BeginCube, BeginSphere, BeginHemisphere, BeginParabolic -
// This function initiates the rendering of the environment map. As
// parameters, you pass the textures in which will get filled in with
// the resulting environment map.
//
// Face -
// Call this function to initiate the drawing of each face. For each
// environment map, you will call this six times.. once for each face
// in D3DCUBEMAP_FACES.
//
// End -
// This will restore all render targets, and if needed compose all the
// rendered faces into the environment map surfaces.
//
// OnLostDevice, OnResetDevice -
// Call OnLostDevice() on this object before calling Reset() on the
// device, so that this object can release any stateblocks and video
// memory resources. After Reset(), the call OnResetDevice().
///////////////////////////////////////////////////////////////////////////
type
PD3DXRTEDesc = ^TD3DXRTEDesc;
_D3DXRTE_DESC = record
Size: LongWord;
Format: TD3DFormat;
DepthStencil: Bool;
DepthStencilFormat: TD3DFormat;
end {_D3DXRTE_DESC};
{$EXTERNALSYM _D3DXRTE_DESC}
D3DXRTE_DESC = _D3DXRTE_DESC;
{$EXTERNALSYM D3DXRTE_DESC}
TD3DXRTEDesc = _D3DXRTE_DESC;
{$HPPEMIT 'DECLARE_DINTERFACE_TYPE(ID3DXRenderToEnvMap);'}
{$EXTERNALSYM ID3DXRenderToEnvMap}
ID3DXRenderToEnvMap = interface(IUnknown)
['{4E42C623-9451-44b7-8C86-ABCCDE5D52C8}']
// ID3DXRenderToEnvMap
function GetDevice(out ppDevice: IDirect3DDevice8): HResult; stdcall;
function GetDesc(out pDesc: TD3DXRTEDesc): HResult; stdcall;
function BeginCube(pCubeTex: IDirect3DCubeTexture8): HResult; stdcall;
function BeginSphere(pTex: IDirect3DTexture8): HResult; stdcall;
function BeginHemisphere(pTexZPos, pTexZNeg: IDirect3DTexture8): HResult; stdcall;
function BeginParabolic(pTexZPos, pTexZNeg: IDirect3DTexture8): HResult; stdcall;
function Face(Face: TD3DCubemapFaces): HResult; stdcall;
function _End: HResult; stdcall;
function OnLostDevice: HResult; stdcall;
function OnResetDevice: HResult; stdcall;
end;
function D3DXCreateRenderToEnvMap(ppDevice: IDirect3DDevice8;
Size: LongWord;
Format: TD3DFormat;
DepthStencil: BOOL;
DepthStencilFormat: TD3DFormat;
out ppRenderToEnvMap: ID3DXRenderToEnvMap): HResult; stdcall; external d3dx8dll;
{$EXTERNALSYM D3DXCreateRenderToEnvMap}
///////////////////////////////////////////////////////////////////////////
// Shader assemblers:
///////////////////////////////////////////////////////////////////////////
//-------------------------------------------------------------------------
// D3DXASM flags:
// --------------
//
// D3DXASM_DEBUG
// Generate debug info.
//
// D3DXASM_SKIPVALIDATION
// Do not validate the generated code against known capabilities and
// constraints. This option is only recommended when assembling shaders
// you KNOW will work. (ie. have assembled before without this option.)
//-------------------------------------------------------------------------
const
D3DXASM_DEBUG = (1 shl 0);
{$EXTERNALSYM D3DXASM_DEBUG}
D3DXASM_SKIPVALIDATION = (1 shl 1);
{$EXTERNALSYM D3DXASM_SKIPVALIDATION}
//-------------------------------------------------------------------------
// D3DXAssembleShader:
// -------------------
// Assembles an ascii description of a vertex or pixel shader into
// binary form.
//
// Parameters:
// pSrcFile
// Source file name
// hSrcModule
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -