ported to DX9

This commit is contained in:
d1str4ught
2025-08-19 03:18:56 +02:00
parent 97a82baa4a
commit e87b6fc67b
130 changed files with 19303 additions and 10435 deletions

1688
extern/include/d3d.h vendored

File diff suppressed because it is too large Load Diff

1279
extern/include/d3d8.h vendored

File diff suppressed because it is too large Load Diff

2791
extern/include/d3d9.h vendored Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -2,28 +2,127 @@
*
* Copyright (C) Microsoft Corporation. All Rights Reserved.
*
* File: d3d8caps.h
* File: d3d9caps.h
* Content: Direct3D capabilities include file
*
***************************************************************************/
#ifndef _D3D8CAPS_H
#define _D3D8CAPS_H
#ifndef _d3d9CAPS_H
#define _d3d9CAPS_H
#ifndef DIRECT3D_VERSION
#define DIRECT3D_VERSION 0x0800
#define DIRECT3D_VERSION 0x0900
#endif //DIRECT3D_VERSION
// include this file content only if compiling for DX8 interfaces
#if(DIRECT3D_VERSION >= 0x0800)
// include this file content only if compiling for DX9 interfaces
#if(DIRECT3D_VERSION >= 0x0900)
#if defined(_X86_) || defined(_IA64_)
#pragma pack(4)
#endif
typedef struct _D3DCAPS8
typedef struct _D3DVSHADERCAPS2_0
{
DWORD Caps;
INT DynamicFlowControlDepth;
INT NumTemps;
INT StaticFlowControlDepth;
} D3DVSHADERCAPS2_0;
#define D3DVS20CAPS_PREDICATION (1<<0)
#define D3DVS20_MAX_DYNAMICFLOWCONTROLDEPTH 24
#define D3DVS20_MIN_DYNAMICFLOWCONTROLDEPTH 0
#define D3DVS20_MAX_NUMTEMPS 32
#define D3DVS20_MIN_NUMTEMPS 12
#define D3DVS20_MAX_STATICFLOWCONTROLDEPTH 4
#define D3DVS20_MIN_STATICFLOWCONTROLDEPTH 1
typedef struct _D3DPSHADERCAPS2_0
{
DWORD Caps;
INT DynamicFlowControlDepth;
INT NumTemps;
INT StaticFlowControlDepth;
INT NumInstructionSlots;
} D3DPSHADERCAPS2_0;
#define D3DPS20CAPS_ARBITRARYSWIZZLE (1<<0)
#define D3DPS20CAPS_GRADIENTINSTRUCTIONS (1<<1)
#define D3DPS20CAPS_PREDICATION (1<<2)
#define D3DPS20CAPS_NODEPENDENTREADLIMIT (1<<3)
#define D3DPS20CAPS_NOTEXINSTRUCTIONLIMIT (1<<4)
#define D3DPS20_MAX_DYNAMICFLOWCONTROLDEPTH 24
#define D3DPS20_MIN_DYNAMICFLOWCONTROLDEPTH 0
#define D3DPS20_MAX_NUMTEMPS 32
#define D3DPS20_MIN_NUMTEMPS 12
#define D3DPS20_MAX_STATICFLOWCONTROLDEPTH 4
#define D3DPS20_MIN_STATICFLOWCONTROLDEPTH 0
#define D3DPS20_MAX_NUMINSTRUCTIONSLOTS 512
#define D3DPS20_MIN_NUMINSTRUCTIONSLOTS 96
#define D3DMIN30SHADERINSTRUCTIONS 512
#define D3DMAX30SHADERINSTRUCTIONS 32768
/* D3D9Ex only -- */
#if !defined(D3D_DISABLE_9EX)
typedef struct _D3DOVERLAYCAPS
{
UINT Caps;
UINT MaxOverlayDisplayWidth;
UINT MaxOverlayDisplayHeight;
} D3DOVERLAYCAPS;
#define D3DOVERLAYCAPS_FULLRANGERGB 0x00000001
#define D3DOVERLAYCAPS_LIMITEDRANGERGB 0x00000002
#define D3DOVERLAYCAPS_YCbCr_BT601 0x00000004
#define D3DOVERLAYCAPS_YCbCr_BT709 0x00000008
#define D3DOVERLAYCAPS_YCbCr_BT601_xvYCC 0x00000010
#define D3DOVERLAYCAPS_YCbCr_BT709_xvYCC 0x00000020
#define D3DOVERLAYCAPS_STRETCHX 0x00000040
#define D3DOVERLAYCAPS_STRETCHY 0x00000080
typedef struct _D3DCONTENTPROTECTIONCAPS
{
DWORD Caps;
GUID KeyExchangeType;
UINT BufferAlignmentStart;
UINT BlockAlignmentSize;
ULONGLONG ProtectedMemorySize;
} D3DCONTENTPROTECTIONCAPS;
#define D3DCPCAPS_SOFTWARE 0x00000001
#define D3DCPCAPS_HARDWARE 0x00000002
#define D3DCPCAPS_PROTECTIONALWAYSON 0x00000004
#define D3DCPCAPS_PARTIALDECRYPTION 0x00000008
#define D3DCPCAPS_CONTENTKEY 0x00000010
#define D3DCPCAPS_FRESHENSESSIONKEY 0x00000020
#define D3DCPCAPS_ENCRYPTEDREADBACK 0x00000040
#define D3DCPCAPS_ENCRYPTEDREADBACKKEY 0x00000080
#define D3DCPCAPS_SEQUENTIAL_CTR_IV 0x00000100
#define D3DCPCAPS_ENCRYPTSLICEDATAONLY 0x00000200
DEFINE_GUID(D3DCRYPTOTYPE_AES128_CTR,
0x9b6bd711, 0x4f74, 0x41c9, 0x9e, 0x7b, 0xb, 0xe2, 0xd7, 0xd9, 0x3b, 0x4f);
DEFINE_GUID(D3DCRYPTOTYPE_PROPRIETARY,
0xab4e9afd, 0x1d1c, 0x46e6, 0xa7, 0x2f, 0x8, 0x69, 0x91, 0x7b, 0xd, 0xe8);
DEFINE_GUID(D3DKEYEXCHANGE_RSAES_OAEP,
0xc1949895, 0xd72a, 0x4a1d, 0x8e, 0x5d, 0xed, 0x85, 0x7d, 0x17, 0x15, 0x20);
DEFINE_GUID(D3DKEYEXCHANGE_DXVA,
0x43d3775c, 0x38e5, 0x4924, 0x8d, 0x86, 0xd3, 0xfc, 0xcf, 0x15, 0x3e, 0x9b);
#endif // !D3D_DISABLE_9EX
/* -- D3D9Ex only */
typedef struct _D3DCAPS9
{
/* Device Info */
D3DDEVTYPE DeviceType;
UINT AdapterOrdinal;
UINT AdapterOrdinal;
/* Caps from DX7 Draw */
DWORD Caps;
@@ -45,11 +144,11 @@ typedef struct _D3DCAPS8
DWORD AlphaCmpCaps;
DWORD ShadeCaps;
DWORD TextureCaps;
DWORD TextureFilterCaps; // D3DPTFILTERCAPS for IDirect3DTexture8's
DWORD CubeTextureFilterCaps; // D3DPTFILTERCAPS for IDirect3DCubeTexture8's
DWORD VolumeTextureFilterCaps; // D3DPTFILTERCAPS for IDirect3DVolumeTexture8's
DWORD TextureAddressCaps; // D3DPTADDRESSCAPS for IDirect3DTexture8's
DWORD VolumeTextureAddressCaps; // D3DPTADDRESSCAPS for IDirect3DVolumeTexture8's
DWORD TextureFilterCaps; // D3DPTFILTERCAPS for IDirect3DTexture9's
DWORD CubeTextureFilterCaps; // D3DPTFILTERCAPS for IDirect3DCubeTexture9's
DWORD VolumeTextureFilterCaps; // D3DPTFILTERCAPS for IDirect3DVolumeTexture9's
DWORD TextureAddressCaps; // D3DPTADDRESSCAPS for IDirect3DTexture9's
DWORD VolumeTextureAddressCaps; // D3DPTADDRESSCAPS for IDirect3DVolumeTexture9's
DWORD LineCaps; // D3DLINECAPS
@@ -91,29 +190,56 @@ typedef struct _D3DCAPS8
DWORD MaxVertexShaderConst; // number of vertex shader constant registers
DWORD PixelShaderVersion;
float MaxPixelShaderValue; // max value of pixel shader arithmetic component
float PixelShader1xMaxValue; // max value storable in registers of ps.1.x shaders
} D3DCAPS8;
// Here are the DX9 specific ones
DWORD DevCaps2;
float MaxNpatchTessellationLevel;
DWORD Reserved5;
UINT MasterAdapterOrdinal; // ordinal of master adaptor for adapter group
UINT AdapterOrdinalInGroup; // ordinal inside the adapter group
UINT NumberOfAdaptersInGroup; // number of adapters in this adapter group (only if master)
DWORD DeclTypes; // Data types, supported in vertex declarations
DWORD NumSimultaneousRTs; // Will be at least 1
DWORD StretchRectFilterCaps; // Filter caps supported by StretchRect
D3DVSHADERCAPS2_0 VS20Caps;
D3DPSHADERCAPS2_0 PS20Caps;
DWORD VertexTextureFilterCaps; // D3DPTFILTERCAPS for IDirect3DTexture9's for texture, used in vertex shaders
DWORD MaxVShaderInstructionsExecuted; // maximum number of vertex shader instructions that can be executed
DWORD MaxPShaderInstructionsExecuted; // maximum number of pixel shader instructions that can be executed
DWORD MaxVertexShader30InstructionSlots;
DWORD MaxPixelShader30InstructionSlots;
} D3DCAPS9;
//
// BIT DEFINES FOR D3DCAPS8 DWORD MEMBERS
// BIT DEFINES FOR D3DCAPS9 DWORD MEMBERS
//
//
// Caps
//
#define D3DCAPS_OVERLAY 0x00000800L
#define D3DCAPS_READ_SCANLINE 0x00020000L
//
// Caps2
//
#define D3DCAPS2_NO2DDURING3DSCENE 0x00000002L
#define D3DCAPS2_FULLSCREENGAMMA 0x00020000L
#define D3DCAPS2_CANRENDERWINDOWED 0x00080000L
#define D3DCAPS2_CANCALIBRATEGAMMA 0x00100000L
#define D3DCAPS2_RESERVED 0x02000000L
#define D3DCAPS2_CANMANAGERESOURCE 0x10000000L
#define D3DCAPS2_DYNAMICTEXTURES 0x20000000L
#define D3DCAPS2_CANAUTOGENMIPMAP 0x40000000L
/* D3D9Ex only -- */
#if !defined(D3D_DISABLE_9EX)
#define D3DCAPS2_CANSHARERESOURCE 0x80000000L
#endif // !D3D_DISABLE_9EX
/* -- D3D9Ex only */
//
// Caps3
@@ -125,6 +251,15 @@ typedef struct _D3DCAPS8
// COPY and COPYVSYNC swap effects work whether or not this flag is set.
#define D3DCAPS3_ALPHA_FULLSCREEN_FLIP_OR_DISCARD 0x00000020L
// Indicates that the device can perform a gamma correction from
// a windowed back buffer containing linear content to the sRGB desktop.
#define D3DCAPS3_LINEAR_TO_SRGB_PRESENTATION 0x00000080L
#define D3DCAPS3_COPY_TO_VIDMEM 0x00000100L /* Device can acclerate copies from sysmem to local vidmem */
#define D3DCAPS3_COPY_TO_SYSTEMMEM 0x00000200L /* Device can acclerate copies from local vidmem to sysmem */
#define D3DCAPS3_DXVAHD 0x00000400L
//
// PresentationIntervals
//
@@ -171,7 +306,6 @@ typedef struct _D3DCAPS8
// PrimitiveMiscCaps
//
#define D3DPMISCCAPS_MASKZ 0x00000002L
#define D3DPMISCCAPS_LINEPATTERNREP 0x00000004L
#define D3DPMISCCAPS_CULLNONE 0x00000010L
#define D3DPMISCCAPS_CULLCW 0x00000020L
#define D3DPMISCCAPS_CULLCCW 0x00000040L
@@ -181,6 +315,23 @@ typedef struct _D3DCAPS8
#define D3DPMISCCAPS_TSSARGTEMP 0x00000400L /* device supports D3DTA_TEMP for temporary register */
#define D3DPMISCCAPS_BLENDOP 0x00000800L /* device supports D3DRS_BLENDOP */
#define D3DPMISCCAPS_NULLREFERENCE 0x00001000L /* Reference Device that doesnt render */
#define D3DPMISCCAPS_INDEPENDENTWRITEMASKS 0x00004000L /* Device supports independent write masks for MET or MRT */
#define D3DPMISCCAPS_PERSTAGECONSTANT 0x00008000L /* Device supports per-stage constants */
#define D3DPMISCCAPS_FOGANDSPECULARALPHA 0x00010000L /* Device supports separate fog and specular alpha (many devices
use the specular alpha channel to store fog factor) */
#define D3DPMISCCAPS_SEPARATEALPHABLEND 0x00020000L /* Device supports separate blend settings for the alpha channel */
#define D3DPMISCCAPS_MRTINDEPENDENTBITDEPTHS 0x00040000L /* Device supports different bit depths for MRT */
#define D3DPMISCCAPS_MRTPOSTPIXELSHADERBLENDING 0x00080000L /* Device supports post-pixel shader operations for MRT */
#define D3DPMISCCAPS_FOGVERTEXCLAMPED 0x00100000L /* Device clamps fog blend factor per vertex */
/* D3D9Ex only -- */
#if !defined(D3D_DISABLE_9EX)
#define D3DPMISCCAPS_POSTBLENDSRGBCONVERT 0x00200000L /* Indicates device can perform conversion to sRGB after blending. */
#endif // !D3D_DISABLE_9EX
/* -- D3D9Ex only */
//
// LineCaps
@@ -190,26 +341,27 @@ typedef struct _D3DCAPS8
#define D3DLINECAPS_BLEND 0x00000004L
#define D3DLINECAPS_ALPHACMP 0x00000008L
#define D3DLINECAPS_FOG 0x00000010L
#define D3DLINECAPS_ANTIALIAS 0x00000020L
//
// RasterCaps
//
#define D3DPRASTERCAPS_DITHER 0x00000001L
#define D3DPRASTERCAPS_PAT 0x00000008L
#define D3DPRASTERCAPS_ZTEST 0x00000010L
#define D3DPRASTERCAPS_FOGVERTEX 0x00000080L
#define D3DPRASTERCAPS_FOGTABLE 0x00000100L
#define D3DPRASTERCAPS_ANTIALIASEDGES 0x00001000L
#define D3DPRASTERCAPS_MIPMAPLODBIAS 0x00002000L
#define D3DPRASTERCAPS_ZBIAS 0x00004000L
#define D3DPRASTERCAPS_ZBUFFERLESSHSR 0x00008000L
#define D3DPRASTERCAPS_FOGRANGE 0x00010000L
#define D3DPRASTERCAPS_ANISOTROPY 0x00020000L
#define D3DPRASTERCAPS_WBUFFER 0x00040000L
#define D3DPRASTERCAPS_WFOG 0x00100000L
#define D3DPRASTERCAPS_ZFOG 0x00200000L
#define D3DPRASTERCAPS_COLORPERSPECTIVE 0x00400000L /* Device iterates colors perspective correct */
#define D3DPRASTERCAPS_STRETCHBLTMULTISAMPLE 0x00800000L
#define D3DPRASTERCAPS_DITHER 0x00000001L
#define D3DPRASTERCAPS_ZTEST 0x00000010L
#define D3DPRASTERCAPS_FOGVERTEX 0x00000080L
#define D3DPRASTERCAPS_FOGTABLE 0x00000100L
#define D3DPRASTERCAPS_MIPMAPLODBIAS 0x00002000L
#define D3DPRASTERCAPS_ZBUFFERLESSHSR 0x00008000L
#define D3DPRASTERCAPS_FOGRANGE 0x00010000L
#define D3DPRASTERCAPS_ANISOTROPY 0x00020000L
#define D3DPRASTERCAPS_WBUFFER 0x00040000L
#define D3DPRASTERCAPS_WFOG 0x00100000L
#define D3DPRASTERCAPS_ZFOG 0x00200000L
#define D3DPRASTERCAPS_COLORPERSPECTIVE 0x00400000L /* Device iterates colors perspective correct */
#define D3DPRASTERCAPS_SCISSORTEST 0x01000000L
#define D3DPRASTERCAPS_SLOPESCALEDEPTHBIAS 0x02000000L
#define D3DPRASTERCAPS_DEPTHBIAS 0x04000000L
#define D3DPRASTERCAPS_MULTISAMPLE_TOGGLE 0x08000000L
//
// ZCmpCaps, AlphaCmpCaps
@@ -239,6 +391,17 @@ typedef struct _D3DCAPS8
#define D3DPBLENDCAPS_SRCALPHASAT 0x00000400L
#define D3DPBLENDCAPS_BOTHSRCALPHA 0x00000800L
#define D3DPBLENDCAPS_BOTHINVSRCALPHA 0x00001000L
#define D3DPBLENDCAPS_BLENDFACTOR 0x00002000L /* Supports both D3DBLEND_BLENDFACTOR and D3DBLEND_INVBLENDFACTOR */
/* D3D9Ex only -- */
#if !defined(D3D_DISABLE_9EX)
#define D3DPBLENDCAPS_SRCCOLOR2 0x00004000L
#define D3DPBLENDCAPS_INVSRCCOLOR2 0x00008000L
#endif // !D3D_DISABLE_9EX
/* -- D3D9Ex only */
//
// ShadeCaps
@@ -270,20 +433,33 @@ typedef struct _D3DCAPS8
#define D3DPTEXTURECAPS_MIPCUBEMAP 0x00010000L /* Device can do mipmapped cube maps */
#define D3DPTEXTURECAPS_CUBEMAP_POW2 0x00020000L /* Device requires that cubemaps be power-of-2 dimension */
#define D3DPTEXTURECAPS_VOLUMEMAP_POW2 0x00040000L /* Device requires that volume maps be power-of-2 dimension */
#define D3DPTEXTURECAPS_NOPROJECTEDBUMPENV 0x00200000L /* Device does not support projected bump env lookup operation
in programmable and fixed function pixel shaders */
//
// TextureFilterCaps
// TextureFilterCaps, StretchRectFilterCaps
//
#define D3DPTFILTERCAPS_MINFPOINT 0x00000100L /* Min Filter */
#define D3DPTFILTERCAPS_MINFLINEAR 0x00000200L
#define D3DPTFILTERCAPS_MINFANISOTROPIC 0x00000400L
#define D3DPTFILTERCAPS_MINFPYRAMIDALQUAD 0x00000800L
#define D3DPTFILTERCAPS_MINFGAUSSIANQUAD 0x00001000L
#define D3DPTFILTERCAPS_MIPFPOINT 0x00010000L /* Mip Filter */
#define D3DPTFILTERCAPS_MIPFLINEAR 0x00020000L
/* D3D9Ex only -- */
#if !defined(D3D_DISABLE_9EX)
#define D3DPTFILTERCAPS_CONVOLUTIONMONO 0x00040000L /* Min and Mag for the convolution mono filter */
#endif // !D3D_DISABLE_9EX
/* -- D3D9Ex only */
#define D3DPTFILTERCAPS_MAGFPOINT 0x01000000L /* Mag Filter */
#define D3DPTFILTERCAPS_MAGFLINEAR 0x02000000L
#define D3DPTFILTERCAPS_MAGFANISOTROPIC 0x04000000L
#define D3DPTFILTERCAPS_MAGFAFLATCUBIC 0x08000000L
#define D3DPTFILTERCAPS_MAGFGAUSSIANCUBIC 0x10000000L
#define D3DPTFILTERCAPS_MAGFPYRAMIDALQUAD 0x08000000L
#define D3DPTFILTERCAPS_MAGFGAUSSIANQUAD 0x10000000L
//
// TextureAddressCaps
@@ -306,6 +482,7 @@ typedef struct _D3DCAPS8
#define D3DSTENCILCAPS_INVERT 0x00000020L
#define D3DSTENCILCAPS_INCR 0x00000040L
#define D3DSTENCILCAPS_DECR 0x00000080L
#define D3DSTENCILCAPS_TWOSIDED 0x00000100L
//
// TextureOpCaps
@@ -353,10 +530,38 @@ typedef struct _D3DCAPS8
#define D3DVTXPCAPS_POSITIONALLIGHTS 0x00000010L /* device can do positional lights (includes point and spot) */
#define D3DVTXPCAPS_LOCALVIEWER 0x00000020L /* device can do local viewer */
#define D3DVTXPCAPS_TWEENING 0x00000040L /* device can do vertex tweening */
#define D3DVTXPCAPS_NO_VSDT_UBYTE4 0x00000080L /* device does not support D3DVSDT_UBYTE4 */
#define D3DVTXPCAPS_TEXGEN_SPHEREMAP 0x00000100L /* device supports D3DTSS_TCI_SPHEREMAP */
#define D3DVTXPCAPS_NO_TEXGEN_NONLOCALVIEWER 0x00000200L /* device does not support TexGen in non-local
viewer mode */
//
// DevCaps2
//
#define D3DDEVCAPS2_STREAMOFFSET 0x00000001L /* Device supports offsets in streams. Must be set by DX9 drivers */
#define D3DDEVCAPS2_DMAPNPATCH 0x00000002L /* Device supports displacement maps for N-Patches*/
#define D3DDEVCAPS2_ADAPTIVETESSRTPATCH 0x00000004L /* Device supports adaptive tesselation of RT-patches*/
#define D3DDEVCAPS2_ADAPTIVETESSNPATCH 0x00000008L /* Device supports adaptive tesselation of N-patches*/
#define D3DDEVCAPS2_CAN_STRETCHRECT_FROM_TEXTURES 0x00000010L /* Device supports StretchRect calls with a texture as the source*/
#define D3DDEVCAPS2_PRESAMPLEDDMAPNPATCH 0x00000020L /* Device supports presampled displacement maps for N-Patches */
#define D3DDEVCAPS2_VERTEXELEMENTSCANSHARESTREAMOFFSET 0x00000040L /* Vertex elements in a vertex declaration can share the same stream offset */
//
// DeclTypes
//
#define D3DDTCAPS_UBYTE4 0x00000001L
#define D3DDTCAPS_UBYTE4N 0x00000002L
#define D3DDTCAPS_SHORT2N 0x00000004L
#define D3DDTCAPS_SHORT4N 0x00000008L
#define D3DDTCAPS_USHORT2N 0x00000010L
#define D3DDTCAPS_USHORT4N 0x00000020L
#define D3DDTCAPS_UDEC3 0x00000040L
#define D3DDTCAPS_DEC3N 0x00000080L
#define D3DDTCAPS_FLOAT16_2 0x00000100L
#define D3DDTCAPS_FLOAT16_4 0x00000200L
#pragma pack()
#endif /* (DIRECT3D_VERSION >= 0x0800) */
#endif /* _D3D8CAPS_H_ */
#endif /* (DIRECT3D_VERSION >= 0x0900) */
#endif /* _d3d9CAPS_H_ */

File diff suppressed because it is too large Load Diff

View File

@@ -1,599 +0,0 @@
/*==========================================================================;
*
* Copyright (C) Microsoft Corporation. All Rights Reserved.
*
* File: d3dcaps.h
* Content: Direct3D capabilities include file
*
***************************************************************************/
#ifndef _D3DCAPS_H
#define _D3DCAPS_H
/*
* Pull in DirectDraw include file automatically:
*/
#include "ddraw.h"
#ifndef DIRECT3D_VERSION
#define DIRECT3D_VERSION 0x0700
#endif
#pragma pack(4)
/* Description of capabilities of transform */
typedef struct _D3DTRANSFORMCAPS {
DWORD dwSize;
DWORD dwCaps;
} D3DTRANSFORMCAPS, *LPD3DTRANSFORMCAPS;
#define D3DTRANSFORMCAPS_CLIP 0x00000001L /* Will clip whilst transforming */
/* Description of capabilities of lighting */
typedef struct _D3DLIGHTINGCAPS {
DWORD dwSize;
DWORD dwCaps; /* Lighting caps */
DWORD dwLightingModel; /* Lighting model - RGB or mono */
DWORD dwNumLights; /* Number of lights that can be handled */
} D3DLIGHTINGCAPS, *LPD3DLIGHTINGCAPS;
#define D3DLIGHTINGMODEL_RGB 0x00000001L
#define D3DLIGHTINGMODEL_MONO 0x00000002L
#define D3DLIGHTCAPS_POINT 0x00000001L /* Point lights supported */
#define D3DLIGHTCAPS_SPOT 0x00000002L /* Spot lights supported */
#define D3DLIGHTCAPS_DIRECTIONAL 0x00000004L /* Directional lights supported */
#if(DIRECT3D_VERSION < 0x700)
#define D3DLIGHTCAPS_PARALLELPOINT 0x00000008L /* Parallel point lights supported */
#endif
#if(DIRECT3D_VERSION < 0x500)
#define D3DLIGHTCAPS_GLSPOT 0x00000010L /* GL syle spot lights supported */
#endif
/* Description of capabilities for each primitive type */
typedef struct _D3DPrimCaps {
DWORD dwSize;
DWORD dwMiscCaps; /* Capability flags */
DWORD dwRasterCaps;
DWORD dwZCmpCaps;
DWORD dwSrcBlendCaps;
DWORD dwDestBlendCaps;
DWORD dwAlphaCmpCaps;
DWORD dwShadeCaps;
DWORD dwTextureCaps;
DWORD dwTextureFilterCaps;
DWORD dwTextureBlendCaps;
DWORD dwTextureAddressCaps;
DWORD dwStippleWidth; /* maximum width and height of */
DWORD dwStippleHeight; /* of supported stipple (up to 32x32) */
} D3DPRIMCAPS, *LPD3DPRIMCAPS;
/* D3DPRIMCAPS dwMiscCaps */
#define D3DPMISCCAPS_MASKPLANES 0x00000001L
#define D3DPMISCCAPS_MASKZ 0x00000002L
#define D3DPMISCCAPS_LINEPATTERNREP 0x00000004L
#define D3DPMISCCAPS_CONFORMANT 0x00000008L
#define D3DPMISCCAPS_CULLNONE 0x00000010L
#define D3DPMISCCAPS_CULLCW 0x00000020L
#define D3DPMISCCAPS_CULLCCW 0x00000040L
/* D3DPRIMCAPS dwRasterCaps */
#define D3DPRASTERCAPS_DITHER 0x00000001L
#define D3DPRASTERCAPS_ROP2 0x00000002L
#define D3DPRASTERCAPS_XOR 0x00000004L
#define D3DPRASTERCAPS_PAT 0x00000008L
#define D3DPRASTERCAPS_ZTEST 0x00000010L
#define D3DPRASTERCAPS_SUBPIXEL 0x00000020L
#define D3DPRASTERCAPS_SUBPIXELX 0x00000040L
#define D3DPRASTERCAPS_FOGVERTEX 0x00000080L
#define D3DPRASTERCAPS_FOGTABLE 0x00000100L
#define D3DPRASTERCAPS_STIPPLE 0x00000200L
#if(DIRECT3D_VERSION >= 0x0500)
#define D3DPRASTERCAPS_ANTIALIASSORTDEPENDENT 0x00000400L
#define D3DPRASTERCAPS_ANTIALIASSORTINDEPENDENT 0x00000800L
#define D3DPRASTERCAPS_ANTIALIASEDGES 0x00001000L
#define D3DPRASTERCAPS_MIPMAPLODBIAS 0x00002000L
#define D3DPRASTERCAPS_ZBIAS 0x00004000L
#define D3DPRASTERCAPS_ZBUFFERLESSHSR 0x00008000L
#define D3DPRASTERCAPS_FOGRANGE 0x00010000L
#define D3DPRASTERCAPS_ANISOTROPY 0x00020000L
#endif /* DIRECT3D_VERSION >= 0x0500 */
#if(DIRECT3D_VERSION >= 0x0600)
#define D3DPRASTERCAPS_WBUFFER 0x00040000L
#define D3DPRASTERCAPS_TRANSLUCENTSORTINDEPENDENT 0x00080000L
#define D3DPRASTERCAPS_WFOG 0x00100000L
#define D3DPRASTERCAPS_ZFOG 0x00200000L
#endif /* DIRECT3D_VERSION >= 0x0600 */
/* D3DPRIMCAPS dwZCmpCaps, dwAlphaCmpCaps */
#define D3DPCMPCAPS_NEVER 0x00000001L
#define D3DPCMPCAPS_LESS 0x00000002L
#define D3DPCMPCAPS_EQUAL 0x00000004L
#define D3DPCMPCAPS_LESSEQUAL 0x00000008L
#define D3DPCMPCAPS_GREATER 0x00000010L
#define D3DPCMPCAPS_NOTEQUAL 0x00000020L
#define D3DPCMPCAPS_GREATEREQUAL 0x00000040L
#define D3DPCMPCAPS_ALWAYS 0x00000080L
/* D3DPRIMCAPS dwSourceBlendCaps, dwDestBlendCaps */
#define D3DPBLENDCAPS_ZERO 0x00000001L
#define D3DPBLENDCAPS_ONE 0x00000002L
#define D3DPBLENDCAPS_SRCCOLOR 0x00000004L
#define D3DPBLENDCAPS_INVSRCCOLOR 0x00000008L
#define D3DPBLENDCAPS_SRCALPHA 0x00000010L
#define D3DPBLENDCAPS_INVSRCALPHA 0x00000020L
#define D3DPBLENDCAPS_DESTALPHA 0x00000040L
#define D3DPBLENDCAPS_INVDESTALPHA 0x00000080L
#define D3DPBLENDCAPS_DESTCOLOR 0x00000100L
#define D3DPBLENDCAPS_INVDESTCOLOR 0x00000200L
#define D3DPBLENDCAPS_SRCALPHASAT 0x00000400L
#define D3DPBLENDCAPS_BOTHSRCALPHA 0x00000800L
#define D3DPBLENDCAPS_BOTHINVSRCALPHA 0x00001000L
/* D3DPRIMCAPS dwShadeCaps */
#define D3DPSHADECAPS_COLORFLATMONO 0x00000001L
#define D3DPSHADECAPS_COLORFLATRGB 0x00000002L
#define D3DPSHADECAPS_COLORGOURAUDMONO 0x00000004L
#define D3DPSHADECAPS_COLORGOURAUDRGB 0x00000008L
#define D3DPSHADECAPS_COLORPHONGMONO 0x00000010L
#define D3DPSHADECAPS_COLORPHONGRGB 0x00000020L
#define D3DPSHADECAPS_SPECULARFLATMONO 0x00000040L
#define D3DPSHADECAPS_SPECULARFLATRGB 0x00000080L
#define D3DPSHADECAPS_SPECULARGOURAUDMONO 0x00000100L
#define D3DPSHADECAPS_SPECULARGOURAUDRGB 0x00000200L
#define D3DPSHADECAPS_SPECULARPHONGMONO 0x00000400L
#define D3DPSHADECAPS_SPECULARPHONGRGB 0x00000800L
#define D3DPSHADECAPS_ALPHAFLATBLEND 0x00001000L
#define D3DPSHADECAPS_ALPHAFLATSTIPPLED 0x00002000L
#define D3DPSHADECAPS_ALPHAGOURAUDBLEND 0x00004000L
#define D3DPSHADECAPS_ALPHAGOURAUDSTIPPLED 0x00008000L
#define D3DPSHADECAPS_ALPHAPHONGBLEND 0x00010000L
#define D3DPSHADECAPS_ALPHAPHONGSTIPPLED 0x00020000L
#define D3DPSHADECAPS_FOGFLAT 0x00040000L
#define D3DPSHADECAPS_FOGGOURAUD 0x00080000L
#define D3DPSHADECAPS_FOGPHONG 0x00100000L
/* D3DPRIMCAPS dwTextureCaps */
/*
* Perspective-correct texturing is supported
*/
#define D3DPTEXTURECAPS_PERSPECTIVE 0x00000001L
/*
* Power-of-2 texture dimensions are required
*/
#define D3DPTEXTURECAPS_POW2 0x00000002L
/*
* Alpha in texture pixels is supported
*/
#define D3DPTEXTURECAPS_ALPHA 0x00000004L
/*
* Color-keyed textures are supported
*/
#define D3DPTEXTURECAPS_TRANSPARENCY 0x00000008L
/*
* obsolete, see D3DPTADDRESSCAPS_BORDER
*/
#define D3DPTEXTURECAPS_BORDER 0x00000010L
/*
* Only square textures are supported
*/
#define D3DPTEXTURECAPS_SQUAREONLY 0x00000020L
#if(DIRECT3D_VERSION >= 0x0600)
/*
* Texture indices are not scaled by the texture size prior
* to interpolation.
*/
#define D3DPTEXTURECAPS_TEXREPEATNOTSCALEDBYSIZE 0x00000040L
/*
* Device can draw alpha from texture palettes
*/
#define D3DPTEXTURECAPS_ALPHAPALETTE 0x00000080L
/*
* 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)
*/
#define D3DPTEXTURECAPS_NONPOW2CONDITIONAL 0x00000100L
#endif /* DIRECT3D_VERSION >= 0x0600 */
#if(DIRECT3D_VERSION >= 0x0700)
// 0x00000200L unused
/*
* Device can divide transformed texture coordinates by the
* COUNTth texture coordinate (can do D3DTTFF_PROJECTED)
*/
#define D3DPTEXTURECAPS_PROJECTED 0x00000400L
/*
* Device can do cubemap textures
*/
#define D3DPTEXTURECAPS_CUBEMAP 0x00000800L
#define D3DPTEXTURECAPS_COLORKEYBLEND 0x00001000L
#endif /* DIRECT3D_VERSION >= 0x0700 */
/* D3DPRIMCAPS dwTextureFilterCaps */
#define D3DPTFILTERCAPS_NEAREST 0x00000001L
#define D3DPTFILTERCAPS_LINEAR 0x00000002L
#define D3DPTFILTERCAPS_MIPNEAREST 0x00000004L
#define D3DPTFILTERCAPS_MIPLINEAR 0x00000008L
#define D3DPTFILTERCAPS_LINEARMIPNEAREST 0x00000010L
#define D3DPTFILTERCAPS_LINEARMIPLINEAR 0x00000020L
#if(DIRECT3D_VERSION >= 0x0600)
/* Device3 Min Filter */
#define D3DPTFILTERCAPS_MINFPOINT 0x00000100L
#define D3DPTFILTERCAPS_MINFLINEAR 0x00000200L
#define D3DPTFILTERCAPS_MINFANISOTROPIC 0x00000400L
/* Device3 Mip Filter */
#define D3DPTFILTERCAPS_MIPFPOINT 0x00010000L
#define D3DPTFILTERCAPS_MIPFLINEAR 0x00020000L
/* Device3 Mag Filter */
#define D3DPTFILTERCAPS_MAGFPOINT 0x01000000L
#define D3DPTFILTERCAPS_MAGFLINEAR 0x02000000L
#define D3DPTFILTERCAPS_MAGFANISOTROPIC 0x04000000L
#define D3DPTFILTERCAPS_MAGFAFLATCUBIC 0x08000000L
#define D3DPTFILTERCAPS_MAGFGAUSSIANCUBIC 0x10000000L
#endif /* DIRECT3D_VERSION >= 0x0600 */
/* D3DPRIMCAPS dwTextureBlendCaps */
#define D3DPTBLENDCAPS_DECAL 0x00000001L
#define D3DPTBLENDCAPS_MODULATE 0x00000002L
#define D3DPTBLENDCAPS_DECALALPHA 0x00000004L
#define D3DPTBLENDCAPS_MODULATEALPHA 0x00000008L
#define D3DPTBLENDCAPS_DECALMASK 0x00000010L
#define D3DPTBLENDCAPS_MODULATEMASK 0x00000020L
#define D3DPTBLENDCAPS_COPY 0x00000040L
#if(DIRECT3D_VERSION >= 0x0500)
#define D3DPTBLENDCAPS_ADD 0x00000080L
#endif /* DIRECT3D_VERSION >= 0x0500 */
/* D3DPRIMCAPS dwTextureAddressCaps */
#define D3DPTADDRESSCAPS_WRAP 0x00000001L
#define D3DPTADDRESSCAPS_MIRROR 0x00000002L
#define D3DPTADDRESSCAPS_CLAMP 0x00000004L
#if(DIRECT3D_VERSION >= 0x0500)
#define D3DPTADDRESSCAPS_BORDER 0x00000008L
#define D3DPTADDRESSCAPS_INDEPENDENTUV 0x00000010L
#endif /* DIRECT3D_VERSION >= 0x0500 */
#if(DIRECT3D_VERSION >= 0x0600)
/* D3DDEVICEDESC dwStencilCaps */
#define D3DSTENCILCAPS_KEEP 0x00000001L
#define D3DSTENCILCAPS_ZERO 0x00000002L
#define D3DSTENCILCAPS_REPLACE 0x00000004L
#define D3DSTENCILCAPS_INCRSAT 0x00000008L
#define D3DSTENCILCAPS_DECRSAT 0x00000010L
#define D3DSTENCILCAPS_INVERT 0x00000020L
#define D3DSTENCILCAPS_INCR 0x00000040L
#define D3DSTENCILCAPS_DECR 0x00000080L
/* D3DDEVICEDESC dwTextureOpCaps */
#define D3DTEXOPCAPS_DISABLE 0x00000001L
#define D3DTEXOPCAPS_SELECTARG1 0x00000002L
#define D3DTEXOPCAPS_SELECTARG2 0x00000004L
#define D3DTEXOPCAPS_MODULATE 0x00000008L
#define D3DTEXOPCAPS_MODULATE2X 0x00000010L
#define D3DTEXOPCAPS_MODULATE4X 0x00000020L
#define D3DTEXOPCAPS_ADD 0x00000040L
#define D3DTEXOPCAPS_ADDSIGNED 0x00000080L
#define D3DTEXOPCAPS_ADDSIGNED2X 0x00000100L
#define D3DTEXOPCAPS_SUBTRACT 0x00000200L
#define D3DTEXOPCAPS_ADDSMOOTH 0x00000400L
#define D3DTEXOPCAPS_BLENDDIFFUSEALPHA 0x00000800L
#define D3DTEXOPCAPS_BLENDTEXTUREALPHA 0x00001000L
#define D3DTEXOPCAPS_BLENDFACTORALPHA 0x00002000L
#define D3DTEXOPCAPS_BLENDTEXTUREALPHAPM 0x00004000L
#define D3DTEXOPCAPS_BLENDCURRENTALPHA 0x00008000L
#define D3DTEXOPCAPS_PREMODULATE 0x00010000L
#define D3DTEXOPCAPS_MODULATEALPHA_ADDCOLOR 0x00020000L
#define D3DTEXOPCAPS_MODULATECOLOR_ADDALPHA 0x00040000L
#define D3DTEXOPCAPS_MODULATEINVALPHA_ADDCOLOR 0x00080000L
#define D3DTEXOPCAPS_MODULATEINVCOLOR_ADDALPHA 0x00100000L
#define D3DTEXOPCAPS_BUMPENVMAP 0x00200000L
#define D3DTEXOPCAPS_BUMPENVMAPLUMINANCE 0x00400000L
#define D3DTEXOPCAPS_DOTPRODUCT3 0x00800000L
/* D3DDEVICEDESC dwFVFCaps flags */
#define D3DFVFCAPS_TEXCOORDCOUNTMASK 0x0000ffffL /* mask for texture coordinate count field */
#define D3DFVFCAPS_DONOTSTRIPELEMENTS 0x00080000L /* Device prefers that vertex elements not be stripped */
#endif /* DIRECT3D_VERSION >= 0x0600 */
/*
* Description for a device.
* This is used to describe a device that is to be created or to query
* the current device.
*/
typedef struct _D3DDeviceDesc {
DWORD dwSize; /* Size of D3DDEVICEDESC structure */
DWORD dwFlags; /* Indicates which fields have valid data */
D3DCOLORMODEL dcmColorModel; /* Color model of device */
DWORD dwDevCaps; /* Capabilities of device */
D3DTRANSFORMCAPS dtcTransformCaps; /* Capabilities of transform */
BOOL bClipping; /* Device can do 3D clipping */
D3DLIGHTINGCAPS dlcLightingCaps; /* Capabilities of lighting */
D3DPRIMCAPS dpcLineCaps;
D3DPRIMCAPS dpcTriCaps;
DWORD dwDeviceRenderBitDepth; /* One of DDBB_8, 16, etc.. */
DWORD dwDeviceZBufferBitDepth;/* One of DDBD_16, 32, etc.. */
DWORD dwMaxBufferSize; /* Maximum execute buffer size */
DWORD dwMaxVertexCount; /* Maximum vertex count */
#if(DIRECT3D_VERSION >= 0x0500)
// *** New fields for DX5 *** //
// Width and height caps are 0 for legacy HALs.
DWORD dwMinTextureWidth, dwMinTextureHeight;
DWORD dwMaxTextureWidth, dwMaxTextureHeight;
DWORD dwMinStippleWidth, dwMaxStippleWidth;
DWORD dwMinStippleHeight, dwMaxStippleHeight;
#endif /* DIRECT3D_VERSION >= 0x0500 */
#if(DIRECT3D_VERSION >= 0x0600)
// New fields for DX6
DWORD dwMaxTextureRepeat;
DWORD dwMaxTextureAspectRatio;
DWORD dwMaxAnisotropy;
// Guard band that the rasterizer can accommodate
// Screen-space vertices inside this space but outside the viewport
// will get clipped properly.
D3DVALUE dvGuardBandLeft;
D3DVALUE dvGuardBandTop;
D3DVALUE dvGuardBandRight;
D3DVALUE dvGuardBandBottom;
D3DVALUE dvExtentsAdjust;
DWORD dwStencilCaps;
DWORD dwFVFCaps;
DWORD dwTextureOpCaps;
WORD wMaxTextureBlendStages;
WORD wMaxSimultaneousTextures;
#endif /* DIRECT3D_VERSION >= 0x0600 */
} D3DDEVICEDESC, *LPD3DDEVICEDESC;
#if(DIRECT3D_VERSION >= 0x0700)
typedef struct _D3DDeviceDesc7 {
DWORD dwDevCaps; /* Capabilities of device */
D3DPRIMCAPS dpcLineCaps;
D3DPRIMCAPS dpcTriCaps;
DWORD dwDeviceRenderBitDepth; /* One of DDBB_8, 16, etc.. */
DWORD dwDeviceZBufferBitDepth;/* One of DDBD_16, 32, etc.. */
DWORD dwMinTextureWidth, dwMinTextureHeight;
DWORD dwMaxTextureWidth, dwMaxTextureHeight;
DWORD dwMaxTextureRepeat;
DWORD dwMaxTextureAspectRatio;
DWORD dwMaxAnisotropy;
D3DVALUE dvGuardBandLeft;
D3DVALUE dvGuardBandTop;
D3DVALUE dvGuardBandRight;
D3DVALUE dvGuardBandBottom;
D3DVALUE dvExtentsAdjust;
DWORD dwStencilCaps;
DWORD dwFVFCaps;
DWORD dwTextureOpCaps;
WORD wMaxTextureBlendStages;
WORD wMaxSimultaneousTextures;
DWORD dwMaxActiveLights;
D3DVALUE dvMaxVertexW;
GUID deviceGUID;
WORD wMaxUserClipPlanes;
WORD wMaxVertexBlendMatrices;
DWORD dwVertexProcessingCaps;
DWORD dwReserved1;
DWORD dwReserved2;
DWORD dwReserved3;
DWORD dwReserved4;
} D3DDEVICEDESC7, *LPD3DDEVICEDESC7;
#endif /* DIRECT3D_VERSION >= 0x0700 */
#define D3DDEVICEDESCSIZE (sizeof(D3DDEVICEDESC))
#define D3DDEVICEDESC7SIZE (sizeof(D3DDEVICEDESC7))
typedef HRESULT (CALLBACK * LPD3DENUMDEVICESCALLBACK)(GUID FAR *lpGuid, LPSTR lpDeviceDescription, LPSTR lpDeviceName, LPD3DDEVICEDESC, LPD3DDEVICEDESC, LPVOID);
#if(DIRECT3D_VERSION >= 0x0700)
typedef HRESULT (CALLBACK * LPD3DENUMDEVICESCALLBACK7)(LPSTR lpDeviceDescription, LPSTR lpDeviceName, LPD3DDEVICEDESC7, LPVOID);
#endif /* DIRECT3D_VERSION >= 0x0700 */
/* D3DDEVICEDESC dwFlags indicating valid fields */
#define D3DDD_COLORMODEL 0x00000001L /* dcmColorModel is valid */
#define D3DDD_DEVCAPS 0x00000002L /* dwDevCaps is valid */
#define D3DDD_TRANSFORMCAPS 0x00000004L /* dtcTransformCaps is valid */
#define D3DDD_LIGHTINGCAPS 0x00000008L /* dlcLightingCaps is valid */
#define D3DDD_BCLIPPING 0x00000010L /* bClipping is valid */
#define D3DDD_LINECAPS 0x00000020L /* dpcLineCaps is valid */
#define D3DDD_TRICAPS 0x00000040L /* dpcTriCaps is valid */
#define D3DDD_DEVICERENDERBITDEPTH 0x00000080L /* dwDeviceRenderBitDepth is valid */
#define D3DDD_DEVICEZBUFFERBITDEPTH 0x00000100L /* dwDeviceZBufferBitDepth is valid */
#define D3DDD_MAXBUFFERSIZE 0x00000200L /* dwMaxBufferSize is valid */
#define D3DDD_MAXVERTEXCOUNT 0x00000400L /* dwMaxVertexCount is valid */
/* D3DDEVICEDESC dwDevCaps flags */
#define D3DDEVCAPS_FLOATTLVERTEX 0x00000001L /* Device accepts floating point */
/* for post-transform vertex data */
#define D3DDEVCAPS_SORTINCREASINGZ 0x00000002L /* Device needs data sorted for increasing Z */
#define D3DDEVCAPS_SORTDECREASINGZ 0X00000004L /* Device needs data sorted for decreasing Z */
#define D3DDEVCAPS_SORTEXACT 0x00000008L /* Device needs data sorted exactly */
#define D3DDEVCAPS_EXECUTESYSTEMMEMORY 0x00000010L /* Device can use execute buffers from system memory */
#define D3DDEVCAPS_EXECUTEVIDEOMEMORY 0x00000020L /* Device can use execute buffers from video memory */
#define D3DDEVCAPS_TLVERTEXSYSTEMMEMORY 0x00000040L /* Device can use TL buffers from system memory */
#define D3DDEVCAPS_TLVERTEXVIDEOMEMORY 0x00000080L /* Device can use TL buffers from video memory */
#define D3DDEVCAPS_TEXTURESYSTEMMEMORY 0x00000100L /* Device can texture from system memory */
#define D3DDEVCAPS_TEXTUREVIDEOMEMORY 0x00000200L /* Device can texture from device memory */
#if(DIRECT3D_VERSION >= 0x0500)
#define D3DDEVCAPS_DRAWPRIMTLVERTEX 0x00000400L /* Device can draw TLVERTEX primitives */
#define D3DDEVCAPS_CANRENDERAFTERFLIP 0x00000800L /* Device can render without waiting for flip to complete */
#define D3DDEVCAPS_TEXTURENONLOCALVIDMEM 0x00001000L /* Device can texture from nonlocal video memory */
#endif /* DIRECT3D_VERSION >= 0x0500 */
#if(DIRECT3D_VERSION >= 0x0600)
#define D3DDEVCAPS_DRAWPRIMITIVES2 0x00002000L /* Device can support DrawPrimitives2 */
#define D3DDEVCAPS_SEPARATETEXTUREMEMORIES 0x00004000L /* Device is texturing from separate memory pools */
#define D3DDEVCAPS_DRAWPRIMITIVES2EX 0x00008000L /* Device can support Extended DrawPrimitives2 i.e. DX7 compliant driver*/
#endif /* DIRECT3D_VERSION >= 0x0600 */
#if(DIRECT3D_VERSION >= 0x0700)
#define D3DDEVCAPS_HWTRANSFORMANDLIGHT 0x00010000L /* Device can support transformation and lighting in hardware and DRAWPRIMITIVES2EX must be also */
#define D3DDEVCAPS_CANBLTSYSTONONLOCAL 0x00020000L /* Device supports a Tex Blt from system memory to non-local vidmem */
#define D3DDEVCAPS_HWRASTERIZATION 0x00080000L /* Device has HW acceleration for rasterization */
/*
* These are the flags in the D3DDEVICEDESC7.dwVertexProcessingCaps field
*/
/* device can do texgen */
#define D3DVTXPCAPS_TEXGEN 0x00000001L
/* device can do IDirect3DDevice7 colormaterialsource ops */
#define D3DVTXPCAPS_MATERIALSOURCE7 0x00000002L
/* device can do vertex fog */
#define D3DVTXPCAPS_VERTEXFOG 0x00000004L
/* device can do directional lights */
#define D3DVTXPCAPS_DIRECTIONALLIGHTS 0x00000008L
/* device can do positional lights (includes point and spot) */
#define D3DVTXPCAPS_POSITIONALLIGHTS 0x00000010L
/* device can do local viewer */
#define D3DVTXPCAPS_LOCALVIEWER 0x00000020L
#endif /* DIRECT3D_VERSION >= 0x0700 */
#define D3DFDS_COLORMODEL 0x00000001L /* Match color model */
#define D3DFDS_GUID 0x00000002L /* Match guid */
#define D3DFDS_HARDWARE 0x00000004L /* Match hardware/software */
#define D3DFDS_TRIANGLES 0x00000008L /* Match in triCaps */
#define D3DFDS_LINES 0x00000010L /* Match in lineCaps */
#define D3DFDS_MISCCAPS 0x00000020L /* Match primCaps.dwMiscCaps */
#define D3DFDS_RASTERCAPS 0x00000040L /* Match primCaps.dwRasterCaps */
#define D3DFDS_ZCMPCAPS 0x00000080L /* Match primCaps.dwZCmpCaps */
#define D3DFDS_ALPHACMPCAPS 0x00000100L /* Match primCaps.dwAlphaCmpCaps */
#define D3DFDS_SRCBLENDCAPS 0x00000200L /* Match primCaps.dwSourceBlendCaps */
#define D3DFDS_DSTBLENDCAPS 0x00000400L /* Match primCaps.dwDestBlendCaps */
#define D3DFDS_SHADECAPS 0x00000800L /* Match primCaps.dwShadeCaps */
#define D3DFDS_TEXTURECAPS 0x00001000L /* Match primCaps.dwTextureCaps */
#define D3DFDS_TEXTUREFILTERCAPS 0x00002000L /* Match primCaps.dwTextureFilterCaps */
#define D3DFDS_TEXTUREBLENDCAPS 0x00004000L /* Match primCaps.dwTextureBlendCaps */
#define D3DFDS_TEXTUREADDRESSCAPS 0x00008000L /* Match primCaps.dwTextureBlendCaps */
/*
* FindDevice arguments
*/
typedef struct _D3DFINDDEVICESEARCH {
DWORD dwSize;
DWORD dwFlags;
BOOL bHardware;
D3DCOLORMODEL dcmColorModel;
GUID guid;
DWORD dwCaps;
D3DPRIMCAPS dpcPrimCaps;
} D3DFINDDEVICESEARCH, *LPD3DFINDDEVICESEARCH;
typedef struct _D3DFINDDEVICERESULT {
DWORD dwSize;
GUID guid; /* guid which matched */
D3DDEVICEDESC ddHwDesc; /* hardware D3DDEVICEDESC */
D3DDEVICEDESC ddSwDesc; /* software D3DDEVICEDESC */
} D3DFINDDEVICERESULT, *LPD3DFINDDEVICERESULT;
/*
* Description of execute buffer.
*/
typedef struct _D3DExecuteBufferDesc {
DWORD dwSize; /* size of this structure */
DWORD dwFlags; /* flags indicating which fields are valid */
DWORD dwCaps; /* capabilities of execute buffer */
DWORD dwBufferSize; /* size of execute buffer data */
LPVOID lpData; /* pointer to actual data */
} D3DEXECUTEBUFFERDESC, *LPD3DEXECUTEBUFFERDESC;
/* D3DEXECUTEBUFFER dwFlags indicating valid fields */
#define D3DDEB_BUFSIZE 0x00000001l /* buffer size valid */
#define D3DDEB_CAPS 0x00000002l /* caps valid */
#define D3DDEB_LPDATA 0x00000004l /* lpData valid */
/* D3DEXECUTEBUFFER dwCaps */
#define D3DDEBCAPS_SYSTEMMEMORY 0x00000001l /* buffer in system memory */
#define D3DDEBCAPS_VIDEOMEMORY 0x00000002l /* buffer in device memory */
#define D3DDEBCAPS_MEM (D3DDEBCAPS_SYSTEMMEMORY|D3DDEBCAPS_VIDEOMEMORY)
#if(DIRECT3D_VERSION < 0x0800)
#if(DIRECT3D_VERSION >= 0x0700)
typedef struct _D3DDEVINFO_TEXTUREMANAGER {
BOOL bThrashing; /* indicates if thrashing */
DWORD dwApproxBytesDownloaded; /* Approximate number of bytes downloaded by texture manager */
DWORD dwNumEvicts; /* number of textures evicted */
DWORD dwNumVidCreates; /* number of textures created in video memory */
DWORD dwNumTexturesUsed; /* number of textures used */
DWORD dwNumUsedTexInVid; /* number of used textures present in video memory */
DWORD dwWorkingSet; /* number of textures in video memory */
DWORD dwWorkingSetBytes; /* number of bytes in video memory */
DWORD dwTotalManaged; /* total number of managed textures */
DWORD dwTotalBytes; /* total number of bytes of managed textures */
DWORD dwLastPri; /* priority of last texture evicted */
} D3DDEVINFO_TEXTUREMANAGER, *LPD3DDEVINFO_TEXTUREMANAGER;
typedef struct _D3DDEVINFO_TEXTURING {
DWORD dwNumLoads; /* counts Load() API calls */
DWORD dwApproxBytesLoaded; /* Approximate number bytes loaded via Load() */
DWORD dwNumPreLoads; /* counts PreLoad() API calls */
DWORD dwNumSet; /* counts SetTexture() API calls */
DWORD dwNumCreates; /* counts texture creates */
DWORD dwNumDestroys; /* counts texture destroys */
DWORD dwNumSetPriorities; /* counts SetPriority() API calls */
DWORD dwNumSetLODs; /* counts SetLOD() API calls */
DWORD dwNumLocks; /* counts number of texture locks */
DWORD dwNumGetDCs; /* counts number of GetDCs to textures */
} D3DDEVINFO_TEXTURING, *LPD3DDEVINFO_TEXTURING;
#endif /* DIRECT3D_VERSION >= 0x0700 */
#endif //(DIRECT3D_VERSION < 0x0800)
#pragma pack()
#endif /* _D3DCAPS_H_ */

File diff suppressed because it is too large Load Diff

View File

@@ -1,45 +0,0 @@
///////////////////////////////////////////////////////////////////////////
//
// Copyright (C) Microsoft Corporation. All Rights Reserved.
//
// File: d3dx8.h
// Content: D3DX utility library
//
///////////////////////////////////////////////////////////////////////////
#ifndef __D3DX8_H__
#define __D3DX8_H__
#include "d3d8.h"
#include <limits.h>
#ifndef D3DXINLINE
#ifdef _MSC_VER
#if (_MSC_VER >= 1200)
#define D3DXINLINE __forceinline
#else
#define D3DXINLINE __inline
#endif
#else
#ifdef __cplusplus
#define D3DXINLINE inline
#else
#define D3DXINLINE
#endif
#endif
#endif
#define D3DX_DEFAULT ULONG_MAX
#define D3DX_DEFAULT_FLOAT FLT_MAX
#include "d3dx8math.h"
#include "d3dx8core.h"
#include "d3dx8tex.h"
#include "d3dx8mesh.h"
#include "d3dx8shape.h"
#include "d3dx8effect.h"
#endif //__D3DX8_H__

View File

@@ -1,563 +0,0 @@
///////////////////////////////////////////////////////////////////////////
//
// Copyright (C) Microsoft Corporation. All Rights Reserved.
//
// File: d3dx8core.h
// Content: D3DX core types and functions
//
///////////////////////////////////////////////////////////////////////////
#include "d3dx8.h"
#ifndef __D3DX8CORE_H__
#define __D3DX8CORE_H__
///////////////////////////////////////////////////////////////////////////
// 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.
///////////////////////////////////////////////////////////////////////////
typedef interface ID3DXBuffer ID3DXBuffer;
typedef interface ID3DXBuffer *LPD3DXBUFFER;
// {932E6A7E-C68E-45dd-A7BF-53D19C86DB1F}
DEFINE_GUID(IID_ID3DXBuffer,
0x932e6a7e, 0xc68e, 0x45dd, 0xa7, 0xbf, 0x53, 0xd1, 0x9c, 0x86, 0xdb, 0x1f);
#undef INTERFACE
#define INTERFACE ID3DXBuffer
DECLARE_INTERFACE_(ID3DXBuffer, IUnknown)
{
// IUnknown
STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE;
STDMETHOD_(ULONG, AddRef)(THIS) PURE;
STDMETHOD_(ULONG, Release)(THIS) PURE;
// ID3DXBuffer
STDMETHOD_(LPVOID, GetBufferPointer)(THIS) PURE;
STDMETHOD_(DWORD, GetBufferSize)(THIS) PURE;
};
///////////////////////////////////////////////////////////////////////////
// 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().
//
///////////////////////////////////////////////////////////////////////////
typedef interface ID3DXFont ID3DXFont;
typedef interface ID3DXFont *LPD3DXFONT;
// {89FAD6A5-024D-49af-8FE7-F51123B85E25}
DEFINE_GUID( IID_ID3DXFont,
0x89fad6a5, 0x24d, 0x49af, 0x8f, 0xe7, 0xf5, 0x11, 0x23, 0xb8, 0x5e, 0x25);
#undef INTERFACE
#define INTERFACE ID3DXFont
DECLARE_INTERFACE_(ID3DXFont, IUnknown)
{
// IUnknown
STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE;
STDMETHOD_(ULONG, AddRef)(THIS) PURE;
STDMETHOD_(ULONG, Release)(THIS) PURE;
// ID3DXFont
STDMETHOD(GetDevice)(THIS_ LPDIRECT3DDEVICE8* ppDevice) PURE;
STDMETHOD(GetLogFont)(THIS_ LOGFONT* pLogFont) PURE;
STDMETHOD(Begin)(THIS) PURE;
STDMETHOD_(INT, DrawTextA)(THIS_ LPCSTR pString, INT Count, LPRECT pRect, DWORD Format, D3DCOLOR Color) PURE;
STDMETHOD_(INT, DrawTextW)(THIS_ LPCWSTR pString, INT Count, LPRECT pRect, DWORD Format, D3DCOLOR Color) PURE;
STDMETHOD(End)(THIS) PURE;
STDMETHOD(OnLostDevice)(THIS) PURE;
STDMETHOD(OnResetDevice)(THIS) PURE;
};
#ifndef DrawText
#ifdef UNICODE
#define DrawText DrawTextW
#else
#define DrawText DrawTextA
#endif
#endif
#ifdef __cplusplus
extern "C" {
#endif //__cplusplus
HRESULT WINAPI
D3DXCreateFont(
LPDIRECT3DDEVICE8 pDevice,
HFONT hFont,
LPD3DXFONT* ppFont);
HRESULT WINAPI
D3DXCreateFontIndirect(
LPDIRECT3DDEVICE8 pDevice,
CONST LOGFONT* pLogFont,
LPD3DXFONT* ppFont);
#ifdef __cplusplus
}
#endif //__cplusplus
///////////////////////////////////////////////////////////////////////////
// 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().
///////////////////////////////////////////////////////////////////////////
typedef interface ID3DXSprite ID3DXSprite;
typedef interface ID3DXSprite *LPD3DXSPRITE;
// {13D69D15-F9B0-4e0f-B39E-C91EB33F6CE7}
DEFINE_GUID( IID_ID3DXSprite,
0x13d69d15, 0xf9b0, 0x4e0f, 0xb3, 0x9e, 0xc9, 0x1e, 0xb3, 0x3f, 0x6c, 0xe7);
#undef INTERFACE
#define INTERFACE ID3DXSprite
DECLARE_INTERFACE_(ID3DXSprite, IUnknown)
{
// IUnknown
STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE;
STDMETHOD_(ULONG, AddRef)(THIS) PURE;
STDMETHOD_(ULONG, Release)(THIS) PURE;
// ID3DXSprite
STDMETHOD(GetDevice)(THIS_ LPDIRECT3DDEVICE8* ppDevice) PURE;
STDMETHOD(Begin)(THIS) PURE;
STDMETHOD(Draw)(THIS_ LPDIRECT3DTEXTURE8 pSrcTexture,
CONST RECT* pSrcRect, CONST D3DXVECTOR2* pScaling,
CONST D3DXVECTOR2* pRotationCenter, FLOAT Rotation,
CONST D3DXVECTOR2* pTranslation, D3DCOLOR Color) PURE;
STDMETHOD(DrawTransform)(THIS_ LPDIRECT3DTEXTURE8 pSrcTexture,
CONST RECT* pSrcRect, CONST D3DXMATRIX* pTransform,
D3DCOLOR Color) PURE;
STDMETHOD(End)(THIS) PURE;
STDMETHOD(OnLostDevice)(THIS) PURE;
STDMETHOD(OnResetDevice)(THIS) PURE;
};
#ifdef __cplusplus
extern "C" {
#endif //__cplusplus
HRESULT WINAPI
D3DXCreateSprite(
LPDIRECT3DDEVICE8 pDevice,
LPD3DXSPRITE* ppSprite);
#ifdef __cplusplus
}
#endif //__cplusplus
///////////////////////////////////////////////////////////////////////////
// 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().
///////////////////////////////////////////////////////////////////////////
typedef struct _D3DXRTS_DESC
{
UINT Width;
UINT Height;
D3DFORMAT Format;
BOOL DepthStencil;
D3DFORMAT DepthStencilFormat;
} D3DXRTS_DESC;
typedef interface ID3DXRenderToSurface ID3DXRenderToSurface;
typedef interface ID3DXRenderToSurface *LPD3DXRENDERTOSURFACE;
// {82DF5B90-E34E-496e-AC1C-62117A6A5913}
DEFINE_GUID( IID_ID3DXRenderToSurface,
0x82df5b90, 0xe34e, 0x496e, 0xac, 0x1c, 0x62, 0x11, 0x7a, 0x6a, 0x59, 0x13);
#undef INTERFACE
#define INTERFACE ID3DXRenderToSurface
DECLARE_INTERFACE_(ID3DXRenderToSurface, IUnknown)
{
// IUnknown
STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE;
STDMETHOD_(ULONG, AddRef)(THIS) PURE;
STDMETHOD_(ULONG, Release)(THIS) PURE;
// ID3DXRenderToSurface
STDMETHOD(GetDevice)(THIS_ LPDIRECT3DDEVICE8* ppDevice) PURE;
STDMETHOD(GetDesc)(THIS_ D3DXRTS_DESC* pDesc) PURE;
STDMETHOD(BeginScene)(THIS_ LPDIRECT3DSURFACE8 pSurface, CONST D3DVIEWPORT8* pViewport) PURE;
STDMETHOD(EndScene)(THIS) PURE;
STDMETHOD(OnLostDevice)(THIS) PURE;
STDMETHOD(OnResetDevice)(THIS) PURE;
};
#ifdef __cplusplus
extern "C" {
#endif //__cplusplus
HRESULT WINAPI
D3DXCreateRenderToSurface(
LPDIRECT3DDEVICE8 pDevice,
UINT Width,
UINT Height,
D3DFORMAT Format,
BOOL DepthStencil,
D3DFORMAT DepthStencilFormat,
LPD3DXRENDERTOSURFACE* ppRenderToSurface);
#ifdef __cplusplus
}
#endif //__cplusplus
///////////////////////////////////////////////////////////////////////////
// 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().
///////////////////////////////////////////////////////////////////////////
typedef struct _D3DXRTE_DESC
{
UINT Size;
D3DFORMAT Format;
BOOL DepthStencil;
D3DFORMAT DepthStencilFormat;
} D3DXRTE_DESC;
typedef interface ID3DXRenderToEnvMap ID3DXRenderToEnvMap;
typedef interface ID3DXRenderToEnvMap *LPD3DXRenderToEnvMap;
// {4E42C623-9451-44b7-8C86-ABCCDE5D52C8}
DEFINE_GUID( IID_ID3DXRenderToEnvMap,
0x4e42c623, 0x9451, 0x44b7, 0x8c, 0x86, 0xab, 0xcc, 0xde, 0x5d, 0x52, 0xc8);
#undef INTERFACE
#define INTERFACE ID3DXRenderToEnvMap
DECLARE_INTERFACE_(ID3DXRenderToEnvMap, IUnknown)
{
// IUnknown
STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE;
STDMETHOD_(ULONG, AddRef)(THIS) PURE;
STDMETHOD_(ULONG, Release)(THIS) PURE;
// ID3DXRenderToEnvMap
STDMETHOD(GetDevice)(THIS_ LPDIRECT3DDEVICE8* ppDevice) PURE;
STDMETHOD(GetDesc)(THIS_ D3DXRTE_DESC* pDesc) PURE;
STDMETHOD(BeginCube)(THIS_
LPDIRECT3DCUBETEXTURE8 pCubeTex) PURE;
STDMETHOD(BeginSphere)(THIS_
LPDIRECT3DTEXTURE8 pTex) PURE;
STDMETHOD(BeginHemisphere)(THIS_
LPDIRECT3DTEXTURE8 pTexZPos,
LPDIRECT3DTEXTURE8 pTexZNeg) PURE;
STDMETHOD(BeginParabolic)(THIS_
LPDIRECT3DTEXTURE8 pTexZPos,
LPDIRECT3DTEXTURE8 pTexZNeg) PURE;
STDMETHOD(Face)(THIS_ D3DCUBEMAP_FACES Face) PURE;
STDMETHOD(End)(THIS) PURE;
STDMETHOD(OnLostDevice)(THIS) PURE;
STDMETHOD(OnResetDevice)(THIS) PURE;
};
#ifdef __cplusplus
extern "C" {
#endif //__cplusplus
HRESULT WINAPI
D3DXCreateRenderToEnvMap(
LPDIRECT3DDEVICE8 pDevice,
UINT Size,
D3DFORMAT Format,
BOOL DepthStencil,
D3DFORMAT DepthStencilFormat,
LPD3DXRenderToEnvMap* ppRenderToEnvMap);
#ifdef __cplusplus
}
#endif //__cplusplus
///////////////////////////////////////////////////////////////////////////
// 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.)
//-------------------------------------------------------------------------
#define D3DXASM_DEBUG (1 << 0)
#define D3DXASM_SKIPVALIDATION (1 << 1)
#ifdef __cplusplus
extern "C" {
#endif //__cplusplus
//-------------------------------------------------------------------------
// D3DXAssembleShader:
// -------------------
// Assembles an ascii description of a vertex or pixel shader into
// binary form.
//
// Parameters:
// pSrcFile
// Source file name
// hSrcModule
// Module handle. if NULL, current module will be used.
// pSrcResource
// Resource name in module
// pSrcData
// Pointer to source code
// SrcDataLen
// Size of source code, in bytes
// Flags
// D3DXASM_xxx flags
// ppConstants
// Returns an ID3DXBuffer object containing constant declarations.
// ppCompiledShader
// Returns an ID3DXBuffer object containing the object code.
// ppCompilationErrors
// Returns an ID3DXBuffer object containing ascii error messages
//-------------------------------------------------------------------------
HRESULT WINAPI
D3DXAssembleShaderFromFileA(
LPCSTR pSrcFile,
DWORD Flags,
LPD3DXBUFFER* ppConstants,
LPD3DXBUFFER* ppCompiledShader,
LPD3DXBUFFER* ppCompilationErrors);
HRESULT WINAPI
D3DXAssembleShaderFromFileW(
LPCWSTR pSrcFile,
DWORD Flags,
LPD3DXBUFFER* ppConstants,
LPD3DXBUFFER* ppCompiledShader,
LPD3DXBUFFER* ppCompilationErrors);
#ifdef UNICODE
#define D3DXAssembleShaderFromFile D3DXAssembleShaderFromFileW
#else
#define D3DXAssembleShaderFromFile D3DXAssembleShaderFromFileA
#endif
HRESULT WINAPI
D3DXAssembleShaderFromResourceA(
HMODULE hSrcModule,
LPCSTR pSrcResource,
DWORD Flags,
LPD3DXBUFFER* ppConstants,
LPD3DXBUFFER* ppCompiledShader,
LPD3DXBUFFER* ppCompilationErrors);
HRESULT WINAPI
D3DXAssembleShaderFromResourceW(
HMODULE hSrcModule,
LPCWSTR pSrcResource,
DWORD Flags,
LPD3DXBUFFER* ppConstants,
LPD3DXBUFFER* ppCompiledShader,
LPD3DXBUFFER* ppCompilationErrors);
#ifdef UNICODE
#define D3DXAssembleShaderFromResource D3DXAssembleShaderFromResourceW
#else
#define D3DXAssembleShaderFromResource D3DXAssembleShaderFromResourceA
#endif
HRESULT WINAPI
D3DXAssembleShader(
LPCVOID pSrcData,
UINT SrcDataLen,
DWORD Flags,
LPD3DXBUFFER* ppConstants,
LPD3DXBUFFER* ppCompiledShader,
LPD3DXBUFFER* ppCompilationErrors);
#ifdef __cplusplus
}
#endif //__cplusplus
///////////////////////////////////////////////////////////////////////////
// Misc APIs:
///////////////////////////////////////////////////////////////////////////
#ifdef __cplusplus
extern "C" {
#endif //__cplusplus
//-------------------------------------------------------------------------
// 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.
//-------------------------------------------------------------------------
HRESULT WINAPI
D3DXGetErrorStringA(
HRESULT hr,
LPSTR pBuffer,
UINT BufferLen);
HRESULT WINAPI
D3DXGetErrorStringW(
HRESULT hr,
LPWSTR pBuffer,
UINT BufferLen);
#ifdef UNICODE
#define D3DXGetErrorString D3DXGetErrorStringW
#else
#define D3DXGetErrorString D3DXGetErrorStringA
#endif
#ifdef __cplusplus
}
#endif //__cplusplus
#endif //__D3DX8CORE_H__

View File

@@ -1,226 +0,0 @@
///////////////////////////////////////////////////////////////////////////
//
// Copyright (C) Microsoft Corporation. All Rights Reserved.
//
// File: d3dx8effect.h
// Content: D3DX effect types and functions
//
///////////////////////////////////////////////////////////////////////////
#include "d3dx8.h"
#ifndef __D3DX8EFFECT_H__
#define __D3DX8EFFECT_H__
#define D3DXFX_DONOTSAVESTATE (1 << 0)
typedef enum _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,
D3DXPT_STRING = 8,
D3DXPT_FORCE_DWORD = 0x7fffffff /* force 32-bit size enum */
} D3DXPARAMETERTYPE;
typedef struct _D3DXEFFECT_DESC
{
UINT Parameters;
UINT Techniques;
} D3DXEFFECT_DESC;
typedef struct _D3DXPARAMETER_DESC
{
LPCSTR Name;
LPCSTR Index;
D3DXPARAMETERTYPE Type;
} D3DXPARAMETER_DESC;
typedef struct _D3DXTECHNIQUE_DESC
{
LPCSTR Name;
LPCSTR Index;
UINT Passes;
} D3DXTECHNIQUE_DESC;
typedef struct _D3DXPASS_DESC
{
LPCSTR Name;
LPCSTR Index;
} D3DXPASS_DESC;
//////////////////////////////////////////////////////////////////////////////
// ID3DXEffect ///////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
typedef interface ID3DXEffect ID3DXEffect;
typedef interface ID3DXEffect *LPD3DXEFFECT;
// {648B1CEB-8D4E-4d66-B6FA-E44969E82E89}
DEFINE_GUID( IID_ID3DXEffect,
0x648b1ceb, 0x8d4e, 0x4d66, 0xb6, 0xfa, 0xe4, 0x49, 0x69, 0xe8, 0x2e, 0x89);
#undef INTERFACE
#define INTERFACE ID3DXEffect
DECLARE_INTERFACE_(ID3DXEffect, IUnknown)
{
// IUnknown
STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE;
STDMETHOD_(ULONG, AddRef)(THIS) PURE;
STDMETHOD_(ULONG, Release)(THIS) PURE;
// ID3DXEffect
STDMETHOD(GetDevice)(THIS_ LPDIRECT3DDEVICE8* ppDevice) PURE;
STDMETHOD(GetDesc)(THIS_ D3DXEFFECT_DESC* pDesc) PURE;
STDMETHOD(GetParameterDesc)(THIS_ LPCSTR pParameter, D3DXPARAMETER_DESC* pDesc) PURE;
STDMETHOD(GetTechniqueDesc)(THIS_ LPCSTR pTechnique, D3DXTECHNIQUE_DESC* pDesc) PURE;
STDMETHOD(GetPassDesc)(THIS_ LPCSTR pTechnique, LPCSTR pPass, D3DXPASS_DESC* pDesc) PURE;
STDMETHOD(FindNextValidTechnique)(THIS_ LPCSTR pTechnique, D3DXTECHNIQUE_DESC* pDesc) PURE;
STDMETHOD(CloneEffect)(THIS_ LPDIRECT3DDEVICE8 pDevice, LPD3DXEFFECT* ppEffect) PURE;
STDMETHOD(GetCompiledEffect)(THIS_ LPD3DXBUFFER* ppCompiledEffect) PURE;
STDMETHOD(SetTechnique)(THIS_ LPCSTR pTechnique) PURE;
STDMETHOD(GetTechnique)(THIS_ LPCSTR* ppTechnique) PURE;
STDMETHOD(SetDword)(THIS_ LPCSTR pParameter, DWORD dw) PURE;
STDMETHOD(GetDword)(THIS_ LPCSTR pParameter, DWORD* pdw) PURE;
STDMETHOD(SetFloat)(THIS_ LPCSTR pParameter, FLOAT f) PURE;
STDMETHOD(GetFloat)(THIS_ LPCSTR pParameter, FLOAT* pf) PURE;
STDMETHOD(SetVector)(THIS_ LPCSTR pParameter, CONST D3DXVECTOR4* pVector) PURE;
STDMETHOD(GetVector)(THIS_ LPCSTR pParameter, D3DXVECTOR4* pVector) PURE;
STDMETHOD(SetMatrix)(THIS_ LPCSTR pParameter, CONST D3DXMATRIX* pMatrix) PURE;
STDMETHOD(GetMatrix)(THIS_ LPCSTR pParameter, D3DXMATRIX* pMatrix) PURE;
STDMETHOD(SetTexture)(THIS_ LPCSTR pParameter, LPDIRECT3DBASETEXTURE8 pTexture) PURE;
STDMETHOD(GetTexture)(THIS_ LPCSTR pParameter, LPDIRECT3DBASETEXTURE8 *ppTexture) PURE;
STDMETHOD(SetVertexShader)(THIS_ LPCSTR pParameter, DWORD Handle) PURE;
STDMETHOD(GetVertexShader)(THIS_ LPCSTR pParameter, DWORD* pHandle) PURE;
STDMETHOD(SetPixelShader)(THIS_ LPCSTR pParameter, DWORD Handle) PURE;
STDMETHOD(GetPixelShader)(THIS_ LPCSTR pParameter, DWORD* pHandle) PURE;
STDMETHOD(SetString)(THIS_ LPCSTR pParameter, LPCSTR pString) PURE;
STDMETHOD(GetString)(THIS_ LPCSTR pParameter, LPCSTR* ppString) PURE;
STDMETHOD_(BOOL, IsParameterUsed)(THIS_ LPCSTR pParameter) PURE;
STDMETHOD(Validate)(THIS) PURE;
STDMETHOD(Begin)(THIS_ UINT *pPasses, DWORD Flags) PURE;
STDMETHOD(Pass)(THIS_ UINT Pass) PURE;
STDMETHOD(End)(THIS) PURE;
STDMETHOD(OnLostDevice)(THIS) PURE;
STDMETHOD(OnResetDevice)(THIS) PURE;
};
//////////////////////////////////////////////////////////////////////////////
// APIs //////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
#ifdef __cplusplus
extern "C" {
#endif //__cplusplus
//----------------------------------------------------------------------------
// D3DXCreateEffect:
// -----------------
// Creates an effect from an ascii or binaray effect description.
//
// Parameters:
// pDevice
// Pointer of the device on which to create the effect
// pSrcFile
// Name of the file containing the effect description
// hSrcModule
// Module handle. if NULL, current module will be used.
// pSrcResource
// Resource name in module
// pSrcData
// Pointer to effect description
// SrcDataSize
// Size of the effect description in bytes
// ppEffect
// Returns a buffer containing created effect.
// ppCompilationErrors
// Returns a buffer containing any error messages which occurred during
// compile. Or NULL if you do not care about the error messages.
//
//----------------------------------------------------------------------------
HRESULT WINAPI
D3DXCreateEffectFromFileA(
LPDIRECT3DDEVICE8 pDevice,
LPCSTR pSrcFile,
LPD3DXEFFECT* ppEffect,
LPD3DXBUFFER* ppCompilationErrors);
HRESULT WINAPI
D3DXCreateEffectFromFileW(
LPDIRECT3DDEVICE8 pDevice,
LPCWSTR pSrcFile,
LPD3DXEFFECT* ppEffect,
LPD3DXBUFFER* ppCompilationErrors);
#ifdef UNICODE
#define D3DXCreateEffectFromFile D3DXCreateEffectFromFileW
#else
#define D3DXCreateEffectFromFile D3DXCreateEffectFromFileA
#endif
HRESULT WINAPI
D3DXCreateEffectFromResourceA(
LPDIRECT3DDEVICE8 pDevice,
HMODULE hSrcModule,
LPCSTR pSrcResource,
LPD3DXEFFECT* ppEffect,
LPD3DXBUFFER* ppCompilationErrors);
HRESULT WINAPI
D3DXCreateEffectFromResourceW(
LPDIRECT3DDEVICE8 pDevice,
HMODULE hSrcModule,
LPCWSTR pSrcResource,
LPD3DXEFFECT* ppEffect,
LPD3DXBUFFER* ppCompilationErrors);
#ifdef UNICODE
#define D3DXCreateEffectFromResource D3DXCreateEffectFromResourceW
#else
#define D3DXCreateEffectFromResource D3DXCreateEffectFromResourceA
#endif
HRESULT WINAPI
D3DXCreateEffect(
LPDIRECT3DDEVICE8 pDevice,
LPCVOID pSrcData,
UINT SrcDataSize,
LPD3DXEFFECT* ppEffect,
LPD3DXBUFFER* ppCompilationErrors);
#ifdef __cplusplus
}
#endif //__cplusplus
#endif //__D3DX8EFFECT_H__

View File

@@ -1,760 +0,0 @@
//////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) Microsoft Corporation. All Rights Reserved.
//
// File: d3dx8mesh.h
// Content: D3DX mesh types and functions
//
//////////////////////////////////////////////////////////////////////////////
#include "d3dx8.h"
#ifndef __D3DX8MESH_H__
#define __D3DX8MESH_H__
#include "dxfile.h" // defines LPDIRECTXFILEDATA
// {2A835771-BF4D-43f4-8E14-82A809F17D8A}
DEFINE_GUID(IID_ID3DXBaseMesh,
0x2a835771, 0xbf4d, 0x43f4, 0x8e, 0x14, 0x82, 0xa8, 0x9, 0xf1, 0x7d, 0x8a);
// {CCAE5C3B-4DD1-4d0f-997E-4684CA64557F}
DEFINE_GUID(IID_ID3DXMesh,
0xccae5c3b, 0x4dd1, 0x4d0f, 0x99, 0x7e, 0x46, 0x84, 0xca, 0x64, 0x55, 0x7f);
// {19FBE386-C282-4659-97BD-CB869B084A6C}
DEFINE_GUID(IID_ID3DXPMesh,
0x19fbe386, 0xc282, 0x4659, 0x97, 0xbd, 0xcb, 0x86, 0x9b, 0x8, 0x4a, 0x6c);
// {4E3CA05C-D4FF-4d11-8A02-16459E08F6F4}
DEFINE_GUID(IID_ID3DXSPMesh,
0x4e3ca05c, 0xd4ff, 0x4d11, 0x8a, 0x2, 0x16, 0x45, 0x9e, 0x8, 0xf6, 0xf4);
// {8DB06ECC-EBFC-408a-9404-3074B4773515}
DEFINE_GUID(IID_ID3DXSkinMesh,
0x8db06ecc, 0xebfc, 0x408a, 0x94, 0x4, 0x30, 0x74, 0xb4, 0x77, 0x35, 0x15);
// Mesh options - lower 3 bytes only, upper byte used by _D3DXMESHOPT option flags
enum _D3DXMESH {
D3DXMESH_32BIT = 0x001, // If set, then use 32 bit indices, if not set use 16 bit indices.
D3DXMESH_DONOTCLIP = 0x002, // Use D3DUSAGE_DONOTCLIP for VB & IB.
D3DXMESH_POINTS = 0x004, // Use D3DUSAGE_POINTS for VB & IB.
D3DXMESH_RTPATCHES = 0x008, // Use D3DUSAGE_RTPATCHES for VB & IB.
D3DXMESH_NPATCHES = 0x4000,// Use D3DUSAGE_NPATCHES for VB & IB.
D3DXMESH_VB_SYSTEMMEM = 0x010, // Use D3DPOOL_SYSTEMMEM for VB. Overrides D3DXMESH_MANAGEDVERTEXBUFFER
D3DXMESH_VB_MANAGED = 0x020, // Use D3DPOOL_MANAGED for VB.
D3DXMESH_VB_WRITEONLY = 0x040, // Use D3DUSAGE_WRITEONLY for VB.
D3DXMESH_VB_DYNAMIC = 0x080, // Use D3DUSAGE_DYNAMIC for VB.
D3DXMESH_VB_SOFTWAREPROCESSING = 0x8000, // Use D3DUSAGE_SOFTWAREPROCESSING for VB.
D3DXMESH_IB_SYSTEMMEM = 0x100, // Use D3DPOOL_SYSTEMMEM for IB. Overrides D3DXMESH_MANAGEDINDEXBUFFER
D3DXMESH_IB_MANAGED = 0x200, // Use D3DPOOL_MANAGED for IB.
D3DXMESH_IB_WRITEONLY = 0x400, // Use D3DUSAGE_WRITEONLY for IB.
D3DXMESH_IB_DYNAMIC = 0x800, // Use D3DUSAGE_DYNAMIC for IB.
D3DXMESH_IB_SOFTWAREPROCESSING= 0x10000, // Use D3DUSAGE_SOFTWAREPROCESSING for IB.
D3DXMESH_VB_SHARE = 0x1000, // Valid for Clone* calls only, forces cloned mesh/pmesh to share vertex buffer
D3DXMESH_USEHWONLY = 0x2000, // Valid for ID3DXSkinMesh::ConvertToBlendedMesh
// Helper options
D3DXMESH_SYSTEMMEM = 0x110, // D3DXMESH_VB_SYSTEMMEM | D3DXMESH_IB_SYSTEMMEM
D3DXMESH_MANAGED = 0x220, // D3DXMESH_VB_MANAGED | D3DXMESH_IB_MANAGED
D3DXMESH_WRITEONLY = 0x440, // D3DXMESH_VB_WRITEONLY | D3DXMESH_IB_WRITEONLY
D3DXMESH_DYNAMIC = 0x880, // D3DXMESH_VB_DYNAMIC | D3DXMESH_IB_DYNAMIC
D3DXMESH_SOFTWAREPROCESSING = 0x18000, // D3DXMESH_VB_SOFTWAREPROCESSING | D3DXMESH_IB_SOFTWAREPROCESSING
};
// option field values for specifying min value in D3DXGeneratePMesh and D3DXSimplifyMesh
enum _D3DXMESHSIMP
{
D3DXMESHSIMP_VERTEX = 0x1,
D3DXMESHSIMP_FACE = 0x2,
};
enum _MAX_FVF_DECL_SIZE
{
MAX_FVF_DECL_SIZE = 20
};
typedef struct ID3DXBaseMesh *LPD3DXBASEMESH;
typedef struct ID3DXMesh *LPD3DXMESH;
typedef struct ID3DXPMesh *LPD3DXPMESH;
typedef struct ID3DXSPMesh *LPD3DXSPMESH;
typedef struct ID3DXSkinMesh *LPD3DXSKINMESH;
typedef struct _D3DXATTRIBUTERANGE
{
DWORD AttribId;
DWORD FaceStart;
DWORD FaceCount;
DWORD VertexStart;
DWORD VertexCount;
} D3DXATTRIBUTERANGE;
typedef D3DXATTRIBUTERANGE* LPD3DXATTRIBUTERANGE;
#ifdef __cplusplus
extern "C" {
#endif //__cplusplus
struct D3DXMATERIAL
{
D3DMATERIAL8 MatD3D;
LPSTR pTextureFilename;
};
typedef struct D3DXMATERIAL *LPD3DXMATERIAL;
#ifdef __cplusplus
}
#endif //__cplusplus
typedef struct _D3DXATTRIBUTEWEIGHTS
{
FLOAT Position;
FLOAT Boundary;
FLOAT Normal;
FLOAT Diffuse;
FLOAT Specular;
FLOAT Tex[8];
} D3DXATTRIBUTEWEIGHTS;
typedef D3DXATTRIBUTEWEIGHTS* LPD3DXATTRIBUTEWEIGHTS;
enum _D3DXWELDEPSILONSFLAGS
{
D3DXWELDEPSILONS_WELDALL = 0x1, // weld all vertices marked by adjacency as being overlapping
D3DXWELDEPSILONS_WELDPARTIALMATCHES = 0x2, // if a given vertex component is within epsilon, modify partial matched
// vertices so that both components identical AND if all components "equal"
// remove one of the vertices
D3DXWELDEPSILONS_DONOTREMOVEVERTICES = 0x4, // instructs weld to only allow modifications to vertices and not removal
// ONLY valid if D3DXWELDEPSILONS_WELDPARTIALMATCHES is set
// useful to modify vertices to be equal, but not allow vertices to be removed
};
typedef struct _D3DXWELDEPSILONS
{
FLOAT SkinWeights;
FLOAT Normal;
FLOAT Tex[8];
DWORD Flags;
} D3DXWELDEPSILONS;
typedef D3DXWELDEPSILONS* LPD3DXWELDEPSILONS;
#undef INTERFACE
#define INTERFACE ID3DXBaseMesh
DECLARE_INTERFACE_(ID3DXBaseMesh, IUnknown)
{
// IUnknown
STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE;
STDMETHOD_(ULONG, AddRef)(THIS) PURE;
STDMETHOD_(ULONG, Release)(THIS) PURE;
// ID3DXBaseMesh
STDMETHOD(DrawSubset)(THIS_ DWORD AttribId) PURE;
STDMETHOD_(DWORD, GetNumFaces)(THIS) PURE;
STDMETHOD_(DWORD, GetNumVertices)(THIS) PURE;
STDMETHOD_(DWORD, GetFVF)(THIS) PURE;
STDMETHOD(GetDeclaration)(THIS_ DWORD Declaration[MAX_FVF_DECL_SIZE]) PURE;
STDMETHOD_(DWORD, GetOptions)(THIS) PURE;
STDMETHOD(GetDevice)(THIS_ LPDIRECT3DDEVICE8* ppDevice) PURE;
STDMETHOD(CloneMeshFVF)(THIS_ DWORD Options,
DWORD FVF, LPDIRECT3DDEVICE8 pD3DDevice, LPD3DXMESH* ppCloneMesh) PURE;
STDMETHOD(CloneMesh)(THIS_ DWORD Options,
CONST DWORD *pDeclaration, LPDIRECT3DDEVICE8 pD3DDevice, LPD3DXMESH* ppCloneMesh) PURE;
STDMETHOD(GetVertexBuffer)(THIS_ LPDIRECT3DVERTEXBUFFER8* ppVB) PURE;
STDMETHOD(GetIndexBuffer)(THIS_ LPDIRECT3DINDEXBUFFER8* ppIB) PURE;
STDMETHOD(LockVertexBuffer)(THIS_ DWORD Flags, BYTE** ppData) PURE;
STDMETHOD(UnlockVertexBuffer)(THIS) PURE;
STDMETHOD(LockIndexBuffer)(THIS_ DWORD Flags, BYTE** ppData) PURE;
STDMETHOD(UnlockIndexBuffer)(THIS) PURE;
STDMETHOD(GetAttributeTable)(
THIS_ D3DXATTRIBUTERANGE *pAttribTable, DWORD* pAttribTableSize) PURE;
STDMETHOD(ConvertPointRepsToAdjacency)(THIS_ CONST DWORD* pPRep, DWORD* pAdjacency) PURE;
STDMETHOD(ConvertAdjacencyToPointReps)(THIS_ CONST DWORD* pAdjacency, DWORD* pPRep) PURE;
STDMETHOD(GenerateAdjacency)(THIS_ FLOAT Epsilon, DWORD* pAdjacency) PURE;
};
#undef INTERFACE
#define INTERFACE ID3DXMesh
DECLARE_INTERFACE_(ID3DXMesh, ID3DXBaseMesh)
{
// IUnknown
STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE;
STDMETHOD_(ULONG, AddRef)(THIS) PURE;
STDMETHOD_(ULONG, Release)(THIS) PURE;
// ID3DXBaseMesh
STDMETHOD(DrawSubset)(THIS_ DWORD AttribId) PURE;
STDMETHOD_(DWORD, GetNumFaces)(THIS) PURE;
STDMETHOD_(DWORD, GetNumVertices)(THIS) PURE;
STDMETHOD_(DWORD, GetFVF)(THIS) PURE;
STDMETHOD(GetDeclaration)(THIS_ DWORD Declaration[MAX_FVF_DECL_SIZE]) PURE;
STDMETHOD_(DWORD, GetOptions)(THIS) PURE;
STDMETHOD(GetDevice)(THIS_ LPDIRECT3DDEVICE8* ppDevice) PURE;
STDMETHOD(CloneMeshFVF)(THIS_ DWORD Options,
DWORD FVF, LPDIRECT3DDEVICE8 pD3DDevice, LPD3DXMESH* ppCloneMesh) PURE;
STDMETHOD(CloneMesh)(THIS_ DWORD Options,
CONST DWORD *pDeclaration, LPDIRECT3DDEVICE8 pD3DDevice, LPD3DXMESH* ppCloneMesh) PURE;
STDMETHOD(GetVertexBuffer)(THIS_ LPDIRECT3DVERTEXBUFFER8* ppVB) PURE;
STDMETHOD(GetIndexBuffer)(THIS_ LPDIRECT3DINDEXBUFFER8* ppIB) PURE;
STDMETHOD(LockVertexBuffer)(THIS_ DWORD Flags, BYTE** ppData) PURE;
STDMETHOD(UnlockVertexBuffer)(THIS) PURE;
STDMETHOD(LockIndexBuffer)(THIS_ DWORD Flags, BYTE** ppData) PURE;
STDMETHOD(UnlockIndexBuffer)(THIS) PURE;
STDMETHOD(GetAttributeTable)(
THIS_ D3DXATTRIBUTERANGE *pAttribTable, DWORD* pAttribTableSize) PURE;
STDMETHOD(ConvertPointRepsToAdjacency)(THIS_ CONST DWORD* pPRep, DWORD* pAdjacency) PURE;
STDMETHOD(ConvertAdjacencyToPointReps)(THIS_ CONST DWORD* pAdjacency, DWORD* pPRep) PURE;
STDMETHOD(GenerateAdjacency)(THIS_ FLOAT Epsilon, DWORD* pAdjacency) PURE;
// ID3DXMesh
STDMETHOD(LockAttributeBuffer)(THIS_ DWORD Flags, DWORD** ppData) PURE;
STDMETHOD(UnlockAttributeBuffer)(THIS) PURE;
STDMETHOD(Optimize)(THIS_ DWORD Flags, CONST DWORD* pAdjacencyIn, DWORD* pAdjacencyOut,
DWORD* pFaceRemap, LPD3DXBUFFER *ppVertexRemap,
LPD3DXMESH* ppOptMesh) PURE;
STDMETHOD(OptimizeInplace)(THIS_ DWORD Flags, CONST DWORD* pAdjacencyIn, DWORD* pAdjacencyOut,
DWORD* pFaceRemap, LPD3DXBUFFER *ppVertexRemap) PURE;
};
#undef INTERFACE
#define INTERFACE ID3DXPMesh
DECLARE_INTERFACE_(ID3DXPMesh, ID3DXBaseMesh)
{
// IUnknown
STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE;
STDMETHOD_(ULONG, AddRef)(THIS) PURE;
STDMETHOD_(ULONG, Release)(THIS) PURE;
// ID3DXBaseMesh
STDMETHOD(DrawSubset)(THIS_ DWORD AttribId) PURE;
STDMETHOD_(DWORD, GetNumFaces)(THIS) PURE;
STDMETHOD_(DWORD, GetNumVertices)(THIS) PURE;
STDMETHOD_(DWORD, GetFVF)(THIS) PURE;
STDMETHOD(GetDeclaration)(THIS_ DWORD Declaration[MAX_FVF_DECL_SIZE]) PURE;
STDMETHOD_(DWORD, GetOptions)(THIS) PURE;
STDMETHOD(GetDevice)(THIS_ LPDIRECT3DDEVICE8* ppDevice) PURE;
STDMETHOD(CloneMeshFVF)(THIS_ DWORD Options,
DWORD FVF, LPDIRECT3DDEVICE8 pD3DDevice, LPD3DXMESH* ppCloneMesh) PURE;
STDMETHOD(CloneMesh)(THIS_ DWORD Options,
CONST DWORD *pDeclaration, LPDIRECT3DDEVICE8 pD3DDevice, LPD3DXMESH* ppCloneMesh) PURE;
STDMETHOD(GetVertexBuffer)(THIS_ LPDIRECT3DVERTEXBUFFER8* ppVB) PURE;
STDMETHOD(GetIndexBuffer)(THIS_ LPDIRECT3DINDEXBUFFER8* ppIB) PURE;
STDMETHOD(LockVertexBuffer)(THIS_ DWORD Flags, BYTE** ppData) PURE;
STDMETHOD(UnlockVertexBuffer)(THIS) PURE;
STDMETHOD(LockIndexBuffer)(THIS_ DWORD Flags, BYTE** ppData) PURE;
STDMETHOD(UnlockIndexBuffer)(THIS) PURE;
STDMETHOD(GetAttributeTable)(
THIS_ D3DXATTRIBUTERANGE *pAttribTable, DWORD* pAttribTableSize) PURE;
STDMETHOD(ConvertPointRepsToAdjacency)(THIS_ CONST DWORD* pPRep, DWORD* pAdjacency) PURE;
STDMETHOD(ConvertAdjacencyToPointReps)(THIS_ CONST DWORD* pAdjacency, DWORD* pPRep) PURE;
STDMETHOD(GenerateAdjacency)(THIS_ FLOAT Epsilon, DWORD* pAdjacency) PURE;
// ID3DXPMesh
STDMETHOD(ClonePMeshFVF)(THIS_ DWORD Options,
DWORD FVF, LPDIRECT3DDEVICE8 pD3D, LPD3DXPMESH* ppCloneMesh) PURE;
STDMETHOD(ClonePMesh)(THIS_ DWORD Options,
CONST DWORD *pDeclaration, LPDIRECT3DDEVICE8 pD3D, LPD3DXPMESH* ppCloneMesh) PURE;
STDMETHOD(SetNumFaces)(THIS_ DWORD Faces) PURE;
STDMETHOD(SetNumVertices)(THIS_ DWORD Vertices) PURE;
STDMETHOD_(DWORD, GetMaxFaces)(THIS) PURE;
STDMETHOD_(DWORD, GetMinFaces)(THIS) PURE;
STDMETHOD_(DWORD, GetMaxVertices)(THIS) PURE;
STDMETHOD_(DWORD, GetMinVertices)(THIS) PURE;
STDMETHOD(Save)(THIS_ IStream *pStream, LPD3DXMATERIAL pMaterials, DWORD NumMaterials) PURE;
STDMETHOD(Optimize)(THIS_ DWORD Flags, DWORD* pAdjacencyOut,
DWORD* pFaceRemap, LPD3DXBUFFER *ppVertexRemap,
LPD3DXMESH* ppOptMesh) PURE;
STDMETHOD(OptimizeBaseLOD)(THIS_ DWORD Flags, DWORD* pFaceRemap) PURE;
STDMETHOD(TrimByFaces)(THIS_ DWORD NewFacesMin, DWORD NewFacesMax, DWORD *rgiFaceRemap, DWORD *rgiVertRemap) PURE;
STDMETHOD(TrimByVertices)(THIS_ DWORD NewVerticesMin, DWORD NewVerticesMax, DWORD *rgiFaceRemap, DWORD *rgiVertRemap) PURE;
STDMETHOD(GetAdjacency)(THIS_ DWORD* pAdjacency) PURE;
};
#undef INTERFACE
#define INTERFACE ID3DXSPMesh
DECLARE_INTERFACE_(ID3DXSPMesh, IUnknown)
{
// IUnknown
STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE;
STDMETHOD_(ULONG, AddRef)(THIS) PURE;
STDMETHOD_(ULONG, Release)(THIS) PURE;
// ID3DXSPMesh
STDMETHOD_(DWORD, GetNumFaces)(THIS) PURE;
STDMETHOD_(DWORD, GetNumVertices)(THIS) PURE;
STDMETHOD_(DWORD, GetFVF)(THIS) PURE;
STDMETHOD(GetDeclaration)(THIS_ DWORD Declaration[MAX_FVF_DECL_SIZE]) PURE;
STDMETHOD_(DWORD, GetOptions)(THIS) PURE;
STDMETHOD(GetDevice)(THIS_ LPDIRECT3DDEVICE8* ppDevice) PURE;
STDMETHOD(CloneMeshFVF)(THIS_ DWORD Options,
DWORD FVF, LPDIRECT3DDEVICE8 pD3D, DWORD *pAdjacencyOut, DWORD *pVertexRemapOut, LPD3DXMESH* ppCloneMesh) PURE;
STDMETHOD(CloneMesh)(THIS_ DWORD Options,
CONST DWORD *pDeclaration, LPDIRECT3DDEVICE8 pD3DDevice, DWORD *pAdjacencyOut, DWORD *pVertexRemapOut, LPD3DXMESH* ppCloneMesh) PURE;
STDMETHOD(ClonePMeshFVF)(THIS_ DWORD Options,
DWORD FVF, LPDIRECT3DDEVICE8 pD3D, DWORD *pVertexRemapOut, LPD3DXPMESH* ppCloneMesh) PURE;
STDMETHOD(ClonePMesh)(THIS_ DWORD Options,
CONST DWORD *pDeclaration, LPDIRECT3DDEVICE8 pD3D, DWORD *pVertexRemapOut, LPD3DXPMESH* ppCloneMesh) PURE;
STDMETHOD(ReduceFaces)(THIS_ DWORD Faces) PURE;
STDMETHOD(ReduceVertices)(THIS_ DWORD Vertices) PURE;
STDMETHOD_(DWORD, GetMaxFaces)(THIS) PURE;
STDMETHOD_(DWORD, GetMaxVertices)(THIS) PURE;
STDMETHOD(GetVertexAttributeWeights)(THIS_ LPD3DXATTRIBUTEWEIGHTS pVertexAttributeWeights) PURE;
STDMETHOD(GetVertexWeights)(THIS_ FLOAT *pVertexWeights) PURE;
};
#define UNUSED16 (0xffff)
#define UNUSED32 (0xffffffff)
// ID3DXMesh::Optimize options - upper byte only, lower 3 bytes used from _D3DXMESH option flags
enum _D3DXMESHOPT {
D3DXMESHOPT_COMPACT = 0x01000000,
D3DXMESHOPT_ATTRSORT = 0x02000000,
D3DXMESHOPT_VERTEXCACHE = 0x04000000,
D3DXMESHOPT_STRIPREORDER = 0x08000000,
D3DXMESHOPT_IGNOREVERTS = 0x10000000, // optimize faces only, don't touch vertices
D3DXMESHOPT_SHAREVB = 0x1000, // same as D3DXMESH_VB_SHARE
};
// Subset of the mesh that has the same attribute and bone combination.
// This subset can be rendered in a single draw call
typedef struct _D3DXBONECOMBINATION
{
DWORD AttribId;
DWORD FaceStart;
DWORD FaceCount;
DWORD VertexStart;
DWORD VertexCount;
DWORD* BoneId;
} D3DXBONECOMBINATION, *LPD3DXBONECOMBINATION;
#undef INTERFACE
#define INTERFACE ID3DXSkinMesh
DECLARE_INTERFACE_(ID3DXSkinMesh, IUnknown)
{
// IUnknown
STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE;
STDMETHOD_(ULONG, AddRef)(THIS) PURE;
STDMETHOD_(ULONG, Release)(THIS) PURE;
// ID3DXMesh
STDMETHOD_(DWORD, GetNumFaces)(THIS) PURE;
STDMETHOD_(DWORD, GetNumVertices)(THIS) PURE;
STDMETHOD_(DWORD, GetFVF)(THIS) PURE;
STDMETHOD(GetDeclaration)(THIS_ DWORD Declaration[MAX_FVF_DECL_SIZE]) PURE;
STDMETHOD_(DWORD, GetOptions)(THIS) PURE;
STDMETHOD(GetDevice)(THIS_ LPDIRECT3DDEVICE8* ppDevice) PURE;
STDMETHOD(GetVertexBuffer)(THIS_ LPDIRECT3DVERTEXBUFFER8* ppVB) PURE;
STDMETHOD(GetIndexBuffer)(THIS_ LPDIRECT3DINDEXBUFFER8* ppIB) PURE;
STDMETHOD(LockVertexBuffer)(THIS_ DWORD flags, BYTE** ppData) PURE;
STDMETHOD(UnlockVertexBuffer)(THIS) PURE;
STDMETHOD(LockIndexBuffer)(THIS_ DWORD flags, BYTE** ppData) PURE;
STDMETHOD(UnlockIndexBuffer)(THIS) PURE;
STDMETHOD(LockAttributeBuffer)(THIS_ DWORD flags, DWORD** ppData) PURE;
STDMETHOD(UnlockAttributeBuffer)(THIS) PURE;
// ID3DXSkinMesh
STDMETHOD_(DWORD, GetNumBones)(THIS) PURE;
STDMETHOD(GetOriginalMesh)(THIS_ LPD3DXMESH* ppMesh) PURE;
STDMETHOD(SetBoneInfluence)(THIS_ DWORD bone, DWORD numInfluences, CONST DWORD* vertices, CONST FLOAT* weights) PURE;
STDMETHOD_(DWORD, GetNumBoneInfluences)(THIS_ DWORD bone) PURE;
STDMETHOD(GetBoneInfluence)(THIS_ DWORD bone, DWORD* vertices, FLOAT* weights) PURE;
STDMETHOD(GetMaxVertexInfluences)(THIS_ DWORD* maxVertexInfluences) PURE;
STDMETHOD(GetMaxFaceInfluences)(THIS_ DWORD* maxFaceInfluences) PURE;
STDMETHOD(ConvertToBlendedMesh)(THIS_ DWORD Options,
CONST LPDWORD pAdjacencyIn,
LPDWORD pAdjacencyOut,
DWORD* pNumBoneCombinations,
LPD3DXBUFFER* ppBoneCombinationTable,
DWORD* pFaceRemap,
LPD3DXBUFFER *ppVertexRemap,
LPD3DXMESH* ppMesh) PURE;
STDMETHOD(ConvertToIndexedBlendedMesh)(THIS_ DWORD Options,
CONST LPDWORD pAdjacencyIn,
DWORD paletteSize,
LPDWORD pAdjacencyOut,
DWORD* pNumBoneCombinations,
LPD3DXBUFFER* ppBoneCombinationTable,
DWORD* pFaceRemap,
LPD3DXBUFFER *ppVertexRemap,
LPD3DXMESH* ppMesh) PURE;
STDMETHOD(GenerateSkinnedMesh)(THIS_ DWORD Options,
FLOAT minWeight,
CONST LPDWORD pAdjacencyIn,
LPDWORD pAdjacencyOut,
DWORD* pFaceRemap,
LPD3DXBUFFER *ppVertexRemap,
LPD3DXMESH* ppMesh) PURE;
STDMETHOD(UpdateSkinnedMesh)(THIS_ CONST D3DXMATRIX* pBoneTransforms, CONST D3DXMATRIX* pBoneInvTransforms, LPD3DXMESH pMesh) PURE;
};
#ifdef __cplusplus
extern "C" {
#endif //__cplusplus
HRESULT WINAPI
D3DXCreateMesh(
DWORD NumFaces,
DWORD NumVertices,
DWORD Options,
CONST DWORD *pDeclaration,
LPDIRECT3DDEVICE8 pD3D,
LPD3DXMESH* ppMesh);
HRESULT WINAPI
D3DXCreateMeshFVF(
DWORD NumFaces,
DWORD NumVertices,
DWORD Options,
DWORD FVF,
LPDIRECT3DDEVICE8 pD3D,
LPD3DXMESH* ppMesh);
HRESULT WINAPI
D3DXCreateSPMesh(
LPD3DXMESH pMesh,
CONST DWORD* pAdjacency,
CONST LPD3DXATTRIBUTEWEIGHTS pVertexAttributeWeights,
CONST FLOAT *pVertexWeights,
LPD3DXSPMESH* ppSMesh);
// clean a mesh up for simplification, try to make manifold
HRESULT WINAPI
D3DXCleanMesh(
LPD3DXMESH pMeshIn,
CONST DWORD* pAdjacencyIn,
LPD3DXMESH* ppMeshOut,
DWORD* pAdjacencyOut,
LPD3DXBUFFER* ppErrorsAndWarnings);
HRESULT WINAPI
D3DXValidMesh(
LPD3DXMESH pMeshIn,
CONST DWORD* pAdjacency,
LPD3DXBUFFER* ppErrorsAndWarnings);
HRESULT WINAPI
D3DXGeneratePMesh(
LPD3DXMESH pMesh,
CONST DWORD* pAdjacency,
CONST LPD3DXATTRIBUTEWEIGHTS pVertexAttributeWeights,
CONST FLOAT *pVertexWeights,
DWORD MinValue,
DWORD Options,
LPD3DXPMESH* ppPMesh);
HRESULT WINAPI
D3DXSimplifyMesh(
LPD3DXMESH pMesh,
CONST DWORD* pAdjacency,
CONST LPD3DXATTRIBUTEWEIGHTS pVertexAttributeWeights,
CONST FLOAT *pVertexWeights,
DWORD MinValue,
DWORD Options,
LPD3DXMESH* ppMesh);
HRESULT WINAPI
D3DXComputeBoundingSphere(
PVOID pPointsFVF,
DWORD NumVertices,
DWORD FVF,
D3DXVECTOR3 *pCenter,
FLOAT *pRadius);
HRESULT WINAPI
D3DXComputeBoundingBox(
PVOID pPointsFVF,
DWORD NumVertices,
DWORD FVF,
D3DXVECTOR3 *pMin,
D3DXVECTOR3 *pMax);
HRESULT WINAPI
D3DXComputeNormals(
LPD3DXBASEMESH pMesh,
CONST DWORD *pAdjacency);
HRESULT WINAPI
D3DXCreateBuffer(
DWORD NumBytes,
LPD3DXBUFFER *ppBuffer);
HRESULT WINAPI
D3DXLoadMeshFromX(
LPSTR pFilename,
DWORD Options,
LPDIRECT3DDEVICE8 pD3D,
LPD3DXBUFFER *ppAdjacency,
LPD3DXBUFFER *ppMaterials,
DWORD *pNumMaterials,
LPD3DXMESH *ppMesh);
HRESULT WINAPI
D3DXLoadMeshFromXInMemory(
PBYTE Memory,
DWORD SizeOfMemory,
DWORD Options,
LPDIRECT3DDEVICE8 pD3D,
LPD3DXBUFFER *ppAdjacency,
LPD3DXBUFFER *ppMaterials,
DWORD *pNumMaterials,
LPD3DXMESH *ppMesh);
HRESULT WINAPI
D3DXLoadMeshFromXResource(
HMODULE Module,
LPCTSTR Name,
LPCTSTR Type,
DWORD Options,
LPDIRECT3DDEVICE8 pD3D,
LPD3DXBUFFER *ppAdjacency,
LPD3DXBUFFER *ppMaterials,
DWORD *pNumMaterials,
LPD3DXMESH *ppMesh);
HRESULT WINAPI
D3DXSaveMeshToX(
LPSTR pFilename,
LPD3DXMESH pMesh,
CONST DWORD* pAdjacency,
CONST LPD3DXMATERIAL pMaterials,
DWORD NumMaterials,
DWORD Format
);
HRESULT WINAPI
D3DXCreatePMeshFromStream(
IStream *pStream,
DWORD Options,
LPDIRECT3DDEVICE8 pD3DDevice,
LPD3DXBUFFER *ppMaterials,
DWORD* pNumMaterials,
LPD3DXPMESH *ppPMesh);
HRESULT WINAPI
D3DXCreateSkinMesh(
DWORD NumFaces,
DWORD NumVertices,
DWORD NumBones,
DWORD Options,
CONST DWORD *pDeclaration,
LPDIRECT3DDEVICE8 pD3D,
LPD3DXSKINMESH* ppSkinMesh);
HRESULT WINAPI
D3DXCreateSkinMeshFVF(
DWORD NumFaces,
DWORD NumVertices,
DWORD NumBones,
DWORD Options,
DWORD FVF,
LPDIRECT3DDEVICE8 pD3D,
LPD3DXSKINMESH* ppSkinMesh);
HRESULT WINAPI
D3DXCreateSkinMeshFromMesh(
LPD3DXMESH pMesh,
DWORD numBones,
LPD3DXSKINMESH* ppSkinMesh);
HRESULT WINAPI
D3DXLoadMeshFromXof(
LPDIRECTXFILEDATA pXofObjMesh,
DWORD Options,
LPDIRECT3DDEVICE8 pD3DDevice,
LPD3DXBUFFER *ppAdjacency,
LPD3DXBUFFER *ppMaterials,
DWORD *pNumMaterials,
LPD3DXMESH *ppMesh);
HRESULT WINAPI
D3DXLoadSkinMeshFromXof(
LPDIRECTXFILEDATA pxofobjMesh,
DWORD Options,
LPDIRECT3DDEVICE8 pD3D,
LPD3DXBUFFER* ppAdjacency,
LPD3DXBUFFER* ppMaterials,
DWORD *pMatOut,
LPD3DXBUFFER* ppBoneNames,
LPD3DXBUFFER* ppBoneTransforms,
LPD3DXSKINMESH* ppMesh);
HRESULT WINAPI
D3DXTessellateNPatches(
LPD3DXMESH pMeshIn,
CONST DWORD* pAdjacencyIn,
FLOAT NumSegs,
BOOL QuadraticInterpNormals, // if false use linear intrep for normals, if true use quadratic
LPD3DXMESH *ppMeshOut,
LPD3DXBUFFER *ppAdjacencyOut);
UINT WINAPI
D3DXGetFVFVertexSize(DWORD FVF);
HRESULT WINAPI
D3DXDeclaratorFromFVF(
DWORD FVF,
DWORD Declaration[MAX_FVF_DECL_SIZE]);
HRESULT WINAPI
D3DXFVFFromDeclarator(
CONST DWORD *pDeclarator,
DWORD *pFVF);
HRESULT WINAPI
D3DXWeldVertices(
CONST LPD3DXMESH pMesh,
LPD3DXWELDEPSILONS pEpsilons,
CONST DWORD *pAdjacencyIn,
DWORD *pAdjacencyOut,
DWORD* pFaceRemap,
LPD3DXBUFFER *ppVertexRemap);
typedef struct _D3DXINTERSECTINFO
{
DWORD FaceIndex; // index of face intersected
FLOAT U; // Barycentric Hit Coordinates
FLOAT V; // Barycentric Hit Coordinates
FLOAT Dist; // Ray-Intersection Parameter Distance
} D3DXINTERSECTINFO, *LPD3DXINTERSECTINFO;
HRESULT WINAPI
D3DXIntersect(
LPD3DXBASEMESH pMesh,
CONST D3DXVECTOR3 *pRayPos,
CONST D3DXVECTOR3 *pRayDir,
BOOL *pHit, // True if any faces were intersected
DWORD *pFaceIndex, // index of closest face intersected
FLOAT *pU, // Barycentric Hit Coordinates
FLOAT *pV, // Barycentric Hit Coordinates
FLOAT *pDist, // Ray-Intersection Parameter Distance
LPD3DXBUFFER *ppAllHits, // Array of D3DXINTERSECTINFOs for all hits (not just closest)
DWORD *pCountOfHits); // Number of entries in AllHits array
HRESULT WINAPI
D3DXIntersectSubset(
LPD3DXBASEMESH pMesh,
DWORD AttribId,
CONST D3DXVECTOR3 *pRayPos,
CONST D3DXVECTOR3 *pRayDir,
BOOL *pHit, // True if any faces were intersected
DWORD *pFaceIndex, // index of closest face intersected
FLOAT *pU, // Barycentric Hit Coordinates
FLOAT *pV, // Barycentric Hit Coordinates
FLOAT *pDist, // Ray-Intersection Parameter Distance
LPD3DXBUFFER *ppAllHits, // Array of D3DXINTERSECTINFOs for all hits (not just closest)
DWORD *pCountOfHits); // Number of entries in AllHits array
HRESULT WINAPI D3DXSplitMesh
(
CONST LPD3DXMESH pMeshIn,
CONST DWORD *pAdjacencyIn,
CONST DWORD MaxSize,
CONST DWORD Options,
DWORD *pMeshesOut,
LPD3DXBUFFER *ppMeshArrayOut,
LPD3DXBUFFER *ppAdjacencyArrayOut,
LPD3DXBUFFER *ppFaceRemapArrayOut,
LPD3DXBUFFER *ppVertRemapArrayOut
);
BOOL D3DXIntersectTri
(
CONST D3DXVECTOR3 *p0, // Triangle vertex 0 position
CONST D3DXVECTOR3 *p1, // Triangle vertex 1 position
CONST D3DXVECTOR3 *p2, // Triangle vertex 2 position
CONST D3DXVECTOR3 *pRayPos, // Ray origin
CONST D3DXVECTOR3 *pRayDir, // Ray direction
FLOAT *pU, // Barycentric Hit Coordinates
FLOAT *pV, // Barycentric Hit Coordinates
FLOAT *pDist); // Ray-Intersection Parameter Distance
BOOL WINAPI
D3DXSphereBoundProbe(
CONST D3DXVECTOR3 *pCenter,
FLOAT Radius,
CONST D3DXVECTOR3 *pRayPosition,
CONST D3DXVECTOR3 *pRayDirection);
BOOL WINAPI
D3DXBoxBoundProbe(
CONST D3DXVECTOR3 *pMin,
CONST D3DXVECTOR3 *pMax,
CONST D3DXVECTOR3 *pRayPosition,
CONST D3DXVECTOR3 *pRayDirection);
enum _D3DXERR {
D3DXERR_CANNOTMODIFYINDEXBUFFER = MAKE_DDHRESULT(2900),
D3DXERR_INVALIDMESH = MAKE_DDHRESULT(2901),
D3DXERR_CANNOTATTRSORT = MAKE_DDHRESULT(2902),
D3DXERR_SKINNINGNOTSUPPORTED = MAKE_DDHRESULT(2903),
D3DXERR_TOOMANYINFLUENCES = MAKE_DDHRESULT(2904),
D3DXERR_INVALIDDATA = MAKE_DDHRESULT(2905),
D3DXERR_LOADEDMESHASNODATA = MAKE_DDHRESULT(2906),
};
#define D3DX_COMP_TANGENT_NONE 0xFFFFFFFF
HRESULT WINAPI D3DXComputeTangent(LPD3DXMESH InMesh,
DWORD TexStage,
LPD3DXMESH OutMesh,
DWORD TexStageUVec,
DWORD TexStageVVec,
DWORD Wrap,
DWORD *Adjacency);
HRESULT WINAPI
D3DXConvertMeshSubsetToSingleStrip
(
LPD3DXBASEMESH MeshIn,
DWORD AttribId,
DWORD IBOptions,
LPDIRECT3DINDEXBUFFER8 *ppIndexBuffer,
DWORD *pNumIndices
);
HRESULT WINAPI
D3DXConvertMeshSubsetToStrips
(
LPD3DXBASEMESH MeshIn,
DWORD AttribId,
DWORD IBOptions,
LPDIRECT3DINDEXBUFFER8 *ppIndexBuffer,
DWORD *pNumIndices,
LPD3DXBUFFER *ppStripLengths,
DWORD *pNumStrips
);
#ifdef __cplusplus
}
#endif //__cplusplus
#endif //__D3DX8MESH_H__

78
extern/include/d3dx9.h vendored Normal file
View File

@@ -0,0 +1,78 @@
//////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) Microsoft Corporation. All Rights Reserved.
//
// File: d3dx9.h
// Content: D3DX utility library
//
//////////////////////////////////////////////////////////////////////////////
#ifdef __D3DX_INTERNAL__
#error Incorrect D3DX header used
#endif
#ifndef __D3DX9_H__
#define __D3DX9_H__
// Defines
#include <limits.h>
#define D3DX_DEFAULT ((UINT) -1)
#define D3DX_DEFAULT_NONPOW2 ((UINT) -2)
#define D3DX_DEFAULT_FLOAT FLT_MAX
#define D3DX_FROM_FILE ((UINT) -3)
#define D3DFMT_FROM_FILE ((D3DFORMAT) -3)
#ifndef D3DXINLINE
#ifdef _MSC_VER
#if (_MSC_VER >= 1200)
#define D3DXINLINE __forceinline
#else
#define D3DXINLINE __inline
#endif
#else
#ifdef __cplusplus
#define D3DXINLINE inline
#else
#define D3DXINLINE
#endif
#endif
#endif
// Includes
#include "d3d9.h"
#include "d3dx9math.h"
#include "d3dx9core.h"
#include "d3dx9xof.h"
#include "d3dx9mesh.h"
#include "d3dx9shader.h"
#include "d3dx9effect.h"
#include "d3dx9tex.h"
#include "d3dx9shape.h"
#include "d3dx9anim.h"
// Errors
#define _FACDD 0x876
#define MAKE_DDHRESULT( code ) MAKE_HRESULT( 1, _FACDD, code )
enum _D3DXERR {
D3DXERR_CANNOTMODIFYINDEXBUFFER = MAKE_DDHRESULT(2900),
D3DXERR_INVALIDMESH = MAKE_DDHRESULT(2901),
D3DXERR_CANNOTATTRSORT = MAKE_DDHRESULT(2902),
D3DXERR_SKINNINGNOTSUPPORTED = MAKE_DDHRESULT(2903),
D3DXERR_TOOMANYINFLUENCES = MAKE_DDHRESULT(2904),
D3DXERR_INVALIDDATA = MAKE_DDHRESULT(2905),
D3DXERR_LOADEDMESHASNODATA = MAKE_DDHRESULT(2906),
D3DXERR_DUPLICATENAMEDFRAGMENT = MAKE_DDHRESULT(2907),
D3DXERR_CANNOTREMOVELASTITEM = MAKE_DDHRESULT(2908),
};
#endif //__D3DX9_H__

1114
extern/include/d3dx9anim.h vendored Normal file

File diff suppressed because it is too large Load Diff

753
extern/include/d3dx9core.h vendored Normal file
View File

@@ -0,0 +1,753 @@
///////////////////////////////////////////////////////////////////////////
//
// Copyright (C) Microsoft Corporation. All Rights Reserved.
//
// File: d3dx9core.h
// Content: D3DX core types and functions
//
///////////////////////////////////////////////////////////////////////////
#include "d3dx9.h"
#ifndef __D3DX9CORE_H__
#define __D3DX9CORE_H__
///////////////////////////////////////////////////////////////////////////
// D3DX_SDK_VERSION:
// -----------------
// This identifier is passed to D3DXCheckVersion in order to ensure that an
// application was built against the correct header files and lib files.
// This number is incremented whenever a header (or other) change would
// require applications to be rebuilt. If the version doesn't match,
// D3DXCheckVersion will return FALSE. (The number itself has no meaning.)
///////////////////////////////////////////////////////////////////////////
#define D3DX_VERSION 0x0902
#define D3DX_SDK_VERSION 43
#ifdef __cplusplus
extern "C" {
#endif //__cplusplus
BOOL WINAPI
D3DXCheckVersion(UINT D3DSdkVersion, UINT D3DXSdkVersion);
#ifdef __cplusplus
}
#endif //__cplusplus
///////////////////////////////////////////////////////////////////////////
// D3DXDebugMute
// Mutes D3DX and D3D debug spew (TRUE - mute, FALSE - not mute)
//
// returns previous mute value
//
///////////////////////////////////////////////////////////////////////////
#ifdef __cplusplus
extern "C" {
#endif //__cplusplus
BOOL WINAPI
D3DXDebugMute(BOOL Mute);
#ifdef __cplusplus
}
#endif //__cplusplus
///////////////////////////////////////////////////////////////////////////
// D3DXGetDriverLevel:
// Returns driver version information:
//
// 700 - DX7 level driver
// 800 - DX8 level driver
// 900 - DX9 level driver
///////////////////////////////////////////////////////////////////////////
#ifdef __cplusplus
extern "C" {
#endif //__cplusplus
UINT WINAPI
D3DXGetDriverLevel(LPDIRECT3DDEVICE9 pDevice);
#ifdef __cplusplus
}
#endif //__cplusplus
///////////////////////////////////////////////////////////////////////////
// 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.
///////////////////////////////////////////////////////////////////////////
typedef interface ID3DXBuffer ID3DXBuffer;
typedef interface ID3DXBuffer *LPD3DXBUFFER;
// {8BA5FB08-5195-40e2-AC58-0D989C3A0102}
DEFINE_GUID(IID_ID3DXBuffer,
0x8ba5fb08, 0x5195, 0x40e2, 0xac, 0x58, 0xd, 0x98, 0x9c, 0x3a, 0x1, 0x2);
#undef INTERFACE
#define INTERFACE ID3DXBuffer
DECLARE_INTERFACE_(ID3DXBuffer, IUnknown)
{
// IUnknown
STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE;
STDMETHOD_(ULONG, AddRef)(THIS) PURE;
STDMETHOD_(ULONG, Release)(THIS) PURE;
// ID3DXBuffer
STDMETHOD_(LPVOID, GetBufferPointer)(THIS) PURE;
STDMETHOD_(DWORD, GetBufferSize)(THIS) PURE;
};
//////////////////////////////////////////////////////////////////////////////
// D3DXSPRITE flags:
// -----------------
// D3DXSPRITE_DONOTSAVESTATE
// Specifies device state is not to be saved and restored in Begin/End.
// D3DXSPRITE_DONOTMODIFY_RENDERSTATE
// Specifies device render state is not to be changed in Begin. The device
// is assumed to be in a valid state to draw vertices containing POSITION0,
// TEXCOORD0, and COLOR0 data.
// D3DXSPRITE_OBJECTSPACE
// The WORLD, VIEW, and PROJECTION transforms are NOT modified. The
// transforms currently set to the device are used to transform the sprites
// when the batch is drawn (at Flush or End). If this is not specified,
// WORLD, VIEW, and PROJECTION transforms are modified so that sprites are
// drawn in screenspace coordinates.
// D3DXSPRITE_BILLBOARD
// Rotates each sprite about its center so that it is facing the viewer.
// D3DXSPRITE_ALPHABLEND
// Enables ALPHABLEND(SRCALPHA, INVSRCALPHA) and ALPHATEST(alpha > 0).
// ID3DXFont expects this to be set when drawing text.
// D3DXSPRITE_SORT_TEXTURE
// Sprites are sorted by texture prior to drawing. This is recommended when
// drawing non-overlapping sprites of uniform depth. For example, drawing
// screen-aligned text with ID3DXFont.
// D3DXSPRITE_SORT_DEPTH_FRONTTOBACK
// Sprites are sorted by depth front-to-back prior to drawing. This is
// recommended when drawing opaque sprites of varying depths.
// D3DXSPRITE_SORT_DEPTH_BACKTOFRONT
// Sprites are sorted by depth back-to-front prior to drawing. This is
// recommended when drawing transparent sprites of varying depths.
// D3DXSPRITE_DO_NOT_ADDREF_TEXTURE
// Disables calling AddRef() on every draw, and Release() on Flush() for
// better performance.
//////////////////////////////////////////////////////////////////////////////
#define D3DXSPRITE_DONOTSAVESTATE (1 << 0)
#define D3DXSPRITE_DONOTMODIFY_RENDERSTATE (1 << 1)
#define D3DXSPRITE_OBJECTSPACE (1 << 2)
#define D3DXSPRITE_BILLBOARD (1 << 3)
#define D3DXSPRITE_ALPHABLEND (1 << 4)
#define D3DXSPRITE_SORT_TEXTURE (1 << 5)
#define D3DXSPRITE_SORT_DEPTH_FRONTTOBACK (1 << 6)
#define D3DXSPRITE_SORT_DEPTH_BACKTOFRONT (1 << 7)
#define D3DXSPRITE_DO_NOT_ADDREF_TEXTURE (1 << 8)
//////////////////////////////////////////////////////////////////////////////
// ID3DXSprite:
// ------------
// This object intends to provide an easy way to drawing sprites using D3D.
//
// Begin -
// Prepares device for drawing sprites.
//
// Draw -
// Draws a sprite. Before transformation, the sprite is the size of
// SrcRect, with its top-left corner specified by Position. The color
// and alpha channels are modulated by Color.
//
// Flush -
// Forces all batched sprites to submitted to the device.
//
// 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().
//////////////////////////////////////////////////////////////////////////////
typedef interface ID3DXSprite ID3DXSprite;
typedef interface ID3DXSprite *LPD3DXSPRITE;
// {BA0B762D-7D28-43ec-B9DC-2F84443B0614}
DEFINE_GUID(IID_ID3DXSprite,
0xba0b762d, 0x7d28, 0x43ec, 0xb9, 0xdc, 0x2f, 0x84, 0x44, 0x3b, 0x6, 0x14);
#undef INTERFACE
#define INTERFACE ID3DXSprite
DECLARE_INTERFACE_(ID3DXSprite, IUnknown)
{
// IUnknown
STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE;
STDMETHOD_(ULONG, AddRef)(THIS) PURE;
STDMETHOD_(ULONG, Release)(THIS) PURE;
// ID3DXSprite
STDMETHOD(GetDevice)(THIS_ LPDIRECT3DDEVICE9* ppDevice) PURE;
STDMETHOD(GetTransform)(THIS_ D3DXMATRIX *pTransform) PURE;
STDMETHOD(SetTransform)(THIS_ CONST D3DXMATRIX *pTransform) PURE;
STDMETHOD(SetWorldViewRH)(THIS_ CONST D3DXMATRIX *pWorld, CONST D3DXMATRIX *pView) PURE;
STDMETHOD(SetWorldViewLH)(THIS_ CONST D3DXMATRIX *pWorld, CONST D3DXMATRIX *pView) PURE;
STDMETHOD(Begin)(THIS_ DWORD Flags) PURE;
STDMETHOD(Draw)(THIS_ LPDIRECT3DTEXTURE9 pTexture, CONST RECT *pSrcRect, CONST D3DXVECTOR3 *pCenter, CONST D3DXVECTOR3 *pPosition, D3DCOLOR Color) PURE;
STDMETHOD(Flush)(THIS) PURE;
STDMETHOD(End)(THIS) PURE;
STDMETHOD(OnLostDevice)(THIS) PURE;
STDMETHOD(OnResetDevice)(THIS) PURE;
};
#ifdef __cplusplus
extern "C" {
#endif //__cplusplus
HRESULT WINAPI
D3DXCreateSprite(
LPDIRECT3DDEVICE9 pDevice,
LPD3DXSPRITE* ppSprite);
#ifdef __cplusplus
}
#endif //__cplusplus
//////////////////////////////////////////////////////////////////////////////
// ID3DXFont:
// ----------
// Font objects contain the textures and resources needed to render a specific
// font on a specific device.
//
// GetGlyphData -
// Returns glyph cache data, for a given glyph.
//
// PreloadCharacters/PreloadGlyphs/PreloadText -
// Preloads glyphs into the glyph cache textures.
//
// 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.
// If pSprite is NULL, an internal sprite object will be used.
//
// 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().
//////////////////////////////////////////////////////////////////////////////
typedef struct _D3DXFONT_DESCA
{
INT Height;
UINT Width;
UINT Weight;
UINT MipLevels;
BOOL Italic;
BYTE CharSet;
BYTE OutputPrecision;
BYTE Quality;
BYTE PitchAndFamily;
CHAR FaceName[LF_FACESIZE];
} D3DXFONT_DESCA, *LPD3DXFONT_DESCA;
typedef struct _D3DXFONT_DESCW
{
INT Height;
UINT Width;
UINT Weight;
UINT MipLevels;
BOOL Italic;
BYTE CharSet;
BYTE OutputPrecision;
BYTE Quality;
BYTE PitchAndFamily;
WCHAR FaceName[LF_FACESIZE];
} D3DXFONT_DESCW, *LPD3DXFONT_DESCW;
#ifdef UNICODE
typedef D3DXFONT_DESCW D3DXFONT_DESC;
typedef LPD3DXFONT_DESCW LPD3DXFONT_DESC;
#else
typedef D3DXFONT_DESCA D3DXFONT_DESC;
typedef LPD3DXFONT_DESCA LPD3DXFONT_DESC;
#endif
typedef interface ID3DXFont ID3DXFont;
typedef interface ID3DXFont *LPD3DXFONT;
// {D79DBB70-5F21-4d36-BBC2-FF525C213CDC}
DEFINE_GUID(IID_ID3DXFont,
0xd79dbb70, 0x5f21, 0x4d36, 0xbb, 0xc2, 0xff, 0x52, 0x5c, 0x21, 0x3c, 0xdc);
#undef INTERFACE
#define INTERFACE ID3DXFont
DECLARE_INTERFACE_(ID3DXFont, IUnknown)
{
// IUnknown
STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE;
STDMETHOD_(ULONG, AddRef)(THIS) PURE;
STDMETHOD_(ULONG, Release)(THIS) PURE;
// ID3DXFont
STDMETHOD(GetDevice)(THIS_ LPDIRECT3DDEVICE9 *ppDevice) PURE;
STDMETHOD(GetDescA)(THIS_ D3DXFONT_DESCA *pDesc) PURE;
STDMETHOD(GetDescW)(THIS_ D3DXFONT_DESCW *pDesc) PURE;
STDMETHOD_(BOOL, GetTextMetricsA)(THIS_ TEXTMETRICA *pTextMetrics) PURE;
STDMETHOD_(BOOL, GetTextMetricsW)(THIS_ TEXTMETRICW *pTextMetrics) PURE;
STDMETHOD_(HDC, GetDC)(THIS) PURE;
STDMETHOD(GetGlyphData)(THIS_ UINT Glyph, LPDIRECT3DTEXTURE9 *ppTexture, RECT *pBlackBox, POINT *pCellInc) PURE;
STDMETHOD(PreloadCharacters)(THIS_ UINT First, UINT Last) PURE;
STDMETHOD(PreloadGlyphs)(THIS_ UINT First, UINT Last) PURE;
STDMETHOD(PreloadTextA)(THIS_ LPCSTR pString, INT Count) PURE;
STDMETHOD(PreloadTextW)(THIS_ LPCWSTR pString, INT Count) PURE;
STDMETHOD_(INT, DrawTextA)(THIS_ LPD3DXSPRITE pSprite, LPCSTR pString, INT Count, LPRECT pRect, DWORD Format, D3DCOLOR Color) PURE;
STDMETHOD_(INT, DrawTextW)(THIS_ LPD3DXSPRITE pSprite, LPCWSTR pString, INT Count, LPRECT pRect, DWORD Format, D3DCOLOR Color) PURE;
STDMETHOD(OnLostDevice)(THIS) PURE;
STDMETHOD(OnResetDevice)(THIS) PURE;
#ifdef __cplusplus
#ifdef UNICODE
HRESULT GetDesc(D3DXFONT_DESCW *pDesc) { return GetDescW(pDesc); }
HRESULT PreloadText(LPCWSTR pString, INT Count) { return PreloadTextW(pString, Count); }
#else
HRESULT GetDesc(D3DXFONT_DESCA *pDesc) { return GetDescA(pDesc); }
HRESULT PreloadText(LPCSTR pString, INT Count) { return PreloadTextA(pString, Count); }
#endif
#endif //__cplusplus
};
#ifndef GetTextMetrics
#ifdef UNICODE
#define GetTextMetrics GetTextMetricsW
#else
#define GetTextMetrics GetTextMetricsA
#endif
#endif
#ifndef DrawText
#ifdef UNICODE
#define DrawText DrawTextW
#else
#define DrawText DrawTextA
#endif
#endif
#ifdef __cplusplus
extern "C" {
#endif //__cplusplus
HRESULT WINAPI
D3DXCreateFontA(
LPDIRECT3DDEVICE9 pDevice,
INT Height,
UINT Width,
UINT Weight,
UINT MipLevels,
BOOL Italic,
DWORD CharSet,
DWORD OutputPrecision,
DWORD Quality,
DWORD PitchAndFamily,
LPCSTR pFaceName,
LPD3DXFONT* ppFont);
HRESULT WINAPI
D3DXCreateFontW(
LPDIRECT3DDEVICE9 pDevice,
INT Height,
UINT Width,
UINT Weight,
UINT MipLevels,
BOOL Italic,
DWORD CharSet,
DWORD OutputPrecision,
DWORD Quality,
DWORD PitchAndFamily,
LPCWSTR pFaceName,
LPD3DXFONT* ppFont);
#ifdef UNICODE
#define D3DXCreateFont D3DXCreateFontW
#else
#define D3DXCreateFont D3DXCreateFontA
#endif
HRESULT WINAPI
D3DXCreateFontIndirectA(
LPDIRECT3DDEVICE9 pDevice,
CONST D3DXFONT_DESCA* pDesc,
LPD3DXFONT* ppFont);
HRESULT WINAPI
D3DXCreateFontIndirectW(
LPDIRECT3DDEVICE9 pDevice,
CONST D3DXFONT_DESCW* pDesc,
LPD3DXFONT* ppFont);
#ifdef UNICODE
#define D3DXCreateFontIndirect D3DXCreateFontIndirectW
#else
#define D3DXCreateFontIndirect D3DXCreateFontIndirectA
#endif
#ifdef __cplusplus
}
#endif //__cplusplus
///////////////////////////////////////////////////////////////////////////
// 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().
///////////////////////////////////////////////////////////////////////////
typedef struct _D3DXRTS_DESC
{
UINT Width;
UINT Height;
D3DFORMAT Format;
BOOL DepthStencil;
D3DFORMAT DepthStencilFormat;
} D3DXRTS_DESC, *LPD3DXRTS_DESC;
typedef interface ID3DXRenderToSurface ID3DXRenderToSurface;
typedef interface ID3DXRenderToSurface *LPD3DXRENDERTOSURFACE;
// {6985F346-2C3D-43b3-BE8B-DAAE8A03D894}
DEFINE_GUID(IID_ID3DXRenderToSurface,
0x6985f346, 0x2c3d, 0x43b3, 0xbe, 0x8b, 0xda, 0xae, 0x8a, 0x3, 0xd8, 0x94);
#undef INTERFACE
#define INTERFACE ID3DXRenderToSurface
DECLARE_INTERFACE_(ID3DXRenderToSurface, IUnknown)
{
// IUnknown
STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE;
STDMETHOD_(ULONG, AddRef)(THIS) PURE;
STDMETHOD_(ULONG, Release)(THIS) PURE;
// ID3DXRenderToSurface
STDMETHOD(GetDevice)(THIS_ LPDIRECT3DDEVICE9* ppDevice) PURE;
STDMETHOD(GetDesc)(THIS_ D3DXRTS_DESC* pDesc) PURE;
STDMETHOD(BeginScene)(THIS_ LPDIRECT3DSURFACE9 pSurface, CONST D3DVIEWPORT9* pViewport) PURE;
STDMETHOD(EndScene)(THIS_ DWORD MipFilter) PURE;
STDMETHOD(OnLostDevice)(THIS) PURE;
STDMETHOD(OnResetDevice)(THIS) PURE;
};
#ifdef __cplusplus
extern "C" {
#endif //__cplusplus
HRESULT WINAPI
D3DXCreateRenderToSurface(
LPDIRECT3DDEVICE9 pDevice,
UINT Width,
UINT Height,
D3DFORMAT Format,
BOOL DepthStencil,
D3DFORMAT DepthStencilFormat,
LPD3DXRENDERTOSURFACE* ppRenderToSurface);
#ifdef __cplusplus
}
#endif //__cplusplus
///////////////////////////////////////////////////////////////////////////
// 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().
///////////////////////////////////////////////////////////////////////////
typedef struct _D3DXRTE_DESC
{
UINT Size;
UINT MipLevels;
D3DFORMAT Format;
BOOL DepthStencil;
D3DFORMAT DepthStencilFormat;
} D3DXRTE_DESC, *LPD3DXRTE_DESC;
typedef interface ID3DXRenderToEnvMap ID3DXRenderToEnvMap;
typedef interface ID3DXRenderToEnvMap *LPD3DXRenderToEnvMap;
// {313F1B4B-C7B0-4fa2-9D9D-8D380B64385E}
DEFINE_GUID(IID_ID3DXRenderToEnvMap,
0x313f1b4b, 0xc7b0, 0x4fa2, 0x9d, 0x9d, 0x8d, 0x38, 0xb, 0x64, 0x38, 0x5e);
#undef INTERFACE
#define INTERFACE ID3DXRenderToEnvMap
DECLARE_INTERFACE_(ID3DXRenderToEnvMap, IUnknown)
{
// IUnknown
STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE;
STDMETHOD_(ULONG, AddRef)(THIS) PURE;
STDMETHOD_(ULONG, Release)(THIS) PURE;
// ID3DXRenderToEnvMap
STDMETHOD(GetDevice)(THIS_ LPDIRECT3DDEVICE9* ppDevice) PURE;
STDMETHOD(GetDesc)(THIS_ D3DXRTE_DESC* pDesc) PURE;
STDMETHOD(BeginCube)(THIS_
LPDIRECT3DCUBETEXTURE9 pCubeTex) PURE;
STDMETHOD(BeginSphere)(THIS_
LPDIRECT3DTEXTURE9 pTex) PURE;
STDMETHOD(BeginHemisphere)(THIS_
LPDIRECT3DTEXTURE9 pTexZPos,
LPDIRECT3DTEXTURE9 pTexZNeg) PURE;
STDMETHOD(BeginParabolic)(THIS_
LPDIRECT3DTEXTURE9 pTexZPos,
LPDIRECT3DTEXTURE9 pTexZNeg) PURE;
STDMETHOD(Face)(THIS_ D3DCUBEMAP_FACES Face, DWORD MipFilter) PURE;
STDMETHOD(End)(THIS_ DWORD MipFilter) PURE;
STDMETHOD(OnLostDevice)(THIS) PURE;
STDMETHOD(OnResetDevice)(THIS) PURE;
};
#ifdef __cplusplus
extern "C" {
#endif //__cplusplus
HRESULT WINAPI
D3DXCreateRenderToEnvMap(
LPDIRECT3DDEVICE9 pDevice,
UINT Size,
UINT MipLevels,
D3DFORMAT Format,
BOOL DepthStencil,
D3DFORMAT DepthStencilFormat,
LPD3DXRenderToEnvMap* ppRenderToEnvMap);
#ifdef __cplusplus
}
#endif //__cplusplus
///////////////////////////////////////////////////////////////////////////
// ID3DXLine:
// ------------
// This object intends to provide an easy way to draw lines using D3D.
//
// Begin -
// Prepares device for drawing lines
//
// Draw -
// Draws a line strip in screen-space.
// Input is in the form of a array defining points on the line strip. of D3DXVECTOR2
//
// DrawTransform -
// Draws a line in screen-space with a specified input transformation matrix.
//
// End -
// Restores device state to how it was when Begin was called.
//
// SetPattern -
// Applies a stipple pattern to the line. Input is one 32-bit
// DWORD which describes the stipple pattern. 1 is opaque, 0 is
// transparent.
//
// SetPatternScale -
// Stretches the stipple pattern in the u direction. Input is one
// floating-point value. 0.0f is no scaling, whereas 1.0f doubles
// the length of the stipple pattern.
//
// SetWidth -
// Specifies the thickness of the line in the v direction. Input is
// one floating-point value.
//
// SetAntialias -
// Toggles line antialiasing. Input is a BOOL.
// TRUE = Antialiasing on.
// FALSE = Antialiasing off.
//
// SetGLLines -
// Toggles non-antialiased OpenGL line emulation. Input is a BOOL.
// TRUE = OpenGL line emulation on.
// FALSE = OpenGL line emulation off.
//
// OpenGL line: Regular line:
// *\ *\
// | \ / \
// | \ *\ \
// *\ \ \ \
// \ \ \ \
// \ * \ *
// \ | \ /
// \| *
// *
//
// 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().
///////////////////////////////////////////////////////////////////////////
typedef interface ID3DXLine ID3DXLine;
typedef interface ID3DXLine *LPD3DXLINE;
// {D379BA7F-9042-4ac4-9F5E-58192A4C6BD8}
DEFINE_GUID(IID_ID3DXLine,
0xd379ba7f, 0x9042, 0x4ac4, 0x9f, 0x5e, 0x58, 0x19, 0x2a, 0x4c, 0x6b, 0xd8);
#undef INTERFACE
#define INTERFACE ID3DXLine
DECLARE_INTERFACE_(ID3DXLine, IUnknown)
{
// IUnknown
STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE;
STDMETHOD_(ULONG, AddRef)(THIS) PURE;
STDMETHOD_(ULONG, Release)(THIS) PURE;
// ID3DXLine
STDMETHOD(GetDevice)(THIS_ LPDIRECT3DDEVICE9* ppDevice) PURE;
STDMETHOD(Begin)(THIS) PURE;
STDMETHOD(Draw)(THIS_ CONST D3DXVECTOR2 *pVertexList,
DWORD dwVertexListCount, D3DCOLOR Color) PURE;
STDMETHOD(DrawTransform)(THIS_ CONST D3DXVECTOR3 *pVertexList,
DWORD dwVertexListCount, CONST D3DXMATRIX* pTransform,
D3DCOLOR Color) PURE;
STDMETHOD(SetPattern)(THIS_ DWORD dwPattern) PURE;
STDMETHOD_(DWORD, GetPattern)(THIS) PURE;
STDMETHOD(SetPatternScale)(THIS_ FLOAT fPatternScale) PURE;
STDMETHOD_(FLOAT, GetPatternScale)(THIS) PURE;
STDMETHOD(SetWidth)(THIS_ FLOAT fWidth) PURE;
STDMETHOD_(FLOAT, GetWidth)(THIS) PURE;
STDMETHOD(SetAntialias)(THIS_ BOOL bAntialias) PURE;
STDMETHOD_(BOOL, GetAntialias)(THIS) PURE;
STDMETHOD(SetGLLines)(THIS_ BOOL bGLLines) PURE;
STDMETHOD_(BOOL, GetGLLines)(THIS) PURE;
STDMETHOD(End)(THIS) PURE;
STDMETHOD(OnLostDevice)(THIS) PURE;
STDMETHOD(OnResetDevice)(THIS) PURE;
};
#ifdef __cplusplus
extern "C" {
#endif //__cplusplus
HRESULT WINAPI
D3DXCreateLine(
LPDIRECT3DDEVICE9 pDevice,
LPD3DXLINE* ppLine);
#ifdef __cplusplus
}
#endif //__cplusplus
#endif //__D3DX9CORE_H__

873
extern/include/d3dx9effect.h vendored Normal file
View File

@@ -0,0 +1,873 @@
//////////////////////////////////////////////////////////////////////////////
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// File: d3dx9effect.h
// Content: D3DX effect types and Shaders
//
//////////////////////////////////////////////////////////////////////////////
#include "d3dx9.h"
#ifndef __D3DX9EFFECT_H__
#define __D3DX9EFFECT_H__
//----------------------------------------------------------------------------
// D3DXFX_DONOTSAVESTATE
// This flag is used as a parameter to ID3DXEffect::Begin(). When this flag
// is specified, device state is not saved or restored in Begin/End.
// D3DXFX_DONOTSAVESHADERSTATE
// This flag is used as a parameter to ID3DXEffect::Begin(). When this flag
// is specified, shader device state is not saved or restored in Begin/End.
// This includes pixel/vertex shaders and shader constants
// D3DXFX_DONOTSAVESAMPLERSTATE
// This flag is used as a parameter to ID3DXEffect::Begin(). When this flag
// is specified, sampler device state is not saved or restored in Begin/End.
// D3DXFX_NOT_CLONEABLE
// This flag is used as a parameter to the D3DXCreateEffect family of APIs.
// When this flag is specified, the effect will be non-cloneable and will not
// contain any shader binary data.
// Furthermore, GetPassDesc will not return shader function pointers.
// Setting this flag reduces effect memory usage by about 50%.
//----------------------------------------------------------------------------
#define D3DXFX_DONOTSAVESTATE (1 << 0)
#define D3DXFX_DONOTSAVESHADERSTATE (1 << 1)
#define D3DXFX_DONOTSAVESAMPLERSTATE (1 << 2)
#define D3DXFX_NOT_CLONEABLE (1 << 11)
#define D3DXFX_LARGEADDRESSAWARE (1 << 17)
//----------------------------------------------------------------------------
// D3DX_PARAMETER_SHARED
// Indicates that the value of a parameter will be shared with all effects
// which share the same namespace. Changing the value in one effect will
// change it in all.
//
// D3DX_PARAMETER_LITERAL
// Indicates that the value of this parameter can be treated as literal.
// Literal parameters can be marked when the effect is compiled, and their
// cannot be changed after the effect is compiled. Shared parameters cannot
// be literal.
//----------------------------------------------------------------------------
#define D3DX_PARAMETER_SHARED (1 << 0)
#define D3DX_PARAMETER_LITERAL (1 << 1)
#define D3DX_PARAMETER_ANNOTATION (1 << 2)
//----------------------------------------------------------------------------
// D3DXEFFECT_DESC:
//----------------------------------------------------------------------------
typedef struct _D3DXEFFECT_DESC
{
LPCSTR Creator; // Creator string
UINT Parameters; // Number of parameters
UINT Techniques; // Number of techniques
UINT Functions; // Number of function entrypoints
} D3DXEFFECT_DESC;
//----------------------------------------------------------------------------
// D3DXPARAMETER_DESC:
//----------------------------------------------------------------------------
typedef struct _D3DXPARAMETER_DESC
{
LPCSTR Name; // Parameter name
LPCSTR Semantic; // Parameter semantic
D3DXPARAMETER_CLASS Class; // Class
D3DXPARAMETER_TYPE Type; // Component type
UINT Rows; // Number of rows
UINT Columns; // Number of columns
UINT Elements; // Number of array elements
UINT Annotations; // Number of annotations
UINT StructMembers; // Number of structure member sub-parameters
DWORD Flags; // D3DX_PARAMETER_* flags
UINT Bytes; // Parameter size, in bytes
} D3DXPARAMETER_DESC;
//----------------------------------------------------------------------------
// D3DXTECHNIQUE_DESC:
//----------------------------------------------------------------------------
typedef struct _D3DXTECHNIQUE_DESC
{
LPCSTR Name; // Technique name
UINT Passes; // Number of passes
UINT Annotations; // Number of annotations
} D3DXTECHNIQUE_DESC;
//----------------------------------------------------------------------------
// D3DXPASS_DESC:
//----------------------------------------------------------------------------
typedef struct _D3DXPASS_DESC
{
LPCSTR Name; // Pass name
UINT Annotations; // Number of annotations
CONST DWORD *pVertexShaderFunction; // Vertex shader function
CONST DWORD *pPixelShaderFunction; // Pixel shader function
} D3DXPASS_DESC;
//----------------------------------------------------------------------------
// D3DXFUNCTION_DESC:
//----------------------------------------------------------------------------
typedef struct _D3DXFUNCTION_DESC
{
LPCSTR Name; // Function name
UINT Annotations; // Number of annotations
} D3DXFUNCTION_DESC;
//////////////////////////////////////////////////////////////////////////////
// ID3DXEffectPool ///////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
typedef interface ID3DXEffectPool ID3DXEffectPool;
typedef interface ID3DXEffectPool *LPD3DXEFFECTPOOL;
// {9537AB04-3250-412e-8213-FCD2F8677933}
DEFINE_GUID(IID_ID3DXEffectPool,
0x9537ab04, 0x3250, 0x412e, 0x82, 0x13, 0xfc, 0xd2, 0xf8, 0x67, 0x79, 0x33);
#undef INTERFACE
#define INTERFACE ID3DXEffectPool
DECLARE_INTERFACE_(ID3DXEffectPool, IUnknown)
{
// IUnknown
STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE;
STDMETHOD_(ULONG, AddRef)(THIS) PURE;
STDMETHOD_(ULONG, Release)(THIS) PURE;
// No public methods
};
//////////////////////////////////////////////////////////////////////////////
// ID3DXBaseEffect ///////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
typedef interface ID3DXBaseEffect ID3DXBaseEffect;
typedef interface ID3DXBaseEffect *LPD3DXBASEEFFECT;
// {017C18AC-103F-4417-8C51-6BF6EF1E56BE}
DEFINE_GUID(IID_ID3DXBaseEffect,
0x17c18ac, 0x103f, 0x4417, 0x8c, 0x51, 0x6b, 0xf6, 0xef, 0x1e, 0x56, 0xbe);
#undef INTERFACE
#define INTERFACE ID3DXBaseEffect
DECLARE_INTERFACE_(ID3DXBaseEffect, IUnknown)
{
// IUnknown
STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE;
STDMETHOD_(ULONG, AddRef)(THIS) PURE;
STDMETHOD_(ULONG, Release)(THIS) PURE;
// Descs
STDMETHOD(GetDesc)(THIS_ D3DXEFFECT_DESC* pDesc) PURE;
STDMETHOD(GetParameterDesc)(THIS_ D3DXHANDLE hParameter, D3DXPARAMETER_DESC* pDesc) PURE;
STDMETHOD(GetTechniqueDesc)(THIS_ D3DXHANDLE hTechnique, D3DXTECHNIQUE_DESC* pDesc) PURE;
STDMETHOD(GetPassDesc)(THIS_ D3DXHANDLE hPass, D3DXPASS_DESC* pDesc) PURE;
STDMETHOD(GetFunctionDesc)(THIS_ D3DXHANDLE hShader, D3DXFUNCTION_DESC* pDesc) PURE;
// Handle operations
STDMETHOD_(D3DXHANDLE, GetParameter)(THIS_ D3DXHANDLE hParameter, UINT Index) PURE;
STDMETHOD_(D3DXHANDLE, GetParameterByName)(THIS_ D3DXHANDLE hParameter, LPCSTR pName) PURE;
STDMETHOD_(D3DXHANDLE, GetParameterBySemantic)(THIS_ D3DXHANDLE hParameter, LPCSTR pSemantic) PURE;
STDMETHOD_(D3DXHANDLE, GetParameterElement)(THIS_ D3DXHANDLE hParameter, UINT Index) PURE;
STDMETHOD_(D3DXHANDLE, GetTechnique)(THIS_ UINT Index) PURE;
STDMETHOD_(D3DXHANDLE, GetTechniqueByName)(THIS_ LPCSTR pName) PURE;
STDMETHOD_(D3DXHANDLE, GetPass)(THIS_ D3DXHANDLE hTechnique, UINT Index) PURE;
STDMETHOD_(D3DXHANDLE, GetPassByName)(THIS_ D3DXHANDLE hTechnique, LPCSTR pName) PURE;
STDMETHOD_(D3DXHANDLE, GetFunction)(THIS_ UINT Index) PURE;
STDMETHOD_(D3DXHANDLE, GetFunctionByName)(THIS_ LPCSTR pName) PURE;
STDMETHOD_(D3DXHANDLE, GetAnnotation)(THIS_ D3DXHANDLE hObject, UINT Index) PURE;
STDMETHOD_(D3DXHANDLE, GetAnnotationByName)(THIS_ D3DXHANDLE hObject, LPCSTR pName) PURE;
// Get/Set Parameters
STDMETHOD(SetValue)(THIS_ D3DXHANDLE hParameter, LPCVOID pData, UINT Bytes) PURE;
STDMETHOD(GetValue)(THIS_ D3DXHANDLE hParameter, LPVOID pData, UINT Bytes) PURE;
STDMETHOD(SetBool)(THIS_ D3DXHANDLE hParameter, BOOL b) PURE;
STDMETHOD(GetBool)(THIS_ D3DXHANDLE hParameter, BOOL* pb) PURE;
STDMETHOD(SetBoolArray)(THIS_ D3DXHANDLE hParameter, CONST BOOL* pb, UINT Count) PURE;
STDMETHOD(GetBoolArray)(THIS_ D3DXHANDLE hParameter, BOOL* pb, UINT Count) PURE;
STDMETHOD(SetInt)(THIS_ D3DXHANDLE hParameter, INT n) PURE;
STDMETHOD(GetInt)(THIS_ D3DXHANDLE hParameter, INT* pn) PURE;
STDMETHOD(SetIntArray)(THIS_ D3DXHANDLE hParameter, CONST INT* pn, UINT Count) PURE;
STDMETHOD(GetIntArray)(THIS_ D3DXHANDLE hParameter, INT* pn, UINT Count) PURE;
STDMETHOD(SetFloat)(THIS_ D3DXHANDLE hParameter, FLOAT f) PURE;
STDMETHOD(GetFloat)(THIS_ D3DXHANDLE hParameter, FLOAT* pf) PURE;
STDMETHOD(SetFloatArray)(THIS_ D3DXHANDLE hParameter, CONST FLOAT* pf, UINT Count) PURE;
STDMETHOD(GetFloatArray)(THIS_ D3DXHANDLE hParameter, FLOAT* pf, UINT Count) PURE;
STDMETHOD(SetVector)(THIS_ D3DXHANDLE hParameter, CONST D3DXVECTOR4* pVector) PURE;
STDMETHOD(GetVector)(THIS_ D3DXHANDLE hParameter, D3DXVECTOR4* pVector) PURE;
STDMETHOD(SetVectorArray)(THIS_ D3DXHANDLE hParameter, CONST D3DXVECTOR4* pVector, UINT Count) PURE;
STDMETHOD(GetVectorArray)(THIS_ D3DXHANDLE hParameter, D3DXVECTOR4* pVector, UINT Count) PURE;
STDMETHOD(SetMatrix)(THIS_ D3DXHANDLE hParameter, CONST D3DXMATRIX* pMatrix) PURE;
STDMETHOD(GetMatrix)(THIS_ D3DXHANDLE hParameter, D3DXMATRIX* pMatrix) PURE;
STDMETHOD(SetMatrixArray)(THIS_ D3DXHANDLE hParameter, CONST D3DXMATRIX* pMatrix, UINT Count) PURE;
STDMETHOD(GetMatrixArray)(THIS_ D3DXHANDLE hParameter, D3DXMATRIX* pMatrix, UINT Count) PURE;
STDMETHOD(SetMatrixPointerArray)(THIS_ D3DXHANDLE hParameter, CONST D3DXMATRIX** ppMatrix, UINT Count) PURE;
STDMETHOD(GetMatrixPointerArray)(THIS_ D3DXHANDLE hParameter, D3DXMATRIX** ppMatrix, UINT Count) PURE;
STDMETHOD(SetMatrixTranspose)(THIS_ D3DXHANDLE hParameter, CONST D3DXMATRIX* pMatrix) PURE;
STDMETHOD(GetMatrixTranspose)(THIS_ D3DXHANDLE hParameter, D3DXMATRIX* pMatrix) PURE;
STDMETHOD(SetMatrixTransposeArray)(THIS_ D3DXHANDLE hParameter, CONST D3DXMATRIX* pMatrix, UINT Count) PURE;
STDMETHOD(GetMatrixTransposeArray)(THIS_ D3DXHANDLE hParameter, D3DXMATRIX* pMatrix, UINT Count) PURE;
STDMETHOD(SetMatrixTransposePointerArray)(THIS_ D3DXHANDLE hParameter, CONST D3DXMATRIX** ppMatrix, UINT Count) PURE;
STDMETHOD(GetMatrixTransposePointerArray)(THIS_ D3DXHANDLE hParameter, D3DXMATRIX** ppMatrix, UINT Count) PURE;
STDMETHOD(SetString)(THIS_ D3DXHANDLE hParameter, LPCSTR pString) PURE;
STDMETHOD(GetString)(THIS_ D3DXHANDLE hParameter, LPCSTR* ppString) PURE;
STDMETHOD(SetTexture)(THIS_ D3DXHANDLE hParameter, LPDIRECT3DBASETEXTURE9 pTexture) PURE;
STDMETHOD(GetTexture)(THIS_ D3DXHANDLE hParameter, LPDIRECT3DBASETEXTURE9 *ppTexture) PURE;
STDMETHOD(GetPixelShader)(THIS_ D3DXHANDLE hParameter, LPDIRECT3DPIXELSHADER9 *ppPShader) PURE;
STDMETHOD(GetVertexShader)(THIS_ D3DXHANDLE hParameter, LPDIRECT3DVERTEXSHADER9 *ppVShader) PURE;
//Set Range of an Array to pass to device
//Useful for sending only a subrange of an array down to the device
STDMETHOD(SetArrayRange)(THIS_ D3DXHANDLE hParameter, UINT uStart, UINT uEnd) PURE;
};
//----------------------------------------------------------------------------
// ID3DXEffectStateManager:
// ------------------------
// This is a user implemented interface that can be used to manage device
// state changes made by an Effect.
//----------------------------------------------------------------------------
typedef interface ID3DXEffectStateManager ID3DXEffectStateManager;
typedef interface ID3DXEffectStateManager *LPD3DXEFFECTSTATEMANAGER;
// {79AAB587-6DBC-4fa7-82DE-37FA1781C5CE}
DEFINE_GUID(IID_ID3DXEffectStateManager,
0x79aab587, 0x6dbc, 0x4fa7, 0x82, 0xde, 0x37, 0xfa, 0x17, 0x81, 0xc5, 0xce);
#undef INTERFACE
#define INTERFACE ID3DXEffectStateManager
DECLARE_INTERFACE_(ID3DXEffectStateManager, IUnknown)
{
// The user must correctly implement QueryInterface, AddRef, and Release.
// IUnknown
STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE;
STDMETHOD_(ULONG, AddRef)(THIS) PURE;
STDMETHOD_(ULONG, Release)(THIS) PURE;
// The following methods are called by the Effect when it wants to make
// the corresponding device call. Note that:
// 1. Users manage the state and are therefore responsible for making the
// the corresponding device calls themselves inside their callbacks.
// 2. Effects pay attention to the return values of the callbacks, and so
// users must pay attention to what they return in their callbacks.
STDMETHOD(SetTransform)(THIS_ D3DTRANSFORMSTATETYPE State, CONST D3DMATRIX *pMatrix) PURE;
STDMETHOD(SetMaterial)(THIS_ CONST D3DMATERIAL9 *pMaterial) PURE;
STDMETHOD(SetLight)(THIS_ DWORD Index, CONST D3DLIGHT9 *pLight) PURE;
STDMETHOD(LightEnable)(THIS_ DWORD Index, BOOL Enable) PURE;
STDMETHOD(SetRenderState)(THIS_ D3DRENDERSTATETYPE State, DWORD Value) PURE;
STDMETHOD(SetTexture)(THIS_ DWORD Stage, LPDIRECT3DBASETEXTURE9 pTexture) PURE;
STDMETHOD(SetTextureStageState)(THIS_ DWORD Stage, D3DTEXTURESTAGESTATETYPE Type, DWORD Value) PURE;
STDMETHOD(SetSamplerState)(THIS_ DWORD Sampler, D3DSAMPLERSTATETYPE Type, DWORD Value) PURE;
STDMETHOD(SetNPatchMode)(THIS_ FLOAT NumSegments) PURE;
STDMETHOD(SetFVF)(THIS_ DWORD FVF) PURE;
STDMETHOD(SetVertexShader)(THIS_ LPDIRECT3DVERTEXSHADER9 pShader) PURE;
STDMETHOD(SetVertexShaderConstantF)(THIS_ UINT RegisterIndex, CONST FLOAT *pConstantData, UINT RegisterCount) PURE;
STDMETHOD(SetVertexShaderConstantI)(THIS_ UINT RegisterIndex, CONST INT *pConstantData, UINT RegisterCount) PURE;
STDMETHOD(SetVertexShaderConstantB)(THIS_ UINT RegisterIndex, CONST BOOL *pConstantData, UINT RegisterCount) PURE;
STDMETHOD(SetPixelShader)(THIS_ LPDIRECT3DPIXELSHADER9 pShader) PURE;
STDMETHOD(SetPixelShaderConstantF)(THIS_ UINT RegisterIndex, CONST FLOAT *pConstantData, UINT RegisterCount) PURE;
STDMETHOD(SetPixelShaderConstantI)(THIS_ UINT RegisterIndex, CONST INT *pConstantData, UINT RegisterCount) PURE;
STDMETHOD(SetPixelShaderConstantB)(THIS_ UINT RegisterIndex, CONST BOOL *pConstantData, UINT RegisterCount) PURE;
};
//////////////////////////////////////////////////////////////////////////////
// ID3DXEffect ///////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
typedef interface ID3DXEffect ID3DXEffect;
typedef interface ID3DXEffect *LPD3DXEFFECT;
// {F6CEB4B3-4E4C-40dd-B883-8D8DE5EA0CD5}
DEFINE_GUID(IID_ID3DXEffect,
0xf6ceb4b3, 0x4e4c, 0x40dd, 0xb8, 0x83, 0x8d, 0x8d, 0xe5, 0xea, 0xc, 0xd5);
#undef INTERFACE
#define INTERFACE ID3DXEffect
DECLARE_INTERFACE_(ID3DXEffect, ID3DXBaseEffect)
{
// ID3DXBaseEffect
STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE;
STDMETHOD_(ULONG, AddRef)(THIS) PURE;
STDMETHOD_(ULONG, Release)(THIS) PURE;
// Descs
STDMETHOD(GetDesc)(THIS_ D3DXEFFECT_DESC* pDesc) PURE;
STDMETHOD(GetParameterDesc)(THIS_ D3DXHANDLE hParameter, D3DXPARAMETER_DESC* pDesc) PURE;
STDMETHOD(GetTechniqueDesc)(THIS_ D3DXHANDLE hTechnique, D3DXTECHNIQUE_DESC* pDesc) PURE;
STDMETHOD(GetPassDesc)(THIS_ D3DXHANDLE hPass, D3DXPASS_DESC* pDesc) PURE;
STDMETHOD(GetFunctionDesc)(THIS_ D3DXHANDLE hShader, D3DXFUNCTION_DESC* pDesc) PURE;
// Handle operations
STDMETHOD_(D3DXHANDLE, GetParameter)(THIS_ D3DXHANDLE hParameter, UINT Index) PURE;
STDMETHOD_(D3DXHANDLE, GetParameterByName)(THIS_ D3DXHANDLE hParameter, LPCSTR pName) PURE;
STDMETHOD_(D3DXHANDLE, GetParameterBySemantic)(THIS_ D3DXHANDLE hParameter, LPCSTR pSemantic) PURE;
STDMETHOD_(D3DXHANDLE, GetParameterElement)(THIS_ D3DXHANDLE hParameter, UINT Index) PURE;
STDMETHOD_(D3DXHANDLE, GetTechnique)(THIS_ UINT Index) PURE;
STDMETHOD_(D3DXHANDLE, GetTechniqueByName)(THIS_ LPCSTR pName) PURE;
STDMETHOD_(D3DXHANDLE, GetPass)(THIS_ D3DXHANDLE hTechnique, UINT Index) PURE;
STDMETHOD_(D3DXHANDLE, GetPassByName)(THIS_ D3DXHANDLE hTechnique, LPCSTR pName) PURE;
STDMETHOD_(D3DXHANDLE, GetFunction)(THIS_ UINT Index) PURE;
STDMETHOD_(D3DXHANDLE, GetFunctionByName)(THIS_ LPCSTR pName) PURE;
STDMETHOD_(D3DXHANDLE, GetAnnotation)(THIS_ D3DXHANDLE hObject, UINT Index) PURE;
STDMETHOD_(D3DXHANDLE, GetAnnotationByName)(THIS_ D3DXHANDLE hObject, LPCSTR pName) PURE;
// Get/Set Parameters
STDMETHOD(SetValue)(THIS_ D3DXHANDLE hParameter, LPCVOID pData, UINT Bytes) PURE;
STDMETHOD(GetValue)(THIS_ D3DXHANDLE hParameter, LPVOID pData, UINT Bytes) PURE;
STDMETHOD(SetBool)(THIS_ D3DXHANDLE hParameter, BOOL b) PURE;
STDMETHOD(GetBool)(THIS_ D3DXHANDLE hParameter, BOOL* pb) PURE;
STDMETHOD(SetBoolArray)(THIS_ D3DXHANDLE hParameter, CONST BOOL* pb, UINT Count) PURE;
STDMETHOD(GetBoolArray)(THIS_ D3DXHANDLE hParameter, BOOL* pb, UINT Count) PURE;
STDMETHOD(SetInt)(THIS_ D3DXHANDLE hParameter, INT n) PURE;
STDMETHOD(GetInt)(THIS_ D3DXHANDLE hParameter, INT* pn) PURE;
STDMETHOD(SetIntArray)(THIS_ D3DXHANDLE hParameter, CONST INT* pn, UINT Count) PURE;
STDMETHOD(GetIntArray)(THIS_ D3DXHANDLE hParameter, INT* pn, UINT Count) PURE;
STDMETHOD(SetFloat)(THIS_ D3DXHANDLE hParameter, FLOAT f) PURE;
STDMETHOD(GetFloat)(THIS_ D3DXHANDLE hParameter, FLOAT* pf) PURE;
STDMETHOD(SetFloatArray)(THIS_ D3DXHANDLE hParameter, CONST FLOAT* pf, UINT Count) PURE;
STDMETHOD(GetFloatArray)(THIS_ D3DXHANDLE hParameter, FLOAT* pf, UINT Count) PURE;
STDMETHOD(SetVector)(THIS_ D3DXHANDLE hParameter, CONST D3DXVECTOR4* pVector) PURE;
STDMETHOD(GetVector)(THIS_ D3DXHANDLE hParameter, D3DXVECTOR4* pVector) PURE;
STDMETHOD(SetVectorArray)(THIS_ D3DXHANDLE hParameter, CONST D3DXVECTOR4* pVector, UINT Count) PURE;
STDMETHOD(GetVectorArray)(THIS_ D3DXHANDLE hParameter, D3DXVECTOR4* pVector, UINT Count) PURE;
STDMETHOD(SetMatrix)(THIS_ D3DXHANDLE hParameter, CONST D3DXMATRIX* pMatrix) PURE;
STDMETHOD(GetMatrix)(THIS_ D3DXHANDLE hParameter, D3DXMATRIX* pMatrix) PURE;
STDMETHOD(SetMatrixArray)(THIS_ D3DXHANDLE hParameter, CONST D3DXMATRIX* pMatrix, UINT Count) PURE;
STDMETHOD(GetMatrixArray)(THIS_ D3DXHANDLE hParameter, D3DXMATRIX* pMatrix, UINT Count) PURE;
STDMETHOD(SetMatrixPointerArray)(THIS_ D3DXHANDLE hParameter, CONST D3DXMATRIX** ppMatrix, UINT Count) PURE;
STDMETHOD(GetMatrixPointerArray)(THIS_ D3DXHANDLE hParameter, D3DXMATRIX** ppMatrix, UINT Count) PURE;
STDMETHOD(SetMatrixTranspose)(THIS_ D3DXHANDLE hParameter, CONST D3DXMATRIX* pMatrix) PURE;
STDMETHOD(GetMatrixTranspose)(THIS_ D3DXHANDLE hParameter, D3DXMATRIX* pMatrix) PURE;
STDMETHOD(SetMatrixTransposeArray)(THIS_ D3DXHANDLE hParameter, CONST D3DXMATRIX* pMatrix, UINT Count) PURE;
STDMETHOD(GetMatrixTransposeArray)(THIS_ D3DXHANDLE hParameter, D3DXMATRIX* pMatrix, UINT Count) PURE;
STDMETHOD(SetMatrixTransposePointerArray)(THIS_ D3DXHANDLE hParameter, CONST D3DXMATRIX** ppMatrix, UINT Count) PURE;
STDMETHOD(GetMatrixTransposePointerArray)(THIS_ D3DXHANDLE hParameter, D3DXMATRIX** ppMatrix, UINT Count) PURE;
STDMETHOD(SetString)(THIS_ D3DXHANDLE hParameter, LPCSTR pString) PURE;
STDMETHOD(GetString)(THIS_ D3DXHANDLE hParameter, LPCSTR* ppString) PURE;
STDMETHOD(SetTexture)(THIS_ D3DXHANDLE hParameter, LPDIRECT3DBASETEXTURE9 pTexture) PURE;
STDMETHOD(GetTexture)(THIS_ D3DXHANDLE hParameter, LPDIRECT3DBASETEXTURE9 *ppTexture) PURE;
STDMETHOD(GetPixelShader)(THIS_ D3DXHANDLE hParameter, LPDIRECT3DPIXELSHADER9 *ppPShader) PURE;
STDMETHOD(GetVertexShader)(THIS_ D3DXHANDLE hParameter, LPDIRECT3DVERTEXSHADER9 *ppVShader) PURE;
//Set Range of an Array to pass to device
//Usefull for sending only a subrange of an array down to the device
STDMETHOD(SetArrayRange)(THIS_ D3DXHANDLE hParameter, UINT uStart, UINT uEnd) PURE;
// ID3DXBaseEffect
// Pool
STDMETHOD(GetPool)(THIS_ LPD3DXEFFECTPOOL* ppPool) PURE;
// Selecting and setting a technique
STDMETHOD(SetTechnique)(THIS_ D3DXHANDLE hTechnique) PURE;
STDMETHOD_(D3DXHANDLE, GetCurrentTechnique)(THIS) PURE;
STDMETHOD(ValidateTechnique)(THIS_ D3DXHANDLE hTechnique) PURE;
STDMETHOD(FindNextValidTechnique)(THIS_ D3DXHANDLE hTechnique, D3DXHANDLE *pTechnique) PURE;
STDMETHOD_(BOOL, IsParameterUsed)(THIS_ D3DXHANDLE hParameter, D3DXHANDLE hTechnique) PURE;
// Using current technique
// Begin starts active technique
// BeginPass begins a pass
// CommitChanges updates changes to any set calls in the pass. This should be called before
// any DrawPrimitive call to d3d
// EndPass ends a pass
// End ends active technique
STDMETHOD(Begin)(THIS_ UINT *pPasses, DWORD Flags) PURE;
STDMETHOD(BeginPass)(THIS_ UINT Pass) PURE;
STDMETHOD(CommitChanges)(THIS) PURE;
STDMETHOD(EndPass)(THIS) PURE;
STDMETHOD(End)(THIS) PURE;
// Managing D3D Device
STDMETHOD(GetDevice)(THIS_ LPDIRECT3DDEVICE9* ppDevice) PURE;
STDMETHOD(OnLostDevice)(THIS) PURE;
STDMETHOD(OnResetDevice)(THIS) PURE;
// Logging device calls
STDMETHOD(SetStateManager)(THIS_ LPD3DXEFFECTSTATEMANAGER pManager) PURE;
STDMETHOD(GetStateManager)(THIS_ LPD3DXEFFECTSTATEMANAGER *ppManager) PURE;
// Parameter blocks
STDMETHOD(BeginParameterBlock)(THIS) PURE;
STDMETHOD_(D3DXHANDLE, EndParameterBlock)(THIS) PURE;
STDMETHOD(ApplyParameterBlock)(THIS_ D3DXHANDLE hParameterBlock) PURE;
STDMETHOD(DeleteParameterBlock)(THIS_ D3DXHANDLE hParameterBlock) PURE;
// Cloning
STDMETHOD(CloneEffect)(THIS_ LPDIRECT3DDEVICE9 pDevice, LPD3DXEFFECT* ppEffect) PURE;
// Fast path for setting variables directly in ID3DXEffect
STDMETHOD(SetRawValue)(THIS_ D3DXHANDLE hParameter, LPCVOID pData, UINT ByteOffset, UINT Bytes) PURE;
};
//////////////////////////////////////////////////////////////////////////////
// ID3DXEffectCompiler ///////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
typedef interface ID3DXEffectCompiler ID3DXEffectCompiler;
typedef interface ID3DXEffectCompiler *LPD3DXEFFECTCOMPILER;
// {51B8A949-1A31-47e6-BEA0-4B30DB53F1E0}
DEFINE_GUID(IID_ID3DXEffectCompiler,
0x51b8a949, 0x1a31, 0x47e6, 0xbe, 0xa0, 0x4b, 0x30, 0xdb, 0x53, 0xf1, 0xe0);
#undef INTERFACE
#define INTERFACE ID3DXEffectCompiler
DECLARE_INTERFACE_(ID3DXEffectCompiler, ID3DXBaseEffect)
{
// ID3DXBaseEffect
STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE;
STDMETHOD_(ULONG, AddRef)(THIS) PURE;
STDMETHOD_(ULONG, Release)(THIS) PURE;
// Descs
STDMETHOD(GetDesc)(THIS_ D3DXEFFECT_DESC* pDesc) PURE;
STDMETHOD(GetParameterDesc)(THIS_ D3DXHANDLE hParameter, D3DXPARAMETER_DESC* pDesc) PURE;
STDMETHOD(GetTechniqueDesc)(THIS_ D3DXHANDLE hTechnique, D3DXTECHNIQUE_DESC* pDesc) PURE;
STDMETHOD(GetPassDesc)(THIS_ D3DXHANDLE hPass, D3DXPASS_DESC* pDesc) PURE;
STDMETHOD(GetFunctionDesc)(THIS_ D3DXHANDLE hShader, D3DXFUNCTION_DESC* pDesc) PURE;
// Handle operations
STDMETHOD_(D3DXHANDLE, GetParameter)(THIS_ D3DXHANDLE hParameter, UINT Index) PURE;
STDMETHOD_(D3DXHANDLE, GetParameterByName)(THIS_ D3DXHANDLE hParameter, LPCSTR pName) PURE;
STDMETHOD_(D3DXHANDLE, GetParameterBySemantic)(THIS_ D3DXHANDLE hParameter, LPCSTR pSemantic) PURE;
STDMETHOD_(D3DXHANDLE, GetParameterElement)(THIS_ D3DXHANDLE hParameter, UINT Index) PURE;
STDMETHOD_(D3DXHANDLE, GetTechnique)(THIS_ UINT Index) PURE;
STDMETHOD_(D3DXHANDLE, GetTechniqueByName)(THIS_ LPCSTR pName) PURE;
STDMETHOD_(D3DXHANDLE, GetPass)(THIS_ D3DXHANDLE hTechnique, UINT Index) PURE;
STDMETHOD_(D3DXHANDLE, GetPassByName)(THIS_ D3DXHANDLE hTechnique, LPCSTR pName) PURE;
STDMETHOD_(D3DXHANDLE, GetFunction)(THIS_ UINT Index) PURE;
STDMETHOD_(D3DXHANDLE, GetFunctionByName)(THIS_ LPCSTR pName) PURE;
STDMETHOD_(D3DXHANDLE, GetAnnotation)(THIS_ D3DXHANDLE hObject, UINT Index) PURE;
STDMETHOD_(D3DXHANDLE, GetAnnotationByName)(THIS_ D3DXHANDLE hObject, LPCSTR pName) PURE;
// Get/Set Parameters
STDMETHOD(SetValue)(THIS_ D3DXHANDLE hParameter, LPCVOID pData, UINT Bytes) PURE;
STDMETHOD(GetValue)(THIS_ D3DXHANDLE hParameter, LPVOID pData, UINT Bytes) PURE;
STDMETHOD(SetBool)(THIS_ D3DXHANDLE hParameter, BOOL b) PURE;
STDMETHOD(GetBool)(THIS_ D3DXHANDLE hParameter, BOOL* pb) PURE;
STDMETHOD(SetBoolArray)(THIS_ D3DXHANDLE hParameter, CONST BOOL* pb, UINT Count) PURE;
STDMETHOD(GetBoolArray)(THIS_ D3DXHANDLE hParameter, BOOL* pb, UINT Count) PURE;
STDMETHOD(SetInt)(THIS_ D3DXHANDLE hParameter, INT n) PURE;
STDMETHOD(GetInt)(THIS_ D3DXHANDLE hParameter, INT* pn) PURE;
STDMETHOD(SetIntArray)(THIS_ D3DXHANDLE hParameter, CONST INT* pn, UINT Count) PURE;
STDMETHOD(GetIntArray)(THIS_ D3DXHANDLE hParameter, INT* pn, UINT Count) PURE;
STDMETHOD(SetFloat)(THIS_ D3DXHANDLE hParameter, FLOAT f) PURE;
STDMETHOD(GetFloat)(THIS_ D3DXHANDLE hParameter, FLOAT* pf) PURE;
STDMETHOD(SetFloatArray)(THIS_ D3DXHANDLE hParameter, CONST FLOAT* pf, UINT Count) PURE;
STDMETHOD(GetFloatArray)(THIS_ D3DXHANDLE hParameter, FLOAT* pf, UINT Count) PURE;
STDMETHOD(SetVector)(THIS_ D3DXHANDLE hParameter, CONST D3DXVECTOR4* pVector) PURE;
STDMETHOD(GetVector)(THIS_ D3DXHANDLE hParameter, D3DXVECTOR4* pVector) PURE;
STDMETHOD(SetVectorArray)(THIS_ D3DXHANDLE hParameter, CONST D3DXVECTOR4* pVector, UINT Count) PURE;
STDMETHOD(GetVectorArray)(THIS_ D3DXHANDLE hParameter, D3DXVECTOR4* pVector, UINT Count) PURE;
STDMETHOD(SetMatrix)(THIS_ D3DXHANDLE hParameter, CONST D3DXMATRIX* pMatrix) PURE;
STDMETHOD(GetMatrix)(THIS_ D3DXHANDLE hParameter, D3DXMATRIX* pMatrix) PURE;
STDMETHOD(SetMatrixArray)(THIS_ D3DXHANDLE hParameter, CONST D3DXMATRIX* pMatrix, UINT Count) PURE;
STDMETHOD(GetMatrixArray)(THIS_ D3DXHANDLE hParameter, D3DXMATRIX* pMatrix, UINT Count) PURE;
STDMETHOD(SetMatrixPointerArray)(THIS_ D3DXHANDLE hParameter, CONST D3DXMATRIX** ppMatrix, UINT Count) PURE;
STDMETHOD(GetMatrixPointerArray)(THIS_ D3DXHANDLE hParameter, D3DXMATRIX** ppMatrix, UINT Count) PURE;
STDMETHOD(SetMatrixTranspose)(THIS_ D3DXHANDLE hParameter, CONST D3DXMATRIX* pMatrix) PURE;
STDMETHOD(GetMatrixTranspose)(THIS_ D3DXHANDLE hParameter, D3DXMATRIX* pMatrix) PURE;
STDMETHOD(SetMatrixTransposeArray)(THIS_ D3DXHANDLE hParameter, CONST D3DXMATRIX* pMatrix, UINT Count) PURE;
STDMETHOD(GetMatrixTransposeArray)(THIS_ D3DXHANDLE hParameter, D3DXMATRIX* pMatrix, UINT Count) PURE;
STDMETHOD(SetMatrixTransposePointerArray)(THIS_ D3DXHANDLE hParameter, CONST D3DXMATRIX** ppMatrix, UINT Count) PURE;
STDMETHOD(GetMatrixTransposePointerArray)(THIS_ D3DXHANDLE hParameter, D3DXMATRIX** ppMatrix, UINT Count) PURE;
STDMETHOD(SetString)(THIS_ D3DXHANDLE hParameter, LPCSTR pString) PURE;
STDMETHOD(GetString)(THIS_ D3DXHANDLE hParameter, LPCSTR* ppString) PURE;
STDMETHOD(SetTexture)(THIS_ D3DXHANDLE hParameter, LPDIRECT3DBASETEXTURE9 pTexture) PURE;
STDMETHOD(GetTexture)(THIS_ D3DXHANDLE hParameter, LPDIRECT3DBASETEXTURE9 *ppTexture) PURE;
STDMETHOD(GetPixelShader)(THIS_ D3DXHANDLE hParameter, LPDIRECT3DPIXELSHADER9 *ppPShader) PURE;
STDMETHOD(GetVertexShader)(THIS_ D3DXHANDLE hParameter, LPDIRECT3DVERTEXSHADER9 *ppVShader) PURE;
//Set Range of an Array to pass to device
//Usefull for sending only a subrange of an array down to the device
STDMETHOD(SetArrayRange)(THIS_ D3DXHANDLE hParameter, UINT uStart, UINT uEnd) PURE;
// ID3DXBaseEffect
// Parameter sharing, specialization, and information
STDMETHOD(SetLiteral)(THIS_ D3DXHANDLE hParameter, BOOL Literal) PURE;
STDMETHOD(GetLiteral)(THIS_ D3DXHANDLE hParameter, BOOL *pLiteral) PURE;
// Compilation
STDMETHOD(CompileEffect)(THIS_ DWORD Flags,
LPD3DXBUFFER* ppEffect, LPD3DXBUFFER* ppErrorMsgs) PURE;
STDMETHOD(CompileShader)(THIS_ D3DXHANDLE hFunction, LPCSTR pTarget, DWORD Flags,
LPD3DXBUFFER* ppShader, LPD3DXBUFFER* ppErrorMsgs, LPD3DXCONSTANTTABLE* ppConstantTable) PURE;
};
//////////////////////////////////////////////////////////////////////////////
// APIs //////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
#ifdef __cplusplus
extern "C" {
#endif //__cplusplus
//----------------------------------------------------------------------------
// D3DXCreateEffectPool:
// ---------------------
// Creates an effect pool. Pools are used for sharing parameters between
// multiple effects. For all effects within a pool, shared parameters of the
// same name all share the same value.
//
// Parameters:
// ppPool
// Returns the created pool.
//----------------------------------------------------------------------------
HRESULT WINAPI
D3DXCreateEffectPool(
LPD3DXEFFECTPOOL* ppPool);
//----------------------------------------------------------------------------
// D3DXCreateEffect:
// -----------------
// Creates an effect from an ascii or binary effect description.
//
// Parameters:
// pDevice
// Pointer of the device on which to create the effect
// pSrcFile
// Name of the file containing the effect description
// hSrcModule
// Module handle. if NULL, current module will be used.
// pSrcResource
// Resource name in module
// pSrcData
// Pointer to effect description
// SrcDataSize
// Size of the effect description in bytes
// pDefines
// Optional NULL-terminated array of preprocessor macro definitions.
// Flags
// See D3DXSHADER_xxx flags.
// pSkipConstants
// A list of semi-colon delimited variable names. The effect will
// not set these variables to the device when they are referenced
// by a shader. NOTE: the variables specified here must be
// register bound in the file and must not be used in expressions
// in passes or samplers or the file will not load.
// pInclude
// Optional interface pointer to use for handling #include directives.
// If this parameter is NULL, #includes will be honored when compiling
// from file, and will error when compiling from resource or memory.
// pPool
// Pointer to ID3DXEffectPool object to use for shared parameters.
// If NULL, no parameters will be shared.
// ppEffect
// Returns a buffer containing created effect.
// ppCompilationErrors
// Returns a buffer containing any error messages which occurred during
// compile. Or NULL if you do not care about the error messages.
//
//----------------------------------------------------------------------------
HRESULT WINAPI
D3DXCreateEffectFromFileA(
LPDIRECT3DDEVICE9 pDevice,
LPCSTR pSrcFile,
CONST D3DXMACRO* pDefines,
LPD3DXINCLUDE pInclude,
DWORD Flags,
LPD3DXEFFECTPOOL pPool,
LPD3DXEFFECT* ppEffect,
LPD3DXBUFFER* ppCompilationErrors);
HRESULT WINAPI
D3DXCreateEffectFromFileW(
LPDIRECT3DDEVICE9 pDevice,
LPCWSTR pSrcFile,
CONST D3DXMACRO* pDefines,
LPD3DXINCLUDE pInclude,
DWORD Flags,
LPD3DXEFFECTPOOL pPool,
LPD3DXEFFECT* ppEffect,
LPD3DXBUFFER* ppCompilationErrors);
#ifdef UNICODE
#define D3DXCreateEffectFromFile D3DXCreateEffectFromFileW
#else
#define D3DXCreateEffectFromFile D3DXCreateEffectFromFileA
#endif
HRESULT WINAPI
D3DXCreateEffectFromResourceA(
LPDIRECT3DDEVICE9 pDevice,
HMODULE hSrcModule,
LPCSTR pSrcResource,
CONST D3DXMACRO* pDefines,
LPD3DXINCLUDE pInclude,
DWORD Flags,
LPD3DXEFFECTPOOL pPool,
LPD3DXEFFECT* ppEffect,
LPD3DXBUFFER* ppCompilationErrors);
HRESULT WINAPI
D3DXCreateEffectFromResourceW(
LPDIRECT3DDEVICE9 pDevice,
HMODULE hSrcModule,
LPCWSTR pSrcResource,
CONST D3DXMACRO* pDefines,
LPD3DXINCLUDE pInclude,
DWORD Flags,
LPD3DXEFFECTPOOL pPool,
LPD3DXEFFECT* ppEffect,
LPD3DXBUFFER* ppCompilationErrors);
#ifdef UNICODE
#define D3DXCreateEffectFromResource D3DXCreateEffectFromResourceW
#else
#define D3DXCreateEffectFromResource D3DXCreateEffectFromResourceA
#endif
HRESULT WINAPI
D3DXCreateEffect(
LPDIRECT3DDEVICE9 pDevice,
LPCVOID pSrcData,
UINT SrcDataLen,
CONST D3DXMACRO* pDefines,
LPD3DXINCLUDE pInclude,
DWORD Flags,
LPD3DXEFFECTPOOL pPool,
LPD3DXEFFECT* ppEffect,
LPD3DXBUFFER* ppCompilationErrors);
//
// Ex functions that accept pSkipConstants in addition to other parameters
//
HRESULT WINAPI
D3DXCreateEffectFromFileExA(
LPDIRECT3DDEVICE9 pDevice,
LPCSTR pSrcFile,
CONST D3DXMACRO* pDefines,
LPD3DXINCLUDE pInclude,
LPCSTR pSkipConstants,
DWORD Flags,
LPD3DXEFFECTPOOL pPool,
LPD3DXEFFECT* ppEffect,
LPD3DXBUFFER* ppCompilationErrors);
HRESULT WINAPI
D3DXCreateEffectFromFileExW(
LPDIRECT3DDEVICE9 pDevice,
LPCWSTR pSrcFile,
CONST D3DXMACRO* pDefines,
LPD3DXINCLUDE pInclude,
LPCSTR pSkipConstants,
DWORD Flags,
LPD3DXEFFECTPOOL pPool,
LPD3DXEFFECT* ppEffect,
LPD3DXBUFFER* ppCompilationErrors);
#ifdef UNICODE
#define D3DXCreateEffectFromFileEx D3DXCreateEffectFromFileExW
#else
#define D3DXCreateEffectFromFileEx D3DXCreateEffectFromFileExA
#endif
HRESULT WINAPI
D3DXCreateEffectFromResourceExA(
LPDIRECT3DDEVICE9 pDevice,
HMODULE hSrcModule,
LPCSTR pSrcResource,
CONST D3DXMACRO* pDefines,
LPD3DXINCLUDE pInclude,
LPCSTR pSkipConstants,
DWORD Flags,
LPD3DXEFFECTPOOL pPool,
LPD3DXEFFECT* ppEffect,
LPD3DXBUFFER* ppCompilationErrors);
HRESULT WINAPI
D3DXCreateEffectFromResourceExW(
LPDIRECT3DDEVICE9 pDevice,
HMODULE hSrcModule,
LPCWSTR pSrcResource,
CONST D3DXMACRO* pDefines,
LPD3DXINCLUDE pInclude,
LPCSTR pSkipConstants,
DWORD Flags,
LPD3DXEFFECTPOOL pPool,
LPD3DXEFFECT* ppEffect,
LPD3DXBUFFER* ppCompilationErrors);
#ifdef UNICODE
#define D3DXCreateEffectFromResourceEx D3DXCreateEffectFromResourceExW
#else
#define D3DXCreateEffectFromResourceEx D3DXCreateEffectFromResourceExA
#endif
HRESULT WINAPI
D3DXCreateEffectEx(
LPDIRECT3DDEVICE9 pDevice,
LPCVOID pSrcData,
UINT SrcDataLen,
CONST D3DXMACRO* pDefines,
LPD3DXINCLUDE pInclude,
LPCSTR pSkipConstants,
DWORD Flags,
LPD3DXEFFECTPOOL pPool,
LPD3DXEFFECT* ppEffect,
LPD3DXBUFFER* ppCompilationErrors);
//----------------------------------------------------------------------------
// D3DXCreateEffectCompiler:
// -------------------------
// Creates an effect from an ascii or binary effect description.
//
// Parameters:
// pSrcFile
// Name of the file containing the effect description
// hSrcModule
// Module handle. if NULL, current module will be used.
// pSrcResource
// Resource name in module
// pSrcData
// Pointer to effect description
// SrcDataSize
// Size of the effect description in bytes
// pDefines
// Optional NULL-terminated array of preprocessor macro definitions.
// pInclude
// Optional interface pointer to use for handling #include directives.
// If this parameter is NULL, #includes will be honored when compiling
// from file, and will error when compiling from resource or memory.
// pPool
// Pointer to ID3DXEffectPool object to use for shared parameters.
// If NULL, no parameters will be shared.
// ppCompiler
// Returns a buffer containing created effect compiler.
// ppParseErrors
// Returns a buffer containing any error messages which occurred during
// parse. Or NULL if you do not care about the error messages.
//
//----------------------------------------------------------------------------
HRESULT WINAPI
D3DXCreateEffectCompilerFromFileA(
LPCSTR pSrcFile,
CONST D3DXMACRO* pDefines,
LPD3DXINCLUDE pInclude,
DWORD Flags,
LPD3DXEFFECTCOMPILER* ppCompiler,
LPD3DXBUFFER* ppParseErrors);
HRESULT WINAPI
D3DXCreateEffectCompilerFromFileW(
LPCWSTR pSrcFile,
CONST D3DXMACRO* pDefines,
LPD3DXINCLUDE pInclude,
DWORD Flags,
LPD3DXEFFECTCOMPILER* ppCompiler,
LPD3DXBUFFER* ppParseErrors);
#ifdef UNICODE
#define D3DXCreateEffectCompilerFromFile D3DXCreateEffectCompilerFromFileW
#else
#define D3DXCreateEffectCompilerFromFile D3DXCreateEffectCompilerFromFileA
#endif
HRESULT WINAPI
D3DXCreateEffectCompilerFromResourceA(
HMODULE hSrcModule,
LPCSTR pSrcResource,
CONST D3DXMACRO* pDefines,
LPD3DXINCLUDE pInclude,
DWORD Flags,
LPD3DXEFFECTCOMPILER* ppCompiler,
LPD3DXBUFFER* ppParseErrors);
HRESULT WINAPI
D3DXCreateEffectCompilerFromResourceW(
HMODULE hSrcModule,
LPCWSTR pSrcResource,
CONST D3DXMACRO* pDefines,
LPD3DXINCLUDE pInclude,
DWORD Flags,
LPD3DXEFFECTCOMPILER* ppCompiler,
LPD3DXBUFFER* ppParseErrors);
#ifdef UNICODE
#define D3DXCreateEffectCompilerFromResource D3DXCreateEffectCompilerFromResourceW
#else
#define D3DXCreateEffectCompilerFromResource D3DXCreateEffectCompilerFromResourceA
#endif
HRESULT WINAPI
D3DXCreateEffectCompiler(
LPCSTR pSrcData,
UINT SrcDataLen,
CONST D3DXMACRO* pDefines,
LPD3DXINCLUDE pInclude,
DWORD Flags,
LPD3DXEFFECTCOMPILER* ppCompiler,
LPD3DXBUFFER* ppParseErrors);
//----------------------------------------------------------------------------
// D3DXDisassembleEffect:
// -----------------------
//
// Parameters:
//----------------------------------------------------------------------------
HRESULT WINAPI
D3DXDisassembleEffect(
LPD3DXEFFECT pEffect,
BOOL EnableColorCode,
LPD3DXBUFFER *ppDisassembly);
#ifdef __cplusplus
}
#endif //__cplusplus
#endif //__D3DX9EFFECT_H__

View File

@@ -2,17 +2,20 @@
//
// Copyright (C) Microsoft Corporation. All Rights Reserved.
//
// File: d3dx8math.h
// File: d3dx9math.h
// Content: D3DX math types and functions
//
//////////////////////////////////////////////////////////////////////////////
#include "d3dx8.h"
#include "d3dx9.h"
#ifndef __D3DX8MATH_H__
#define __D3DX8MATH_H__
#ifndef __D3DX9MATH_H__
#define __D3DX9MATH_H__
#include <math.h>
#if _MSC_VER >= 1200
#pragma warning(push)
#endif
#pragma warning(disable:4201) // anonymous unions warning
@@ -30,12 +33,54 @@
//===========================================================================
//
// 16 bit floating point numbers
//
//===========================================================================
#define D3DX_16F_DIG 3 // # of decimal digits of precision
#define D3DX_16F_EPSILON 4.8875809e-4f // smallest such that 1.0 + epsilon != 1.0
#define D3DX_16F_MANT_DIG 11 // # of bits in mantissa
#define D3DX_16F_MAX 6.550400e+004 // max value
#define D3DX_16F_MAX_10_EXP 4 // max decimal exponent
#define D3DX_16F_MAX_EXP 15 // max binary exponent
#define D3DX_16F_MIN 6.1035156e-5f // min positive value
#define D3DX_16F_MIN_10_EXP (-4) // min decimal exponent
#define D3DX_16F_MIN_EXP (-14) // min binary exponent
#define D3DX_16F_RADIX 2 // exponent radix
#define D3DX_16F_ROUNDS 1 // addition rounding: near
typedef struct D3DXFLOAT16
{
#ifdef __cplusplus
public:
D3DXFLOAT16() {};
D3DXFLOAT16( FLOAT );
D3DXFLOAT16( CONST D3DXFLOAT16& );
// casting
operator FLOAT ();
// binary operators
BOOL operator == ( CONST D3DXFLOAT16& ) const;
BOOL operator != ( CONST D3DXFLOAT16& ) const;
protected:
#endif //__cplusplus
WORD value;
} D3DXFLOAT16, *LPD3DXFLOAT16;
//===========================================================================
//
// Vectors
//
//===========================================================================
//--------------------------
// 2D Vector
//--------------------------
@@ -45,6 +90,7 @@ typedef struct D3DXVECTOR2
public:
D3DXVECTOR2() {};
D3DXVECTOR2( CONST FLOAT * );
D3DXVECTOR2( CONST D3DXFLOAT16 * );
D3DXVECTOR2( FLOAT x, FLOAT y );
// casting
@@ -79,6 +125,36 @@ public:
} D3DXVECTOR2, *LPD3DXVECTOR2;
//--------------------------
// 2D Vector (16 bit)
//--------------------------
typedef struct D3DXVECTOR2_16F
{
#ifdef __cplusplus
public:
D3DXVECTOR2_16F() {};
D3DXVECTOR2_16F( CONST FLOAT * );
D3DXVECTOR2_16F( CONST D3DXFLOAT16 * );
D3DXVECTOR2_16F( CONST D3DXFLOAT16 &x, CONST D3DXFLOAT16 &y );
// casting
operator D3DXFLOAT16* ();
operator CONST D3DXFLOAT16* () const;
// binary operators
BOOL operator == ( CONST D3DXVECTOR2_16F& ) const;
BOOL operator != ( CONST D3DXVECTOR2_16F& ) const;
public:
#endif //__cplusplus
D3DXFLOAT16 x, y;
} D3DXVECTOR2_16F, *LPD3DXVECTOR2_16F;
//--------------------------
// 3D Vector
//--------------------------
@@ -89,6 +165,7 @@ public:
D3DXVECTOR3() {};
D3DXVECTOR3( CONST FLOAT * );
D3DXVECTOR3( CONST D3DVECTOR& );
D3DXVECTOR3( CONST D3DXFLOAT16 * );
D3DXVECTOR3( FLOAT x, FLOAT y, FLOAT z );
// casting
@@ -123,6 +200,36 @@ typedef struct _D3DVECTOR D3DXVECTOR3, *LPD3DXVECTOR3;
#endif //!__cplusplus
//--------------------------
// 3D Vector (16 bit)
//--------------------------
typedef struct D3DXVECTOR3_16F
{
#ifdef __cplusplus
public:
D3DXVECTOR3_16F() {};
D3DXVECTOR3_16F( CONST FLOAT * );
D3DXVECTOR3_16F( CONST D3DVECTOR& );
D3DXVECTOR3_16F( CONST D3DXFLOAT16 * );
D3DXVECTOR3_16F( CONST D3DXFLOAT16 &x, CONST D3DXFLOAT16 &y, CONST D3DXFLOAT16 &z );
// casting
operator D3DXFLOAT16* ();
operator CONST D3DXFLOAT16* () const;
// binary operators
BOOL operator == ( CONST D3DXVECTOR3_16F& ) const;
BOOL operator != ( CONST D3DXVECTOR3_16F& ) const;
public:
#endif //__cplusplus
D3DXFLOAT16 x, y, z;
} D3DXVECTOR3_16F, *LPD3DXVECTOR3_16F;
//--------------------------
// 4D Vector
//--------------------------
@@ -132,6 +239,8 @@ typedef struct D3DXVECTOR4
public:
D3DXVECTOR4() {};
D3DXVECTOR4( CONST FLOAT* );
D3DXVECTOR4( CONST D3DXFLOAT16* );
D3DXVECTOR4( CONST D3DVECTOR& xyz, FLOAT w );
D3DXVECTOR4( FLOAT x, FLOAT y, FLOAT z, FLOAT w );
// casting
@@ -165,6 +274,35 @@ public:
} D3DXVECTOR4, *LPD3DXVECTOR4;
//--------------------------
// 4D Vector (16 bit)
//--------------------------
typedef struct D3DXVECTOR4_16F
{
#ifdef __cplusplus
public:
D3DXVECTOR4_16F() {};
D3DXVECTOR4_16F( CONST FLOAT * );
D3DXVECTOR4_16F( CONST D3DXFLOAT16* );
D3DXVECTOR4_16F( CONST D3DXVECTOR3_16F& xyz, CONST D3DXFLOAT16& w );
D3DXVECTOR4_16F( CONST D3DXFLOAT16& x, CONST D3DXFLOAT16& y, CONST D3DXFLOAT16& z, CONST D3DXFLOAT16& w );
// casting
operator D3DXFLOAT16* ();
operator CONST D3DXFLOAT16* () const;
// binary operators
BOOL operator == ( CONST D3DXVECTOR4_16F& ) const;
BOOL operator != ( CONST D3DXVECTOR4_16F& ) const;
public:
#endif //__cplusplus
D3DXFLOAT16 x, y, z, w;
} D3DXVECTOR4_16F, *LPD3DXVECTOR4_16F;
//===========================================================================
//
// Matrices
@@ -177,6 +315,7 @@ public:
D3DXMATRIX() {};
D3DXMATRIX( CONST FLOAT * );
D3DXMATRIX( CONST D3DMATRIX& );
D3DXMATRIX( CONST D3DXFLOAT16 * );
D3DXMATRIX( FLOAT _11, FLOAT _12, FLOAT _13, FLOAT _14,
FLOAT _21, FLOAT _22, FLOAT _23, FLOAT _24,
FLOAT _31, FLOAT _32, FLOAT _33, FLOAT _34,
@@ -220,8 +359,8 @@ public:
typedef struct _D3DMATRIX D3DXMATRIX, *LPD3DXMATRIX;
#endif //!__cplusplus
//===========================================================================
//
//---------------------------------------------------------------------------
// Aligned Matrices
//
// This class helps keep matrices 16-byte aligned as preferred by P4 cpus.
@@ -230,95 +369,53 @@ typedef struct _D3DMATRIX D3DXMATRIX, *LPD3DXMATRIX;
// with the processor pack. Unfortunately there is no way to detect the
// latter so this is turned on only on VC7. On other compilers this is the
// the same as D3DXMATRIX.
//
// Using this class on a compiler that does not actually do the alignment
// can be dangerous since it will not expose bugs that ignore alignment.
// E.g if an object of this class in inside a struct or class, and some code
// memcopys data in it assuming tight packing. This could break on a compiler
// that eventually start aligning the matrix.
//
//===========================================================================
//---------------------------------------------------------------------------
#ifdef __cplusplus
typedef struct _D3DXMATRIXA16 : public D3DXMATRIX
{
_D3DXMATRIXA16() {}
_D3DXMATRIXA16( CONST FLOAT * f): D3DXMATRIX(f) {}
_D3DXMATRIXA16( CONST D3DMATRIX& m): D3DXMATRIX(m) {}
_D3DXMATRIXA16( CONST FLOAT * );
_D3DXMATRIXA16( CONST D3DMATRIX& );
_D3DXMATRIXA16( CONST D3DXFLOAT16 * );
_D3DXMATRIXA16( FLOAT _11, FLOAT _12, FLOAT _13, FLOAT _14,
FLOAT _21, FLOAT _22, FLOAT _23, FLOAT _24,
FLOAT _31, FLOAT _32, FLOAT _33, FLOAT _34,
FLOAT _41, FLOAT _42, FLOAT _43, FLOAT _44 ) :
D3DXMATRIX(_11, _12, _13, _14,
_21, _22, _23, _24,
_31, _32, _33, _34,
_41, _42, _43, _44) {}
void* operator new(size_t s)
{
LPBYTE p = ::new BYTE[s + 16];
if (p)
{
BYTE offset = (BYTE)(16 - ((UINT_PTR)p & 15));
p += offset;
p[-1] = offset;
}
return p;
};
FLOAT _41, FLOAT _42, FLOAT _43, FLOAT _44 );
void* operator new[](size_t s)
{
LPBYTE p = ::new BYTE[s + 16];
if (p)
{
BYTE offset = (BYTE)(16 - ((UINT_PTR)p & 15));
p += offset;
p[-1] = offset;
}
return p;
};
// new operators
void* operator new ( size_t );
void* operator new[] ( size_t );
// This is NOT a virtual operator. If you cast
// to D3DXMATRIX, do not delete using that
void operator delete(void* p)
{
if(p)
{
BYTE* pb = static_cast<BYTE*>(p);
pb -= pb[-1];
::delete [] pb;
}
};
// delete operators
void operator delete ( void* ); // These are NOT virtual; Do not
void operator delete[] ( void* ); // cast to D3DXMATRIX and delete.
// assignment operators
_D3DXMATRIXA16& operator = ( CONST D3DXMATRIX& );
// This is NOT a virtual operator. If you cast
// to D3DXMATRIX, do not delete using that
void operator delete[](void* p)
{
if(p)
{
BYTE* pb = static_cast<BYTE*>(p);
pb -= pb[-1];
::delete [] pb;
}
};
struct _D3DXMATRIXA16& operator=(CONST D3DXMATRIX& rhs)
{
memcpy(&_11, &rhs, sizeof(D3DXMATRIX));
return *this;
};
} _D3DXMATRIXA16;
#else //!__cplusplus
typedef D3DXMATRIX _D3DXMATRIXA16;
#endif //!__cplusplus
#if _MSC_VER >= 1300 // VC7
#define _ALIGN_16 __declspec(align(16))
#if _MSC_VER >= 1300 // VC7
#define D3DX_ALIGN16 __declspec(align(16))
#else
#define _ALIGN_16 // Earlier compiler may not understand this, do nothing.
#define D3DX_ALIGN16 // Earlier compiler may not understand this, do nothing.
#endif
#define D3DXMATRIXA16 _ALIGN_16 _D3DXMATRIXA16
typedef D3DX_ALIGN16 _D3DXMATRIXA16 D3DXMATRIXA16, *LPD3DXMATRIXA16;
typedef D3DXMATRIXA16 *LPD3DXMATRIXA16;
//===========================================================================
//
@@ -331,6 +428,7 @@ typedef struct D3DXQUATERNION
public:
D3DXQUATERNION() {}
D3DXQUATERNION( CONST FLOAT * );
D3DXQUATERNION( CONST D3DXFLOAT16 * );
D3DXQUATERNION( FLOAT x, FLOAT y, FLOAT z, FLOAT w );
// casting
@@ -376,17 +474,27 @@ typedef struct D3DXPLANE
public:
D3DXPLANE() {}
D3DXPLANE( CONST FLOAT* );
D3DXPLANE( CONST D3DXFLOAT16* );
D3DXPLANE( FLOAT a, FLOAT b, FLOAT c, FLOAT d );
// casting
operator FLOAT* ();
operator CONST FLOAT* () const;
// assignment operators
D3DXPLANE& operator *= ( FLOAT );
D3DXPLANE& operator /= ( FLOAT );
// unary operators
D3DXPLANE operator + () const;
D3DXPLANE operator - () const;
// binary operators
D3DXPLANE operator * ( FLOAT ) const;
D3DXPLANE operator / ( FLOAT ) const;
friend D3DXPLANE operator * ( FLOAT, CONST D3DXPLANE& );
BOOL operator == ( CONST D3DXPLANE& ) const;
BOOL operator != ( CONST D3DXPLANE& ) const;
@@ -408,6 +516,7 @@ public:
D3DXCOLOR() {}
D3DXCOLOR( DWORD argb );
D3DXCOLOR( CONST FLOAT * );
D3DXCOLOR( CONST D3DXFLOAT16 * );
D3DXCOLOR( CONST D3DCOLORVALUE& );
D3DXCOLOR( FLOAT r, FLOAT g, FLOAT b, FLOAT a );
@@ -439,7 +548,7 @@ public:
D3DXCOLOR operator * ( FLOAT ) const;
D3DXCOLOR operator / ( FLOAT ) const;
friend D3DXCOLOR operator * (FLOAT, CONST D3DXCOLOR& );
friend D3DXCOLOR operator * ( FLOAT, CONST D3DXCOLOR& );
BOOL operator == ( CONST D3DXCOLOR& ) const;
BOOL operator != ( CONST D3DXCOLOR& ) const;
@@ -462,6 +571,28 @@ public:
//
//===========================================================================
//--------------------------
// Float16
//--------------------------
// non-inline
#ifdef __cplusplus
extern "C" {
#endif
// Converts an array 32-bit floats to 16-bit floats
D3DXFLOAT16* WINAPI D3DXFloat32To16Array
( D3DXFLOAT16 *pOut, CONST FLOAT *pIn, UINT n );
// Converts an array 16-bit floats to 32-bit floats
FLOAT* WINAPI D3DXFloat16To32Array
( FLOAT *pOut, CONST D3DXFLOAT16 *pIn, UINT n );
#ifdef __cplusplus
}
#endif
//--------------------------
// 2D Vector
//--------------------------
@@ -538,6 +669,20 @@ D3DXVECTOR2* WINAPI D3DXVec2TransformCoord
// Transform (x, y, 0, 0) by matrix.
D3DXVECTOR2* WINAPI D3DXVec2TransformNormal
( D3DXVECTOR2 *pOut, CONST D3DXVECTOR2 *pV, CONST D3DXMATRIX *pM );
// Transform Array (x, y, 0, 1) by matrix.
D3DXVECTOR4* WINAPI D3DXVec2TransformArray
( D3DXVECTOR4 *pOut, UINT OutStride, CONST D3DXVECTOR2 *pV, UINT VStride, CONST D3DXMATRIX *pM, UINT n);
// Transform Array (x, y, 0, 1) by matrix, project result back into w=1.
D3DXVECTOR2* WINAPI D3DXVec2TransformCoordArray
( D3DXVECTOR2 *pOut, UINT OutStride, CONST D3DXVECTOR2 *pV, UINT VStride, CONST D3DXMATRIX *pM, UINT n );
// Transform Array (x, y, 0, 0) by matrix.
D3DXVECTOR2* WINAPI D3DXVec2TransformNormalArray
( D3DXVECTOR2 *pOut, UINT OutStride, CONST D3DXVECTOR2 *pV, UINT VStride, CONST D3DXMATRIX *pM, UINT n );
#ifdef __cplusplus
}
@@ -621,16 +766,42 @@ D3DXVECTOR3* WINAPI D3DXVec3TransformCoord
// transpose of the inverse of the matrix you would use to transform a coord.
D3DXVECTOR3* WINAPI D3DXVec3TransformNormal
( D3DXVECTOR3 *pOut, CONST D3DXVECTOR3 *pV, CONST D3DXMATRIX *pM );
// Transform Array (x, y, z, 1) by matrix.
D3DXVECTOR4* WINAPI D3DXVec3TransformArray
( D3DXVECTOR4 *pOut, UINT OutStride, CONST D3DXVECTOR3 *pV, UINT VStride, CONST D3DXMATRIX *pM, UINT n );
// Transform Array (x, y, z, 1) by matrix, project result back into w=1.
D3DXVECTOR3* WINAPI D3DXVec3TransformCoordArray
( D3DXVECTOR3 *pOut, UINT OutStride, CONST D3DXVECTOR3 *pV, UINT VStride, CONST D3DXMATRIX *pM, UINT n );
// Transform (x, y, z, 0) by matrix. If you transforming a normal by a
// non-affine matrix, the matrix you pass to this function should be the
// transpose of the inverse of the matrix you would use to transform a coord.
D3DXVECTOR3* WINAPI D3DXVec3TransformNormalArray
( D3DXVECTOR3 *pOut, UINT OutStride, CONST D3DXVECTOR3 *pV, UINT VStride, CONST D3DXMATRIX *pM, UINT n );
// Project vector from object space into screen space
D3DXVECTOR3* WINAPI D3DXVec3Project
( D3DXVECTOR3 *pOut, CONST D3DXVECTOR3 *pV, CONST D3DVIEWPORT8 *pViewport,
( D3DXVECTOR3 *pOut, CONST D3DXVECTOR3 *pV, CONST D3DVIEWPORT9 *pViewport,
CONST D3DXMATRIX *pProjection, CONST D3DXMATRIX *pView, CONST D3DXMATRIX *pWorld);
// Project vector from screen space into object space
D3DXVECTOR3* WINAPI D3DXVec3Unproject
( D3DXVECTOR3 *pOut, CONST D3DXVECTOR3 *pV, CONST D3DVIEWPORT8 *pViewport,
( D3DXVECTOR3 *pOut, CONST D3DXVECTOR3 *pV, CONST D3DVIEWPORT9 *pViewport,
CONST D3DXMATRIX *pProjection, CONST D3DXMATRIX *pView, CONST D3DXMATRIX *pWorld);
// Project vector Array from object space into screen space
D3DXVECTOR3* WINAPI D3DXVec3ProjectArray
( D3DXVECTOR3 *pOut, UINT OutStride,CONST D3DXVECTOR3 *pV, UINT VStride,CONST D3DVIEWPORT9 *pViewport,
CONST D3DXMATRIX *pProjection, CONST D3DXMATRIX *pView, CONST D3DXMATRIX *pWorld, UINT n);
// Project vector Array from screen space into object space
D3DXVECTOR3* WINAPI D3DXVec3UnprojectArray
( D3DXVECTOR3 *pOut, UINT OutStride, CONST D3DXVECTOR3 *pV, UINT VStride, CONST D3DVIEWPORT9 *pViewport,
CONST D3DXMATRIX *pProjection, CONST D3DXMATRIX *pView, CONST D3DXMATRIX *pWorld, UINT n);
#ifdef __cplusplus
}
@@ -707,6 +878,10 @@ D3DXVECTOR4* WINAPI D3DXVec4BaryCentric
// Transform vector by matrix.
D3DXVECTOR4* WINAPI D3DXVec4Transform
( D3DXVECTOR4 *pOut, CONST D3DXVECTOR4 *pV, CONST D3DXMATRIX *pM );
// Transform vector array by matrix.
D3DXVECTOR4* WINAPI D3DXVec4TransformArray
( D3DXVECTOR4 *pOut, UINT OutStride, CONST D3DXVECTOR4 *pV, UINT VStride, CONST D3DXMATRIX *pM, UINT n );
#ifdef __cplusplus
}
@@ -731,9 +906,13 @@ BOOL D3DXMatrixIsIdentity
extern "C" {
#endif
FLOAT WINAPI D3DXMatrixfDeterminant
FLOAT WINAPI D3DXMatrixDeterminant
( CONST D3DXMATRIX *pM );
HRESULT WINAPI D3DXMatrixDecompose
( D3DXVECTOR3 *pOutScale, D3DXQUATERNION *pOutRotation,
D3DXVECTOR3 *pOutTranslation, CONST D3DXMATRIX *pM );
D3DXMATRIX* WINAPI D3DXMatrixTranspose
( D3DXMATRIX *pOut, CONST D3DXMATRIX *pM );
@@ -785,7 +964,6 @@ D3DXMATRIX* WINAPI D3DXMatrixRotationQuaternion
D3DXMATRIX* WINAPI D3DXMatrixRotationYawPitchRoll
( D3DXMATRIX *pOut, FLOAT Yaw, FLOAT Pitch, FLOAT Roll );
// Build transformation matrix. NULL arguments are treated as identity.
// Mout = Msc-1 * Msr-1 * Ms * Msr * Msc * Mrc-1 * Mr * Mrc * Mt
D3DXMATRIX* WINAPI D3DXMatrixTransformation
@@ -794,12 +972,26 @@ D3DXMATRIX* WINAPI D3DXMatrixTransformation
CONST D3DXVECTOR3 *pRotationCenter, CONST D3DXQUATERNION *pRotation,
CONST D3DXVECTOR3 *pTranslation);
// Build 2D transformation matrix in XY plane. NULL arguments are treated as identity.
// Mout = Msc-1 * Msr-1 * Ms * Msr * Msc * Mrc-1 * Mr * Mrc * Mt
D3DXMATRIX* WINAPI D3DXMatrixTransformation2D
( D3DXMATRIX *pOut, CONST D3DXVECTOR2* pScalingCenter,
FLOAT ScalingRotation, CONST D3DXVECTOR2* pScaling,
CONST D3DXVECTOR2* pRotationCenter, FLOAT Rotation,
CONST D3DXVECTOR2* pTranslation);
// Build affine transformation matrix. NULL arguments are treated as identity.
// Mout = Ms * Mrc-1 * Mr * Mrc * Mt
D3DXMATRIX* WINAPI D3DXMatrixAffineTransformation
( D3DXMATRIX *pOut, FLOAT Scaling, CONST D3DXVECTOR3 *pRotationCenter,
CONST D3DXQUATERNION *pRotation, CONST D3DXVECTOR3 *pTranslation);
// Build 2D affine transformation matrix in XY plane. NULL arguments are treated as identity.
// Mout = Ms * Mrc-1 * Mr * Mrc * Mt
D3DXMATRIX* WINAPI D3DXMatrixAffineTransformation2D
( D3DXMATRIX *pOut, FLOAT Scaling, CONST D3DXVECTOR2* pRotationCenter,
FLOAT Rotation, CONST D3DXVECTOR2* pTranslation);
// Build a lookat matrix. (right-handed)
D3DXMATRIX* WINAPI D3DXMatrixLookAtRH
( D3DXMATRIX *pOut, CONST D3DXVECTOR3 *pEye, CONST D3DXVECTOR3 *pAt,
@@ -993,6 +1185,9 @@ FLOAT D3DXPlaneDotCoord
FLOAT D3DXPlaneDotNormal
( CONST D3DXPLANE *pP, CONST D3DXVECTOR3 *pV);
D3DXPLANE* D3DXPlaneScale
(D3DXPLANE *pOut, CONST D3DXPLANE *pP, FLOAT s);
// non-inline
#ifdef __cplusplus
extern "C" {
@@ -1021,6 +1216,11 @@ D3DXPLANE* WINAPI D3DXPlaneFromPoints
// M should be the inverse transpose of the transformation desired.
D3DXPLANE* WINAPI D3DXPlaneTransform
( D3DXPLANE *pOut, CONST D3DXPLANE *pP, CONST D3DXMATRIX *pM );
// Transform an array of planes by a matrix. The vectors (a,b,c) must be normal.
// M should be the inverse transpose of the transformation desired.
D3DXPLANE* WINAPI D3DXPlaneTransformArray
( D3DXPLANE *pOut, UINT OutStride, CONST D3DXPLANE *pP, UINT PStride, CONST D3DXMATRIX *pM, UINT n );
#ifdef __cplusplus
}
@@ -1103,9 +1303,9 @@ FLOAT WINAPI D3DXFresnelTerm
typedef interface ID3DXMatrixStack ID3DXMatrixStack;
typedef interface ID3DXMatrixStack *LPD3DXMATRIXSTACK;
// {E3357330-CC5E-11d2-A434-00A0C90629A8}
DEFINE_GUID( IID_ID3DXMatrixStack,
0xe3357330, 0xcc5e, 0x11d2, 0xa4, 0x34, 0x0, 0xa0, 0xc9, 0x6, 0x29, 0xa8);
// {C7885BA7-F990-4fe7-922D-8515E477DD85}
DEFINE_GUID(IID_ID3DXMatrixStack,
0xc7885ba7, 0xf990, 0x4fe7, 0x92, 0x2d, 0x85, 0x15, 0xe4, 0x77, 0xdd, 0x85);
#undef INTERFACE
@@ -1208,8 +1408,389 @@ HRESULT WINAPI
}
#endif
#include "d3dx8math.inl"
//===========================================================================
//
// Spherical Harmonic Runtime Routines
//
// NOTE:
// * Most of these functions can take the same object as in and out parameters.
// The exceptions are the rotation functions.
//
// * Out parameters are typically also returned as return values, so that
// the output of one function may be used as a parameter to another.
//
//============================================================================
// non-inline
#ifdef __cplusplus
extern "C" {
#endif
//============================================================================
//
// Basic Spherical Harmonic math routines
//
//============================================================================
#define D3DXSH_MINORDER 2
#define D3DXSH_MAXORDER 6
//============================================================================
//
// D3DXSHEvalDirection:
// --------------------
// Evaluates the Spherical Harmonic basis functions
//
// Parameters:
// pOut
// Output SH coefficients - basis function Ylm is stored at l*l + m+l
// This is the pointer that is returned.
// Order
// Order of the SH evaluation, generates Order^2 coefs, degree is Order-1
// pDir
// Direction to evaluate in - assumed to be normalized
//
//============================================================================
FLOAT* WINAPI D3DXSHEvalDirection
( FLOAT *pOut, UINT Order, CONST D3DXVECTOR3 *pDir );
//============================================================================
//
// D3DXSHRotate:
// --------------------
// Rotates SH vector by a rotation matrix
//
// Parameters:
// pOut
// Output SH coefficients - basis function Ylm is stored at l*l + m+l
// This is the pointer that is returned (should not alias with pIn.)
// Order
// Order of the SH evaluation, generates Order^2 coefs, degree is Order-1
// pMatrix
// Matrix used for rotation - rotation sub matrix should be orthogonal
// and have a unit determinant.
// pIn
// Input SH coeffs (rotated), incorect results if this is also output.
//
//============================================================================
FLOAT* WINAPI D3DXSHRotate
( FLOAT *pOut, UINT Order, CONST D3DXMATRIX *pMatrix, CONST FLOAT *pIn );
//============================================================================
//
// D3DXSHRotateZ:
// --------------------
// Rotates the SH vector in the Z axis by an angle
//
// Parameters:
// pOut
// Output SH coefficients - basis function Ylm is stored at l*l + m+l
// This is the pointer that is returned (should not alias with pIn.)
// Order
// Order of the SH evaluation, generates Order^2 coefs, degree is Order-1
// Angle
// Angle in radians to rotate around the Z axis.
// pIn
// Input SH coeffs (rotated), incorect results if this is also output.
//
//============================================================================
FLOAT* WINAPI D3DXSHRotateZ
( FLOAT *pOut, UINT Order, FLOAT Angle, CONST FLOAT *pIn );
//============================================================================
//
// D3DXSHAdd:
// --------------------
// Adds two SH vectors, pOut[i] = pA[i] + pB[i];
//
// Parameters:
// pOut
// Output SH coefficients - basis function Ylm is stored at l*l + m+l
// This is the pointer that is returned.
// Order
// Order of the SH evaluation, generates Order^2 coefs, degree is Order-1
// pA
// Input SH coeffs.
// pB
// Input SH coeffs (second vector.)
//
//============================================================================
FLOAT* WINAPI D3DXSHAdd
( FLOAT *pOut, UINT Order, CONST FLOAT *pA, CONST FLOAT *pB );
//============================================================================
//
// D3DXSHScale:
// --------------------
// Adds two SH vectors, pOut[i] = pA[i]*Scale;
//
// Parameters:
// pOut
// Output SH coefficients - basis function Ylm is stored at l*l + m+l
// This is the pointer that is returned.
// Order
// Order of the SH evaluation, generates Order^2 coefs, degree is Order-1
// pIn
// Input SH coeffs.
// Scale
// Scale factor.
//
//============================================================================
FLOAT* WINAPI D3DXSHScale
( FLOAT *pOut, UINT Order, CONST FLOAT *pIn, CONST FLOAT Scale );
//============================================================================
//
// D3DXSHDot:
// --------------------
// Computes the dot product of two SH vectors
//
// Parameters:
// Order
// Order of the SH evaluation, generates Order^2 coefs, degree is Order-1
// pA
// Input SH coeffs.
// pB
// Second set of input SH coeffs.
//
//============================================================================
FLOAT WINAPI D3DXSHDot
( UINT Order, CONST FLOAT *pA, CONST FLOAT *pB );
//============================================================================
//
// D3DXSHMultiply[O]:
// --------------------
// Computes the product of two functions represented using SH (f and g), where:
// pOut[i] = int(y_i(s) * f(s) * g(s)), where y_i(s) is the ith SH basis
// function, f(s) and g(s) are SH functions (sum_i(y_i(s)*c_i)). The order O
// determines the lengths of the arrays, where there should always be O^2
// coefficients. In general the product of two SH functions of order O generates
// and SH function of order 2*O - 1, but we truncate the result. This means
// that the product commutes (f*g == g*f) but doesn't associate
// (f*(g*h) != (f*g)*h.
//
// Parameters:
// pOut
// Output SH coefficients - basis function Ylm is stored at l*l + m+l
// This is the pointer that is returned.
// pF
// Input SH coeffs for first function.
// pG
// Second set of input SH coeffs.
//
//============================================================================
FLOAT* WINAPI D3DXSHMultiply2( FLOAT *pOut, CONST FLOAT *pF, CONST FLOAT *pG);
FLOAT* WINAPI D3DXSHMultiply3( FLOAT *pOut, CONST FLOAT *pF, CONST FLOAT *pG);
FLOAT* WINAPI D3DXSHMultiply4( FLOAT *pOut, CONST FLOAT *pF, CONST FLOAT *pG);
FLOAT* WINAPI D3DXSHMultiply5( FLOAT *pOut, CONST FLOAT *pF, CONST FLOAT *pG);
FLOAT* WINAPI D3DXSHMultiply6( FLOAT *pOut, CONST FLOAT *pF, CONST FLOAT *pG);
//============================================================================
//
// Basic Spherical Harmonic lighting routines
//
//============================================================================
//============================================================================
//
// D3DXSHEvalDirectionalLight:
// --------------------
// Evaluates a directional light and returns spectral SH data. The output
// vector is computed so that if the intensity of R/G/B is unit the resulting
// exit radiance of a point directly under the light on a diffuse object with
// an albedo of 1 would be 1.0. This will compute 3 spectral samples, pROut
// has to be specified, while pGout and pBout are optional.
//
// Parameters:
// Order
// Order of the SH evaluation, generates Order^2 coefs, degree is Order-1
// pDir
// Direction light is coming from (assumed to be normalized.)
// RIntensity
// Red intensity of light.
// GIntensity
// Green intensity of light.
// BIntensity
// Blue intensity of light.
// pROut
// Output SH vector for Red.
// pGOut
// Output SH vector for Green (optional.)
// pBOut
// Output SH vector for Blue (optional.)
//
//============================================================================
HRESULT WINAPI D3DXSHEvalDirectionalLight
( UINT Order, CONST D3DXVECTOR3 *pDir,
FLOAT RIntensity, FLOAT GIntensity, FLOAT BIntensity,
FLOAT *pROut, FLOAT *pGOut, FLOAT *pBOut );
//============================================================================
//
// D3DXSHEvalSphericalLight:
// --------------------
// Evaluates a spherical light and returns spectral SH data. There is no
// normalization of the intensity of the light like there is for directional
// lights, care has to be taken when specifiying the intensities. This will
// compute 3 spectral samples, pROut has to be specified, while pGout and
// pBout are optional.
//
// Parameters:
// Order
// Order of the SH evaluation, generates Order^2 coefs, degree is Order-1
// pPos
// Position of light - reciever is assumed to be at the origin.
// Radius
// Radius of the spherical light source.
// RIntensity
// Red intensity of light.
// GIntensity
// Green intensity of light.
// BIntensity
// Blue intensity of light.
// pROut
// Output SH vector for Red.
// pGOut
// Output SH vector for Green (optional.)
// pBOut
// Output SH vector for Blue (optional.)
//
//============================================================================
HRESULT WINAPI D3DXSHEvalSphericalLight
( UINT Order, CONST D3DXVECTOR3 *pPos, FLOAT Radius,
FLOAT RIntensity, FLOAT GIntensity, FLOAT BIntensity,
FLOAT *pROut, FLOAT *pGOut, FLOAT *pBOut );
//============================================================================
//
// D3DXSHEvalConeLight:
// --------------------
// Evaluates a light that is a cone of constant intensity and returns spectral
// SH data. The output vector is computed so that if the intensity of R/G/B is
// unit the resulting exit radiance of a point directly under the light oriented
// in the cone direction on a diffuse object with an albedo of 1 would be 1.0.
// This will compute 3 spectral samples, pROut has to be specified, while pGout
// and pBout are optional.
//
// Parameters:
// Order
// Order of the SH evaluation, generates Order^2 coefs, degree is Order-1
// pDir
// Direction light is coming from (assumed to be normalized.)
// Radius
// Radius of cone in radians.
// RIntensity
// Red intensity of light.
// GIntensity
// Green intensity of light.
// BIntensity
// Blue intensity of light.
// pROut
// Output SH vector for Red.
// pGOut
// Output SH vector for Green (optional.)
// pBOut
// Output SH vector for Blue (optional.)
//
//============================================================================
HRESULT WINAPI D3DXSHEvalConeLight
( UINT Order, CONST D3DXVECTOR3 *pDir, FLOAT Radius,
FLOAT RIntensity, FLOAT GIntensity, FLOAT BIntensity,
FLOAT *pROut, FLOAT *pGOut, FLOAT *pBOut );
//============================================================================
//
// D3DXSHEvalHemisphereLight:
// --------------------
// Evaluates a light that is a linear interpolant between two colors over the
// sphere. The interpolant is linear along the axis of the two points, not
// over the surface of the sphere (ie: if the axis was (0,0,1) it is linear in
// Z, not in the azimuthal angle.) The resulting spherical lighting function
// is normalized so that a point on a perfectly diffuse surface with no
// shadowing and a normal pointed in the direction pDir would result in exit
// radiance with a value of 1 if the top color was white and the bottom color
// was black. This is a very simple model where Top represents the intensity
// of the "sky" and Bottom represents the intensity of the "ground".
//
// Parameters:
// Order
// Order of the SH evaluation, generates Order^2 coefs, degree is Order-1
// pDir
// Axis of the hemisphere.
// Top
// Color of the upper hemisphere.
// Bottom
// Color of the lower hemisphere.
// pROut
// Output SH vector for Red.
// pGOut
// Output SH vector for Green
// pBOut
// Output SH vector for Blue
//
//============================================================================
HRESULT WINAPI D3DXSHEvalHemisphereLight
( UINT Order, CONST D3DXVECTOR3 *pDir, D3DXCOLOR Top, D3DXCOLOR Bottom,
FLOAT *pROut, FLOAT *pGOut, FLOAT *pBOut );
//============================================================================
//
// Basic Spherical Harmonic projection routines
//
//============================================================================
//============================================================================
//
// D3DXSHProjectCubeMap:
// --------------------
// Projects a function represented on a cube map into spherical harmonics.
//
// Parameters:
// Order
// Order of the SH evaluation, generates Order^2 coefs, degree is Order-1
// pCubeMap
// CubeMap that is going to be projected into spherical harmonics
// pROut
// Output SH vector for Red.
// pGOut
// Output SH vector for Green
// pBOut
// Output SH vector for Blue
//
//============================================================================
HRESULT WINAPI D3DXSHProjectCubeMap
( UINT uOrder, LPDIRECT3DCUBETEXTURE9 pCubeMap,
FLOAT *pROut, FLOAT *pGOut, FLOAT *pBOut );
#ifdef __cplusplus
}
#endif
#include "d3dx9math.inl"
#if _MSC_VER >= 1200
#pragma warning(pop)
#else
#pragma warning(default:4201)
#endif
#endif // __D3DX9MATH_H__
#endif // __D3DX8MATH_H__

View File

@@ -2,14 +2,13 @@
//
// Copyright (C) Microsoft Corporation. All Rights Reserved.
//
// File: d3dx8math.inl
// File: d3dx9math.inl
// Content: D3DX math inline functions
//
//////////////////////////////////////////////////////////////////////////////
#ifndef __D3DX8MATH_INL__
#define __D3DX8MATH_INL__
#ifndef __D3DX9MATH_INL__
#define __D3DX9MATH_INL__
//===========================================================================
//
@@ -19,6 +18,45 @@
#ifdef __cplusplus
//--------------------------
// Float16
//--------------------------
D3DXINLINE
D3DXFLOAT16::D3DXFLOAT16( FLOAT f )
{
D3DXFloat32To16Array(this, &f, 1);
}
D3DXINLINE
D3DXFLOAT16::D3DXFLOAT16( CONST D3DXFLOAT16& f )
{
value = f.value;
}
// casting
D3DXINLINE
D3DXFLOAT16::operator FLOAT ()
{
FLOAT f;
D3DXFloat16To32Array(&f, this, 1);
return f;
}
// binary operators
D3DXINLINE BOOL
D3DXFLOAT16::operator == ( CONST D3DXFLOAT16& f ) const
{
return value == f.value;
}
D3DXINLINE BOOL
D3DXFLOAT16::operator != ( CONST D3DXFLOAT16& f ) const
{
return value != f.value;
}
//--------------------------
// 2D Vector
//--------------------------
@@ -35,6 +73,17 @@ D3DXVECTOR2::D3DXVECTOR2( CONST FLOAT *pf )
y = pf[1];
}
D3DXINLINE
D3DXVECTOR2::D3DXVECTOR2( CONST D3DXFLOAT16 *pf )
{
#ifdef D3DX_DEBUG
if(!pf)
return;
#endif
D3DXFloat16To32Array(&x, pf, 2);
}
D3DXINLINE
D3DXVECTOR2::D3DXVECTOR2( FLOAT fx, FLOAT fy )
{
@@ -42,6 +91,7 @@ D3DXVECTOR2::D3DXVECTOR2( FLOAT fx, FLOAT fy )
y = fy;
}
// casting
D3DXINLINE
D3DXVECTOR2::operator FLOAT* ()
@@ -55,6 +105,7 @@ D3DXVECTOR2::operator CONST FLOAT* () const
return (CONST FLOAT *) &x;
}
// assignment operators
D3DXINLINE D3DXVECTOR2&
D3DXVECTOR2::operator += ( CONST D3DXVECTOR2& v )
@@ -89,6 +140,7 @@ D3DXVECTOR2::operator /= ( FLOAT f )
return *this;
}
// unary operators
D3DXINLINE D3DXVECTOR2
D3DXVECTOR2::operator + () const
@@ -102,6 +154,7 @@ D3DXVECTOR2::operator - () const
return D3DXVECTOR2(-x, -y);
}
// binary operators
D3DXINLINE D3DXVECTOR2
D3DXVECTOR2::operator + ( CONST D3DXVECTOR2& v ) const
@@ -128,7 +181,6 @@ D3DXVECTOR2::operator / ( FLOAT f ) const
return D3DXVECTOR2(x * fInv, y * fInv);
}
D3DXINLINE D3DXVECTOR2
operator * ( FLOAT f, CONST D3DXVECTOR2& v )
{
@@ -149,6 +201,67 @@ D3DXVECTOR2::operator != ( CONST D3DXVECTOR2& v ) const
//--------------------------
// 2D Vector (16 bit)
//--------------------------
D3DXINLINE
D3DXVECTOR2_16F::D3DXVECTOR2_16F( CONST FLOAT *pf )
{
#ifdef D3DX_DEBUG
if(!pf)
return;
#endif
D3DXFloat32To16Array(&x, pf, 2);
}
D3DXINLINE
D3DXVECTOR2_16F::D3DXVECTOR2_16F( CONST D3DXFLOAT16 *pf )
{
#ifdef D3DX_DEBUG
if(!pf)
return;
#endif
*((DWORD *) &x) = *((DWORD *) &pf[0]);
}
D3DXINLINE
D3DXVECTOR2_16F::D3DXVECTOR2_16F( CONST D3DXFLOAT16 &fx, CONST D3DXFLOAT16 &fy )
{
x = fx;
y = fy;
}
// casting
D3DXINLINE
D3DXVECTOR2_16F::operator D3DXFLOAT16* ()
{
return (D3DXFLOAT16*) &x;
}
D3DXINLINE
D3DXVECTOR2_16F::operator CONST D3DXFLOAT16* () const
{
return (CONST D3DXFLOAT16*) &x;
}
// binary operators
D3DXINLINE BOOL
D3DXVECTOR2_16F::operator == ( CONST D3DXVECTOR2_16F &v ) const
{
return *((DWORD *) &x) == *((DWORD *) &v.x);
}
D3DXINLINE BOOL
D3DXVECTOR2_16F::operator != ( CONST D3DXVECTOR2_16F &v ) const
{
return *((DWORD *) &x) != *((DWORD *) &v.x);
}
//--------------------------
// 3D Vector
@@ -174,6 +287,17 @@ D3DXVECTOR3::D3DXVECTOR3( CONST D3DVECTOR& v )
z = v.z;
}
D3DXINLINE
D3DXVECTOR3::D3DXVECTOR3( CONST D3DXFLOAT16 *pf )
{
#ifdef D3DX_DEBUG
if(!pf)
return;
#endif
D3DXFloat16To32Array(&x, pf, 3);
}
D3DXINLINE
D3DXVECTOR3::D3DXVECTOR3( FLOAT fx, FLOAT fy, FLOAT fz )
{
@@ -298,6 +422,80 @@ D3DXVECTOR3::operator != ( CONST D3DXVECTOR3& v ) const
//--------------------------
// 3D Vector (16 bit)
//--------------------------
D3DXINLINE
D3DXVECTOR3_16F::D3DXVECTOR3_16F( CONST FLOAT *pf )
{
#ifdef D3DX_DEBUG
if(!pf)
return;
#endif
D3DXFloat32To16Array(&x, pf, 3);
}
D3DXINLINE
D3DXVECTOR3_16F::D3DXVECTOR3_16F( CONST D3DVECTOR& v )
{
D3DXFloat32To16Array(&x, &v.x, 1);
D3DXFloat32To16Array(&y, &v.y, 1);
D3DXFloat32To16Array(&z, &v.z, 1);
}
D3DXINLINE
D3DXVECTOR3_16F::D3DXVECTOR3_16F( CONST D3DXFLOAT16 *pf )
{
#ifdef D3DX_DEBUG
if(!pf)
return;
#endif
*((DWORD *) &x) = *((DWORD *) &pf[0]);
*((WORD *) &z) = *((WORD *) &pf[2]);
}
D3DXINLINE
D3DXVECTOR3_16F::D3DXVECTOR3_16F( CONST D3DXFLOAT16 &fx, CONST D3DXFLOAT16 &fy, CONST D3DXFLOAT16 &fz )
{
x = fx;
y = fy;
z = fz;
}
// casting
D3DXINLINE
D3DXVECTOR3_16F::operator D3DXFLOAT16* ()
{
return (D3DXFLOAT16*) &x;
}
D3DXINLINE
D3DXVECTOR3_16F::operator CONST D3DXFLOAT16* () const
{
return (CONST D3DXFLOAT16*) &x;
}
// binary operators
D3DXINLINE BOOL
D3DXVECTOR3_16F::operator == ( CONST D3DXVECTOR3_16F &v ) const
{
return *((DWORD *) &x) == *((DWORD *) &v.x) &&
*((WORD *) &z) == *((WORD *) &v.z);
}
D3DXINLINE BOOL
D3DXVECTOR3_16F::operator != ( CONST D3DXVECTOR3_16F &v ) const
{
return *((DWORD *) &x) != *((DWORD *) &v.x) ||
*((WORD *) &z) != *((WORD *) &v.z);
}
//--------------------------
// 4D Vector
//--------------------------
@@ -315,6 +513,26 @@ D3DXVECTOR4::D3DXVECTOR4( CONST FLOAT *pf )
w = pf[3];
}
D3DXINLINE
D3DXVECTOR4::D3DXVECTOR4( CONST D3DXFLOAT16 *pf )
{
#ifdef D3DX_DEBUG
if(!pf)
return;
#endif
D3DXFloat16To32Array(&x, pf, 4);
}
D3DXINLINE
D3DXVECTOR4::D3DXVECTOR4( CONST D3DVECTOR& v, FLOAT f )
{
x = v.x;
y = v.y;
z = v.z;
w = f;
}
D3DXINLINE
D3DXVECTOR4::D3DXVECTOR4( FLOAT fx, FLOAT fy, FLOAT fz, FLOAT fw )
{
@@ -422,7 +640,6 @@ D3DXVECTOR4::operator / ( FLOAT f ) const
return D3DXVECTOR4(x * fInv, y * fInv, z * fInv, w * fInv);
}
D3DXINLINE D3DXVECTOR4
operator * ( FLOAT f, CONST D3DXVECTOR4& v )
{
@@ -443,6 +660,83 @@ D3DXVECTOR4::operator != ( CONST D3DXVECTOR4& v ) const
}
//--------------------------
// 4D Vector (16 bit)
//--------------------------
D3DXINLINE
D3DXVECTOR4_16F::D3DXVECTOR4_16F( CONST FLOAT *pf )
{
#ifdef D3DX_DEBUG
if(!pf)
return;
#endif
D3DXFloat32To16Array(&x, pf, 4);
}
D3DXINLINE
D3DXVECTOR4_16F::D3DXVECTOR4_16F( CONST D3DXFLOAT16 *pf )
{
#ifdef D3DX_DEBUG
if(!pf)
return;
#endif
*((DWORD *) &x) = *((DWORD *) &pf[0]);
*((DWORD *) &z) = *((DWORD *) &pf[2]);
}
D3DXINLINE
D3DXVECTOR4_16F::D3DXVECTOR4_16F( CONST D3DXVECTOR3_16F& v, CONST D3DXFLOAT16& f )
{
x = v.x;
y = v.y;
z = v.z;
w = f;
}
D3DXINLINE
D3DXVECTOR4_16F::D3DXVECTOR4_16F( CONST D3DXFLOAT16 &fx, CONST D3DXFLOAT16 &fy, CONST D3DXFLOAT16 &fz, CONST D3DXFLOAT16 &fw )
{
x = fx;
y = fy;
z = fz;
w = fw;
}
// casting
D3DXINLINE
D3DXVECTOR4_16F::operator D3DXFLOAT16* ()
{
return (D3DXFLOAT16*) &x;
}
D3DXINLINE
D3DXVECTOR4_16F::operator CONST D3DXFLOAT16* () const
{
return (CONST D3DXFLOAT16*) &x;
}
// binary operators
D3DXINLINE BOOL
D3DXVECTOR4_16F::operator == ( CONST D3DXVECTOR4_16F &v ) const
{
return *((DWORD *) &x) == *((DWORD *) &v.x) &&
*((DWORD *) &z) == *((DWORD *) &v.z);
}
D3DXINLINE BOOL
D3DXVECTOR4_16F::operator != ( CONST D3DXVECTOR4_16F &v ) const
{
return *((DWORD *) &x) != *((DWORD *) &v.x) ||
*((DWORD *) &z) != *((DWORD *) &v.z);
}
//--------------------------
// Matrix
//--------------------------
@@ -463,6 +757,17 @@ D3DXMATRIX::D3DXMATRIX( CONST D3DMATRIX& mat )
memcpy(&_11, &mat, sizeof(D3DXMATRIX));
}
D3DXINLINE
D3DXMATRIX::D3DXMATRIX( CONST D3DXFLOAT16* pf )
{
#ifdef D3DX_DEBUG
if(!pf)
return;
#endif
D3DXFloat16To32Array(&_11, pf, 16);
}
D3DXINLINE
D3DXMATRIX::D3DXMATRIX( FLOAT f11, FLOAT f12, FLOAT f13, FLOAT f14,
FLOAT f21, FLOAT f22, FLOAT f23, FLOAT f24,
@@ -643,6 +948,104 @@ D3DXMATRIX::operator != ( CONST D3DXMATRIX& mat ) const
//--------------------------
// Aligned Matrices
//--------------------------
D3DXINLINE
_D3DXMATRIXA16::_D3DXMATRIXA16( CONST FLOAT* f ) :
D3DXMATRIX( f )
{
}
D3DXINLINE
_D3DXMATRIXA16::_D3DXMATRIXA16( CONST D3DMATRIX& m ) :
D3DXMATRIX( m )
{
}
D3DXINLINE
_D3DXMATRIXA16::_D3DXMATRIXA16( CONST D3DXFLOAT16* f ) :
D3DXMATRIX( f )
{
}
D3DXINLINE
_D3DXMATRIXA16::_D3DXMATRIXA16( FLOAT _11, FLOAT _12, FLOAT _13, FLOAT _14,
FLOAT _21, FLOAT _22, FLOAT _23, FLOAT _24,
FLOAT _31, FLOAT _32, FLOAT _33, FLOAT _34,
FLOAT _41, FLOAT _42, FLOAT _43, FLOAT _44 ) :
D3DXMATRIX(_11, _12, _13, _14,
_21, _22, _23, _24,
_31, _32, _33, _34,
_41, _42, _43, _44)
{
}
#ifndef SIZE_MAX
#define SIZE_MAX ((SIZE_T)-1)
#endif
D3DXINLINE void*
_D3DXMATRIXA16::operator new( size_t s )
{
if (s > (SIZE_MAX-16))
return NULL;
LPBYTE p = ::new BYTE[s + 16];
if (p)
{
BYTE offset = (BYTE)(16 - ((UINT_PTR)p & 15));
p += offset;
p[-1] = offset;
}
return p;
}
D3DXINLINE void*
_D3DXMATRIXA16::operator new[]( size_t s )
{
if (s > (SIZE_MAX-16))
return NULL;
LPBYTE p = ::new BYTE[s + 16];
if (p)
{
BYTE offset = (BYTE)(16 - ((UINT_PTR)p & 15));
p += offset;
p[-1] = offset;
}
return p;
}
D3DXINLINE void
_D3DXMATRIXA16::operator delete(void* p)
{
if(p)
{
BYTE* pb = static_cast<BYTE*>(p);
pb -= pb[-1];
::delete [] pb;
}
}
D3DXINLINE void
_D3DXMATRIXA16::operator delete[](void* p)
{
if(p)
{
BYTE* pb = static_cast<BYTE*>(p);
pb -= pb[-1];
::delete [] pb;
}
}
D3DXINLINE _D3DXMATRIXA16&
_D3DXMATRIXA16::operator=(CONST D3DXMATRIX& rhs)
{
memcpy(&_11, &rhs, sizeof(D3DXMATRIX));
return *this;
}
//--------------------------
// Quaternion
//--------------------------
@@ -661,6 +1064,17 @@ D3DXQUATERNION::D3DXQUATERNION( CONST FLOAT* pf )
w = pf[3];
}
D3DXINLINE
D3DXQUATERNION::D3DXQUATERNION( CONST D3DXFLOAT16* pf )
{
#ifdef D3DX_DEBUG
if(!pf)
return;
#endif
D3DXFloat16To32Array(&x, pf, 4);
}
D3DXINLINE
D3DXQUATERNION::D3DXQUATERNION( FLOAT fx, FLOAT fy, FLOAT fz, FLOAT fw )
{
@@ -823,6 +1237,17 @@ D3DXPLANE::D3DXPLANE( CONST FLOAT* pf )
d = pf[3];
}
D3DXINLINE
D3DXPLANE::D3DXPLANE( CONST D3DXFLOAT16* pf )
{
#ifdef D3DX_DEBUG
if(!pf)
return;
#endif
D3DXFloat16To32Array(&a, pf, 4);
}
D3DXINLINE
D3DXPLANE::D3DXPLANE( FLOAT fa, FLOAT fb, FLOAT fc, FLOAT fd )
{
@@ -847,6 +1272,29 @@ D3DXPLANE::operator CONST FLOAT* () const
}
// assignment operators
D3DXINLINE D3DXPLANE&
D3DXPLANE::operator *= ( FLOAT f )
{
a *= f;
b *= f;
c *= f;
d *= f;
return *this;
}
D3DXINLINE D3DXPLANE&
D3DXPLANE::operator /= ( FLOAT f )
{
FLOAT fInv = 1.0f / f;
a *= fInv;
b *= fInv;
c *= fInv;
d *= fInv;
return *this;
}
// unary operators
D3DXINLINE D3DXPLANE
D3DXPLANE::operator + () const
@@ -862,6 +1310,25 @@ D3DXPLANE::operator - () const
// binary operators
D3DXINLINE D3DXPLANE
D3DXPLANE::operator * ( FLOAT f ) const
{
return D3DXPLANE(a * f, b * f, c * f, d * f);
}
D3DXINLINE D3DXPLANE
D3DXPLANE::operator / ( FLOAT f ) const
{
FLOAT fInv = 1.0f / f;
return D3DXPLANE(a * fInv, b * fInv, c * fInv, d * fInv);
}
D3DXINLINE D3DXPLANE
operator * (FLOAT f, CONST D3DXPLANE& p )
{
return D3DXPLANE(f * p.a, f * p.b, f * p.c, f * p.d);
}
D3DXINLINE BOOL
D3DXPLANE::operator == ( CONST D3DXPLANE& p ) const
{
@@ -905,6 +1372,17 @@ D3DXCOLOR::D3DXCOLOR( CONST FLOAT* pf )
a = pf[3];
}
D3DXINLINE
D3DXCOLOR::D3DXCOLOR( CONST D3DXFLOAT16* pf )
{
#ifdef D3DX_DEBUG
if(!pf)
return;
#endif
D3DXFloat16To32Array(&r, pf, 4);
}
D3DXINLINE
D3DXCOLOR::D3DXCOLOR( CONST D3DCOLORVALUE& c )
{
@@ -1658,6 +2136,21 @@ D3DXINLINE FLOAT D3DXPlaneDotNormal
return pP->a * pV->x + pP->b * pV->y + pP->c * pV->z;
}
D3DXINLINE D3DXPLANE* D3DXPlaneScale
(D3DXPLANE *pOut, CONST D3DXPLANE *pP, FLOAT s)
{
#ifdef D3DX_DEBUG
if(!pOut || !pP)
return NULL;
#endif
pOut->a = pP->a * s;
pOut->b = pP->b * s;
pOut->c = pP->c * s;
pOut->d = pP->d * s;
return pOut;
}
//--------------------------
// Color
@@ -1754,4 +2247,5 @@ D3DXINLINE D3DXCOLOR* D3DXColorLerp
}
#endif // __D3DX8MATH_INL__
#endif // __D3DX9MATH_INL__

3007
extern/include/d3dx9mesh.h vendored Normal file

File diff suppressed because it is too large Load Diff

1010
extern/include/d3dx9shader.h vendored Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -2,15 +2,15 @@
//
// Copyright (C) Microsoft Corporation. All Rights Reserved.
//
// File: d3dx8shapes.h
// File: d3dx9shapes.h
// Content: D3DX simple shapes
//
///////////////////////////////////////////////////////////////////////////
#include "d3dx8.h"
#include "d3dx9.h"
#ifndef __D3DX8SHAPES_H__
#define __D3DX8SHAPES_H__
#ifndef __D3DX9SHAPES_H__
#define __D3DX9SHAPES_H__
///////////////////////////////////////////////////////////////////////////
// Functions:
@@ -37,7 +37,7 @@ extern "C" {
//-------------------------------------------------------------------------
HRESULT WINAPI
D3DXCreatePolygon(
LPDIRECT3DDEVICE8 pDevice,
LPDIRECT3DDEVICE9 pDevice,
FLOAT Length,
UINT Sides,
LPD3DXMESH* ppMesh,
@@ -61,7 +61,7 @@ HRESULT WINAPI
//-------------------------------------------------------------------------
HRESULT WINAPI
D3DXCreateBox(
LPDIRECT3DDEVICE8 pDevice,
LPDIRECT3DDEVICE9 pDevice,
FLOAT Width,
FLOAT Height,
FLOAT Depth,
@@ -88,7 +88,7 @@ HRESULT WINAPI
//-------------------------------------------------------------------------
HRESULT WINAPI
D3DXCreateCylinder(
LPDIRECT3DDEVICE8 pDevice,
LPDIRECT3DDEVICE9 pDevice,
FLOAT Radius1,
FLOAT Radius2,
FLOAT Length,
@@ -115,7 +115,7 @@ HRESULT WINAPI
//-------------------------------------------------------------------------
HRESULT WINAPI
D3DXCreateSphere(
LPDIRECT3DDEVICE8 pDevice,
LPDIRECT3DDEVICE9 pDevice,
FLOAT Radius,
UINT Slices,
UINT Stacks,
@@ -141,7 +141,7 @@ HRESULT WINAPI
//-------------------------------------------------------------------------
HRESULT WINAPI
D3DXCreateTorus(
LPDIRECT3DDEVICE8 pDevice,
LPDIRECT3DDEVICE9 pDevice,
FLOAT InnerRadius,
FLOAT OuterRadius,
UINT Sides,
@@ -163,7 +163,7 @@ HRESULT WINAPI
//-------------------------------------------------------------------------
HRESULT WINAPI
D3DXCreateTeapot(
LPDIRECT3DDEVICE8 pDevice,
LPDIRECT3DDEVICE9 pDevice,
LPD3DXMESH* ppMesh,
LPD3DXBUFFER* ppAdjacency);
@@ -186,7 +186,7 @@ HRESULT WINAPI
//-------------------------------------------------------------------------
HRESULT WINAPI
D3DXCreateTextA(
LPDIRECT3DDEVICE8 pDevice,
LPDIRECT3DDEVICE9 pDevice,
HDC hDC,
LPCSTR pText,
FLOAT Deviation,
@@ -197,7 +197,7 @@ HRESULT WINAPI
HRESULT WINAPI
D3DXCreateTextW(
LPDIRECT3DDEVICE8 pDevice,
LPDIRECT3DDEVICE9 pDevice,
HDC hDC,
LPCWSTR pText,
FLOAT Deviation,
@@ -217,4 +217,5 @@ HRESULT WINAPI
}
#endif //__cplusplus
#endif //__D3DX8SHAPES_H__
#endif //__D3DX9SHAPES_H__

View File

@@ -2,15 +2,15 @@
//
// Copyright (C) Microsoft Corporation. All Rights Reserved.
//
// File: d3dx8tex.h
// File: d3dx9tex.h
// Content: D3DX texturing APIs
//
//////////////////////////////////////////////////////////////////////////////
#include "d3dx8.h"
#include "d3dx9.h"
#ifndef __D3DX8TEX_H__
#define __D3DX8TEX_H__
#ifndef __D3DX9TEX_H__
#define __D3DX9TEX_H__
//----------------------------------------------------------------------------
@@ -52,21 +52,44 @@
// Same as specifying D3DX_FILTER_MIRROR_U | D3DX_FILTER_MIRROR_V |
// D3DX_FILTER_MIRROR_V
// D3DX_FILTER_DITHER
// Dithers the resulting image.
// Dithers the resulting image using a 4x4 order dither pattern.
// D3DX_FILTER_SRGB_IN
// Denotes that the input data is in sRGB (gamma 2.2) colorspace.
// D3DX_FILTER_SRGB_OUT
// Denotes that the output data is in sRGB (gamma 2.2) colorspace.
// D3DX_FILTER_SRGB
// Same as specifying D3DX_FILTER_SRGB_IN | D3DX_FILTER_SRGB_OUT
//
//----------------------------------------------------------------------------
#define D3DX_FILTER_NONE (1 << 0)
#define D3DX_FILTER_POINT (2 << 0)
#define D3DX_FILTER_LINEAR (3 << 0)
#define D3DX_FILTER_TRIANGLE (4 << 0)
#define D3DX_FILTER_BOX (5 << 0)
#define D3DX_FILTER_NONE (1 << 0)
#define D3DX_FILTER_POINT (2 << 0)
#define D3DX_FILTER_LINEAR (3 << 0)
#define D3DX_FILTER_TRIANGLE (4 << 0)
#define D3DX_FILTER_BOX (5 << 0)
#define D3DX_FILTER_MIRROR_U (1 << 16)
#define D3DX_FILTER_MIRROR_V (2 << 16)
#define D3DX_FILTER_MIRROR_W (4 << 16)
#define D3DX_FILTER_MIRROR (7 << 16)
#define D3DX_FILTER_DITHER (1 << 19)
#define D3DX_FILTER_DITHER_DIFFUSION (2 << 19)
#define D3DX_FILTER_SRGB_IN (1 << 21)
#define D3DX_FILTER_SRGB_OUT (2 << 21)
#define D3DX_FILTER_SRGB (3 << 21)
//-----------------------------------------------------------------------------
// D3DX_SKIP_DDS_MIP_LEVELS is used to skip mip levels when loading a DDS file:
//-----------------------------------------------------------------------------
#define D3DX_SKIP_DDS_MIP_LEVELS_MASK 0x1F
#define D3DX_SKIP_DDS_MIP_LEVELS_SHIFT 26
#define D3DX_SKIP_DDS_MIP_LEVELS(levels, filter) ((((levels) & D3DX_SKIP_DDS_MIP_LEVELS_MASK) << D3DX_SKIP_DDS_MIP_LEVELS_SHIFT) | ((filter) == D3DX_DEFAULT ? D3DX_FILTER_BOX : (filter)))
#define D3DX_FILTER_MIRROR_U (1 << 16)
#define D3DX_FILTER_MIRROR_V (2 << 16)
#define D3DX_FILTER_MIRROR_W (4 << 16)
#define D3DX_FILTER_MIRROR (7 << 16)
#define D3DX_FILTER_DITHER (8 << 16)
//----------------------------------------------------------------------------
@@ -148,6 +171,8 @@ typedef enum _D3DXIMAGE_FILEFORMAT
D3DXIFF_DDS = 4,
D3DXIFF_PPM = 5,
D3DXIFF_DIB = 6,
D3DXIFF_HDR = 7, //high dynamic range formats
D3DXIFF_PFM = 8, //
D3DXIFF_FORCE_DWORD = 0x7fffffff
} D3DXIMAGE_FILEFORMAT;
@@ -173,8 +198,11 @@ typedef enum _D3DXIMAGE_FILEFORMAT
//
//----------------------------------------------------------------------------
typedef VOID (*LPD3DXFILL2D)(D3DXVECTOR4 *pOut, D3DXVECTOR2 *pTexCoord, D3DXVECTOR2 *pTexelSize, LPVOID pData);
typedef VOID (*LPD3DXFILL3D)(D3DXVECTOR4 *pOut, D3DXVECTOR3 *pTexCoord, D3DXVECTOR3 *pTexelSize, LPVOID pData);
typedef VOID (WINAPI *LPD3DXFILL2D)(D3DXVECTOR4 *pOut,
CONST D3DXVECTOR2 *pTexCoord, CONST D3DXVECTOR2 *pTexelSize, LPVOID pData);
typedef VOID (WINAPI *LPD3DXFILL3D)(D3DXVECTOR4 *pOut,
CONST D3DXVECTOR3 *pTexCoord, CONST D3DXVECTOR3 *pTexelSize, LPVOID pData);
@@ -341,7 +369,7 @@ HRESULT WINAPI
HRESULT WINAPI
D3DXLoadSurfaceFromFileA(
LPDIRECT3DSURFACE8 pDestSurface,
LPDIRECT3DSURFACE9 pDestSurface,
CONST PALETTEENTRY* pDestPalette,
CONST RECT* pDestRect,
LPCSTR pSrcFile,
@@ -352,7 +380,7 @@ HRESULT WINAPI
HRESULT WINAPI
D3DXLoadSurfaceFromFileW(
LPDIRECT3DSURFACE8 pDestSurface,
LPDIRECT3DSURFACE9 pDestSurface,
CONST PALETTEENTRY* pDestPalette,
CONST RECT* pDestRect,
LPCWSTR pSrcFile,
@@ -371,7 +399,7 @@ HRESULT WINAPI
HRESULT WINAPI
D3DXLoadSurfaceFromResourceA(
LPDIRECT3DSURFACE8 pDestSurface,
LPDIRECT3DSURFACE9 pDestSurface,
CONST PALETTEENTRY* pDestPalette,
CONST RECT* pDestRect,
HMODULE hSrcModule,
@@ -383,7 +411,7 @@ HRESULT WINAPI
HRESULT WINAPI
D3DXLoadSurfaceFromResourceW(
LPDIRECT3DSURFACE8 pDestSurface,
LPDIRECT3DSURFACE9 pDestSurface,
CONST PALETTEENTRY* pDestPalette,
CONST RECT* pDestRect,
HMODULE hSrcModule,
@@ -404,7 +432,7 @@ HRESULT WINAPI
HRESULT WINAPI
D3DXLoadSurfaceFromFileInMemory(
LPDIRECT3DSURFACE8 pDestSurface,
LPDIRECT3DSURFACE9 pDestSurface,
CONST PALETTEENTRY* pDestPalette,
CONST RECT* pDestRect,
LPCVOID pSrcData,
@@ -447,10 +475,10 @@ HRESULT WINAPI
HRESULT WINAPI
D3DXLoadSurfaceFromSurface(
LPDIRECT3DSURFACE8 pDestSurface,
LPDIRECT3DSURFACE9 pDestSurface,
CONST PALETTEENTRY* pDestPalette,
CONST RECT* pDestRect,
LPDIRECT3DSURFACE8 pSrcSurface,
LPDIRECT3DSURFACE9 pSrcSurface,
CONST PALETTEENTRY* pSrcPalette,
CONST RECT* pSrcRect,
DWORD Filter,
@@ -493,7 +521,7 @@ HRESULT WINAPI
HRESULT WINAPI
D3DXLoadSurfaceFromMemory(
LPDIRECT3DSURFACE8 pDestSurface,
LPDIRECT3DSURFACE9 pDestSurface,
CONST PALETTEENTRY* pDestPalette,
CONST RECT* pDestRect,
LPCVOID pSrcMemory,
@@ -528,7 +556,7 @@ HRESULT WINAPI
D3DXSaveSurfaceToFileA(
LPCSTR pDestFile,
D3DXIMAGE_FILEFORMAT DestFormat,
LPDIRECT3DSURFACE8 pSrcSurface,
LPDIRECT3DSURFACE9 pSrcSurface,
CONST PALETTEENTRY* pSrcPalette,
CONST RECT* pSrcRect);
@@ -536,7 +564,7 @@ HRESULT WINAPI
D3DXSaveSurfaceToFileW(
LPCWSTR pDestFile,
D3DXIMAGE_FILEFORMAT DestFormat,
LPDIRECT3DSURFACE8 pSrcSurface,
LPDIRECT3DSURFACE9 pSrcSurface,
CONST PALETTEENTRY* pSrcPalette,
CONST RECT* pSrcRect);
@@ -546,7 +574,32 @@ HRESULT WINAPI
#define D3DXSaveSurfaceToFile D3DXSaveSurfaceToFileA
#endif
//----------------------------------------------------------------------------
// D3DXSaveSurfaceToFileInMemory:
// ----------------------
// Save a surface to a image file.
//
// Parameters:
// ppDestBuf
// address of pointer to d3dxbuffer for returning data bits
// DestFormat
// D3DXIMAGE_FILEFORMAT specifying file format to use when saving.
// pSrcSurface
// Source surface, containing the image to be saved
// pSrcPalette
// Source palette of 256 colors, or NULL
// pSrcRect
// Source rectangle, or NULL for the entire image
//
//----------------------------------------------------------------------------
HRESULT WINAPI
D3DXSaveSurfaceToFileInMemory(
LPD3DXBUFFER* ppDestBuf,
D3DXIMAGE_FILEFORMAT DestFormat,
LPDIRECT3DSURFACE9 pSrcSurface,
CONST PALETTEENTRY* pSrcPalette,
CONST RECT* pSrcRect);
//////////////////////////////////////////////////////////////////////////////
@@ -594,7 +647,7 @@ HRESULT WINAPI
HRESULT WINAPI
D3DXLoadVolumeFromFileA(
LPDIRECT3DVOLUME8 pDestVolume,
LPDIRECT3DVOLUME9 pDestVolume,
CONST PALETTEENTRY* pDestPalette,
CONST D3DBOX* pDestBox,
LPCSTR pSrcFile,
@@ -605,7 +658,7 @@ HRESULT WINAPI
HRESULT WINAPI
D3DXLoadVolumeFromFileW(
LPDIRECT3DVOLUME8 pDestVolume,
LPDIRECT3DVOLUME9 pDestVolume,
CONST PALETTEENTRY* pDestPalette,
CONST D3DBOX* pDestBox,
LPCWSTR pSrcFile,
@@ -623,7 +676,7 @@ HRESULT WINAPI
HRESULT WINAPI
D3DXLoadVolumeFromResourceA(
LPDIRECT3DVOLUME8 pDestVolume,
LPDIRECT3DVOLUME9 pDestVolume,
CONST PALETTEENTRY* pDestPalette,
CONST D3DBOX* pDestBox,
HMODULE hSrcModule,
@@ -635,7 +688,7 @@ HRESULT WINAPI
HRESULT WINAPI
D3DXLoadVolumeFromResourceW(
LPDIRECT3DVOLUME8 pDestVolume,
LPDIRECT3DVOLUME9 pDestVolume,
CONST PALETTEENTRY* pDestPalette,
CONST D3DBOX* pDestBox,
HMODULE hSrcModule,
@@ -655,7 +708,7 @@ HRESULT WINAPI
HRESULT WINAPI
D3DXLoadVolumeFromFileInMemory(
LPDIRECT3DVOLUME8 pDestVolume,
LPDIRECT3DVOLUME9 pDestVolume,
CONST PALETTEENTRY* pDestPalette,
CONST D3DBOX* pDestBox,
LPCVOID pSrcData,
@@ -698,10 +751,10 @@ HRESULT WINAPI
HRESULT WINAPI
D3DXLoadVolumeFromVolume(
LPDIRECT3DVOLUME8 pDestVolume,
LPDIRECT3DVOLUME9 pDestVolume,
CONST PALETTEENTRY* pDestPalette,
CONST D3DBOX* pDestBox,
LPDIRECT3DVOLUME8 pSrcVolume,
LPDIRECT3DVOLUME9 pSrcVolume,
CONST PALETTEENTRY* pSrcPalette,
CONST D3DBOX* pSrcBox,
DWORD Filter,
@@ -748,7 +801,7 @@ HRESULT WINAPI
HRESULT WINAPI
D3DXLoadVolumeFromMemory(
LPDIRECT3DVOLUME8 pDestVolume,
LPDIRECT3DVOLUME9 pDestVolume,
CONST PALETTEENTRY* pDestPalette,
CONST D3DBOX* pDestBox,
LPCVOID pSrcMemory,
@@ -785,7 +838,7 @@ HRESULT WINAPI
D3DXSaveVolumeToFileA(
LPCSTR pDestFile,
D3DXIMAGE_FILEFORMAT DestFormat,
LPDIRECT3DVOLUME8 pSrcVolume,
LPDIRECT3DVOLUME9 pSrcVolume,
CONST PALETTEENTRY* pSrcPalette,
CONST D3DBOX* pSrcBox);
@@ -793,7 +846,7 @@ HRESULT WINAPI
D3DXSaveVolumeToFileW(
LPCWSTR pDestFile,
D3DXIMAGE_FILEFORMAT DestFormat,
LPDIRECT3DVOLUME8 pSrcVolume,
LPDIRECT3DVOLUME9 pSrcVolume,
CONST PALETTEENTRY* pSrcPalette,
CONST D3DBOX* pSrcBox);
@@ -804,7 +857,32 @@ HRESULT WINAPI
#endif
//----------------------------------------------------------------------------
// D3DXSaveVolumeToFileInMemory:
// ---------------------
// Save a volume to a image file.
//
// Parameters:
// pDestFile
// File name of the destination file
// DestFormat
// D3DXIMAGE_FILEFORMAT specifying file format to use when saving.
// pSrcVolume
// Source volume, containing the image to be saved
// pSrcPalette
// Source palette of 256 colors, or NULL
// pSrcBox
// Source box, or NULL for the entire volume
//
//----------------------------------------------------------------------------
HRESULT WINAPI
D3DXSaveVolumeToFileInMemory(
LPD3DXBUFFER* ppDestBuf,
D3DXIMAGE_FILEFORMAT DestFormat,
LPDIRECT3DVOLUME9 pSrcVolume,
CONST PALETTEENTRY* pSrcPalette,
CONST D3DBOX* pSrcBox);
//////////////////////////////////////////////////////////////////////////////
// Create/Save Texture APIs //////////////////////////////////////////////////
@@ -835,7 +913,7 @@ HRESULT WINAPI
HRESULT WINAPI
D3DXCheckTextureRequirements(
LPDIRECT3DDEVICE8 pDevice,
LPDIRECT3DDEVICE9 pDevice,
UINT* pWidth,
UINT* pHeight,
UINT* pNumMipLevels,
@@ -845,7 +923,7 @@ HRESULT WINAPI
HRESULT WINAPI
D3DXCheckCubeTextureRequirements(
LPDIRECT3DDEVICE8 pDevice,
LPDIRECT3DDEVICE9 pDevice,
UINT* pSize,
UINT* pNumMipLevels,
DWORD Usage,
@@ -854,7 +932,7 @@ HRESULT WINAPI
HRESULT WINAPI
D3DXCheckVolumeTextureRequirements(
LPDIRECT3DDEVICE8 pDevice,
LPDIRECT3DDEVICE9 pDevice,
UINT* pWidth,
UINT* pHeight,
UINT* pDepth,
@@ -874,9 +952,9 @@ HRESULT WINAPI
// pDevice
// The D3D device with which the texture is going to be used.
// Width, Height, Depth, Size
// size in pixels; these must be non-zero
// size in pixels. these must be non-zero
// MipLevels
// number of mip levels desired; if zero or D3DX_DEFAULT, a complete
// number of mip levels desired. if zero or D3DX_DEFAULT, a complete
// mipmap chain will be created.
// Usage
// Texture usage flags
@@ -891,28 +969,28 @@ HRESULT WINAPI
HRESULT WINAPI
D3DXCreateTexture(
LPDIRECT3DDEVICE8 pDevice,
LPDIRECT3DDEVICE9 pDevice,
UINT Width,
UINT Height,
UINT MipLevels,
DWORD Usage,
D3DFORMAT Format,
D3DPOOL Pool,
LPDIRECT3DTEXTURE8* ppTexture);
LPDIRECT3DTEXTURE9* ppTexture);
HRESULT WINAPI
D3DXCreateCubeTexture(
LPDIRECT3DDEVICE8 pDevice,
LPDIRECT3DDEVICE9 pDevice,
UINT Size,
UINT MipLevels,
DWORD Usage,
D3DFORMAT Format,
D3DPOOL Pool,
LPDIRECT3DCUBETEXTURE8* ppCubeTexture);
LPDIRECT3DCUBETEXTURE9* ppCubeTexture);
HRESULT WINAPI
D3DXCreateVolumeTexture(
LPDIRECT3DDEVICE8 pDevice,
LPDIRECT3DDEVICE9 pDevice,
UINT Width,
UINT Height,
UINT Depth,
@@ -920,7 +998,7 @@ HRESULT WINAPI
DWORD Usage,
D3DFORMAT Format,
D3DPOOL Pool,
LPDIRECT3DVOLUMETEXTURE8* ppVolumeTexture);
LPDIRECT3DVOLUMETEXTURE9* ppVolumeTexture);
@@ -944,16 +1022,23 @@ HRESULT WINAPI
// SrcDataSize
// Size in bytes of file in memory.
// Width, Height, Depth, Size
// Size in pixels; if zero or D3DX_DEFAULT, the size will be taken
// from the file.
// Size in pixels. If zero or D3DX_DEFAULT, the size will be taken from
// the file and rounded up to a power of two. If D3DX_DEFAULT_NONPOW2,
// and the device supports NONPOW2 textures, the size will not be rounded.
// If D3DX_FROM_FILE, the size will be taken exactly as it is in the file,
// and the call will fail if this violates device capabilities.
// MipLevels
// Number of mip levels; if zero or D3DX_DEFAULT, a complete mipmap
// chain will be created.
// Number of mip levels. If zero or D3DX_DEFAULT, a complete mipmap
// chain will be created. If D3DX_FROM_FILE, the size will be taken
// exactly as it is in the file, and the call will fail if this violates
// device capabilities.
// Usage
// Texture usage flags
// Format
// Desired pixel format. If D3DFMT_UNKNOWN, the format will be
// taken from the file.
// taken from the file. If D3DFMT_FROM_FILE, the format will be taken
// exactly as it is in the file, and the call will fail if the device does
// not support the given format.
// Pool
// Memory pool to be used to create texture
// Filter
@@ -961,7 +1046,9 @@ HRESULT WINAPI
// Or D3DX_DEFAULT for D3DX_FILTER_TRIANGLE.
// MipFilter
// D3DX_FILTER flags controlling how each miplevel is filtered.
// Or D3DX_DEFAULT for D3DX_FILTER_BOX,
// Or D3DX_DEFAULT for D3DX_FILTER_BOX.
// Use the D3DX_SKIP_DDS_MIP_LEVELS macro to specify both a filter and the
// number of mip levels to skip when loading DDS files.
// ColorKey
// Color to replace with transparent black, or 0 to disable colorkey.
// This is always a 32-bit ARGB color, independent of the source image
@@ -977,20 +1064,19 @@ HRESULT WINAPI
//
//----------------------------------------------------------------------------
// FromFile
HRESULT WINAPI
D3DXCreateTextureFromFileA(
LPDIRECT3DDEVICE8 pDevice,
LPDIRECT3DDEVICE9 pDevice,
LPCSTR pSrcFile,
LPDIRECT3DTEXTURE8* ppTexture);
LPDIRECT3DTEXTURE9* ppTexture);
HRESULT WINAPI
D3DXCreateTextureFromFileW(
LPDIRECT3DDEVICE8 pDevice,
LPDIRECT3DDEVICE9 pDevice,
LPCWSTR pSrcFile,
LPDIRECT3DTEXTURE8* ppTexture);
LPDIRECT3DTEXTURE9* ppTexture);
#ifdef UNICODE
#define D3DXCreateTextureFromFile D3DXCreateTextureFromFileW
@@ -1001,15 +1087,15 @@ HRESULT WINAPI
HRESULT WINAPI
D3DXCreateCubeTextureFromFileA(
LPDIRECT3DDEVICE8 pDevice,
LPDIRECT3DDEVICE9 pDevice,
LPCSTR pSrcFile,
LPDIRECT3DCUBETEXTURE8* ppCubeTexture);
LPDIRECT3DCUBETEXTURE9* ppCubeTexture);
HRESULT WINAPI
D3DXCreateCubeTextureFromFileW(
LPDIRECT3DDEVICE8 pDevice,
LPDIRECT3DDEVICE9 pDevice,
LPCWSTR pSrcFile,
LPDIRECT3DCUBETEXTURE8* ppCubeTexture);
LPDIRECT3DCUBETEXTURE9* ppCubeTexture);
#ifdef UNICODE
#define D3DXCreateCubeTextureFromFile D3DXCreateCubeTextureFromFileW
@@ -1020,15 +1106,15 @@ HRESULT WINAPI
HRESULT WINAPI
D3DXCreateVolumeTextureFromFileA(
LPDIRECT3DDEVICE8 pDevice,
LPDIRECT3DDEVICE9 pDevice,
LPCSTR pSrcFile,
LPDIRECT3DVOLUMETEXTURE8* ppVolumeTexture);
LPDIRECT3DVOLUMETEXTURE9* ppVolumeTexture);
HRESULT WINAPI
D3DXCreateVolumeTextureFromFileW(
LPDIRECT3DDEVICE8 pDevice,
LPDIRECT3DDEVICE9 pDevice,
LPCWSTR pSrcFile,
LPDIRECT3DVOLUMETEXTURE8* ppVolumeTexture);
LPDIRECT3DVOLUMETEXTURE9* ppVolumeTexture);
#ifdef UNICODE
#define D3DXCreateVolumeTextureFromFile D3DXCreateVolumeTextureFromFileW
@@ -1041,17 +1127,17 @@ HRESULT WINAPI
HRESULT WINAPI
D3DXCreateTextureFromResourceA(
LPDIRECT3DDEVICE8 pDevice,
LPDIRECT3DDEVICE9 pDevice,
HMODULE hSrcModule,
LPCSTR pSrcResource,
LPDIRECT3DTEXTURE8* ppTexture);
LPDIRECT3DTEXTURE9* ppTexture);
HRESULT WINAPI
D3DXCreateTextureFromResourceW(
LPDIRECT3DDEVICE8 pDevice,
LPDIRECT3DDEVICE9 pDevice,
HMODULE hSrcModule,
LPCWSTR pSrcResource,
LPDIRECT3DTEXTURE8* ppTexture);
LPDIRECT3DTEXTURE9* ppTexture);
#ifdef UNICODE
#define D3DXCreateTextureFromResource D3DXCreateTextureFromResourceW
@@ -1062,17 +1148,17 @@ HRESULT WINAPI
HRESULT WINAPI
D3DXCreateCubeTextureFromResourceA(
LPDIRECT3DDEVICE8 pDevice,
LPDIRECT3DDEVICE9 pDevice,
HMODULE hSrcModule,
LPCSTR pSrcResource,
LPDIRECT3DCUBETEXTURE8* ppCubeTexture);
LPDIRECT3DCUBETEXTURE9* ppCubeTexture);
HRESULT WINAPI
D3DXCreateCubeTextureFromResourceW(
LPDIRECT3DDEVICE8 pDevice,
LPDIRECT3DDEVICE9 pDevice,
HMODULE hSrcModule,
LPCWSTR pSrcResource,
LPDIRECT3DCUBETEXTURE8* ppCubeTexture);
LPDIRECT3DCUBETEXTURE9* ppCubeTexture);
#ifdef UNICODE
#define D3DXCreateCubeTextureFromResource D3DXCreateCubeTextureFromResourceW
@@ -1083,17 +1169,17 @@ HRESULT WINAPI
HRESULT WINAPI
D3DXCreateVolumeTextureFromResourceA(
LPDIRECT3DDEVICE8 pDevice,
LPDIRECT3DDEVICE9 pDevice,
HMODULE hSrcModule,
LPCSTR pSrcResource,
LPDIRECT3DVOLUMETEXTURE8* ppVolumeTexture);
LPDIRECT3DVOLUMETEXTURE9* ppVolumeTexture);
HRESULT WINAPI
D3DXCreateVolumeTextureFromResourceW(
LPDIRECT3DDEVICE8 pDevice,
LPDIRECT3DDEVICE9 pDevice,
HMODULE hSrcModule,
LPCWSTR pSrcResource,
LPDIRECT3DVOLUMETEXTURE8* ppVolumeTexture);
LPDIRECT3DVOLUMETEXTURE9* ppVolumeTexture);
#ifdef UNICODE
#define D3DXCreateVolumeTextureFromResource D3DXCreateVolumeTextureFromResourceW
@@ -1106,7 +1192,7 @@ HRESULT WINAPI
HRESULT WINAPI
D3DXCreateTextureFromFileExA(
LPDIRECT3DDEVICE8 pDevice,
LPDIRECT3DDEVICE9 pDevice,
LPCSTR pSrcFile,
UINT Width,
UINT Height,
@@ -1119,11 +1205,11 @@ HRESULT WINAPI
D3DCOLOR ColorKey,
D3DXIMAGE_INFO* pSrcInfo,
PALETTEENTRY* pPalette,
LPDIRECT3DTEXTURE8* ppTexture);
LPDIRECT3DTEXTURE9* ppTexture);
HRESULT WINAPI
D3DXCreateTextureFromFileExW(
LPDIRECT3DDEVICE8 pDevice,
LPDIRECT3DDEVICE9 pDevice,
LPCWSTR pSrcFile,
UINT Width,
UINT Height,
@@ -1136,7 +1222,7 @@ HRESULT WINAPI
D3DCOLOR ColorKey,
D3DXIMAGE_INFO* pSrcInfo,
PALETTEENTRY* pPalette,
LPDIRECT3DTEXTURE8* ppTexture);
LPDIRECT3DTEXTURE9* ppTexture);
#ifdef UNICODE
#define D3DXCreateTextureFromFileEx D3DXCreateTextureFromFileExW
@@ -1147,7 +1233,7 @@ HRESULT WINAPI
HRESULT WINAPI
D3DXCreateCubeTextureFromFileExA(
LPDIRECT3DDEVICE8 pDevice,
LPDIRECT3DDEVICE9 pDevice,
LPCSTR pSrcFile,
UINT Size,
UINT MipLevels,
@@ -1159,11 +1245,11 @@ HRESULT WINAPI
D3DCOLOR ColorKey,
D3DXIMAGE_INFO* pSrcInfo,
PALETTEENTRY* pPalette,
LPDIRECT3DCUBETEXTURE8* ppCubeTexture);
LPDIRECT3DCUBETEXTURE9* ppCubeTexture);
HRESULT WINAPI
D3DXCreateCubeTextureFromFileExW(
LPDIRECT3DDEVICE8 pDevice,
LPDIRECT3DDEVICE9 pDevice,
LPCWSTR pSrcFile,
UINT Size,
UINT MipLevels,
@@ -1175,7 +1261,7 @@ HRESULT WINAPI
D3DCOLOR ColorKey,
D3DXIMAGE_INFO* pSrcInfo,
PALETTEENTRY* pPalette,
LPDIRECT3DCUBETEXTURE8* ppCubeTexture);
LPDIRECT3DCUBETEXTURE9* ppCubeTexture);
#ifdef UNICODE
#define D3DXCreateCubeTextureFromFileEx D3DXCreateCubeTextureFromFileExW
@@ -1186,7 +1272,7 @@ HRESULT WINAPI
HRESULT WINAPI
D3DXCreateVolumeTextureFromFileExA(
LPDIRECT3DDEVICE8 pDevice,
LPDIRECT3DDEVICE9 pDevice,
LPCSTR pSrcFile,
UINT Width,
UINT Height,
@@ -1200,11 +1286,11 @@ HRESULT WINAPI
D3DCOLOR ColorKey,
D3DXIMAGE_INFO* pSrcInfo,
PALETTEENTRY* pPalette,
LPDIRECT3DVOLUMETEXTURE8* ppVolumeTexture);
LPDIRECT3DVOLUMETEXTURE9* ppVolumeTexture);
HRESULT WINAPI
D3DXCreateVolumeTextureFromFileExW(
LPDIRECT3DDEVICE8 pDevice,
LPDIRECT3DDEVICE9 pDevice,
LPCWSTR pSrcFile,
UINT Width,
UINT Height,
@@ -1218,7 +1304,7 @@ HRESULT WINAPI
D3DCOLOR ColorKey,
D3DXIMAGE_INFO* pSrcInfo,
PALETTEENTRY* pPalette,
LPDIRECT3DVOLUMETEXTURE8* ppVolumeTexture);
LPDIRECT3DVOLUMETEXTURE9* ppVolumeTexture);
#ifdef UNICODE
#define D3DXCreateVolumeTextureFromFileEx D3DXCreateVolumeTextureFromFileExW
@@ -1231,7 +1317,7 @@ HRESULT WINAPI
HRESULT WINAPI
D3DXCreateTextureFromResourceExA(
LPDIRECT3DDEVICE8 pDevice,
LPDIRECT3DDEVICE9 pDevice,
HMODULE hSrcModule,
LPCSTR pSrcResource,
UINT Width,
@@ -1245,11 +1331,11 @@ HRESULT WINAPI
D3DCOLOR ColorKey,
D3DXIMAGE_INFO* pSrcInfo,
PALETTEENTRY* pPalette,
LPDIRECT3DTEXTURE8* ppTexture);
LPDIRECT3DTEXTURE9* ppTexture);
HRESULT WINAPI
D3DXCreateTextureFromResourceExW(
LPDIRECT3DDEVICE8 pDevice,
LPDIRECT3DDEVICE9 pDevice,
HMODULE hSrcModule,
LPCWSTR pSrcResource,
UINT Width,
@@ -1263,7 +1349,7 @@ HRESULT WINAPI
D3DCOLOR ColorKey,
D3DXIMAGE_INFO* pSrcInfo,
PALETTEENTRY* pPalette,
LPDIRECT3DTEXTURE8* ppTexture);
LPDIRECT3DTEXTURE9* ppTexture);
#ifdef UNICODE
#define D3DXCreateTextureFromResourceEx D3DXCreateTextureFromResourceExW
@@ -1274,7 +1360,7 @@ HRESULT WINAPI
HRESULT WINAPI
D3DXCreateCubeTextureFromResourceExA(
LPDIRECT3DDEVICE8 pDevice,
LPDIRECT3DDEVICE9 pDevice,
HMODULE hSrcModule,
LPCSTR pSrcResource,
UINT Size,
@@ -1287,11 +1373,11 @@ HRESULT WINAPI
D3DCOLOR ColorKey,
D3DXIMAGE_INFO* pSrcInfo,
PALETTEENTRY* pPalette,
LPDIRECT3DCUBETEXTURE8* ppCubeTexture);
LPDIRECT3DCUBETEXTURE9* ppCubeTexture);
HRESULT WINAPI
D3DXCreateCubeTextureFromResourceExW(
LPDIRECT3DDEVICE8 pDevice,
LPDIRECT3DDEVICE9 pDevice,
HMODULE hSrcModule,
LPCWSTR pSrcResource,
UINT Size,
@@ -1304,7 +1390,7 @@ HRESULT WINAPI
D3DCOLOR ColorKey,
D3DXIMAGE_INFO* pSrcInfo,
PALETTEENTRY* pPalette,
LPDIRECT3DCUBETEXTURE8* ppCubeTexture);
LPDIRECT3DCUBETEXTURE9* ppCubeTexture);
#ifdef UNICODE
#define D3DXCreateCubeTextureFromResourceEx D3DXCreateCubeTextureFromResourceExW
@@ -1315,7 +1401,7 @@ HRESULT WINAPI
HRESULT WINAPI
D3DXCreateVolumeTextureFromResourceExA(
LPDIRECT3DDEVICE8 pDevice,
LPDIRECT3DDEVICE9 pDevice,
HMODULE hSrcModule,
LPCSTR pSrcResource,
UINT Width,
@@ -1330,11 +1416,11 @@ HRESULT WINAPI
D3DCOLOR ColorKey,
D3DXIMAGE_INFO* pSrcInfo,
PALETTEENTRY* pPalette,
LPDIRECT3DVOLUMETEXTURE8* ppVolumeTexture);
LPDIRECT3DVOLUMETEXTURE9* ppVolumeTexture);
HRESULT WINAPI
D3DXCreateVolumeTextureFromResourceExW(
LPDIRECT3DDEVICE8 pDevice,
LPDIRECT3DDEVICE9 pDevice,
HMODULE hSrcModule,
LPCWSTR pSrcResource,
UINT Width,
@@ -1349,7 +1435,7 @@ HRESULT WINAPI
D3DCOLOR ColorKey,
D3DXIMAGE_INFO* pSrcInfo,
PALETTEENTRY* pPalette,
LPDIRECT3DVOLUMETEXTURE8* ppVolumeTexture);
LPDIRECT3DVOLUMETEXTURE9* ppVolumeTexture);
#ifdef UNICODE
#define D3DXCreateVolumeTextureFromResourceEx D3DXCreateVolumeTextureFromResourceExW
@@ -1362,31 +1448,31 @@ HRESULT WINAPI
HRESULT WINAPI
D3DXCreateTextureFromFileInMemory(
LPDIRECT3DDEVICE8 pDevice,
LPDIRECT3DDEVICE9 pDevice,
LPCVOID pSrcData,
UINT SrcDataSize,
LPDIRECT3DTEXTURE8* ppTexture);
LPDIRECT3DTEXTURE9* ppTexture);
HRESULT WINAPI
D3DXCreateCubeTextureFromFileInMemory(
LPDIRECT3DDEVICE8 pDevice,
LPDIRECT3DDEVICE9 pDevice,
LPCVOID pSrcData,
UINT SrcDataSize,
LPDIRECT3DCUBETEXTURE8* ppCubeTexture);
LPDIRECT3DCUBETEXTURE9* ppCubeTexture);
HRESULT WINAPI
D3DXCreateVolumeTextureFromFileInMemory(
LPDIRECT3DDEVICE8 pDevice,
LPDIRECT3DDEVICE9 pDevice,
LPCVOID pSrcData,
UINT SrcDataSize,
LPDIRECT3DVOLUMETEXTURE8* ppVolumeTexture);
LPDIRECT3DVOLUMETEXTURE9* ppVolumeTexture);
// FromFileInMemoryEx
HRESULT WINAPI
D3DXCreateTextureFromFileInMemoryEx(
LPDIRECT3DDEVICE8 pDevice,
LPDIRECT3DDEVICE9 pDevice,
LPCVOID pSrcData,
UINT SrcDataSize,
UINT Width,
@@ -1400,11 +1486,11 @@ HRESULT WINAPI
D3DCOLOR ColorKey,
D3DXIMAGE_INFO* pSrcInfo,
PALETTEENTRY* pPalette,
LPDIRECT3DTEXTURE8* ppTexture);
LPDIRECT3DTEXTURE9* ppTexture);
HRESULT WINAPI
D3DXCreateCubeTextureFromFileInMemoryEx(
LPDIRECT3DDEVICE8 pDevice,
LPDIRECT3DDEVICE9 pDevice,
LPCVOID pSrcData,
UINT SrcDataSize,
UINT Size,
@@ -1417,11 +1503,11 @@ HRESULT WINAPI
D3DCOLOR ColorKey,
D3DXIMAGE_INFO* pSrcInfo,
PALETTEENTRY* pPalette,
LPDIRECT3DCUBETEXTURE8* ppCubeTexture);
LPDIRECT3DCUBETEXTURE9* ppCubeTexture);
HRESULT WINAPI
D3DXCreateVolumeTextureFromFileInMemoryEx(
LPDIRECT3DDEVICE8 pDevice,
LPDIRECT3DDEVICE9 pDevice,
LPCVOID pSrcData,
UINT SrcDataSize,
UINT Width,
@@ -1436,7 +1522,7 @@ HRESULT WINAPI
D3DCOLOR ColorKey,
D3DXIMAGE_INFO* pSrcInfo,
PALETTEENTRY* pPalette,
LPDIRECT3DVOLUMETEXTURE8* ppVolumeTexture);
LPDIRECT3DVOLUMETEXTURE9* ppVolumeTexture);
@@ -1462,14 +1548,14 @@ HRESULT WINAPI
D3DXSaveTextureToFileA(
LPCSTR pDestFile,
D3DXIMAGE_FILEFORMAT DestFormat,
LPDIRECT3DBASETEXTURE8 pSrcTexture,
LPDIRECT3DBASETEXTURE9 pSrcTexture,
CONST PALETTEENTRY* pSrcPalette);
HRESULT WINAPI
D3DXSaveTextureToFileW(
LPCWSTR pDestFile,
D3DXIMAGE_FILEFORMAT DestFormat,
LPDIRECT3DBASETEXTURE8 pSrcTexture,
LPDIRECT3DBASETEXTURE9 pSrcTexture,
CONST PALETTEENTRY* pSrcPalette);
#ifdef UNICODE
@@ -1479,6 +1565,31 @@ HRESULT WINAPI
#endif
//----------------------------------------------------------------------------
// D3DXSaveTextureToFileInMemory:
// ----------------------
// Save a texture to a file.
//
// Parameters:
// ppDestBuf
// address of a d3dxbuffer pointer to return the image data
// DestFormat
// D3DXIMAGE_FILEFORMAT specifying file format to use when saving.
// pSrcTexture
// Source texture, containing the image to be saved
// pSrcPalette
// Source palette of 256 colors, or NULL
//
//----------------------------------------------------------------------------
HRESULT WINAPI
D3DXSaveTextureToFileInMemory(
LPD3DXBUFFER* ppDestBuf,
D3DXIMAGE_FILEFORMAT DestFormat,
LPDIRECT3DBASETEXTURE9 pSrcTexture,
CONST PALETTEENTRY* pSrcPalette);
//////////////////////////////////////////////////////////////////////////////
@@ -1505,7 +1616,7 @@ HRESULT WINAPI
HRESULT WINAPI
D3DXFilterTexture(
LPDIRECT3DBASETEXTURE8 pBaseTexture,
LPDIRECT3DBASETEXTURE9 pBaseTexture,
CONST PALETTEENTRY* pPalette,
UINT SrcLevel,
DWORD Filter);
@@ -1534,22 +1645,53 @@ HRESULT WINAPI
HRESULT WINAPI
D3DXFillTexture(
LPDIRECT3DTEXTURE8 pTexture,
LPDIRECT3DTEXTURE9 pTexture,
LPD3DXFILL2D pFunction,
LPVOID pData);
HRESULT WINAPI
D3DXFillCubeTexture(
LPDIRECT3DCUBETEXTURE8 pCubeTexture,
LPDIRECT3DCUBETEXTURE9 pCubeTexture,
LPD3DXFILL3D pFunction,
LPVOID pData);
HRESULT WINAPI
D3DXFillVolumeTexture(
LPDIRECT3DVOLUMETEXTURE8 pVolumeTexture,
LPDIRECT3DVOLUMETEXTURE9 pVolumeTexture,
LPD3DXFILL3D pFunction,
LPVOID pData);
//---------------------------------------------------------------------------
// D3DXFillTextureTX:
// ------------------
// Uses a TX Shader target to function to fill each texel of each mip level
// of a given texture. The TX Shader target should be a compiled function
// taking 2 paramters and returning a float4 color.
//
// Paramters:
// pTexture, pCubeTexture, pVolumeTexture
// Pointer to the texture to be filled.
// pTextureShader
// Pointer to the texture shader to be used to fill in the texture
//----------------------------------------------------------------------------
HRESULT WINAPI
D3DXFillTextureTX(
LPDIRECT3DTEXTURE9 pTexture,
LPD3DXTEXTURESHADER pTextureShader);
HRESULT WINAPI
D3DXFillCubeTextureTX(
LPDIRECT3DCUBETEXTURE9 pCubeTexture,
LPD3DXTEXTURESHADER pTextureShader);
HRESULT WINAPI
D3DXFillVolumeTextureTX(
LPDIRECT3DVOLUMETEXTURE9 pVolumeTexture,
LPD3DXTEXTURESHADER pTextureShader);
//----------------------------------------------------------------------------
@@ -1575,8 +1717,8 @@ HRESULT WINAPI
HRESULT WINAPI
D3DXComputeNormalMap(
LPDIRECT3DTEXTURE8 pTexture,
LPDIRECT3DTEXTURE8 pSrcTexture,
LPDIRECT3DTEXTURE9 pTexture,
LPDIRECT3DTEXTURE9 pSrcTexture,
CONST PALETTEENTRY* pSrcPalette,
DWORD Flags,
DWORD Channel,
@@ -1589,4 +1731,5 @@ HRESULT WINAPI
}
#endif //__cplusplus
#endif //__D3DX8TEX_H__
#endif //__D3DX9TEX_H__

299
extern/include/d3dx9xof.h vendored Normal file
View File

@@ -0,0 +1,299 @@
///////////////////////////////////////////////////////////////////////////
//
// Copyright (C) Microsoft Corporation. All Rights Reserved.
//
// File: d3dx9xof.h
// Content: D3DX .X File types and functions
//
///////////////////////////////////////////////////////////////////////////
#include "d3dx9.h"
#if !defined( __D3DX9XOF_H__ )
#define __D3DX9XOF_H__
#if defined( __cplusplus )
extern "C" {
#endif // defined( __cplusplus )
//----------------------------------------------------------------------------
// D3DXF_FILEFORMAT
// This flag is used to specify what file type to use when saving to disk.
// _BINARY, and _TEXT are mutually exclusive, while
// _COMPRESSED is an optional setting that works with all file types.
//----------------------------------------------------------------------------
typedef DWORD D3DXF_FILEFORMAT;
#define D3DXF_FILEFORMAT_BINARY 0
#define D3DXF_FILEFORMAT_TEXT 1
#define D3DXF_FILEFORMAT_COMPRESSED 2
//----------------------------------------------------------------------------
// D3DXF_FILESAVEOPTIONS
// This flag is used to specify where to save the file to. Each flag is
// mutually exclusive, indicates the data location of the file, and also
// chooses which additional data will specify the location.
// _TOFILE is paired with a filename (LPCSTR)
// _TOWFILE is paired with a filename (LPWSTR)
//----------------------------------------------------------------------------
typedef DWORD D3DXF_FILESAVEOPTIONS;
#define D3DXF_FILESAVE_TOFILE 0x00L
#define D3DXF_FILESAVE_TOWFILE 0x01L
//----------------------------------------------------------------------------
// D3DXF_FILELOADOPTIONS
// This flag is used to specify where to load the file from. Each flag is
// mutually exclusive, indicates the data location of the file, and also
// chooses which additional data will specify the location.
// _FROMFILE is paired with a filename (LPCSTR)
// _FROMWFILE is paired with a filename (LPWSTR)
// _FROMRESOURCE is paired with a (D3DXF_FILELOADRESOUCE*) description.
// _FROMMEMORY is paired with a (D3DXF_FILELOADMEMORY*) description.
//----------------------------------------------------------------------------
typedef DWORD D3DXF_FILELOADOPTIONS;
#define D3DXF_FILELOAD_FROMFILE 0x00L
#define D3DXF_FILELOAD_FROMWFILE 0x01L
#define D3DXF_FILELOAD_FROMRESOURCE 0x02L
#define D3DXF_FILELOAD_FROMMEMORY 0x03L
//----------------------------------------------------------------------------
// D3DXF_FILELOADRESOURCE:
//----------------------------------------------------------------------------
typedef struct _D3DXF_FILELOADRESOURCE
{
HMODULE hModule; // Desc
LPCSTR lpName; // Desc
LPCSTR lpType; // Desc
} D3DXF_FILELOADRESOURCE;
//----------------------------------------------------------------------------
// D3DXF_FILELOADMEMORY:
//----------------------------------------------------------------------------
typedef struct _D3DXF_FILELOADMEMORY
{
LPCVOID lpMemory; // Desc
SIZE_T dSize; // Desc
} D3DXF_FILELOADMEMORY;
#if defined( _WIN32 ) && !defined( _NO_COM )
// {cef08cf9-7b4f-4429-9624-2a690a933201}
DEFINE_GUID( IID_ID3DXFile,
0xcef08cf9, 0x7b4f, 0x4429, 0x96, 0x24, 0x2a, 0x69, 0x0a, 0x93, 0x32, 0x01 );
// {cef08cfa-7b4f-4429-9624-2a690a933201}
DEFINE_GUID( IID_ID3DXFileSaveObject,
0xcef08cfa, 0x7b4f, 0x4429, 0x96, 0x24, 0x2a, 0x69, 0x0a, 0x93, 0x32, 0x01 );
// {cef08cfb-7b4f-4429-9624-2a690a933201}
DEFINE_GUID( IID_ID3DXFileSaveData,
0xcef08cfb, 0x7b4f, 0x4429, 0x96, 0x24, 0x2a, 0x69, 0x0a, 0x93, 0x32, 0x01 );
// {cef08cfc-7b4f-4429-9624-2a690a933201}
DEFINE_GUID( IID_ID3DXFileEnumObject,
0xcef08cfc, 0x7b4f, 0x4429, 0x96, 0x24, 0x2a, 0x69, 0x0a, 0x93, 0x32, 0x01 );
// {cef08cfd-7b4f-4429-9624-2a690a933201}
DEFINE_GUID( IID_ID3DXFileData,
0xcef08cfd, 0x7b4f, 0x4429, 0x96, 0x24, 0x2a, 0x69, 0x0a, 0x93, 0x32, 0x01 );
#endif // defined( _WIN32 ) && !defined( _NO_COM )
#if defined( __cplusplus )
#if !defined( DECLSPEC_UUID )
#if _MSC_VER >= 1100
#define DECLSPEC_UUID( x ) __declspec( uuid( x ) )
#else // !( _MSC_VER >= 1100 )
#define DECLSPEC_UUID( x )
#endif // !( _MSC_VER >= 1100 )
#endif // !defined( DECLSPEC_UUID )
interface DECLSPEC_UUID( "cef08cf9-7b4f-4429-9624-2a690a933201" )
ID3DXFile;
interface DECLSPEC_UUID( "cef08cfa-7b4f-4429-9624-2a690a933201" )
ID3DXFileSaveObject;
interface DECLSPEC_UUID( "cef08cfb-7b4f-4429-9624-2a690a933201" )
ID3DXFileSaveData;
interface DECLSPEC_UUID( "cef08cfc-7b4f-4429-9624-2a690a933201" )
ID3DXFileEnumObject;
interface DECLSPEC_UUID( "cef08cfd-7b4f-4429-9624-2a690a933201" )
ID3DXFileData;
#if defined( _COM_SMARTPTR_TYPEDEF )
_COM_SMARTPTR_TYPEDEF( ID3DXFile,
__uuidof( ID3DXFile ) );
_COM_SMARTPTR_TYPEDEF( ID3DXFileSaveObject,
__uuidof( ID3DXFileSaveObject ) );
_COM_SMARTPTR_TYPEDEF( ID3DXFileSaveData,
__uuidof( ID3DXFileSaveData ) );
_COM_SMARTPTR_TYPEDEF( ID3DXFileEnumObject,
__uuidof( ID3DXFileEnumObject ) );
_COM_SMARTPTR_TYPEDEF( ID3DXFileData,
__uuidof( ID3DXFileData ) );
#endif // defined( _COM_SMARTPTR_TYPEDEF )
#endif // defined( __cplusplus )
typedef interface ID3DXFile ID3DXFile;
typedef interface ID3DXFileSaveObject ID3DXFileSaveObject;
typedef interface ID3DXFileSaveData ID3DXFileSaveData;
typedef interface ID3DXFileEnumObject ID3DXFileEnumObject;
typedef interface ID3DXFileData ID3DXFileData;
//////////////////////////////////////////////////////////////////////////////
// ID3DXFile /////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
#undef INTERFACE
#define INTERFACE ID3DXFile
DECLARE_INTERFACE_( ID3DXFile, IUnknown )
{
STDMETHOD( QueryInterface )( THIS_ REFIID, LPVOID* ) PURE;
STDMETHOD_( ULONG, AddRef )( THIS ) PURE;
STDMETHOD_( ULONG, Release )( THIS ) PURE;
STDMETHOD( CreateEnumObject )( THIS_ LPCVOID, D3DXF_FILELOADOPTIONS,
ID3DXFileEnumObject** ) PURE;
STDMETHOD( CreateSaveObject )( THIS_ LPCVOID, D3DXF_FILESAVEOPTIONS,
D3DXF_FILEFORMAT, ID3DXFileSaveObject** ) PURE;
STDMETHOD( RegisterTemplates )( THIS_ LPCVOID, SIZE_T ) PURE;
STDMETHOD( RegisterEnumTemplates )( THIS_ ID3DXFileEnumObject* ) PURE;
};
//////////////////////////////////////////////////////////////////////////////
// ID3DXFileSaveObject ///////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
#undef INTERFACE
#define INTERFACE ID3DXFileSaveObject
DECLARE_INTERFACE_( ID3DXFileSaveObject, IUnknown )
{
STDMETHOD( QueryInterface )( THIS_ REFIID, LPVOID* ) PURE;
STDMETHOD_( ULONG, AddRef )( THIS ) PURE;
STDMETHOD_( ULONG, Release )( THIS ) PURE;
STDMETHOD( GetFile )( THIS_ ID3DXFile** ) PURE;
STDMETHOD( AddDataObject )( THIS_ REFGUID, LPCSTR, CONST GUID*,
SIZE_T, LPCVOID, ID3DXFileSaveData** ) PURE;
STDMETHOD( Save )( THIS ) PURE;
};
//////////////////////////////////////////////////////////////////////////////
// ID3DXFileSaveData /////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
#undef INTERFACE
#define INTERFACE ID3DXFileSaveData
DECLARE_INTERFACE_( ID3DXFileSaveData, IUnknown )
{
STDMETHOD( QueryInterface )( THIS_ REFIID, LPVOID* ) PURE;
STDMETHOD_( ULONG, AddRef )( THIS ) PURE;
STDMETHOD_( ULONG, Release )( THIS ) PURE;
STDMETHOD( GetSave )( THIS_ ID3DXFileSaveObject** ) PURE;
STDMETHOD( GetName )( THIS_ LPSTR, SIZE_T* ) PURE;
STDMETHOD( GetId )( THIS_ LPGUID ) PURE;
STDMETHOD( GetType )( THIS_ GUID* ) PURE;
STDMETHOD( AddDataObject )( THIS_ REFGUID, LPCSTR, CONST GUID*,
SIZE_T, LPCVOID, ID3DXFileSaveData** ) PURE;
STDMETHOD( AddDataReference )( THIS_ LPCSTR, CONST GUID* ) PURE;
};
//////////////////////////////////////////////////////////////////////////////
// ID3DXFileEnumObject ///////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
#undef INTERFACE
#define INTERFACE ID3DXFileEnumObject
DECLARE_INTERFACE_( ID3DXFileEnumObject, IUnknown )
{
STDMETHOD( QueryInterface )( THIS_ REFIID, LPVOID* ) PURE;
STDMETHOD_( ULONG, AddRef )( THIS ) PURE;
STDMETHOD_( ULONG, Release )( THIS ) PURE;
STDMETHOD( GetFile )( THIS_ ID3DXFile** ) PURE;
STDMETHOD( GetChildren )( THIS_ SIZE_T* ) PURE;
STDMETHOD( GetChild )( THIS_ SIZE_T, ID3DXFileData** ) PURE;
STDMETHOD( GetDataObjectById )( THIS_ REFGUID, ID3DXFileData** ) PURE;
STDMETHOD( GetDataObjectByName )( THIS_ LPCSTR, ID3DXFileData** ) PURE;
};
//////////////////////////////////////////////////////////////////////////////
// ID3DXFileData /////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
#undef INTERFACE
#define INTERFACE ID3DXFileData
DECLARE_INTERFACE_( ID3DXFileData, IUnknown )
{
STDMETHOD( QueryInterface )( THIS_ REFIID, LPVOID* ) PURE;
STDMETHOD_( ULONG, AddRef )( THIS ) PURE;
STDMETHOD_( ULONG, Release )( THIS ) PURE;
STDMETHOD( GetEnum )( THIS_ ID3DXFileEnumObject** ) PURE;
STDMETHOD( GetName )( THIS_ LPSTR, SIZE_T* ) PURE;
STDMETHOD( GetId )( THIS_ LPGUID ) PURE;
STDMETHOD( Lock )( THIS_ SIZE_T*, LPCVOID* ) PURE;
STDMETHOD( Unlock )( THIS ) PURE;
STDMETHOD( GetType )( THIS_ GUID* ) PURE;
STDMETHOD_( BOOL, IsReference )( THIS ) PURE;
STDMETHOD( GetChildren )( THIS_ SIZE_T* ) PURE;
STDMETHOD( GetChild )( THIS_ SIZE_T, ID3DXFileData** ) PURE;
};
STDAPI D3DXFileCreate( ID3DXFile** lplpDirectXFile );
/*
* DirectX File errors.
*/
#define _FACD3DXF 0x876
#define D3DXFERR_BADOBJECT MAKE_HRESULT( 1, _FACD3DXF, 900 )
#define D3DXFERR_BADVALUE MAKE_HRESULT( 1, _FACD3DXF, 901 )
#define D3DXFERR_BADTYPE MAKE_HRESULT( 1, _FACD3DXF, 902 )
#define D3DXFERR_NOTFOUND MAKE_HRESULT( 1, _FACD3DXF, 903 )
#define D3DXFERR_NOTDONEYET MAKE_HRESULT( 1, _FACD3DXF, 904 )
#define D3DXFERR_FILENOTFOUND MAKE_HRESULT( 1, _FACD3DXF, 905 )
#define D3DXFERR_RESOURCENOTFOUND MAKE_HRESULT( 1, _FACD3DXF, 906 )
#define D3DXFERR_BADRESOURCE MAKE_HRESULT( 1, _FACD3DXF, 907 )
#define D3DXFERR_BADFILETYPE MAKE_HRESULT( 1, _FACD3DXF, 908 )
#define D3DXFERR_BADFILEVERSION MAKE_HRESULT( 1, _FACD3DXF, 909 )
#define D3DXFERR_BADFILEFLOATSIZE MAKE_HRESULT( 1, _FACD3DXF, 910 )
#define D3DXFERR_BADFILE MAKE_HRESULT( 1, _FACD3DXF, 911 )
#define D3DXFERR_PARSEERROR MAKE_HRESULT( 1, _FACD3DXF, 912 )
#define D3DXFERR_BADARRAYSIZE MAKE_HRESULT( 1, _FACD3DXF, 913 )
#define D3DXFERR_BADDATAREFERENCE MAKE_HRESULT( 1, _FACD3DXF, 914 )
#define D3DXFERR_NOMOREOBJECTS MAKE_HRESULT( 1, _FACD3DXF, 915 )
#define D3DXFERR_NOMOREDATA MAKE_HRESULT( 1, _FACD3DXF, 916 )
#define D3DXFERR_BADCACHEFILE MAKE_HRESULT( 1, _FACD3DXF, 917 )
/*
* DirectX File object types.
*/
#ifndef WIN_TYPES
#define WIN_TYPES(itype, ptype) typedef interface itype *LP##ptype, **LPLP##ptype
#endif
WIN_TYPES(ID3DXFile, D3DXFILE);
WIN_TYPES(ID3DXFileEnumObject, D3DXFILEENUMOBJECT);
WIN_TYPES(ID3DXFileSaveObject, D3DXFILESAVEOBJECT);
WIN_TYPES(ID3DXFileData, D3DXFILEDATA);
WIN_TYPES(ID3DXFileSaveData, D3DXFILESAVEDATA);
#if defined( __cplusplus )
} // extern "C"
#endif // defined( __cplusplus )
#endif // !defined( __D3DX9XOF_H__ )

4417
extern/include/dinput.h vendored Normal file

File diff suppressed because it is too large Load Diff

755
extern/include/dinputd.h vendored Normal file
View File

@@ -0,0 +1,755 @@
/****************************************************************************
*
* Copyright (C) 1995-2000 Microsoft Corporation. All Rights Reserved.
*
* File: dinputd.h
* Content: DirectInput include file for device driver implementors
*
****************************************************************************/
#ifndef __DINPUTD_INCLUDED__
#define __DINPUTD_INCLUDED__
#ifndef DIRECTINPUT_VERSION
#define DIRECTINPUT_VERSION 0x0800
#pragma message(__FILE__ ": DIRECTINPUT_VERSION undefined. Defaulting to version 0x0800")
#endif
#ifdef __cplusplus
extern "C" {
#endif
/****************************************************************************
*
* Interfaces
*
****************************************************************************/
#ifndef DIJ_RINGZERO
DEFINE_GUID(IID_IDirectInputEffectDriver, 0x02538130,0x898F,0x11D0,0x9A,0xD0,0x00,0xA0,0xC9,0xA0,0x6E,0x35);
DEFINE_GUID(IID_IDirectInputJoyConfig, 0x1DE12AB1,0xC9F5,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
DEFINE_GUID(IID_IDirectInputPIDDriver, 0xEEC6993A,0xB3FD,0x11D2,0xA9,0x16,0x00,0xC0,0x4F,0xB9,0x86,0x38);
DEFINE_GUID(IID_IDirectInputJoyConfig8, 0xeb0d7dfa,0x1990,0x4f27,0xb4,0xd6,0xed,0xf2,0xee,0xc4,0xa4,0x4c);
#endif /* DIJ_RINGZERO */
/****************************************************************************
*
* IDirectInputEffectDriver
*
****************************************************************************/
typedef struct DIOBJECTATTRIBUTES {
DWORD dwFlags;
WORD wUsagePage;
WORD wUsage;
} DIOBJECTATTRIBUTES, *LPDIOBJECTATTRIBUTES;
typedef const DIOBJECTATTRIBUTES *LPCDIOBJECTATTRIBUTES;
typedef struct DIFFOBJECTATTRIBUTES {
DWORD dwFFMaxForce;
DWORD dwFFForceResolution;
} DIFFOBJECTATTRIBUTES, *LPDIFFOBJECTATTRIBUTES;
typedef const DIFFOBJECTATTRIBUTES *LPCDIFFOBJECTATTRIBUTES;
typedef struct DIOBJECTCALIBRATION {
LONG lMin;
LONG lCenter;
LONG lMax;
} DIOBJECTCALIBRATION, *LPDIOBJECTCALIBRATION;
typedef const DIOBJECTCALIBRATION *LPCDIOBJECTCALIBRATION;
typedef struct DIPOVCALIBRATION {
LONG lMin[5];
LONG lMax[5];
} DIPOVCALIBRATION, *LPDIPOVCALIBRATION;
typedef const DIPOVCALIBRATION *LPCDIPOVCALIBRATION;
typedef struct DIEFFECTATTRIBUTES {
DWORD dwEffectId;
DWORD dwEffType;
DWORD dwStaticParams;
DWORD dwDynamicParams;
DWORD dwCoords;
} DIEFFECTATTRIBUTES, *LPDIEFFECTATTRIBUTES;
typedef const DIEFFECTATTRIBUTES *LPCDIEFFECTATTRIBUTES;
typedef struct DIFFDEVICEATTRIBUTES {
DWORD dwFlags;
DWORD dwFFSamplePeriod;
DWORD dwFFMinTimeResolution;
} DIFFDEVICEATTRIBUTES, *LPDIFFDEVICEATTRIBUTES;
typedef const DIFFDEVICEATTRIBUTES *LPCDIFFDEVICEATTRIBUTES;
typedef struct DIDRIVERVERSIONS {
DWORD dwSize;
DWORD dwFirmwareRevision;
DWORD dwHardwareRevision;
DWORD dwFFDriverVersion;
} DIDRIVERVERSIONS, *LPDIDRIVERVERSIONS;
typedef const DIDRIVERVERSIONS *LPCDIDRIVERVERSIONS;
typedef struct DIDEVICESTATE {
DWORD dwSize;
DWORD dwState;
DWORD dwLoad;
} DIDEVICESTATE, *LPDIDEVICESTATE;
#define DEV_STS_EFFECT_RUNNING DIEGES_PLAYING
#ifndef DIJ_RINGZERO
typedef struct DIHIDFFINITINFO {
DWORD dwSize;
LPWSTR pwszDeviceInterface;
GUID GuidInstance;
} DIHIDFFINITINFO, *LPDIHIDFFINITINFO;
#undef INTERFACE
#define INTERFACE IDirectInputEffectDriver
DECLARE_INTERFACE_(IDirectInputEffectDriver, IUnknown)
{
/*** IUnknown methods ***/
STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID * ppvObj) PURE;
STDMETHOD_(ULONG,AddRef)(THIS) PURE;
STDMETHOD_(ULONG,Release)(THIS) PURE;
/*** IDirectInputEffectDriver methods ***/
STDMETHOD(DeviceID)(THIS_ DWORD,DWORD,DWORD,DWORD,LPVOID) PURE;
STDMETHOD(GetVersions)(THIS_ LPDIDRIVERVERSIONS) PURE;
STDMETHOD(Escape)(THIS_ DWORD,DWORD,LPDIEFFESCAPE) PURE;
STDMETHOD(SetGain)(THIS_ DWORD,DWORD) PURE;
STDMETHOD(SendForceFeedbackCommand)(THIS_ DWORD,DWORD) PURE;
STDMETHOD(GetForceFeedbackState)(THIS_ DWORD,LPDIDEVICESTATE) PURE;
STDMETHOD(DownloadEffect)(THIS_ DWORD,DWORD,LPDWORD,LPCDIEFFECT,DWORD) PURE;
STDMETHOD(DestroyEffect)(THIS_ DWORD,DWORD) PURE;
STDMETHOD(StartEffect)(THIS_ DWORD,DWORD,DWORD,DWORD) PURE;
STDMETHOD(StopEffect)(THIS_ DWORD,DWORD) PURE;
STDMETHOD(GetEffectStatus)(THIS_ DWORD,DWORD,LPDWORD) PURE;
};
typedef struct IDirectInputEffectDriver *LPDIRECTINPUTEFFECTDRIVER;
#if !defined(__cplusplus) || defined(CINTERFACE)
#define IDirectInputEffectDriver_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
#define IDirectInputEffectDriver_AddRef(p) (p)->lpVtbl->AddRef(p)
#define IDirectInputEffectDriver_Release(p) (p)->lpVtbl->Release(p)
#define IDirectInputEffectDriver_DeviceID(p,a,b,c,d,e) (p)->lpVtbl->DeviceID(p,a,b,c,d,e)
#define IDirectInputEffectDriver_GetVersions(p,a) (p)->lpVtbl->GetVersions(p,a)
#define IDirectInputEffectDriver_Escape(p,a,b,c) (p)->lpVtbl->Escape(p,a,b,c)
#define IDirectInputEffectDriver_SetGain(p,a,b) (p)->lpVtbl->SetGain(p,a,b)
#define IDirectInputEffectDriver_SendForceFeedbackCommand(p,a,b) (p)->lpVtbl->SendForceFeedbackCommand(p,a,b)
#define IDirectInputEffectDriver_GetForceFeedbackState(p,a,b) (p)->lpVtbl->GetForceFeedbackState(p,a,b)
#define IDirectInputEffectDriver_DownloadEffect(p,a,b,c,d,e) (p)->lpVtbl->DownloadEffect(p,a,b,c,d,e)
#define IDirectInputEffectDriver_DestroyEffect(p,a,b) (p)->lpVtbl->DestroyEffect(p,a,b)
#define IDirectInputEffectDriver_StartEffect(p,a,b,c,d) (p)->lpVtbl->StartEffect(p,a,b,c,d)
#define IDirectInputEffectDriver_StopEffect(p,a,b) (p)->lpVtbl->StopEffect(p,a,b)
#define IDirectInputEffectDriver_GetEffectStatus(p,a,b,c) (p)->lpVtbl->GetEffectStatus(p,a,b,c)
#else
#define IDirectInputEffectDriver_QueryInterface(p,a,b) (p)->QueryInterface(a,b)
#define IDirectInputEffectDriver_AddRef(p) (p)->AddRef()
#define IDirectInputEffectDriver_Release(p) (p)->Release()
#define IDirectInputEffectDriver_DeviceID(p,a,b,c,d,e) (p)->DeviceID(a,b,c,d,e)
#define IDirectInputEffectDriver_GetVersions(p,a) (p)->GetVersions(a)
#define IDirectInputEffectDriver_Escape(p,a,b,c) (p)->Escape(a,b,c)
#define IDirectInputEffectDriver_SetGain(p,a,b) (p)->SetGain(a,b)
#define IDirectInputEffectDriver_SendForceFeedbackCommand(p,a,b) (p)->SendForceFeedbackCommand(a,b)
#define IDirectInputEffectDriver_GetForceFeedbackState(p,a,b) (p)->GetForceFeedbackState(a,b)
#define IDirectInputEffectDriver_DownloadEffect(p,a,b,c,d,e) (p)->DownloadEffect(a,b,c,d,e)
#define IDirectInputEffectDriver_DestroyEffect(p,a,b) (p)->DestroyEffect(a,b)
#define IDirectInputEffectDriver_StartEffect(p,a,b,c,d) (p)->StartEffect(a,b,c,d)
#define IDirectInputEffectDriver_StopEffect(p,a,b) (p)->StopEffect(a,b)
#define IDirectInputEffectDriver_GetEffectStatus(p,a,b,c) (p)->GetEffectStatus(a,b,c)
#endif
#endif /* DIJ_RINGZERO */
/****************************************************************************
*
* IDirectInputJoyConfig
*
****************************************************************************/
/****************************************************************************
*
* Definitions copied from the DDK
*
****************************************************************************/
#ifndef JOY_HW_NONE
/* pre-defined joystick types */
#define JOY_HW_NONE 0
#define JOY_HW_CUSTOM 1
#define JOY_HW_2A_2B_GENERIC 2
#define JOY_HW_2A_4B_GENERIC 3
#define JOY_HW_2B_GAMEPAD 4
#define JOY_HW_2B_FLIGHTYOKE 5
#define JOY_HW_2B_FLIGHTYOKETHROTTLE 6
#define JOY_HW_3A_2B_GENERIC 7
#define JOY_HW_3A_4B_GENERIC 8
#define JOY_HW_4B_GAMEPAD 9
#define JOY_HW_4B_FLIGHTYOKE 10
#define JOY_HW_4B_FLIGHTYOKETHROTTLE 11
#define JOY_HW_TWO_2A_2B_WITH_Y 12
#define JOY_HW_LASTENTRY 13
/* calibration flags */
#define JOY_ISCAL_XY 0x00000001l /* XY are calibrated */
#define JOY_ISCAL_Z 0x00000002l /* Z is calibrated */
#define JOY_ISCAL_R 0x00000004l /* R is calibrated */
#define JOY_ISCAL_U 0x00000008l /* U is calibrated */
#define JOY_ISCAL_V 0x00000010l /* V is calibrated */
#define JOY_ISCAL_POV 0x00000020l /* POV is calibrated */
/* point of view constants */
#define JOY_POV_NUMDIRS 4
#define JOY_POVVAL_FORWARD 0
#define JOY_POVVAL_BACKWARD 1
#define JOY_POVVAL_LEFT 2
#define JOY_POVVAL_RIGHT 3
/* Specific settings for joystick hardware */
#define JOY_HWS_HASZ 0x00000001l /* has Z info? */
#define JOY_HWS_HASPOV 0x00000002l /* point of view hat present */
#define JOY_HWS_POVISBUTTONCOMBOS 0x00000004l /* pov done through combo of buttons */
#define JOY_HWS_POVISPOLL 0x00000008l /* pov done through polling */
#define JOY_HWS_ISYOKE 0x00000010l /* joystick is a flight yoke */
#define JOY_HWS_ISGAMEPAD 0x00000020l /* joystick is a game pad */
#define JOY_HWS_ISCARCTRL 0x00000040l /* joystick is a car controller */
/* X defaults to J1 X axis */
#define JOY_HWS_XISJ1Y 0x00000080l /* X is on J1 Y axis */
#define JOY_HWS_XISJ2X 0x00000100l /* X is on J2 X axis */
#define JOY_HWS_XISJ2Y 0x00000200l /* X is on J2 Y axis */
/* Y defaults to J1 Y axis */
#define JOY_HWS_YISJ1X 0x00000400l /* Y is on J1 X axis */
#define JOY_HWS_YISJ2X 0x00000800l /* Y is on J2 X axis */
#define JOY_HWS_YISJ2Y 0x00001000l /* Y is on J2 Y axis */
/* Z defaults to J2 Y axis */
#define JOY_HWS_ZISJ1X 0x00002000l /* Z is on J1 X axis */
#define JOY_HWS_ZISJ1Y 0x00004000l /* Z is on J1 Y axis */
#define JOY_HWS_ZISJ2X 0x00008000l /* Z is on J2 X axis */
/* POV defaults to J2 Y axis, if it is not button based */
#define JOY_HWS_POVISJ1X 0x00010000l /* pov done through J1 X axis */
#define JOY_HWS_POVISJ1Y 0x00020000l /* pov done through J1 Y axis */
#define JOY_HWS_POVISJ2X 0x00040000l /* pov done through J2 X axis */
/* R defaults to J2 X axis */
#define JOY_HWS_HASR 0x00080000l /* has R (4th axis) info */
#define JOY_HWS_RISJ1X 0x00100000l /* R done through J1 X axis */
#define JOY_HWS_RISJ1Y 0x00200000l /* R done through J1 Y axis */
#define JOY_HWS_RISJ2Y 0x00400000l /* R done through J2 X axis */
/* U & V for future hardware */
#define JOY_HWS_HASU 0x00800000l /* has U (5th axis) info */
#define JOY_HWS_HASV 0x01000000l /* has V (6th axis) info */
/* Usage settings */
#define JOY_US_HASRUDDER 0x00000001l /* joystick configured with rudder */
#define JOY_US_PRESENT 0x00000002l /* is joystick actually present? */
#define JOY_US_ISOEM 0x00000004l /* joystick is an OEM defined type */
/* reserved for future use -> as link to next possible dword */
#define JOY_US_RESERVED 0x80000000l /* reserved */
/* Settings for TypeInfo Flags1 */
#define JOYTYPE_ZEROGAMEENUMOEMDATA 0x00000001l /* Zero GameEnum's OEM data field */
#define JOYTYPE_NOAUTODETECTGAMEPORT 0x00000002l /* Device does not support Autodetect gameport*/
#define JOYTYPE_NOHIDDIRECT 0x00000004l /* Do not use HID directly for this device */
#define JOYTYPE_ANALOGCOMPAT 0x00000008l /* Expose the analog compatible ID */
#define JOYTYPE_DEFAULTPROPSHEET 0x80000000l /* CPL overrides custom property sheet */
/* Settings for TypeInfo Flags2 */
#define JOYTYPE_DEVICEHIDE 0x00010000l /* Hide unclassified devices */
#define JOYTYPE_MOUSEHIDE 0x00020000l /* Hide mice */
#define JOYTYPE_KEYBHIDE 0x00040000l /* Hide keyboards */
#define JOYTYPE_GAMEHIDE 0x00080000l /* Hide game controllers */
#define JOYTYPE_HIDEACTIVE 0x00100000l /* Hide flags are active */
#define JOYTYPE_INFOMASK 0x00E00000l /* Mask for type specific info */
#define JOYTYPE_INFODEFAULT 0x00000000l /* Use default axis mappings */
#define JOYTYPE_INFOYYPEDALS 0x00200000l /* Use Y as a combined pedals axis */
#define JOYTYPE_INFOZYPEDALS 0x00400000l /* Use Z for accelerate, Y for brake */
#define JOYTYPE_INFOYRPEDALS 0x00600000l /* Use Y for accelerate, R for brake */
#define JOYTYPE_INFOZRPEDALS 0x00800000l /* Use Z for accelerate, R for brake */
#define JOYTYPE_INFOZISSLIDER 0x00200000l /* Use Z as a slider */
#define JOYTYPE_INFOZISZ 0x00400000l /* Use Z as Z axis */
#define JOYTYPE_ENABLEINPUTREPORT 0x01000000l /* Enable initial input reports */
/* struct for storing x,y, z, and rudder values */
typedef struct joypos_tag {
DWORD dwX;
DWORD dwY;
DWORD dwZ;
DWORD dwR;
DWORD dwU;
DWORD dwV;
} JOYPOS, FAR *LPJOYPOS;
/* struct for storing ranges */
typedef struct joyrange_tag {
JOYPOS jpMin;
JOYPOS jpMax;
JOYPOS jpCenter;
} JOYRANGE,FAR *LPJOYRANGE;
/*
* dwTimeout - value at which to timeout joystick polling
* jrvRanges - range of values app wants returned for axes
* jpDeadZone - area around center to be considered
* as "dead". specified as a percentage
* (0-100). Only X & Y handled by system driver
*/
typedef struct joyreguservalues_tag {
DWORD dwTimeOut;
JOYRANGE jrvRanges;
JOYPOS jpDeadZone;
} JOYREGUSERVALUES, FAR *LPJOYREGUSERVALUES;
typedef struct joyreghwsettings_tag {
DWORD dwFlags;
DWORD dwNumButtons;
} JOYREGHWSETTINGS, FAR *LPJOYHWSETTINGS;
/* range of values returned by the hardware (filled in by calibration) */
/*
* jrvHardware - values returned by hardware
* dwPOVValues - POV values returned by hardware
* dwCalFlags - what has been calibrated
*/
typedef struct joyreghwvalues_tag {
JOYRANGE jrvHardware;
DWORD dwPOVValues[JOY_POV_NUMDIRS];
DWORD dwCalFlags;
} JOYREGHWVALUES, FAR *LPJOYREGHWVALUES;
/* hardware configuration */
/*
* hws - hardware settings
* dwUsageSettings - usage settings
* hwv - values returned by hardware
* dwType - type of joystick
* dwReserved - reserved for OEM drivers
*/
typedef struct joyreghwconfig_tag {
JOYREGHWSETTINGS hws;
DWORD dwUsageSettings;
JOYREGHWVALUES hwv;
DWORD dwType;
DWORD dwReserved;
} JOYREGHWCONFIG, FAR *LPJOYREGHWCONFIG;
/* joystick calibration info structure */
typedef struct joycalibrate_tag {
UINT wXbase;
UINT wXdelta;
UINT wYbase;
UINT wYdelta;
UINT wZbase;
UINT wZdelta;
} JOYCALIBRATE;
typedef JOYCALIBRATE FAR *LPJOYCALIBRATE;
#endif
#ifndef DIJ_RINGZERO
#define MAX_JOYSTRING 256
typedef BOOL (FAR PASCAL * LPDIJOYTYPECALLBACK)(LPCWSTR, LPVOID);
#ifndef MAX_JOYSTICKOEMVXDNAME
#define MAX_JOYSTICKOEMVXDNAME 260
#endif
#define DITC_REGHWSETTINGS 0x00000001
#define DITC_CLSIDCONFIG 0x00000002
#define DITC_DISPLAYNAME 0x00000004
#define DITC_CALLOUT 0x00000008
#define DITC_HARDWAREID 0x00000010
#define DITC_FLAGS1 0x00000020
#define DITC_FLAGS2 0x00000040
#define DITC_MAPFILE 0x00000080
/* This structure is defined for DirectX 5.0 compatibility */
typedef struct DIJOYTYPEINFO_DX5 {
DWORD dwSize;
JOYREGHWSETTINGS hws;
CLSID clsidConfig;
WCHAR wszDisplayName[MAX_JOYSTRING];
WCHAR wszCallout[MAX_JOYSTICKOEMVXDNAME];
} DIJOYTYPEINFO_DX5, *LPDIJOYTYPEINFO_DX5;
typedef const DIJOYTYPEINFO_DX5 *LPCDIJOYTYPEINFO_DX5;
/* This structure is defined for DirectX 6.1 compatibility */
typedef struct DIJOYTYPEINFO_DX6 {
DWORD dwSize;
JOYREGHWSETTINGS hws;
CLSID clsidConfig;
WCHAR wszDisplayName[MAX_JOYSTRING];
WCHAR wszCallout[MAX_JOYSTICKOEMVXDNAME];
WCHAR wszHardwareId[MAX_JOYSTRING];
DWORD dwFlags1;
} DIJOYTYPEINFO_DX6, *LPDIJOYTYPEINFO_DX6;
typedef const DIJOYTYPEINFO_DX6 *LPCDIJOYTYPEINFO_DX6;
typedef struct DIJOYTYPEINFO {
DWORD dwSize;
JOYREGHWSETTINGS hws;
CLSID clsidConfig;
WCHAR wszDisplayName[MAX_JOYSTRING];
WCHAR wszCallout[MAX_JOYSTICKOEMVXDNAME];
#if(DIRECTINPUT_VERSION >= 0x05b2)
WCHAR wszHardwareId[MAX_JOYSTRING];
DWORD dwFlags1;
#if(DIRECTINPUT_VERSION >= 0x0800)
DWORD dwFlags2;
WCHAR wszMapFile[MAX_JOYSTRING];
#endif /* DIRECTINPUT_VERSION >= 0x0800 */
#endif /* DIRECTINPUT_VERSION >= 0x05b2 */
} DIJOYTYPEINFO, *LPDIJOYTYPEINFO;
typedef const DIJOYTYPEINFO *LPCDIJOYTYPEINFO;
#define DIJC_GUIDINSTANCE 0x00000001
#define DIJC_REGHWCONFIGTYPE 0x00000002
#define DIJC_GAIN 0x00000004
#define DIJC_CALLOUT 0x00000008
#define DIJC_WDMGAMEPORT 0x00000010
/* This structure is defined for DirectX 5.0 compatibility */
typedef struct DIJOYCONFIG_DX5 {
DWORD dwSize;
GUID guidInstance;
JOYREGHWCONFIG hwc;
DWORD dwGain;
WCHAR wszType[MAX_JOYSTRING];
WCHAR wszCallout[MAX_JOYSTRING];
} DIJOYCONFIG_DX5, *LPDIJOYCONFIG_DX5;
typedef const DIJOYCONFIG_DX5 *LPCDIJOYCONFIG_DX5;
typedef struct DIJOYCONFIG {
DWORD dwSize;
GUID guidInstance;
JOYREGHWCONFIG hwc;
DWORD dwGain;
WCHAR wszType[MAX_JOYSTRING];
WCHAR wszCallout[MAX_JOYSTRING];
#if(DIRECTINPUT_VERSION >= 0x05b2)
GUID guidGameport;
#endif /* DIRECTINPUT_VERSION >= 0x05b2 */
} DIJOYCONFIG, *LPDIJOYCONFIG;
typedef const DIJOYCONFIG *LPCDIJOYCONFIG;
#define DIJU_USERVALUES 0x00000001
#define DIJU_GLOBALDRIVER 0x00000002
#define DIJU_GAMEPORTEMULATOR 0x00000004
typedef struct DIJOYUSERVALUES {
DWORD dwSize;
JOYREGUSERVALUES ruv;
WCHAR wszGlobalDriver[MAX_JOYSTRING];
WCHAR wszGameportEmulator[MAX_JOYSTRING];
} DIJOYUSERVALUES, *LPDIJOYUSERVALUES;
typedef const DIJOYUSERVALUES *LPCDIJOYUSERVALUES;
DEFINE_GUID(GUID_KeyboardClass, 0x4D36E96B,0xE325,0x11CE,0xBF,0xC1,0x08,0x00,0x2B,0xE1,0x03,0x18);
DEFINE_GUID(GUID_MediaClass, 0x4D36E96C,0xE325,0x11CE,0xBF,0xC1,0x08,0x00,0x2B,0xE1,0x03,0x18);
DEFINE_GUID(GUID_MouseClass, 0x4D36E96F,0xE325,0x11CE,0xBF,0xC1,0x08,0x00,0x2B,0xE1,0x03,0x18);
DEFINE_GUID(GUID_HIDClass, 0x745A17A0,0x74D3,0x11D0,0xB6,0xFE,0x00,0xA0,0xC9,0x0F,0x57,0xDA);
#undef INTERFACE
#define INTERFACE IDirectInputJoyConfig
DECLARE_INTERFACE_(IDirectInputJoyConfig, IUnknown)
{
/*** IUnknown methods ***/
STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID * ppvObj) PURE;
STDMETHOD_(ULONG,AddRef)(THIS) PURE;
STDMETHOD_(ULONG,Release)(THIS) PURE;
/*** IDirectInputJoyConfig methods ***/
STDMETHOD(Acquire)(THIS) PURE;
STDMETHOD(Unacquire)(THIS) PURE;
STDMETHOD(SetCooperativeLevel)(THIS_ HWND,DWORD) PURE;
STDMETHOD(SendNotify)(THIS) PURE;
STDMETHOD(EnumTypes)(THIS_ LPDIJOYTYPECALLBACK,LPVOID) PURE;
STDMETHOD(GetTypeInfo)(THIS_ LPCWSTR,LPDIJOYTYPEINFO,DWORD) PURE;
STDMETHOD(SetTypeInfo)(THIS_ LPCWSTR,LPCDIJOYTYPEINFO,DWORD) PURE;
STDMETHOD(DeleteType)(THIS_ LPCWSTR) PURE;
STDMETHOD(GetConfig)(THIS_ UINT,LPDIJOYCONFIG,DWORD) PURE;
STDMETHOD(SetConfig)(THIS_ UINT,LPCDIJOYCONFIG,DWORD) PURE;
STDMETHOD(DeleteConfig)(THIS_ UINT) PURE;
STDMETHOD(GetUserValues)(THIS_ LPDIJOYUSERVALUES,DWORD) PURE;
STDMETHOD(SetUserValues)(THIS_ LPCDIJOYUSERVALUES,DWORD) PURE;
STDMETHOD(AddNewHardware)(THIS_ HWND,REFGUID) PURE;
STDMETHOD(OpenTypeKey)(THIS_ LPCWSTR,DWORD,PHKEY) PURE;
STDMETHOD(OpenConfigKey)(THIS_ UINT,DWORD,PHKEY) PURE;
};
typedef struct IDirectInputJoyConfig *LPDIRECTINPUTJOYCONFIG;
#if !defined(__cplusplus) || defined(CINTERFACE)
#define IDirectInputJoyConfig_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
#define IDirectInputJoyConfig_AddRef(p) (p)->lpVtbl->AddRef(p)
#define IDirectInputJoyConfig_Release(p) (p)->lpVtbl->Release(p)
#define IDirectInputJoyConfig_Acquire(p) (p)->lpVtbl->Acquire(p)
#define IDirectInputJoyConfig_Unacquire(p) (p)->lpVtbl->Unacquire(p)
#define IDirectInputJoyConfig_SetCooperativeLevel(p,a,b) (p)->lpVtbl->SetCooperativeLevel(p,a,b)
#define IDirectInputJoyConfig_SendNotify(p) (p)->lpVtbl->SendNotify(p)
#define IDirectInputJoyConfig_EnumTypes(p,a,b) (p)->lpVtbl->EnumTypes(p,a,b)
#define IDirectInputJoyConfig_GetTypeInfo(p,a,b,c) (p)->lpVtbl->GetTypeInfo(p,a,b,c)
#define IDirectInputJoyConfig_SetTypeInfo(p,a,b,c) (p)->lpVtbl->SetTypeInfo(p,a,b,c)
#define IDirectInputJoyConfig_DeleteType(p,a) (p)->lpVtbl->DeleteType(p,a)
#define IDirectInputJoyConfig_GetConfig(p,a,b,c) (p)->lpVtbl->GetConfig(p,a,b,c)
#define IDirectInputJoyConfig_SetConfig(p,a,b,c) (p)->lpVtbl->SetConfig(p,a,b,c)
#define IDirectInputJoyConfig_DeleteConfig(p,a) (p)->lpVtbl->DeleteConfig(p,a)
#define IDirectInputJoyConfig_GetUserValues(p,a,b) (p)->lpVtbl->GetUserValues(p,a,b)
#define IDirectInputJoyConfig_SetUserValues(p,a,b) (p)->lpVtbl->SetUserValues(p,a,b)
#define IDirectInputJoyConfig_AddNewHardware(p,a,b) (p)->lpVtbl->AddNewHardware(p,a,b)
#define IDirectInputJoyConfig_OpenTypeKey(p,a,b,c) (p)->lpVtbl->OpenTypeKey(p,a,b,c)
#define IDirectInputJoyConfig_OpenConfigKey(p,a,b,c) (p)->lpVtbl->OpenConfigKey(p,a,b,c)
#else
#define IDirectInputJoyConfig_QueryInterface(p,a,b) (p)->QueryInterface(a,b)
#define IDirectInputJoyConfig_AddRef(p) (p)->AddRef()
#define IDirectInputJoyConfig_Release(p) (p)->Release()
#define IDirectInputJoyConfig_Acquire(p) (p)->Acquire()
#define IDirectInputJoyConfig_Unacquire(p) (p)->Unacquire()
#define IDirectInputJoyConfig_SetCooperativeLevel(p,a,b) (p)->SetCooperativeLevel(a,b)
#define IDirectInputJoyConfig_SendNotify(p) (p)->SendNotify()
#define IDirectInputJoyConfig_EnumTypes(p,a,b) (p)->EnumTypes(a,b)
#define IDirectInputJoyConfig_GetTypeInfo(p,a,b,c) (p)->GetTypeInfo(a,b,c)
#define IDirectInputJoyConfig_SetTypeInfo(p,a,b,c) (p)->SetTypeInfo(a,b,c)
#define IDirectInputJoyConfig_DeleteType(p,a) (p)->DeleteType(a)
#define IDirectInputJoyConfig_GetConfig(p,a,b,c) (p)->GetConfig(a,b,c)
#define IDirectInputJoyConfig_SetConfig(p,a,b,c) (p)->SetConfig(a,b,c)
#define IDirectInputJoyConfig_DeleteConfig(p,a) (p)->DeleteConfig(a)
#define IDirectInputJoyConfig_GetUserValues(p,a,b) (p)->GetUserValues(a,b)
#define IDirectInputJoyConfig_SetUserValues(p,a,b) (p)->SetUserValues(a,b)
#define IDirectInputJoyConfig_AddNewHardware(p,a,b) (p)->AddNewHardware(a,b)
#define IDirectInputJoyConfig_OpenTypeKey(p,a,b,c) (p)->OpenTypeKey(a,b,c)
#define IDirectInputJoyConfig_OpenConfigKey(p,a,b,c) (p)->OpenConfigKey(a,b,c)
#endif
#endif /* DIJ_RINGZERO */
#if(DIRECTINPUT_VERSION >= 0x0800)
#ifndef DIJ_RINGZERO
#undef INTERFACE
#define INTERFACE IDirectInputJoyConfig8
DECLARE_INTERFACE_(IDirectInputJoyConfig8, IUnknown)
{
/*** IUnknown methods ***/
STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID * ppvObj) PURE;
STDMETHOD_(ULONG,AddRef)(THIS) PURE;
STDMETHOD_(ULONG,Release)(THIS) PURE;
/*** IDirectInputJoyConfig8 methods ***/
STDMETHOD(Acquire)(THIS) PURE;
STDMETHOD(Unacquire)(THIS) PURE;
STDMETHOD(SetCooperativeLevel)(THIS_ HWND,DWORD) PURE;
STDMETHOD(SendNotify)(THIS) PURE;
STDMETHOD(EnumTypes)(THIS_ LPDIJOYTYPECALLBACK,LPVOID) PURE;
STDMETHOD(GetTypeInfo)(THIS_ LPCWSTR,LPDIJOYTYPEINFO,DWORD) PURE;
STDMETHOD(SetTypeInfo)(THIS_ LPCWSTR,LPCDIJOYTYPEINFO,DWORD,LPWSTR) PURE;
STDMETHOD(DeleteType)(THIS_ LPCWSTR) PURE;
STDMETHOD(GetConfig)(THIS_ UINT,LPDIJOYCONFIG,DWORD) PURE;
STDMETHOD(SetConfig)(THIS_ UINT,LPCDIJOYCONFIG,DWORD) PURE;
STDMETHOD(DeleteConfig)(THIS_ UINT) PURE;
STDMETHOD(GetUserValues)(THIS_ LPDIJOYUSERVALUES,DWORD) PURE;
STDMETHOD(SetUserValues)(THIS_ LPCDIJOYUSERVALUES,DWORD) PURE;
STDMETHOD(AddNewHardware)(THIS_ HWND,REFGUID) PURE;
STDMETHOD(OpenTypeKey)(THIS_ LPCWSTR,DWORD,PHKEY) PURE;
STDMETHOD(OpenAppStatusKey)(THIS_ PHKEY) PURE;
};
typedef struct IDirectInputJoyConfig8 *LPDIRECTINPUTJOYCONFIG8;
#if !defined(__cplusplus) || defined(CINTERFACE)
#define IDirectInputJoyConfig8_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
#define IDirectInputJoyConfig8_AddRef(p) (p)->lpVtbl->AddRef(p)
#define IDirectInputJoyConfig8_Release(p) (p)->lpVtbl->Release(p)
#define IDirectInputJoyConfig8_Acquire(p) (p)->lpVtbl->Acquire(p)
#define IDirectInputJoyConfig8_Unacquire(p) (p)->lpVtbl->Unacquire(p)
#define IDirectInputJoyConfig8_SetCooperativeLevel(p,a,b) (p)->lpVtbl->SetCooperativeLevel(p,a,b)
#define IDirectInputJoyConfig8_SendNotify(p) (p)->lpVtbl->SendNotify(p)
#define IDirectInputJoyConfig8_EnumTypes(p,a,b) (p)->lpVtbl->EnumTypes(p,a,b)
#define IDirectInputJoyConfig8_GetTypeInfo(p,a,b,c) (p)->lpVtbl->GetTypeInfo(p,a,b,c)
#define IDirectInputJoyConfig8_SetTypeInfo(p,a,b,c,d) (p)->lpVtbl->SetTypeInfo(p,a,b,c,d)
#define IDirectInputJoyConfig8_DeleteType(p,a) (p)->lpVtbl->DeleteType(p,a)
#define IDirectInputJoyConfig8_GetConfig(p,a,b,c) (p)->lpVtbl->GetConfig(p,a,b,c)
#define IDirectInputJoyConfig8_SetConfig(p,a,b,c) (p)->lpVtbl->SetConfig(p,a,b,c)
#define IDirectInputJoyConfig8_DeleteConfig(p,a) (p)->lpVtbl->DeleteConfig(p,a)
#define IDirectInputJoyConfig8_GetUserValues(p,a,b) (p)->lpVtbl->GetUserValues(p,a,b)
#define IDirectInputJoyConfig8_SetUserValues(p,a,b) (p)->lpVtbl->SetUserValues(p,a,b)
#define IDirectInputJoyConfig8_AddNewHardware(p,a,b) (p)->lpVtbl->AddNewHardware(p,a,b)
#define IDirectInputJoyConfig8_OpenTypeKey(p,a,b,c) (p)->lpVtbl->OpenTypeKey(p,a,b,c)
#define IDirectInputJoyConfig8_OpenAppStatusKey(p,a) (p)->lpVtbl->OpenAppStatusKey(p,a)
#else
#define IDirectInputJoyConfig8_QueryInterface(p,a,b) (p)->QueryInterface(a,b)
#define IDirectInputJoyConfig8_AddRef(p) (p)->AddRef()
#define IDirectInputJoyConfig8_Release(p) (p)->Release()
#define IDirectInputJoyConfig8_Acquire(p) (p)->Acquire()
#define IDirectInputJoyConfig8_Unacquire(p) (p)->Unacquire()
#define IDirectInputJoyConfig8_SetCooperativeLevel(p,a,b) (p)->SetCooperativeLevel(a,b)
#define IDirectInputJoyConfig8_SendNotify(p) (p)->SendNotify()
#define IDirectInputJoyConfig8_EnumTypes(p,a,b) (p)->EnumTypes(a,b)
#define IDirectInputJoyConfig8_GetTypeInfo(p,a,b,c) (p)->GetTypeInfo(a,b,c)
#define IDirectInputJoyConfig8_SetTypeInfo(p,a,b,c,d) (p)->SetTypeInfo(a,b,c,d)
#define IDirectInputJoyConfig8_DeleteType(p,a) (p)->DeleteType(a)
#define IDirectInputJoyConfig8_GetConfig(p,a,b,c) (p)->GetConfig(a,b,c)
#define IDirectInputJoyConfig8_SetConfig(p,a,b,c) (p)->SetConfig(a,b,c)
#define IDirectInputJoyConfig8_DeleteConfig(p,a) (p)->DeleteConfig(a)
#define IDirectInputJoyConfig8_GetUserValues(p,a,b) (p)->GetUserValues(a,b)
#define IDirectInputJoyConfig8_SetUserValues(p,a,b) (p)->SetUserValues(a,b)
#define IDirectInputJoyConfig8_AddNewHardware(p,a,b) (p)->AddNewHardware(a,b)
#define IDirectInputJoyConfig8_OpenTypeKey(p,a,b,c) (p)->OpenTypeKey(a,b,c)
#define IDirectInputJoyConfig8_OpenAppStatusKey(p,a) (p)->OpenAppStatusKey(a)
#endif
#endif /* DIJ_RINGZERO */
/****************************************************************************
*
* Notification Messages
*
****************************************************************************/
/* RegisterWindowMessage with this to get DirectInput notification messages */
#define DIRECTINPUT_NOTIFICATION_MSGSTRINGA "DIRECTINPUT_NOTIFICATION_MSGSTRING"
#define DIRECTINPUT_NOTIFICATION_MSGSTRINGW L"DIRECTINPUT_NOTIFICATION_MSGSTRING"
#ifdef UNICODE
#define DIRECTINPUT_NOTIFICATION_MSGSTRING DIRECTINPUT_NOTIFICATION_MSGSTRINGW
#else
#define DIRECTINPUT_NOTIFICATION_MSGSTRING DIRECTINPUT_NOTIFICATION_MSGSTRINGA
#endif
#define DIMSGWP_NEWAPPSTART 0x00000001
#define DIMSGWP_DX8APPSTART 0x00000002
#define DIMSGWP_DX8MAPPERAPPSTART 0x00000003
#endif /* DIRECTINPUT_VERSION >= 0x0800 */
#define DIAPPIDFLAG_NOTIME 0x00000001
#define DIAPPIDFLAG_NOSIZE 0x00000002
#define DIRECTINPUT_REGSTR_VAL_APPIDFLAGA "AppIdFlag"
#define DIRECTINPUT_REGSTR_KEY_LASTAPPA "MostRecentApplication"
#define DIRECTINPUT_REGSTR_KEY_LASTMAPAPPA "MostRecentMapperApplication"
#define DIRECTINPUT_REGSTR_VAL_VERSIONA "Version"
#define DIRECTINPUT_REGSTR_VAL_NAMEA "Name"
#define DIRECTINPUT_REGSTR_VAL_IDA "Id"
#define DIRECTINPUT_REGSTR_VAL_MAPPERA "UsesMapper"
#define DIRECTINPUT_REGSTR_VAL_LASTSTARTA "MostRecentStart"
#define DIRECTINPUT_REGSTR_VAL_APPIDFLAGW L"AppIdFlag"
#define DIRECTINPUT_REGSTR_KEY_LASTAPPW L"MostRecentApplication"
#define DIRECTINPUT_REGSTR_KEY_LASTMAPAPPW L"MostRecentMapperApplication"
#define DIRECTINPUT_REGSTR_VAL_VERSIONW L"Version"
#define DIRECTINPUT_REGSTR_VAL_NAMEW L"Name"
#define DIRECTINPUT_REGSTR_VAL_IDW L"Id"
#define DIRECTINPUT_REGSTR_VAL_MAPPERW L"UsesMapper"
#define DIRECTINPUT_REGSTR_VAL_LASTSTARTW L"MostRecentStart"
#ifdef UNICODE
#define DIRECTINPUT_REGSTR_VAL_APPIDFLAG DIRECTINPUT_REGSTR_VAL_APPIDFLAGW
#define DIRECTINPUT_REGSTR_KEY_LASTAPP DIRECTINPUT_REGSTR_KEY_LASTAPPW
#define DIRECTINPUT_REGSTR_KEY_LASTMAPAPP DIRECTINPUT_REGSTR_KEY_LASTMAPAPPW
#define DIRECTINPUT_REGSTR_VAL_VERSION DIRECTINPUT_REGSTR_VAL_VERSIONW
#define DIRECTINPUT_REGSTR_VAL_NAME DIRECTINPUT_REGSTR_VAL_NAMEW
#define DIRECTINPUT_REGSTR_VAL_ID DIRECTINPUT_REGSTR_VAL_IDW
#define DIRECTINPUT_REGSTR_VAL_MAPPER DIRECTINPUT_REGSTR_VAL_MAPPERW
#define DIRECTINPUT_REGSTR_VAL_LASTSTART DIRECTINPUT_REGSTR_VAL_LASTSTARTW
#else
#define DIRECTINPUT_REGSTR_VAL_APPIDFLAG DIRECTINPUT_REGSTR_VAL_APPIDFLAGA
#define DIRECTINPUT_REGSTR_KEY_LASTAPP DIRECTINPUT_REGSTR_KEY_LASTAPPA
#define DIRECTINPUT_REGSTR_KEY_LASTMAPAPP DIRECTINPUT_REGSTR_KEY_LASTMAPAPPA
#define DIRECTINPUT_REGSTR_VAL_VERSION DIRECTINPUT_REGSTR_VAL_VERSIONA
#define DIRECTINPUT_REGSTR_VAL_NAME DIRECTINPUT_REGSTR_VAL_NAMEA
#define DIRECTINPUT_REGSTR_VAL_ID DIRECTINPUT_REGSTR_VAL_IDA
#define DIRECTINPUT_REGSTR_VAL_MAPPER DIRECTINPUT_REGSTR_VAL_MAPPERA
#define DIRECTINPUT_REGSTR_VAL_LASTSTART DIRECTINPUT_REGSTR_VAL_LASTSTARTA
#endif
/****************************************************************************
*
* Return Codes
*
****************************************************************************/
#define DIERR_NOMOREITEMS \
MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, ERROR_NO_MORE_ITEMS)
/*
* Device driver-specific codes.
*/
#define DIERR_DRIVERFIRST 0x80040300L
#define DIERR_DRIVERLAST 0x800403FFL
/*
* Unless the specific driver has been precisely identified, no meaning
* should be attributed to these values other than that the driver
* originated the error. However, to illustrate the types of error that
* may be causing the failure, the PID force feedback driver distributed
* with DirectX 7 could return the following errors:
*
* DIERR_DRIVERFIRST + 1
* The requested usage was not found.
* DIERR_DRIVERFIRST + 2
* The parameter block couldn't be downloaded to the device.
* DIERR_DRIVERFIRST + 3
* PID initialization failed.
* DIERR_DRIVERFIRST + 4
* The provided values couldn't be scaled.
*/
/*
* Device installer errors.
*/
/*
* Registry entry or DLL for class installer invalid
* or class installer not found.
*/
#define DIERR_INVALIDCLASSINSTALLER 0x80040400L
/*
* The user cancelled the install operation.
*/
#define DIERR_CANCELLED 0x80040401L
/*
* The INF file for the selected device could not be
* found or is invalid or is damaged.
*/
#define DIERR_BADINF 0x80040402L
/****************************************************************************
*
* Map files
*
****************************************************************************/
/*
* Delete particular data from default map file.
*/
#define DIDIFT_DELETE 0x01000000
#ifdef __cplusplus
};
#endif
#endif /* __DINPUTD_INCLUDED__ */

View File

@@ -1,239 +0,0 @@
/***************************************************************************
*
* Copyright (C) 1998-1999 Microsoft Corporation. All Rights Reserved.
*
* File: dxfile.h
*
* Content: DirectX File public header file
*
***************************************************************************/
#ifndef __DXFILE_H__
#define __DXFILE_H__
#ifdef __cplusplus
extern "C" {
#endif
typedef DWORD DXFILEFORMAT;
#define DXFILEFORMAT_BINARY 0
#define DXFILEFORMAT_TEXT 1
#define DXFILEFORMAT_COMPRESSED 2
typedef DWORD DXFILELOADOPTIONS;
#define DXFILELOAD_FROMFILE 0x00L
#define DXFILELOAD_FROMRESOURCE 0x01L
#define DXFILELOAD_FROMMEMORY 0x02L
#define DXFILELOAD_FROMSTREAM 0x04L
#define DXFILELOAD_FROMURL 0x08L
typedef struct _DXFILELOADRESOURCE {
HMODULE hModule;
LPCTSTR lpName;
LPCTSTR lpType;
}DXFILELOADRESOURCE, *LPDXFILELOADRESOURCE;
typedef struct _DXFILELOADMEMORY {
LPVOID lpMemory;
DWORD dSize;
}DXFILELOADMEMORY, *LPDXFILELOADMEMORY;
/*
* DirectX File object types.
*/
#ifndef WIN_TYPES
#define WIN_TYPES(itype, ptype) typedef interface itype *LP##ptype, **LPLP##ptype
#endif
WIN_TYPES(IDirectXFile, DIRECTXFILE);
WIN_TYPES(IDirectXFileEnumObject, DIRECTXFILEENUMOBJECT);
WIN_TYPES(IDirectXFileSaveObject, DIRECTXFILESAVEOBJECT);
WIN_TYPES(IDirectXFileObject, DIRECTXFILEOBJECT);
WIN_TYPES(IDirectXFileData, DIRECTXFILEDATA);
WIN_TYPES(IDirectXFileDataReference, DIRECTXFILEDATAREFERENCE);
WIN_TYPES(IDirectXFileBinary, DIRECTXFILEBINARY);
/*
* API for creating IDirectXFile interface.
*/
STDAPI DirectXFileCreate(LPDIRECTXFILE *lplpDirectXFile);
/*
* The methods for IUnknown
*/
#define IUNKNOWN_METHODS(kind) \
STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID *ppvObj) kind; \
STDMETHOD_(ULONG, AddRef) (THIS) kind; \
STDMETHOD_(ULONG, Release) (THIS) kind
/*
* The methods for IDirectXFileObject
*/
#define IDIRECTXFILEOBJECT_METHODS(kind) \
STDMETHOD(GetName) (THIS_ LPSTR, LPDWORD) kind; \
STDMETHOD(GetId) (THIS_ LPGUID) kind
/*
* DirectX File interfaces.
*/
#undef INTERFACE
#define INTERFACE IDirectXFile
DECLARE_INTERFACE_(IDirectXFile, IUnknown)
{
IUNKNOWN_METHODS(PURE);
STDMETHOD(CreateEnumObject) (THIS_ LPVOID, DXFILELOADOPTIONS,
LPDIRECTXFILEENUMOBJECT *) PURE;
STDMETHOD(CreateSaveObject) (THIS_ LPCSTR, DXFILEFORMAT,
LPDIRECTXFILESAVEOBJECT *) PURE;
STDMETHOD(RegisterTemplates) (THIS_ LPVOID, DWORD) PURE;
};
#undef INTERFACE
#define INTERFACE IDirectXFileEnumObject
DECLARE_INTERFACE_(IDirectXFileEnumObject, IUnknown)
{
IUNKNOWN_METHODS(PURE);
STDMETHOD(GetNextDataObject) (THIS_ LPDIRECTXFILEDATA *) PURE;
STDMETHOD(GetDataObjectById) (THIS_ REFGUID, LPDIRECTXFILEDATA *) PURE;
STDMETHOD(GetDataObjectByName) (THIS_ LPCSTR, LPDIRECTXFILEDATA *) PURE;
};
#undef INTERFACE
#define INTERFACE IDirectXFileSaveObject
DECLARE_INTERFACE_(IDirectXFileSaveObject, IUnknown)
{
IUNKNOWN_METHODS(PURE);
STDMETHOD(SaveTemplates) (THIS_ DWORD, const GUID **) PURE;
STDMETHOD(CreateDataObject) (THIS_ REFGUID, LPCSTR, const GUID *,
DWORD, LPVOID, LPDIRECTXFILEDATA *) PURE;
STDMETHOD(SaveData) (THIS_ LPDIRECTXFILEDATA) PURE;
};
#undef INTERFACE
#define INTERFACE IDirectXFileObject
DECLARE_INTERFACE_(IDirectXFileObject, IUnknown)
{
IUNKNOWN_METHODS(PURE);
IDIRECTXFILEOBJECT_METHODS(PURE);
};
#undef INTERFACE
#define INTERFACE IDirectXFileData
DECLARE_INTERFACE_(IDirectXFileData, IDirectXFileObject)
{
IUNKNOWN_METHODS(PURE);
IDIRECTXFILEOBJECT_METHODS(PURE);
STDMETHOD(GetData) (THIS_ LPCSTR, DWORD *, void **) PURE;
STDMETHOD(GetType) (THIS_ const GUID **) PURE;
STDMETHOD(GetNextObject) (THIS_ LPDIRECTXFILEOBJECT *) PURE;
STDMETHOD(AddDataObject) (THIS_ LPDIRECTXFILEDATA) PURE;
STDMETHOD(AddDataReference) (THIS_ LPCSTR, const GUID *) PURE;
STDMETHOD(AddBinaryObject) (THIS_ LPCSTR, const GUID *, LPCSTR, LPVOID, DWORD) PURE;
};
#undef INTERFACE
#define INTERFACE IDirectXFileDataReference
DECLARE_INTERFACE_(IDirectXFileDataReference, IDirectXFileObject)
{
IUNKNOWN_METHODS(PURE);
IDIRECTXFILEOBJECT_METHODS(PURE);
STDMETHOD(Resolve) (THIS_ LPDIRECTXFILEDATA *) PURE;
};
#undef INTERFACE
#define INTERFACE IDirectXFileBinary
DECLARE_INTERFACE_(IDirectXFileBinary, IDirectXFileObject)
{
IUNKNOWN_METHODS(PURE);
IDIRECTXFILEOBJECT_METHODS(PURE);
STDMETHOD(GetSize) (THIS_ DWORD *) PURE;
STDMETHOD(GetMimeType) (THIS_ LPCSTR *) PURE;
STDMETHOD(Read) (THIS_ LPVOID, DWORD, LPDWORD) PURE;
};
/*
* DirectXFile Object Class Id (for CoCreateInstance())
*/
DEFINE_GUID(CLSID_CDirectXFile, 0x4516ec43, 0x8f20, 0x11d0, 0x9b, 0x6d, 0x00, 0x00, 0xc0, 0x78, 0x1b, 0xc3);
/*
* DirectX File Interface GUIDs.
*/
DEFINE_GUID(IID_IDirectXFile, 0x3d82ab40, 0x62da, 0x11cf, 0xab, 0x39, 0x0, 0x20, 0xaf, 0x71, 0xe4, 0x33);
DEFINE_GUID(IID_IDirectXFileEnumObject, 0x3d82ab41, 0x62da, 0x11cf, 0xab, 0x39, 0x0, 0x20, 0xaf, 0x71, 0xe4, 0x33);
DEFINE_GUID(IID_IDirectXFileSaveObject, 0x3d82ab42, 0x62da, 0x11cf, 0xab, 0x39, 0x0, 0x20, 0xaf, 0x71, 0xe4, 0x33);
DEFINE_GUID(IID_IDirectXFileObject, 0x3d82ab43, 0x62da, 0x11cf, 0xab, 0x39, 0x0, 0x20, 0xaf, 0x71, 0xe4, 0x33);
DEFINE_GUID(IID_IDirectXFileData, 0x3d82ab44, 0x62da, 0x11cf, 0xab, 0x39, 0x0, 0x20, 0xaf, 0x71, 0xe4, 0x33);
DEFINE_GUID(IID_IDirectXFileDataReference, 0x3d82ab45, 0x62da, 0x11cf, 0xab, 0x39, 0x0, 0x20, 0xaf, 0x71, 0xe4, 0x33);
DEFINE_GUID(IID_IDirectXFileBinary, 0x3d82ab46, 0x62da, 0x11cf, 0xab, 0x39, 0x0, 0x20, 0xaf, 0x71, 0xe4, 0x33);
/*
* DirectX File Header template's GUID.
*/
DEFINE_GUID(TID_DXFILEHeader, 0x3d82ab43, 0x62da, 0x11cf, 0xab, 0x39, 0x0, 0x20, 0xaf, 0x71, 0xe4, 0x33);
/*
* DirectX File errors.
*/
#define _FACDD 0x876
#define MAKE_DDHRESULT( code ) MAKE_HRESULT( 1, _FACDD, code )
#define DXFILE_OK 0
#define DXFILEERR_BADOBJECT MAKE_DDHRESULT(850)
#define DXFILEERR_BADVALUE MAKE_DDHRESULT(851)
#define DXFILEERR_BADTYPE MAKE_DDHRESULT(852)
#define DXFILEERR_BADSTREAMHANDLE MAKE_DDHRESULT(853)
#define DXFILEERR_BADALLOC MAKE_DDHRESULT(854)
#define DXFILEERR_NOTFOUND MAKE_DDHRESULT(855)
#define DXFILEERR_NOTDONEYET MAKE_DDHRESULT(856)
#define DXFILEERR_FILENOTFOUND MAKE_DDHRESULT(857)
#define DXFILEERR_RESOURCENOTFOUND MAKE_DDHRESULT(858)
#define DXFILEERR_URLNOTFOUND MAKE_DDHRESULT(859)
#define DXFILEERR_BADRESOURCE MAKE_DDHRESULT(860)
#define DXFILEERR_BADFILETYPE MAKE_DDHRESULT(861)
#define DXFILEERR_BADFILEVERSION MAKE_DDHRESULT(862)
#define DXFILEERR_BADFILEFLOATSIZE MAKE_DDHRESULT(863)
#define DXFILEERR_BADFILECOMPRESSIONTYPE MAKE_DDHRESULT(864)
#define DXFILEERR_BADFILE MAKE_DDHRESULT(865)
#define DXFILEERR_PARSEERROR MAKE_DDHRESULT(866)
#define DXFILEERR_NOTEMPLATE MAKE_DDHRESULT(867)
#define DXFILEERR_BADARRAYSIZE MAKE_DDHRESULT(868)
#define DXFILEERR_BADDATAREFERENCE MAKE_DDHRESULT(869)
#define DXFILEERR_INTERNALERROR MAKE_DDHRESULT(870)
#define DXFILEERR_NOMOREOBJECTS MAKE_DDHRESULT(871)
#define DXFILEERR_BADINTRINSICS MAKE_DDHRESULT(872)
#define DXFILEERR_NOMORESTREAMHANDLES MAKE_DDHRESULT(873)
#define DXFILEERR_NOMOREDATA MAKE_DDHRESULT(874)
#define DXFILEERR_BADCACHEFILE MAKE_DDHRESULT(875)
#define DXFILEERR_NOINTERNET MAKE_DDHRESULT(876)
#ifdef __cplusplus
};
#endif
#endif /* _DXFILE_H_ */