forked from metin-server/m2dev-client-src
ported to DX9
This commit is contained in:
@@ -37,6 +37,7 @@ add_definitions(-DUSE_LOD)
|
||||
add_definitions(-DDUNGEON_WORK)
|
||||
add_definitions(-DBUILDING_GRANNY_STATIC)
|
||||
add_definitions(-DGRANNY_THREADED)
|
||||
add_definitions(-DPy_NO_ENABLE_SHARED)
|
||||
|
||||
add_compile_definitions("$<$<CONFIG:Debug>:DEBUG>")
|
||||
add_compile_definitions("$<$<CONFIG:RelWithDebInfo>:_DISTRIBUTE>")
|
||||
|
||||
1688
extern/include/d3d.h
vendored
1688
extern/include/d3d.h
vendored
File diff suppressed because it is too large
Load Diff
1279
extern/include/d3d8.h
vendored
1279
extern/include/d3d8.h
vendored
File diff suppressed because it is too large
Load Diff
2791
extern/include/d3d9.h
vendored
Normal file
2791
extern/include/d3d9.h
vendored
Normal file
File diff suppressed because it is too large
Load Diff
@@ -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_ */
|
||||
|
||||
1521
extern/include/d3d8types.h → extern/include/d3d9types.h
vendored
1521
extern/include/d3d8types.h → extern/include/d3d9types.h
vendored
File diff suppressed because it is too large
Load Diff
599
extern/include/d3dcaps.h
vendored
599
extern/include/d3dcaps.h
vendored
@@ -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_ */
|
||||
|
||||
2117
extern/include/d3dtypes.h
vendored
2117
extern/include/d3dtypes.h
vendored
File diff suppressed because it is too large
Load Diff
45
extern/include/d3dx8.h
vendored
45
extern/include/d3dx8.h
vendored
@@ -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__
|
||||
|
||||
563
extern/include/d3dx8core.h
vendored
563
extern/include/d3dx8core.h
vendored
@@ -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__
|
||||
226
extern/include/d3dx8effect.h
vendored
226
extern/include/d3dx8effect.h
vendored
@@ -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__
|
||||
760
extern/include/d3dx8mesh.h
vendored
760
extern/include/d3dx8mesh.h
vendored
@@ -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
78
extern/include/d3dx9.h
vendored
Normal 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
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
753
extern/include/d3dx9core.h
vendored
Normal 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
873
extern/include/d3dx9effect.h
vendored
Normal 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__
|
||||
|
||||
|
||||
@@ -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__
|
||||
@@ -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
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
1010
extern/include/d3dx9shader.h
vendored
Normal file
File diff suppressed because it is too large
Load Diff
@@ -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__
|
||||
|
||||
@@ -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
299
extern/include/d3dx9xof.h
vendored
Normal 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
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
755
extern/include/dinputd.h
vendored
Normal 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__ */
|
||||
239
extern/include/dxfile.h
vendored
239
extern/include/dxfile.h
vendored
@@ -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_ */
|
||||
14
extern/library/DirectX/CMakeLists.txt
vendored
14
extern/library/DirectX/CMakeLists.txt
vendored
@@ -1,11 +1,3 @@
|
||||
add_library(DirectX STATIC IMPORTED GLOBAL)
|
||||
|
||||
set_target_properties(DirectX PROPERTIES
|
||||
INTERFACE_INCLUDE_DIRECTORIES "${CMAKE_SOURCE_DIR}/extern/include"
|
||||
)
|
||||
|
||||
set_target_properties(DirectX PROPERTIES
|
||||
IMPORTED_LOCATION_DEBUG "${CMAKE_CURRENT_LIST_DIR}/d3d8_debug.lib"
|
||||
IMPORTED_LOCATION_RELEASE "${CMAKE_CURRENT_LIST_DIR}/d3d8.lib"
|
||||
IMPORTED_LOCATION_RELWITHDEBINFO "${CMAKE_CURRENT_LIST_DIR}/d3d8.lib"
|
||||
)
|
||||
add_library(DirectX INTERFACE)
|
||||
target_include_directories(DirectX INTERFACE "${CMAKE_SOURCE_DIR}/extern/include")
|
||||
target_link_libraries(DirectX INTERFACE "${CMAKE_CURRENT_LIST_DIR}/d3d9.lib" "${CMAKE_CURRENT_LIST_DIR}/d3dx9.lib" "${CMAKE_CURRENT_LIST_DIR}/dinput8.lib" "${CMAKE_CURRENT_LIST_DIR}/dxguid.lib")
|
||||
|
||||
3
extern/library/DirectX/d3d8.lib
vendored
3
extern/library/DirectX/d3d8.lib
vendored
@@ -1,3 +0,0 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:26132869fed2b5de881be1857622d9a3bc757b22afa27b86796bc13689ed0c9b
|
||||
size 11843118
|
||||
3
extern/library/DirectX/d3d8_debug.lib
vendored
3
extern/library/DirectX/d3d8_debug.lib
vendored
@@ -1,3 +0,0 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:fe7ebb4a07f74b4ac5dfc3444a95f172ccde2caa93a2299138c3d76e8cd2d698
|
||||
size 6864590
|
||||
3
extern/library/DirectX/d3d9.lib
vendored
Normal file
3
extern/library/DirectX/d3d9.lib
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:e0a752764fc9341ac89bd88bedee462beb7975b4ebcda8357aa730c8176ba19c
|
||||
size 5092
|
||||
3
extern/library/DirectX/d3dx9.lib
vendored
Normal file
3
extern/library/DirectX/d3dx9.lib
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:3ffdfb74ad1aa478bfdec55a18050c24b05867349bd2b427958f09b41acf6545
|
||||
size 81324
|
||||
3
extern/library/DirectX/dinput8.lib
vendored
Normal file
3
extern/library/DirectX/dinput8.lib
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:e440feea37db56603c0c520f6ddd66086f29f24f5e1a3b80709d8a4976153206
|
||||
size 286176
|
||||
3
extern/library/DirectX/dxguid.lib
vendored
Normal file
3
extern/library/DirectX/dxguid.lib
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:96677c579cfb86ec5b2fc2cf962f5de6112357961bc5ec330b4e223c0b4adca8
|
||||
size 977342
|
||||
14
extern/library/Python/CMakeLists.txt
vendored
14
extern/library/Python/CMakeLists.txt
vendored
@@ -1,11 +1,3 @@
|
||||
add_library(Python STATIC IMPORTED GLOBAL)
|
||||
|
||||
set(LIB_FILES
|
||||
"${CMAKE_CURRENT_LIST_DIR}/python27_static.lib"
|
||||
)
|
||||
|
||||
set_target_properties(Python PROPERTIES
|
||||
INTERFACE_INCLUDE_DIRECTORIES "${CMAKE_SOURCE_DIR}/extern/include"
|
||||
INTERFACE_LINK_LIBRARIES "${LIB_FILES}"
|
||||
INTERFACE_COMPILE_DEFINITIONS "Py_NO_ENABLE_SHARED=1"
|
||||
)
|
||||
add_library(Python INTERFACE)
|
||||
target_include_directories(Python INTERFACE "${CMAKE_SOURCE_DIR}/extern/include")
|
||||
target_link_libraries(Python INTERFACE "${CMAKE_CURRENT_LIST_DIR}/python27_static.lib")
|
||||
|
||||
@@ -95,8 +95,11 @@ void CEffectInstance::OnUpdate()
|
||||
|
||||
void CEffectInstance::OnRender()
|
||||
{
|
||||
STATEMANAGER.SaveTextureStageState(0, D3DTSS_MINFILTER, D3DTEXF_NONE);
|
||||
STATEMANAGER.SaveTextureStageState(0, D3DTSS_MAGFILTER, D3DTEXF_NONE);
|
||||
STATEMANAGER.SetFVF(D3DFVF_XYZ | D3DFVF_TEX1);
|
||||
|
||||
STATEMANAGER.SaveSamplerState(0, D3DSAMP_MINFILTER, D3DTEXF_NONE);
|
||||
STATEMANAGER.SaveSamplerState(0, D3DSAMP_MAGFILTER, D3DTEXF_NONE);
|
||||
|
||||
STATEMANAGER.SaveRenderState(D3DRS_ALPHABLENDENABLE, TRUE);
|
||||
STATEMANAGER.SaveRenderState(D3DRS_SRCBLEND, D3DBLEND_SRCALPHA);
|
||||
STATEMANAGER.SaveRenderState(D3DRS_DESTBLEND, D3DBLEND_INVSRCALPHA);
|
||||
@@ -111,13 +114,14 @@ void CEffectInstance::OnRender()
|
||||
STATEMANAGER.SetTextureStageState(0, D3DTSS_ALPHAARG1, D3DTA_TFACTOR);
|
||||
STATEMANAGER.SetTextureStageState(0, D3DTSS_ALPHAARG2, D3DTA_TEXTURE);
|
||||
STATEMANAGER.SetTextureStageState(0, D3DTSS_ALPHAOP, D3DTOP_MODULATE);
|
||||
STATEMANAGER.SetVertexShader(D3DFVF_XYZ|D3DFVF_TEX1);
|
||||
|
||||
std::for_each(m_ParticleInstanceVector.begin(),m_ParticleInstanceVector.end(),std::mem_fn(&CEffectElementBaseInstance::Render));
|
||||
std::for_each(m_MeshInstanceVector.begin(),m_MeshInstanceVector.end(),std::mem_fn(&CEffectElementBaseInstance::Render));
|
||||
|
||||
/////
|
||||
STATEMANAGER.RestoreTextureStageState(0, D3DTSS_MINFILTER);
|
||||
STATEMANAGER.RestoreTextureStageState(0, D3DTSS_MAGFILTER);
|
||||
STATEMANAGER.RestoreSamplerState(0, D3DSAMP_MINFILTER);
|
||||
STATEMANAGER.RestoreSamplerState(0, D3DSAMP_MAGFILTER);
|
||||
|
||||
STATEMANAGER.RestoreRenderState(D3DRS_ALPHABLENDENABLE);
|
||||
STATEMANAGER.RestoreRenderState(D3DRS_SRCBLEND);
|
||||
STATEMANAGER.RestoreRenderState(D3DRS_DESTBLEND);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#pragma once
|
||||
|
||||
#include <d3dx8.h>
|
||||
#include <d3dx9.h>
|
||||
|
||||
#include "../eterlib/GrpScreen.h"
|
||||
#include "../eterlib/Resource.h"
|
||||
|
||||
@@ -168,7 +168,7 @@ void CEffectMeshInstance::OnRender()
|
||||
|
||||
Color.a = fAlpha * rFrameData.fVisibility;
|
||||
STATEMANAGER.SetRenderState(D3DRS_TEXTUREFACTOR, DWORD(Color));
|
||||
STATEMANAGER.SetVertexShader(D3DFVF_XYZ | D3DFVF_TEX1);
|
||||
STATEMANAGER.SetFVF(D3DFVF_XYZ | D3DFVF_TEX1);
|
||||
STATEMANAGER.DrawPrimitiveUP(D3DPT_TRIANGLELIST,
|
||||
rFrameData.dwIndexCount/3,
|
||||
&rFrameData.PDTVertexVector[0],
|
||||
|
||||
@@ -145,7 +145,7 @@ float CLightData::GetDuration()
|
||||
{
|
||||
return m_fDuration;
|
||||
}
|
||||
void CLightData::InitializeLight(D3DLIGHT8& light)
|
||||
void CLightData::InitializeLight(D3DLIGHT9& light)
|
||||
{
|
||||
light.Type = D3DLIGHT_POINT;
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
#pragma once
|
||||
|
||||
#include <d3dx8.h>
|
||||
#include <d3dx9.h>
|
||||
|
||||
#include "../eterLib/TextFileLoader.h"
|
||||
#include "EterLib/TextFileLoader.h"
|
||||
|
||||
#include "Type.h"
|
||||
#include "EffectElementBase.h"
|
||||
@@ -24,7 +24,7 @@ class CLightData : public CEffectElementBase
|
||||
{
|
||||
return m_iLoopCount;
|
||||
}
|
||||
void InitializeLight(D3DLIGHT8& light);
|
||||
void InitializeLight(D3DLIGHT9& light);
|
||||
|
||||
protected:
|
||||
void OnClear();
|
||||
|
||||
@@ -29,7 +29,7 @@ void CLightInstance::OnSetDataPointer(CEffectElementBase * pElement)
|
||||
|
||||
m_iLoopCount = m_pData->GetLoopCount();
|
||||
|
||||
D3DLIGHT8 Light;
|
||||
D3DLIGHT9 Light;
|
||||
m_pData->InitializeLight(Light);
|
||||
CLightManager::Instance().RegisterLight(LIGHT_TYPE_DYNAMIC, &m_LightID, Light);
|
||||
}
|
||||
|
||||
@@ -139,7 +139,7 @@ bool CGrannyMaterial::IsEqual(granny_material* pgrnMaterial) const
|
||||
}
|
||||
|
||||
|
||||
LPDIRECT3DTEXTURE8 CGrannyMaterial::GetD3DTexture(int iStage) const
|
||||
LPDIRECT3DTEXTURE9 CGrannyMaterial::GetD3DTexture(int iStage) const
|
||||
{
|
||||
const CGraphicImage::TRef & ratImage = m_roImage[iStage];
|
||||
|
||||
@@ -333,8 +333,8 @@ void CGrannyMaterial::__ApplySpecularRenderState()
|
||||
|
||||
STATEMANAGER.SetTransform(D3DTS_TEXTURE1, &ms_matSpecular);
|
||||
STATEMANAGER.SaveTextureStageState(1, D3DTSS_TEXTURETRANSFORMFLAGS, D3DTTFF_COUNT2);
|
||||
STATEMANAGER.SaveTextureStageState(1, D3DTSS_ADDRESSU, D3DTADDRESS_WRAP);
|
||||
STATEMANAGER.SaveTextureStageState(1, D3DTSS_ADDRESSV, D3DTADDRESS_WRAP);
|
||||
STATEMANAGER.SaveSamplerState(1, D3DSAMP_ADDRESSU, D3DTADDRESS_WRAP);
|
||||
STATEMANAGER.SaveSamplerState(1, D3DSAMP_ADDRESSV, D3DTADDRESS_WRAP);
|
||||
}
|
||||
|
||||
void CGrannyMaterial::__RestoreSpecularRenderState()
|
||||
@@ -346,8 +346,8 @@ void CGrannyMaterial::__RestoreSpecularRenderState()
|
||||
}
|
||||
|
||||
STATEMANAGER.RestoreTextureStageState(1, D3DTSS_TEXTURETRANSFORMFLAGS);
|
||||
STATEMANAGER.RestoreTextureStageState(1, D3DTSS_ADDRESSU);
|
||||
STATEMANAGER.RestoreTextureStageState(1, D3DTSS_ADDRESSV);
|
||||
STATEMANAGER.RestoreSamplerState(1, D3DSAMP_ADDRESSU);
|
||||
STATEMANAGER.RestoreSamplerState(1, D3DSAMP_ADDRESSV);
|
||||
|
||||
STATEMANAGER.RestoreTextureStageState(1, D3DTSS_TEXCOORDINDEX);
|
||||
STATEMANAGER.SetTextureStageState(1, D3DTSS_COLOROP, D3DTOP_DISABLE);
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
#include <granny.h>
|
||||
#include <windows.h>
|
||||
#include <d3d8.h>
|
||||
#include <d3d9.h>
|
||||
|
||||
#include "../eterlib/ReferenceObject.h"
|
||||
#include "../eterlib/Ref.h"
|
||||
@@ -58,7 +58,7 @@ class CGrannyMaterial : public CReferenceObject
|
||||
const CGraphicTexture * GetDiffuseTexture() const;
|
||||
const CGraphicTexture * GetOpacityTexture() const;
|
||||
|
||||
LPDIRECT3DTEXTURE8 GetD3DTexture(int iStage) const;
|
||||
LPDIRECT3DTEXTURE9 GetD3DTexture(int iStage) const;
|
||||
|
||||
bool IsTwoSided() const { return m_bTwoSideRender; }
|
||||
|
||||
|
||||
@@ -72,12 +72,12 @@ granny_model* CGrannyModel::GetGrannyModelPointer()
|
||||
return m_pgrnModel;
|
||||
}
|
||||
|
||||
LPDIRECT3DINDEXBUFFER8 CGrannyModel::GetD3DIndexBuffer() const
|
||||
LPDIRECT3DINDEXBUFFER9 CGrannyModel::GetD3DIndexBuffer() const
|
||||
{
|
||||
return m_idxBuf.GetD3DIndexBuffer();
|
||||
}
|
||||
|
||||
LPDIRECT3DVERTEXBUFFER8 CGrannyModel::GetPNTD3DVertexBuffer() const
|
||||
LPDIRECT3DVERTEXBUFFER9 CGrannyModel::GetPNTD3DVertexBuffer() const
|
||||
{
|
||||
return m_pntVtxBuf.GetD3DVertexBuffer();
|
||||
}
|
||||
|
||||
@@ -38,8 +38,8 @@ class CGrannyModel : public CReferenceObject
|
||||
granny_model * GetGrannyModelPointer();
|
||||
const CGrannyMesh* GetMeshPointer(int iMesh) const;
|
||||
|
||||
LPDIRECT3DVERTEXBUFFER8 GetPNTD3DVertexBuffer() const;
|
||||
LPDIRECT3DINDEXBUFFER8 GetD3DIndexBuffer() const;
|
||||
LPDIRECT3DVERTEXBUFFER9 GetPNTD3DVertexBuffer() const;
|
||||
LPDIRECT3DINDEXBUFFER9 GetD3DIndexBuffer() const;
|
||||
|
||||
const CGrannyModel::TMeshNode* GetMeshNodeList(CGrannyMesh::EType eMeshType, CGrannyMaterial::EType eMtrlType) const;
|
||||
|
||||
|
||||
@@ -137,7 +137,7 @@ class CGrannyModelInstance : public CGraphicCollisionObject
|
||||
bool __IsDeformableVertexBuffer();
|
||||
void __SetSharedDeformableVertexBuffer(CGraphicVertexBuffer* pkSharedDeformableVertexBuffer);
|
||||
|
||||
IDirect3DVertexBuffer8* __GetDeformableD3DVertexBufferPtr();
|
||||
IDirect3DVertexBuffer9* __GetDeformableD3DVertexBufferPtr();
|
||||
CGraphicVertexBuffer& __GetDeformableVertexBufferRef();
|
||||
|
||||
granny_world_pose* __GetWorldPosePtr() const;
|
||||
|
||||
@@ -208,7 +208,7 @@ bool CGrannyModelInstance::__IsDeformableVertexBuffer()
|
||||
return m_kLocalDeformableVertexBuffer.IsEmpty();
|
||||
}
|
||||
|
||||
IDirect3DVertexBuffer8* CGrannyModelInstance::__GetDeformableD3DVertexBufferPtr()
|
||||
IDirect3DVertexBuffer9* CGrannyModelInstance::__GetDeformableD3DVertexBufferPtr()
|
||||
{
|
||||
return __GetDeformableVertexBufferRef().GetD3DVertexBuffer();
|
||||
}
|
||||
|
||||
@@ -58,13 +58,13 @@ void CGrannyModelInstance::RenderWithOneTexture()
|
||||
return;
|
||||
#endif
|
||||
|
||||
STATEMANAGER.SetVertexShader(ms_pntVS);
|
||||
STATEMANAGER.SetVertexDeclaration(ms_pntVS);
|
||||
|
||||
// WORK
|
||||
LPDIRECT3DVERTEXBUFFER8 lpd3dDeformPNTVtxBuf = __GetDeformableD3DVertexBufferPtr();
|
||||
LPDIRECT3DVERTEXBUFFER9 lpd3dDeformPNTVtxBuf = __GetDeformableD3DVertexBufferPtr();
|
||||
// END_OF_WORK
|
||||
|
||||
LPDIRECT3DVERTEXBUFFER8 lpd3dRigidPNTVtxBuf = m_pModel->GetPNTD3DVertexBuffer();
|
||||
LPDIRECT3DVERTEXBUFFER9 lpd3dRigidPNTVtxBuf = m_pModel->GetPNTD3DVertexBuffer();
|
||||
|
||||
if (lpd3dDeformPNTVtxBuf)
|
||||
{
|
||||
@@ -84,11 +84,11 @@ void CGrannyModelInstance::BlendRenderWithOneTexture()
|
||||
return;
|
||||
|
||||
// WORK
|
||||
LPDIRECT3DVERTEXBUFFER8 lpd3dDeformPNTVtxBuf = __GetDeformableD3DVertexBufferPtr();
|
||||
LPDIRECT3DVERTEXBUFFER9 lpd3dDeformPNTVtxBuf = __GetDeformableD3DVertexBufferPtr();
|
||||
// END_OF_WORK
|
||||
LPDIRECT3DVERTEXBUFFER8 lpd3dRigidPNTVtxBuf = m_pModel->GetPNTD3DVertexBuffer();
|
||||
LPDIRECT3DVERTEXBUFFER9 lpd3dRigidPNTVtxBuf = m_pModel->GetPNTD3DVertexBuffer();
|
||||
|
||||
STATEMANAGER.SetVertexShader(ms_pntVS);
|
||||
STATEMANAGER.SetVertexDeclaration(ms_pntVS);
|
||||
|
||||
if (lpd3dDeformPNTVtxBuf)
|
||||
{
|
||||
@@ -110,12 +110,12 @@ void CGrannyModelInstance::RenderWithTwoTexture()
|
||||
if (IsEmpty())
|
||||
return;
|
||||
|
||||
STATEMANAGER.SetVertexShader(ms_pntVS);
|
||||
STATEMANAGER.SetVertexDeclaration(ms_pntVS);
|
||||
|
||||
// WORK
|
||||
LPDIRECT3DVERTEXBUFFER8 lpd3dDeformPNTVtxBuf = __GetDeformableD3DVertexBufferPtr();
|
||||
LPDIRECT3DVERTEXBUFFER9 lpd3dDeformPNTVtxBuf = __GetDeformableD3DVertexBufferPtr();
|
||||
// END_OF_WORK
|
||||
LPDIRECT3DVERTEXBUFFER8 lpd3dRigidPNTVtxBuf = m_pModel->GetPNTD3DVertexBuffer();
|
||||
LPDIRECT3DVERTEXBUFFER9 lpd3dRigidPNTVtxBuf = m_pModel->GetPNTD3DVertexBuffer();
|
||||
|
||||
if (lpd3dDeformPNTVtxBuf)
|
||||
{
|
||||
@@ -135,11 +135,11 @@ void CGrannyModelInstance::BlendRenderWithTwoTexture()
|
||||
return;
|
||||
|
||||
// WORK
|
||||
LPDIRECT3DVERTEXBUFFER8 lpd3dDeformPNTVtxBuf = __GetDeformableD3DVertexBufferPtr();
|
||||
LPDIRECT3DVERTEXBUFFER9 lpd3dDeformPNTVtxBuf = __GetDeformableD3DVertexBufferPtr();
|
||||
// END_OF_WORK
|
||||
LPDIRECT3DVERTEXBUFFER8 lpd3dRigidPNTVtxBuf = m_pModel->GetPNTD3DVertexBuffer();
|
||||
LPDIRECT3DVERTEXBUFFER9 lpd3dRigidPNTVtxBuf = m_pModel->GetPNTD3DVertexBuffer();
|
||||
|
||||
STATEMANAGER.SetVertexShader(ms_pntVS);
|
||||
STATEMANAGER.SetVertexDeclaration(ms_pntVS);
|
||||
|
||||
if (lpd3dDeformPNTVtxBuf)
|
||||
{
|
||||
@@ -159,14 +159,14 @@ void CGrannyModelInstance::RenderWithoutTexture()
|
||||
if (IsEmpty())
|
||||
return;
|
||||
|
||||
STATEMANAGER.SetVertexShader(ms_pntVS);
|
||||
STATEMANAGER.SetVertexDeclaration(ms_pntVS);
|
||||
STATEMANAGER.SetTexture(0, NULL);
|
||||
STATEMANAGER.SetTexture(1, NULL);
|
||||
|
||||
// WORK
|
||||
LPDIRECT3DVERTEXBUFFER8 lpd3dDeformPNTVtxBuf = __GetDeformableD3DVertexBufferPtr();
|
||||
LPDIRECT3DVERTEXBUFFER9 lpd3dDeformPNTVtxBuf = __GetDeformableD3DVertexBufferPtr();
|
||||
// END_OF_WORK
|
||||
LPDIRECT3DVERTEXBUFFER8 lpd3dRigidPNTVtxBuf = m_pModel->GetPNTD3DVertexBuffer();
|
||||
LPDIRECT3DVERTEXBUFFER9 lpd3dRigidPNTVtxBuf = m_pModel->GetPNTD3DVertexBuffer();
|
||||
|
||||
if (lpd3dDeformPNTVtxBuf)
|
||||
{
|
||||
@@ -195,7 +195,7 @@ void CGrannyModelInstance::RenderMeshNodeListWithOneTexture(CGrannyMesh::EType e
|
||||
{
|
||||
assert(m_pModel != NULL);
|
||||
|
||||
LPDIRECT3DINDEXBUFFER8 lpd3dIdxBuf = m_pModel->GetD3DIndexBuffer();
|
||||
LPDIRECT3DINDEXBUFFER9 lpd3dIdxBuf = m_pModel->GetD3DIndexBuffer();
|
||||
assert(lpd3dIdxBuf != NULL);
|
||||
|
||||
const CGrannyModel::TMeshNode * pMeshNode = m_pModel->GetMeshNodeList(eMeshType, eMtrlType);
|
||||
@@ -233,7 +233,7 @@ void CGrannyModelInstance::RenderMeshNodeListWithTwoTexture(CGrannyMesh::EType e
|
||||
{
|
||||
assert(m_pModel != NULL);
|
||||
|
||||
LPDIRECT3DINDEXBUFFER8 lpd3dIdxBuf = m_pModel->GetD3DIndexBuffer();
|
||||
LPDIRECT3DINDEXBUFFER9 lpd3dIdxBuf = m_pModel->GetD3DIndexBuffer();
|
||||
assert(lpd3dIdxBuf != NULL);
|
||||
|
||||
const CGrannyModel::TMeshNode * pMeshNode = m_pModel->GetMeshNodeList(eMeshType, eMtrlType);
|
||||
@@ -270,7 +270,7 @@ void CGrannyModelInstance::RenderMeshNodeListWithoutTexture(CGrannyMesh::EType e
|
||||
{
|
||||
assert(m_pModel != NULL);
|
||||
|
||||
LPDIRECT3DINDEXBUFFER8 lpd3dIdxBuf = m_pModel->GetD3DIndexBuffer();
|
||||
LPDIRECT3DINDEXBUFFER9 lpd3dIdxBuf = m_pModel->GetD3DIndexBuffer();
|
||||
assert(lpd3dIdxBuf != NULL);
|
||||
|
||||
const CGrannyModel::TMeshNode * pMeshNode = m_pModel->GetMeshNodeList(eMeshType, eMtrlType);
|
||||
@@ -304,7 +304,7 @@ void CGrannyModelInstance::RenderMeshNodeList(CGrannyMesh::EType eMeshType, CGra
|
||||
{
|
||||
assert(m_pModel != NULL);
|
||||
|
||||
LPDIRECT3DINDEXBUFFER8 lpd3dIdxBuf = m_pModel->GetD3DIndexBuffer();
|
||||
LPDIRECT3DINDEXBUFFER9 lpd3dIdxBuf = m_pModel->GetD3DIndexBuffer();
|
||||
assert(lpd3dIdxBuf != NULL);
|
||||
|
||||
const CGrannyModel::TMeshNode * pMeshNode = m_pModel->GetMeshNodeList(eMeshType, eMtrlType);
|
||||
@@ -372,11 +372,11 @@ void CGrannyModelInstance::RenderToShadowMap()
|
||||
if (IsEmpty())
|
||||
return;
|
||||
|
||||
STATEMANAGER.SetVertexShader(ms_pntVS);
|
||||
STATEMANAGER.SetFVF(ms_pntVS);
|
||||
|
||||
// LPDIRECT3DVERTEXBUFFER8 lpd3dDynamicPNTVtxBuf = m_dynamicPNTVtxBuf.GetD3DVertexBuffer();
|
||||
LPDIRECT3DVERTEXBUFFER8 lpd3dDeformPNTVtxBuf = m_dynamicPNTVtxBuf.GetD3DVertexBuffer();
|
||||
LPDIRECT3DVERTEXBUFFER8 lpd3dRigidPNTVtxBuf = m_pModel->GetPNTD3DVertexBuffer();
|
||||
// LPDIRECT3DVERTEXBUFFER9 lpd3dDynamicPNTVtxBuf = m_dynamicPNTVtxBuf.GetD3DVertexBuffer();
|
||||
LPDIRECT3DVERTEXBUFFER9 lpd3dDeformPNTVtxBuf = m_dynamicPNTVtxBuf.GetD3DVertexBuffer();
|
||||
LPDIRECT3DVERTEXBUFFER9 lpd3dRigidPNTVtxBuf = m_pModel->GetPNTD3DVertexBuffer();
|
||||
|
||||
// STATEMANAGER.SaveRenderState(D3DRS_ALPHATESTENABLE, TRUE);
|
||||
// STATEMANAGER.SaveRenderState(D3DRS_ALPHAREF, 0);
|
||||
|
||||
@@ -93,7 +93,7 @@ void CBlockTexture::Render(int ix, int iy)
|
||||
|
||||
STATEMANAGER.SetTexture(0, m_lpd3dTexture);
|
||||
STATEMANAGER.SetTexture(1, NULL);
|
||||
STATEMANAGER.SetVertexShader(D3DFVF_XYZ|D3DFVF_TEX1|D3DFVF_DIFFUSE);
|
||||
STATEMANAGER.SetFVF(D3DFVF_XYZ|D3DFVF_TEX1|D3DFVF_DIFFUSE);
|
||||
STATEMANAGER.DrawIndexedPrimitive(D3DPT_TRIANGLELIST, 0, 4, 0, 2);
|
||||
}
|
||||
}
|
||||
@@ -155,7 +155,7 @@ void CBlockTexture::InvalidateRect(const RECT & c_rsrcRect)
|
||||
|
||||
bool CBlockTexture::Create(CGraphicDib * pDIB, const RECT & c_rRect, DWORD dwWidth, DWORD dwHeight)
|
||||
{
|
||||
if (FAILED(ms_lpd3dDevice->CreateTexture(dwWidth, dwHeight, 0, 0, D3DFMT_A8R8G8B8, D3DPOOL_MANAGED, &m_lpd3dTexture)))
|
||||
if (FAILED(ms_lpd3dDevice->CreateTexture(dwWidth, dwHeight, 0, 0, D3DFMT_A8R8G8B8, D3DPOOL_MANAGED, &m_lpd3dTexture, nullptr)))
|
||||
{
|
||||
Tracef("Failed to create block texture %u, %u\n", dwWidth, dwHeight);
|
||||
return false;
|
||||
|
||||
@@ -22,5 +22,5 @@ class CBlockTexture : public CGraphicBase
|
||||
BOOL m_bClipEnable;
|
||||
DWORD m_dwWidth;
|
||||
DWORD m_dwHeight;
|
||||
LPDIRECT3DTEXTURE8 m_lpd3dTexture;
|
||||
LPDIRECT3DTEXTURE9 m_lpd3dTexture;
|
||||
};
|
||||
|
||||
@@ -279,7 +279,7 @@ void CCamera::SetViewMatrix()
|
||||
|
||||
D3DXMatrixLookAtRH(&m_matView, &m_v3Eye, &m_v3Target, &m_v3Up);
|
||||
|
||||
float fDeterminantD3DMatView = D3DXMatrixfDeterminant(&m_matView);
|
||||
float fDeterminantD3DMatView = D3DXMatrixDeterminant(&m_matView);
|
||||
D3DXMatrixInverse(&m_matInverseView, &fDeterminantD3DMatView, &m_matView);
|
||||
|
||||
m_matBillboard = m_matInverseView;
|
||||
|
||||
@@ -227,7 +227,7 @@ void CDecal::Render()
|
||||
D3DXMatrixIdentity(&matWorld);
|
||||
STATEMANAGER.SetTransform(D3DTS_WORLD, &matWorld);
|
||||
|
||||
STATEMANAGER.SetVertexShader(D3DFVF_XYZ|D3DFVF_DIFFUSE|D3DFVF_TEX1);
|
||||
STATEMANAGER.SetFVF(D3DFVF_XYZ|D3DFVF_DIFFUSE|D3DFVF_TEX1);
|
||||
|
||||
for (DWORD dwi = 0; dwi < m_TriangleFanStructVector.size(); ++dwi)
|
||||
STATEMANAGER.DrawIndexedPrimitiveUP(D3DPT_TRIANGLEFAN,
|
||||
|
||||
@@ -19,19 +19,14 @@ void D3DXVECTOR3ToPixelPosition(const D3DXVECTOR3& c_rv3Src, D3DXVECTOR3* pv3Dst
|
||||
pv3Dst->z=+c_rv3Src.z;
|
||||
}
|
||||
|
||||
UINT CGraphicBase::ms_iD3DAdapterInfo=0;
|
||||
UINT CGraphicBase::ms_iD3DDevInfo=0;
|
||||
UINT CGraphicBase::ms_iD3DModeInfo=0;
|
||||
D3D_CDisplayModeAutoDetector CGraphicBase::ms_kD3DDetector;
|
||||
|
||||
HWND CGraphicBase::ms_hWnd;
|
||||
HDC CGraphicBase::ms_hDC;
|
||||
|
||||
LPDIRECT3D8 CGraphicBase::ms_lpd3d = NULL;
|
||||
LPDIRECT3DDEVICE8 CGraphicBase::ms_lpd3dDevice = NULL;
|
||||
LPDIRECT3D9 CGraphicBase::ms_lpd3d = NULL;
|
||||
LPDIRECT3DDEVICE9 CGraphicBase::ms_lpd3dDevice = NULL;
|
||||
ID3DXMatrixStack * CGraphicBase::ms_lpd3dMatStack = NULL;
|
||||
D3DPRESENT_PARAMETERS CGraphicBase::ms_d3dPresentParameter;
|
||||
D3DVIEWPORT8 CGraphicBase::ms_Viewport;
|
||||
D3DVIEWPORT9 CGraphicBase::ms_Viewport;
|
||||
|
||||
HRESULT CGraphicBase::ms_hLastResult = NULL;
|
||||
|
||||
@@ -40,13 +35,13 @@ int CGraphicBase::ms_iHeight;
|
||||
|
||||
DWORD CGraphicBase::ms_faceCount = 0;
|
||||
|
||||
D3DCAPS8 CGraphicBase::ms_d3dCaps;
|
||||
D3DCAPS9 CGraphicBase::ms_d3dCaps;
|
||||
|
||||
DWORD CGraphicBase::ms_dwD3DBehavior = 0;
|
||||
|
||||
DWORD CGraphicBase::ms_ptVS = 0;
|
||||
DWORD CGraphicBase::ms_pntVS = 0;
|
||||
DWORD CGraphicBase::ms_pnt2VS = 0;
|
||||
LPDIRECT3DVERTEXDECLARATION9 CGraphicBase::ms_ptVS = 0;
|
||||
LPDIRECT3DVERTEXDECLARATION9 CGraphicBase::ms_pntVS = 0;
|
||||
LPDIRECT3DVERTEXDECLARATION9 CGraphicBase::ms_pnt2VS = 0;
|
||||
|
||||
D3DXMATRIX CGraphicBase::ms_matIdentity;
|
||||
|
||||
@@ -96,9 +91,9 @@ std::vector<TIndex> CGraphicBase::ms_fillCubeIdxVector;
|
||||
LPD3DXMESH CGraphicBase::ms_lpSphereMesh = NULL;
|
||||
LPD3DXMESH CGraphicBase::ms_lpCylinderMesh = NULL;
|
||||
|
||||
LPDIRECT3DVERTEXBUFFER8 CGraphicBase::ms_alpd3dPDTVB[PDT_VERTEXBUFFER_NUM];
|
||||
LPDIRECT3DVERTEXBUFFER9 CGraphicBase::ms_alpd3dPDTVB[PDT_VERTEXBUFFER_NUM];
|
||||
|
||||
LPDIRECT3DINDEXBUFFER8 CGraphicBase::ms_alpd3dDefIB[DEFAULT_IB_NUM];
|
||||
LPDIRECT3DINDEXBUFFER9 CGraphicBase::ms_alpd3dDefIB[DEFAULT_IB_NUM];
|
||||
|
||||
bool CGraphicBase::IsLowTextureMemory()
|
||||
{
|
||||
@@ -158,7 +153,7 @@ bool CGraphicBase::SetPDTStream(SPDTVertexRaw* pSrcVertices, UINT uVtxCount)
|
||||
if (s_dwVBPos>=PDT_VERTEXBUFFER_NUM)
|
||||
s_dwVBPos=0;
|
||||
|
||||
IDirect3DVertexBuffer8* plpd3dFillRectVB=ms_alpd3dPDTVB[s_dwVBPos];
|
||||
IDirect3DVertexBuffer9* plpd3dFillRectVB=ms_alpd3dPDTVB[s_dwVBPos];
|
||||
++s_dwVBPos;
|
||||
|
||||
assert(PDT_VERTEX_NUM>=uVtxCount);
|
||||
@@ -167,7 +162,7 @@ bool CGraphicBase::SetPDTStream(SPDTVertexRaw* pSrcVertices, UINT uVtxCount)
|
||||
|
||||
TPDTVertex* pDstVertices;
|
||||
if (FAILED(
|
||||
plpd3dFillRectVB->Lock(0, sizeof(TPDTVertex)*uVtxCount, (BYTE**)&pDstVertices, D3DLOCK_DISCARD)
|
||||
plpd3dFillRectVB->Lock(0, sizeof(TPDTVertex)*uVtxCount, (void**)&pDstVertices, D3DLOCK_DISCARD)
|
||||
))
|
||||
{
|
||||
STATEMANAGER.SetStreamSource(0, NULL, 0);
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
#pragma once
|
||||
|
||||
#include "GrpDetector.h"
|
||||
#include "Ray.h"
|
||||
#include <vector>
|
||||
|
||||
@@ -238,28 +237,23 @@ class CGraphicBase
|
||||
static HRESULT ms_hLastResult;
|
||||
|
||||
static int ms_iWidth;
|
||||
static int ms_iHeight;
|
||||
|
||||
static UINT ms_iD3DAdapterInfo;
|
||||
static UINT ms_iD3DDevInfo;
|
||||
static UINT ms_iD3DModeInfo;
|
||||
static D3D_CDisplayModeAutoDetector ms_kD3DDetector;
|
||||
static int ms_iHeight;
|
||||
|
||||
static HWND ms_hWnd;
|
||||
static HDC ms_hDC;
|
||||
static LPDIRECT3D8 ms_lpd3d;
|
||||
static LPDIRECT3DDEVICE8 ms_lpd3dDevice;
|
||||
static LPDIRECT3D9 ms_lpd3d;
|
||||
static LPDIRECT3DDEVICE9 ms_lpd3dDevice;
|
||||
static ID3DXMatrixStack* ms_lpd3dMatStack;
|
||||
static D3DVIEWPORT8 ms_Viewport;
|
||||
static D3DVIEWPORT9 ms_Viewport;
|
||||
|
||||
static DWORD ms_faceCount;
|
||||
static D3DCAPS8 ms_d3dCaps;
|
||||
static D3DCAPS9 ms_d3dCaps;
|
||||
static D3DPRESENT_PARAMETERS ms_d3dPresentParameter;
|
||||
|
||||
static DWORD ms_dwD3DBehavior;
|
||||
static DWORD ms_ptVS;
|
||||
static DWORD ms_pntVS;
|
||||
static DWORD ms_pnt2VS;
|
||||
static LPDIRECT3DVERTEXDECLARATION9 ms_ptVS;
|
||||
static LPDIRECT3DVERTEXDECLARATION9 ms_pntVS;
|
||||
static LPDIRECT3DVERTEXDECLARATION9 ms_pnt2VS;
|
||||
|
||||
static D3DXMATRIX ms_matScreen0;
|
||||
static D3DXMATRIX ms_matScreen1;
|
||||
@@ -307,6 +301,6 @@ class CGraphicBase
|
||||
};
|
||||
|
||||
|
||||
static LPDIRECT3DVERTEXBUFFER8 ms_alpd3dPDTVB[PDT_VERTEXBUFFER_NUM];
|
||||
static LPDIRECT3DINDEXBUFFER8 ms_alpd3dDefIB[DEFAULT_IB_NUM];
|
||||
static LPDIRECT3DVERTEXBUFFER9 ms_alpd3dPDTVB[PDT_VERTEXBUFFER_NUM];
|
||||
static LPDIRECT3DINDEXBUFFER9 ms_alpd3dDefIB[DEFAULT_IB_NUM];
|
||||
};
|
||||
|
||||
@@ -1,647 +0,0 @@
|
||||
#include "StdAfx.h"
|
||||
#include "../eterBase/Stl.h"
|
||||
#include "GrpDetector.h"
|
||||
|
||||
struct FIsEqualD3DDisplayMode
|
||||
{
|
||||
FIsEqualD3DDisplayMode(D3DDISPLAYMODE* pkD3DDMChk)
|
||||
{
|
||||
m_pkD3DDMChk=pkD3DDMChk;
|
||||
}
|
||||
BOOL operator() (D3DDISPLAYMODE& rkD3DDMTest)
|
||||
{
|
||||
if (rkD3DDMTest.Width!=m_pkD3DDMChk->Width)
|
||||
return FALSE;
|
||||
|
||||
if (rkD3DDMTest.Height!=m_pkD3DDMChk->Height)
|
||||
return FALSE;
|
||||
|
||||
if (rkD3DDMTest.Format!=m_pkD3DDMChk->Format)
|
||||
return FALSE;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
D3DDISPLAYMODE* m_pkD3DDMChk;
|
||||
};
|
||||
|
||||
static int CompareD3DDisplayModeOrder( const VOID* arg1, const VOID* arg2 )
|
||||
{
|
||||
D3DDISPLAYMODE* p1 = (D3DDISPLAYMODE*)arg1;
|
||||
D3DDISPLAYMODE* p2 = (D3DDISPLAYMODE*)arg2;
|
||||
|
||||
if( p1->Format > p2->Format ) return -1;
|
||||
if( p1->Format < p2->Format ) return +1;
|
||||
if( p1->Width < p2->Width ) return -1;
|
||||
if( p1->Width > p2->Width ) return +1;
|
||||
if( p1->Height < p2->Height ) return -1;
|
||||
if( p1->Height > p2->Height ) return +1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
UINT D3D_CAdapterDisplayModeList::GetDisplayModeNum()
|
||||
{
|
||||
return m_uD3DDMNum;
|
||||
}
|
||||
|
||||
UINT D3D_CAdapterDisplayModeList::GetPixelFormatNum()
|
||||
{
|
||||
return m_uD3DFmtNum;
|
||||
}
|
||||
|
||||
|
||||
const D3DDISPLAYMODE& D3D_CAdapterDisplayModeList::GetDisplayModer(UINT iD3DDM)
|
||||
{
|
||||
assert(iD3DDM<m_uD3DDMNum);
|
||||
return m_akD3DDM[iD3DDM];
|
||||
}
|
||||
|
||||
const D3DFORMAT& D3D_CAdapterDisplayModeList::GetPixelFormatr(UINT iD3DFmt)
|
||||
{
|
||||
assert(iD3DFmt<m_uD3DFmtNum);
|
||||
return m_aeD3DFmt[iD3DFmt];
|
||||
}
|
||||
|
||||
VOID D3D_CAdapterDisplayModeList::Build(IDirect3D8& rkD3D, D3DFORMAT eD3DFmtDefault, UINT iD3DAdapterInfo)
|
||||
{
|
||||
D3DDISPLAYMODE* akD3DDM=m_akD3DDM;
|
||||
D3DFORMAT* aeD3DFmt=m_aeD3DFmt;
|
||||
|
||||
UINT uD3DDMNum=0;
|
||||
UINT uD3DFmtNum=0;
|
||||
|
||||
aeD3DFmt[uD3DFmtNum++]=eD3DFmtDefault;
|
||||
|
||||
UINT uAdapterModeNum=rkD3D.GetAdapterModeCount(iD3DAdapterInfo);
|
||||
for (UINT iD3DAdapterInfoMode=0; iD3DAdapterInfoMode<uAdapterModeNum; iD3DAdapterInfoMode++)
|
||||
{
|
||||
D3DDISPLAYMODE kD3DDMCur;
|
||||
rkD3D.EnumAdapterModes(iD3DAdapterInfo, iD3DAdapterInfoMode, &kD3DDMCur);
|
||||
|
||||
// IsFilterOutLowResolutionMode
|
||||
if( kD3DDMCur.Width < FILTEROUT_LOWRESOLUTION_WIDTH || kD3DDMCur.Height < FILTEROUT_LOWRESOLUTION_HEIGHT )
|
||||
continue;
|
||||
|
||||
// FindDisplayMode
|
||||
D3DDISPLAYMODE* pkD3DDMEnd=akD3DDM+uD3DDMNum;
|
||||
D3DDISPLAYMODE* pkD3DDMFind=std::find_if(akD3DDM, pkD3DDMEnd, FIsEqualD3DDisplayMode(&kD3DDMCur));
|
||||
|
||||
// IsNewDisplayMode
|
||||
if (pkD3DDMFind==pkD3DDMEnd && uD3DDMNum<D3DDISPLAYMODE_MAX)
|
||||
{
|
||||
D3DDISPLAYMODE& rkD3DDMNew=akD3DDM[uD3DDMNum++];
|
||||
rkD3DDMNew.Width=kD3DDMCur.Width;
|
||||
rkD3DDMNew.Height=kD3DDMCur.Height;
|
||||
rkD3DDMNew.Format=kD3DDMCur.Format;
|
||||
|
||||
// FindFormat
|
||||
D3DFORMAT* peD3DFmtEnd=aeD3DFmt+uD3DFmtNum;
|
||||
D3DFORMAT* peD3DFmtFind=std::find(aeD3DFmt, peD3DFmtEnd, kD3DDMCur.Format);
|
||||
|
||||
// IsNewFormat
|
||||
if (peD3DFmtFind==peD3DFmtEnd && uD3DFmtNum<D3DFORMAT_MAX)
|
||||
{
|
||||
aeD3DFmt[uD3DFmtNum++]=kD3DDMCur.Format;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
qsort(akD3DDM, uD3DDMNum, sizeof(D3DDISPLAYMODE), CompareD3DDisplayModeOrder);
|
||||
|
||||
m_uD3DFmtNum=uD3DFmtNum;
|
||||
m_uD3DDMNum=uD3DDMNum;
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
VOID D3D_SModeInfo::GetString(std::string* pstEnumList)
|
||||
{
|
||||
UINT uScrDepthBits=16;
|
||||
switch (m_eD3DFmtPixel)
|
||||
{
|
||||
case D3DFMT_X8R8G8B8:
|
||||
case D3DFMT_A8R8G8B8:
|
||||
case D3DFMT_R8G8B8:
|
||||
uScrDepthBits=32;
|
||||
break;
|
||||
}
|
||||
|
||||
int iVP=0;
|
||||
|
||||
switch (m_dwD3DBehavior)
|
||||
{
|
||||
case D3DCREATE_HARDWARE_VERTEXPROCESSING:
|
||||
iVP=1;
|
||||
break;
|
||||
case D3DCREATE_MIXED_VERTEXPROCESSING:
|
||||
iVP=2;
|
||||
break;
|
||||
case D3DCREATE_SOFTWARE_VERTEXPROCESSING:
|
||||
iVP=3;
|
||||
break;
|
||||
}
|
||||
|
||||
static const char* szVP[4]=
|
||||
{
|
||||
"UNKNOWN",
|
||||
"HWVP",
|
||||
"MXVP",
|
||||
"SWVP",
|
||||
};
|
||||
|
||||
char szText[1024+1];
|
||||
_snprintf(szText, sizeof(szText), "%dx%dx%d %s\r\n", m_uScrWidth, m_uScrHeight, uScrDepthBits, szVP[iVP]);
|
||||
pstEnumList->append(szText);
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
const CHAR* D3D_CDeviceInfo::msc_aszD3DDevDesc[D3DDEVICETYPE_NUM] = {"HAL", "REF"};
|
||||
const D3DDEVTYPE D3D_CDeviceInfo::msc_aeD3DDevType[D3DDEVICETYPE_NUM]={D3DDEVTYPE_HAL, D3DDEVTYPE_REF};
|
||||
|
||||
|
||||
UINT D3D_CDeviceInfo::GetD3DModeInfoNum()
|
||||
{
|
||||
return m_uD3DModeInfoNum;
|
||||
}
|
||||
|
||||
D3D_SModeInfo* D3D_CDeviceInfo::GetD3DModeInfop(UINT iD3D_SModeInfo)
|
||||
{
|
||||
if (iD3D_SModeInfo >= m_uD3DModeInfoNum)
|
||||
return NULL;
|
||||
|
||||
return &m_akD3DModeInfo[iD3D_SModeInfo];
|
||||
}
|
||||
|
||||
BOOL D3D_CDeviceInfo::FindDepthStencilFormat(IDirect3D8& rkD3D, UINT iD3DAdapterInfo, D3DDEVTYPE DeviceType, D3DFORMAT TargetFormat, D3DFORMAT* pDepthStencilFormat )
|
||||
{
|
||||
UINT m_dwMinDepthBits = 16;
|
||||
UINT m_dwMinStencilBits = 0;
|
||||
|
||||
if( m_dwMinDepthBits <= 16 && m_dwMinStencilBits == 0 )
|
||||
{
|
||||
if( SUCCEEDED( rkD3D.CheckDeviceFormat( iD3DAdapterInfo, DeviceType,
|
||||
TargetFormat, D3DUSAGE_DEPTHSTENCIL, D3DRTYPE_SURFACE, D3DFMT_D16 ) ) )
|
||||
{
|
||||
if( SUCCEEDED( rkD3D.CheckDepthStencilMatch( iD3DAdapterInfo, DeviceType,
|
||||
TargetFormat, TargetFormat, D3DFMT_D16 ) ) )
|
||||
{
|
||||
*pDepthStencilFormat = D3DFMT_D16;
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if( m_dwMinDepthBits <= 15 && m_dwMinStencilBits <= 1 )
|
||||
{
|
||||
if( SUCCEEDED( rkD3D.CheckDeviceFormat( iD3DAdapterInfo, DeviceType,
|
||||
TargetFormat, D3DUSAGE_DEPTHSTENCIL, D3DRTYPE_SURFACE, D3DFMT_D15S1 ) ) )
|
||||
{
|
||||
if( SUCCEEDED( rkD3D.CheckDepthStencilMatch( iD3DAdapterInfo, DeviceType,
|
||||
TargetFormat, TargetFormat, D3DFMT_D15S1 ) ) )
|
||||
{
|
||||
*pDepthStencilFormat = D3DFMT_D15S1;
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if( m_dwMinDepthBits <= 24 && m_dwMinStencilBits == 0 )
|
||||
{
|
||||
if( SUCCEEDED( rkD3D.CheckDeviceFormat( iD3DAdapterInfo, DeviceType,
|
||||
TargetFormat, D3DUSAGE_DEPTHSTENCIL, D3DRTYPE_SURFACE, D3DFMT_D24X8 ) ) )
|
||||
{
|
||||
if( SUCCEEDED( rkD3D.CheckDepthStencilMatch( iD3DAdapterInfo, DeviceType,
|
||||
TargetFormat, TargetFormat, D3DFMT_D24X8 ) ) )
|
||||
{
|
||||
*pDepthStencilFormat = D3DFMT_D24X8;
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if( m_dwMinDepthBits <= 24 && m_dwMinStencilBits <= 8 )
|
||||
{
|
||||
if( SUCCEEDED( rkD3D.CheckDeviceFormat( iD3DAdapterInfo, DeviceType,
|
||||
TargetFormat, D3DUSAGE_DEPTHSTENCIL, D3DRTYPE_SURFACE, D3DFMT_D24S8 ) ) )
|
||||
{
|
||||
if( SUCCEEDED( rkD3D.CheckDepthStencilMatch( iD3DAdapterInfo, DeviceType,
|
||||
TargetFormat, TargetFormat, D3DFMT_D24S8 ) ) )
|
||||
{
|
||||
*pDepthStencilFormat = D3DFMT_D24S8;
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if( m_dwMinDepthBits <= 24 && m_dwMinStencilBits <= 4 )
|
||||
{
|
||||
if( SUCCEEDED( rkD3D.CheckDeviceFormat( iD3DAdapterInfo, DeviceType,
|
||||
TargetFormat, D3DUSAGE_DEPTHSTENCIL, D3DRTYPE_SURFACE, D3DFMT_D24X4S4 ) ) )
|
||||
{
|
||||
if( SUCCEEDED( rkD3D.CheckDepthStencilMatch( iD3DAdapterInfo, DeviceType,
|
||||
TargetFormat, TargetFormat, D3DFMT_D24X4S4 ) ) )
|
||||
{
|
||||
*pDepthStencilFormat = D3DFMT_D24X4S4;
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if( m_dwMinDepthBits <= 32 && m_dwMinStencilBits == 0 )
|
||||
{
|
||||
if( SUCCEEDED( rkD3D.CheckDeviceFormat( iD3DAdapterInfo, DeviceType,
|
||||
TargetFormat, D3DUSAGE_DEPTHSTENCIL, D3DRTYPE_SURFACE, D3DFMT_D32 ) ) )
|
||||
{
|
||||
if( SUCCEEDED( rkD3D.CheckDepthStencilMatch( iD3DAdapterInfo, DeviceType,
|
||||
TargetFormat, TargetFormat, D3DFMT_D32 ) ) )
|
||||
{
|
||||
*pDepthStencilFormat = D3DFMT_D32;
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
BOOL D3D_CDeviceInfo::Build(IDirect3D8& rkD3D, UINT iD3DAdapterInfo, UINT iDevType, D3D_CAdapterDisplayModeList& rkD3DADMList, BOOL (*pfnConfirmDevice)(D3DCAPS8& rkD3DCaps, UINT uBehavior, D3DFORMAT eD3DFmt))
|
||||
{
|
||||
assert(pfnConfirmDevice!=NULL && "D3D_CDeviceInfo::Build");
|
||||
|
||||
const D3DDEVTYPE c_eD3DDevType=msc_aeD3DDevType[iDevType];
|
||||
const TCHAR* c_szD3DDevDesc=msc_aszD3DDevDesc[iDevType];
|
||||
|
||||
m_eD3DDevType = c_eD3DDevType;
|
||||
rkD3D.GetDeviceCaps(iD3DAdapterInfo, c_eD3DDevType, &m_kD3DCaps);
|
||||
|
||||
m_szDevDesc = c_szD3DDevDesc;
|
||||
m_uD3DModeInfoNum=0;
|
||||
m_canDoWindowed = FALSE;
|
||||
m_isWindowed = FALSE;
|
||||
m_eD3DMSTFullscreen = D3DMULTISAMPLE_NONE;
|
||||
m_eD3DMSTWindowed = D3DMULTISAMPLE_NONE;
|
||||
|
||||
BOOL aisFormatConfirmed[20];
|
||||
DWORD adwD3DBehavior[20];
|
||||
D3DFORMAT aeD3DFmtDepthStencil[20];
|
||||
|
||||
BOOL isHALExists = FALSE;
|
||||
BOOL isHALWindowedCompatible = FALSE;
|
||||
BOOL isHALDesktopCompatible = FALSE;
|
||||
BOOL isHALSampleCompatible = FALSE;
|
||||
|
||||
// GetFlagInfo
|
||||
{
|
||||
UINT uD3DFmtNum=rkD3DADMList.GetPixelFormatNum();
|
||||
|
||||
for (DWORD iFmt=0; iFmt<uD3DFmtNum; ++iFmt)
|
||||
{
|
||||
D3DFORMAT eD3DFmtPixel=rkD3DADMList.GetPixelFormatr(iFmt);
|
||||
DWORD dwD3DBehavior=0;
|
||||
BOOL isFormatConfirmed=FALSE;
|
||||
|
||||
aeD3DFmtDepthStencil[iFmt] = D3DFMT_UNKNOWN;
|
||||
|
||||
// SkipNoRenderTargetFormat;
|
||||
if (FAILED(rkD3D.CheckDeviceType(iD3DAdapterInfo, m_eD3DDevType, eD3DFmtPixel, eD3DFmtPixel, FALSE)))
|
||||
continue;
|
||||
|
||||
if (D3DDEVTYPE_HAL==m_eD3DDevType)
|
||||
{
|
||||
isHALExists=TRUE;
|
||||
|
||||
if (m_kD3DCaps.Caps2 & D3DCAPS2_CANRENDERWINDOWED)
|
||||
{
|
||||
isHALWindowedCompatible=TRUE;
|
||||
|
||||
if (iFmt==0)
|
||||
isHALDesktopCompatible=TRUE;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
// Confirm the device/format for HW vertex processing
|
||||
if (m_kD3DCaps.DevCaps & D3DDEVCAPS_HWTRANSFORMANDLIGHT)
|
||||
{
|
||||
if (m_kD3DCaps.DevCaps & D3DDEVCAPS_PUREDEVICE)
|
||||
{
|
||||
dwD3DBehavior=D3DCREATE_HARDWARE_VERTEXPROCESSING|D3DCREATE_PUREDEVICE;
|
||||
|
||||
if (pfnConfirmDevice(m_kD3DCaps, dwD3DBehavior, eD3DFmtPixel))
|
||||
isFormatConfirmed = TRUE;
|
||||
}
|
||||
|
||||
if (FALSE == isFormatConfirmed)
|
||||
{
|
||||
dwD3DBehavior = D3DCREATE_HARDWARE_VERTEXPROCESSING;
|
||||
|
||||
if (pfnConfirmDevice(m_kD3DCaps, dwD3DBehavior, eD3DFmtPixel))
|
||||
isFormatConfirmed = TRUE;
|
||||
}
|
||||
|
||||
if (FALSE == isFormatConfirmed)
|
||||
{
|
||||
dwD3DBehavior = D3DCREATE_MIXED_VERTEXPROCESSING;
|
||||
|
||||
if (pfnConfirmDevice(m_kD3DCaps, dwD3DBehavior, eD3DFmtPixel))
|
||||
isFormatConfirmed = TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
// Confirm the device/format for SW vertex processing
|
||||
if (FALSE == isFormatConfirmed)
|
||||
{
|
||||
dwD3DBehavior = D3DCREATE_SOFTWARE_VERTEXPROCESSING;
|
||||
|
||||
if (pfnConfirmDevice(m_kD3DCaps, dwD3DBehavior, eD3DFmtPixel))
|
||||
isFormatConfirmed = TRUE;
|
||||
}
|
||||
|
||||
if (isFormatConfirmed)
|
||||
{
|
||||
if (!FindDepthStencilFormat(rkD3D, iD3DAdapterInfo, c_eD3DDevType, eD3DFmtPixel, &aeD3DFmtDepthStencil[iFmt]))
|
||||
isFormatConfirmed = TRUE;
|
||||
|
||||
}
|
||||
|
||||
adwD3DBehavior[iFmt]=dwD3DBehavior;
|
||||
aisFormatConfirmed[iFmt]=isFormatConfirmed;
|
||||
}
|
||||
}
|
||||
|
||||
// BuildModeInfoList
|
||||
{
|
||||
UINT uD3DDMNum=rkD3DADMList.GetDisplayModeNum();
|
||||
UINT uD3DFmtNum=rkD3DADMList.GetPixelFormatNum();
|
||||
|
||||
|
||||
for (UINT iD3DDM=0; iD3DDM<uD3DDMNum; ++iD3DDM)
|
||||
{
|
||||
const D3DDISPLAYMODE& c_rkD3DDM=rkD3DADMList.GetDisplayModer(iD3DDM);
|
||||
for (DWORD iFmt=0; iFmt<uD3DFmtNum; ++iFmt)
|
||||
{
|
||||
if (rkD3DADMList.GetPixelFormatr(iFmt)==c_rkD3DDM.Format)
|
||||
{
|
||||
if (aisFormatConfirmed[iFmt] == TRUE )
|
||||
{
|
||||
D3D_SModeInfo& rkModeInfo=m_akD3DModeInfo[m_uD3DModeInfoNum++];
|
||||
rkModeInfo.m_uScrWidth=c_rkD3DDM.Width;
|
||||
rkModeInfo.m_uScrHeight=c_rkD3DDM.Height;
|
||||
rkModeInfo.m_eD3DFmtPixel=c_rkD3DDM.Format;
|
||||
rkModeInfo.m_dwD3DBehavior=adwD3DBehavior[iFmt];
|
||||
rkModeInfo.m_eD3DFmtDepthStencil=aeD3DFmtDepthStencil[iFmt];
|
||||
|
||||
if( m_eD3DDevType == D3DDEVTYPE_HAL )
|
||||
isHALSampleCompatible = TRUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Check if the device is compatible with the desktop display mode
|
||||
// (which was added initially as formats[0])
|
||||
if (aisFormatConfirmed[0] && (m_kD3DCaps.Caps2 & D3DCAPS2_CANRENDERWINDOWED) )
|
||||
{
|
||||
m_canDoWindowed=TRUE;
|
||||
m_isWindowed=TRUE;
|
||||
}
|
||||
|
||||
if (m_uD3DModeInfoNum>0)
|
||||
return TRUE;
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
BOOL D3D_CDeviceInfo::Find(UINT uScrWidth, UINT uScrHeight, UINT uScrDepthBits, BOOL isWindowed, UINT* piD3DModeInfo)
|
||||
{
|
||||
if (isWindowed)
|
||||
if (!m_isWindowed)
|
||||
return FALSE;
|
||||
|
||||
for (UINT iD3D_SModeInfo=0; iD3D_SModeInfo<m_uD3DModeInfoNum; ++iD3D_SModeInfo)
|
||||
{
|
||||
D3D_SModeInfo& rkModeInfo=m_akD3DModeInfo[iD3D_SModeInfo];
|
||||
if (rkModeInfo.m_uScrWidth==uScrWidth && rkModeInfo.m_uScrHeight==uScrHeight)
|
||||
{
|
||||
if (uScrDepthBits==16)
|
||||
{
|
||||
switch (rkModeInfo.m_eD3DFmtPixel)
|
||||
{
|
||||
case D3DFMT_R5G6B5:
|
||||
case D3DFMT_X1R5G5B5:
|
||||
case D3DFMT_A1R5G5B5:
|
||||
*piD3DModeInfo=iD3D_SModeInfo;
|
||||
return TRUE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
switch (rkModeInfo.m_eD3DFmtPixel)
|
||||
{
|
||||
case D3DFMT_X8R8G8B8:
|
||||
case D3DFMT_A8R8G8B8:
|
||||
case D3DFMT_R8G8B8:
|
||||
*piD3DModeInfo=iD3D_SModeInfo;
|
||||
return TRUE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
VOID D3D_CDeviceInfo::GetString(std::string* pstEnumList)
|
||||
{
|
||||
char szText[1024+1];
|
||||
_snprintf(szText, sizeof(szText), "%s\r\n========================================\r\n", m_szDevDesc);
|
||||
pstEnumList->append(szText);
|
||||
|
||||
for (UINT iD3D_SModeInfo=0; iD3D_SModeInfo<m_uD3DModeInfoNum; ++iD3D_SModeInfo)
|
||||
{
|
||||
_snprintf(szText, sizeof(szText), "%d. ", iD3D_SModeInfo);
|
||||
pstEnumList->append(szText);
|
||||
|
||||
D3D_SModeInfo& rkModeInfo=m_akD3DModeInfo[iD3D_SModeInfo];
|
||||
rkModeInfo.GetString(pstEnumList);
|
||||
}
|
||||
|
||||
pstEnumList->append("\r\n");
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
D3DDISPLAYMODE& D3D_CAdapterInfo::GetDesktopD3DDisplayModer()
|
||||
{
|
||||
return m_kD3DDMDesktop;
|
||||
}
|
||||
|
||||
D3DDISPLAYMODE* D3D_CAdapterInfo::GetDesktopD3DDisplayModep()
|
||||
{
|
||||
return &m_kD3DDMDesktop;
|
||||
}
|
||||
|
||||
D3D_CDeviceInfo* D3D_CAdapterInfo::GetD3DDeviceInfop(UINT iD3DDevInfo)
|
||||
{
|
||||
if (iD3DDevInfo >= m_uD3DDevInfoNum)
|
||||
return NULL;
|
||||
|
||||
return &m_akD3DDevInfo[iD3DDevInfo];
|
||||
}
|
||||
|
||||
D3D_SModeInfo* D3D_CAdapterInfo::GetD3DModeInfop(UINT iD3DDevInfo, UINT iD3D_SModeInfo)
|
||||
{
|
||||
D3D_CDeviceInfo* pkD3DDevInfo=GetD3DDeviceInfop(iD3DDevInfo);
|
||||
if (pkD3DDevInfo)
|
||||
{
|
||||
D3D_SModeInfo* pkD3DModeInfo=pkD3DDevInfo->GetD3DModeInfop(iD3D_SModeInfo);
|
||||
if (pkD3DModeInfo)
|
||||
return pkD3DModeInfo;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
BOOL D3D_CAdapterInfo::Find(UINT uScrWidth, UINT uScrHeight, UINT uScrDepthBits, BOOL isWindowed, UINT* piD3DModeInfo, UINT* piD3DDevInfo)
|
||||
{
|
||||
for (UINT iDevInfo=0; iDevInfo<m_uD3DDevInfoNum; ++iDevInfo)
|
||||
{
|
||||
D3D_CDeviceInfo& rkD3DDevInfo=m_akD3DDevInfo[iDevInfo];
|
||||
if (rkD3DDevInfo.Find(uScrWidth, uScrHeight, uScrDepthBits, isWindowed, piD3DModeInfo))
|
||||
{
|
||||
*piD3DDevInfo=iDevInfo;
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
BOOL D3D_CAdapterInfo::Build(IDirect3D8& rkD3D, UINT iD3DAdapterInfo, PFNCONFIRMDEVICE pfnConfirmDevice)
|
||||
{
|
||||
D3DDISPLAYMODE& rkD3DDMDesktop=m_kD3DDMDesktop;
|
||||
if (FAILED(rkD3D.GetAdapterDisplayMode(iD3DAdapterInfo, &rkD3DDMDesktop)))
|
||||
return FALSE;
|
||||
|
||||
rkD3D.GetAdapterIdentifier(iD3DAdapterInfo, D3DENUM_NO_WHQL_LEVEL, &m_kD3DAdapterIdentifier);
|
||||
|
||||
m_iCurD3DDevInfo=0;
|
||||
m_uD3DDevInfoNum=0;
|
||||
|
||||
D3D_CAdapterDisplayModeList kD3DADMList;
|
||||
kD3DADMList.Build(rkD3D, m_kD3DDMDesktop.Format, iD3DAdapterInfo);
|
||||
|
||||
D3D_CDeviceInfo* akD3DDevInfo=m_akD3DDevInfo;
|
||||
for (UINT iDevType=0; iDevType<D3DDEVICETYPE_NUM; ++iDevType)
|
||||
{
|
||||
D3D_CDeviceInfo& rkD3DDevInfo=akD3DDevInfo[m_uD3DDevInfoNum];
|
||||
if (rkD3DDevInfo.Build(rkD3D, iD3DAdapterInfo, iDevType, kD3DADMList, pfnConfirmDevice))
|
||||
++m_uD3DDevInfoNum;
|
||||
}
|
||||
|
||||
if (m_uD3DDevInfoNum>0)
|
||||
return TRUE;
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
VOID D3D_CAdapterInfo::GetString(std::string* pstEnumList)
|
||||
{
|
||||
for (UINT iDevInfo=0; iDevInfo<m_uD3DDevInfoNum; ++iDevInfo)
|
||||
{
|
||||
char szText[1024+1];
|
||||
_snprintf(szText, sizeof(szText), "Device %d\r\n", iDevInfo);
|
||||
pstEnumList->append(szText);
|
||||
|
||||
D3D_CDeviceInfo& rkD3DDevInfo=m_akD3DDevInfo[iDevInfo];
|
||||
rkD3DDevInfo.GetString(pstEnumList);
|
||||
}
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
D3D_CDisplayModeAutoDetector::D3D_CDisplayModeAutoDetector()
|
||||
{
|
||||
m_uD3DAdapterInfoCount=0;
|
||||
}
|
||||
|
||||
D3D_CDisplayModeAutoDetector::~D3D_CDisplayModeAutoDetector()
|
||||
{
|
||||
}
|
||||
|
||||
D3D_CAdapterInfo* D3D_CDisplayModeAutoDetector::GetD3DAdapterInfop(UINT iD3DAdapterInfo)
|
||||
{
|
||||
if (iD3DAdapterInfo >= m_uD3DAdapterInfoCount)
|
||||
return NULL;
|
||||
|
||||
return &m_akD3DAdapterInfo[iD3DAdapterInfo];
|
||||
}
|
||||
|
||||
D3D_SModeInfo* D3D_CDisplayModeAutoDetector::GetD3DModeInfop(UINT iD3DAdapterInfo, UINT iD3DDevInfo, UINT iD3D_SModeInfo)
|
||||
{
|
||||
D3D_CAdapterInfo* pkD3DAdapterInfo=GetD3DAdapterInfop(iD3DAdapterInfo);
|
||||
if (pkD3DAdapterInfo)
|
||||
{
|
||||
D3D_CDeviceInfo* pkD3DDevInfo=pkD3DAdapterInfo->GetD3DDeviceInfop(iD3DDevInfo);
|
||||
if (pkD3DDevInfo)
|
||||
{
|
||||
D3D_SModeInfo* pkD3D_SModeInfo=pkD3DDevInfo->GetD3DModeInfop(iD3D_SModeInfo);
|
||||
if (pkD3D_SModeInfo)
|
||||
return pkD3D_SModeInfo;
|
||||
}
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
BOOL D3D_CDisplayModeAutoDetector::Find(UINT uScrWidth, UINT uScrHeight, UINT uScrDepthBits, BOOL isWindowed, UINT* piD3DModeInfo, UINT* piD3DDevInfo, UINT* piD3DAdapterInfo)
|
||||
{
|
||||
for (UINT iD3DAdapterInfo=0; iD3DAdapterInfo<m_uD3DAdapterInfoCount; ++iD3DAdapterInfo)
|
||||
{
|
||||
D3D_CAdapterInfo& rkAdapterInfo=m_akD3DAdapterInfo[iD3DAdapterInfo];
|
||||
if (rkAdapterInfo.Find(uScrWidth, uScrHeight, uScrDepthBits, isWindowed, piD3DModeInfo, piD3DDevInfo))
|
||||
{
|
||||
*piD3DAdapterInfo=iD3DAdapterInfo;
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
BOOL D3D_CDisplayModeAutoDetector::Build(IDirect3D8& rkD3D, PFNCONFIRMDEVICE pfnConfirmDevice)
|
||||
{
|
||||
m_uD3DAdapterInfoCount=0;
|
||||
|
||||
UINT uTotalAdapterCount=rkD3D.GetAdapterCount();
|
||||
uTotalAdapterCount=std::min(uTotalAdapterCount, (UINT)D3DADAPTERINFO_NUM);
|
||||
|
||||
for (UINT iD3DAdapterInfo=0; iD3DAdapterInfo<uTotalAdapterCount; ++iD3DAdapterInfo)
|
||||
{
|
||||
D3D_CAdapterInfo& rkAdapterInfo=m_akD3DAdapterInfo[m_uD3DAdapterInfoCount];
|
||||
if (rkAdapterInfo.Build(rkD3D, iD3DAdapterInfo, pfnConfirmDevice))
|
||||
++m_uD3DAdapterInfoCount;
|
||||
}
|
||||
|
||||
if (m_uD3DAdapterInfoCount>0)
|
||||
return TRUE;
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
VOID D3D_CDisplayModeAutoDetector::GetString(std::string* pstEnumList)
|
||||
{
|
||||
for (UINT iD3DAdapterInfo=0; iD3DAdapterInfo<m_uD3DAdapterInfoCount; ++iD3DAdapterInfo)
|
||||
{
|
||||
char szText[1024+1];
|
||||
_snprintf(szText, sizeof(szText), "Adapter %d\r\n", iD3DAdapterInfo);
|
||||
pstEnumList->append(szText);
|
||||
|
||||
D3D_CAdapterInfo& rkAdapterInfo=m_akD3DAdapterInfo[iD3DAdapterInfo];
|
||||
rkAdapterInfo.GetString(pstEnumList);
|
||||
}
|
||||
}
|
||||
@@ -1,166 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
#include <d3d8.h>
|
||||
#include <string>
|
||||
typedef BOOL (*PFNCONFIRMDEVICE) (D3DCAPS8& rkD3DCaps, UINT uBehavior, D3DFORMAT eD3DFmt);
|
||||
|
||||
enum
|
||||
{
|
||||
D3DDEVICETYPE_HAL,
|
||||
D3DDEVICETYPE_REF,
|
||||
D3DDEVICETYPE_NUM,
|
||||
};
|
||||
|
||||
struct D3D_SModeInfo
|
||||
{
|
||||
UINT m_uScrWidth;
|
||||
UINT m_uScrHeight;
|
||||
UINT m_uScrDepthBit;
|
||||
UINT m_dwD3DBehavior;
|
||||
D3DFORMAT m_eD3DFmtPixel;
|
||||
D3DFORMAT m_eD3DFmtDepthStencil;
|
||||
|
||||
VOID GetString(std::string* pstEnumList);
|
||||
};
|
||||
|
||||
class D3D_CAdapterDisplayModeList
|
||||
{
|
||||
public:
|
||||
D3D_CAdapterDisplayModeList() {}
|
||||
~D3D_CAdapterDisplayModeList() {}
|
||||
VOID Build(IDirect3D8& rkD3D, D3DFORMAT eD3DFmtDefault, UINT iAdapter);
|
||||
|
||||
UINT GetDisplayModeNum();
|
||||
UINT GetPixelFormatNum();
|
||||
|
||||
const D3DDISPLAYMODE& GetDisplayModer(UINT iD3DDM);
|
||||
const D3DFORMAT& GetPixelFormatr(UINT iD3DFmt);
|
||||
|
||||
protected:
|
||||
enum
|
||||
{
|
||||
D3DDISPLAYMODE_MAX = 100,
|
||||
D3DFORMAT_MAX = 20,
|
||||
|
||||
FILTEROUT_LOWRESOLUTION_WIDTH = 640,
|
||||
FILTEROUT_LOWRESOLUTION_HEIGHT = 480,
|
||||
};
|
||||
|
||||
protected:
|
||||
D3DDISPLAYMODE m_akD3DDM[D3DDISPLAYMODE_MAX];
|
||||
D3DFORMAT m_aeD3DFmt[D3DFORMAT_MAX];
|
||||
|
||||
UINT m_uD3DDMNum;
|
||||
UINT m_uD3DFmtNum;
|
||||
|
||||
};
|
||||
|
||||
class D3D_CDeviceInfo
|
||||
{
|
||||
public:
|
||||
D3D_CDeviceInfo() {}
|
||||
~D3D_CDeviceInfo() {}
|
||||
BOOL Build(IDirect3D8& rkD3D, UINT iAdapter, UINT iDevType, D3D_CAdapterDisplayModeList& rkD3DADMList, PFNCONFIRMDEVICE pfnConfirmDevice);
|
||||
BOOL Find(UINT uScrWidth, UINT uScrHeight, UINT uScrDepthBits, BOOL isWindowed, UINT* piD3DModeInfo);
|
||||
|
||||
UINT GetD3DModeInfoNum();
|
||||
|
||||
VOID GetString(std::string* pstEnumList);
|
||||
|
||||
BOOL FindDepthStencilFormat(IDirect3D8& rkD3D, UINT iAdapter, D3DDEVTYPE DeviceType, D3DFORMAT TargetFormat, D3DFORMAT* pDepthStencilFormat);
|
||||
|
||||
D3D_SModeInfo& GetD3DModeInfor(UINT iD3DModeInfo);
|
||||
D3D_SModeInfo* GetD3DModeInfop(UINT iD3DModeInfo);
|
||||
|
||||
protected:
|
||||
enum
|
||||
{
|
||||
D3DMODEINFO_NUM = 150,
|
||||
};
|
||||
|
||||
|
||||
protected:
|
||||
const TCHAR* m_szDevDesc;
|
||||
|
||||
D3DDEVTYPE m_eD3DDevType;
|
||||
D3DCAPS8 m_kD3DCaps;
|
||||
BOOL m_canDoWindowed;
|
||||
|
||||
UINT m_iCurD3DModeInfo;
|
||||
UINT m_uD3DModeInfoNum;
|
||||
D3D_SModeInfo m_akD3DModeInfo[D3DMODEINFO_NUM];
|
||||
|
||||
|
||||
BOOL m_isWindowed;
|
||||
|
||||
D3DMULTISAMPLE_TYPE m_eD3DMSTWindowed;
|
||||
D3DMULTISAMPLE_TYPE m_eD3DMSTFullscreen;
|
||||
|
||||
|
||||
protected:
|
||||
static const CHAR* msc_aszD3DDevDesc[D3DDEVICETYPE_NUM];
|
||||
static const D3DDEVTYPE msc_aeD3DDevType[D3DDEVICETYPE_NUM];
|
||||
};
|
||||
|
||||
class D3D_CAdapterInfo
|
||||
{
|
||||
public:
|
||||
D3D_CAdapterInfo() {}
|
||||
~D3D_CAdapterInfo() {}
|
||||
BOOL Find(UINT uScrWidth, UINT uScrHeight, UINT uScrDepthBits, BOOL isWindowed, UINT* piD3DModeInfo, UINT* piD3DDevInfo);
|
||||
|
||||
BOOL Build(IDirect3D8& rkD3D, UINT iAdapter, PFNCONFIRMDEVICE pfnConfirmDevice);
|
||||
VOID GetString(std::string* pstEnumList);
|
||||
|
||||
D3DADAPTER_IDENTIFIER8& GetIdentifier()
|
||||
{
|
||||
return m_kD3DAdapterIdentifier;
|
||||
}
|
||||
|
||||
D3DDISPLAYMODE& GetDesktopD3DDisplayModer();
|
||||
D3DDISPLAYMODE* GetDesktopD3DDisplayModep();
|
||||
|
||||
D3D_CDeviceInfo* GetD3DDeviceInfop(UINT iD3DDevInfo);
|
||||
D3D_SModeInfo* GetD3DModeInfop(UINT iD3DDevInfo, UINT iD3DModeInfo);
|
||||
|
||||
protected:
|
||||
enum
|
||||
{
|
||||
D3DDEVICEINFO_NUM = 5,
|
||||
};
|
||||
|
||||
|
||||
protected:
|
||||
D3DADAPTER_IDENTIFIER8 m_kD3DAdapterIdentifier;
|
||||
D3DDISPLAYMODE m_kD3DDMDesktop;
|
||||
|
||||
UINT m_iCurD3DDevInfo;
|
||||
UINT m_uD3DDevInfoNum;
|
||||
D3D_CDeviceInfo m_akD3DDevInfo[D3DDEVICEINFO_NUM];
|
||||
|
||||
};
|
||||
|
||||
class D3D_CDisplayModeAutoDetector
|
||||
{
|
||||
public:
|
||||
D3D_CDisplayModeAutoDetector();
|
||||
~D3D_CDisplayModeAutoDetector();
|
||||
|
||||
BOOL Find(UINT uScrWidth, UINT uScrHeight, UINT uScrDepthBits, BOOL isWindowed, UINT* piD3DModeInfo, UINT* piD3DDevInfo, UINT* piD3DAdapterInfo);
|
||||
BOOL Build(IDirect3D8& rkD3D, PFNCONFIRMDEVICE pfnConfirmDevice);
|
||||
|
||||
D3D_CAdapterInfo* GetD3DAdapterInfop(UINT iD3DAdapterInfo);
|
||||
D3D_SModeInfo* GetD3DModeInfop(UINT iD3DAdapterInfo, UINT iD3DDevInfo, UINT iD3DModeInfo);
|
||||
|
||||
VOID GetString(std::string* pstEnumList);
|
||||
|
||||
protected:
|
||||
enum
|
||||
{
|
||||
D3DADAPTERINFO_NUM = 10,
|
||||
};
|
||||
|
||||
protected:
|
||||
D3D_CAdapterInfo m_akD3DAdapterInfo[D3DADAPTERINFO_NUM];
|
||||
UINT m_uD3DAdapterInfoCount;
|
||||
};
|
||||
@@ -26,10 +26,6 @@ CGraphicDevice::~CGraphicDevice()
|
||||
|
||||
void CGraphicDevice::__Initialize()
|
||||
{
|
||||
ms_iD3DAdapterInfo=D3DADAPTER_DEFAULT;
|
||||
ms_iD3DDevInfo=D3DADAPTER_DEFAULT;
|
||||
ms_iD3DModeInfo=D3DADAPTER_DEFAULT;
|
||||
|
||||
ms_lpd3d = NULL;
|
||||
ms_lpd3dDevice = NULL;
|
||||
ms_lpd3dMatStack = NULL;
|
||||
@@ -78,9 +74,9 @@ void CGraphicDevice::EnableWebBrowserMode(const RECT& c_rcWebPage)
|
||||
//rkD3DPP.Windowed=TRUE;
|
||||
rkD3DPP.SwapEffect=D3DSWAPEFFECT_COPY;
|
||||
rkD3DPP.BackBufferCount = 1;
|
||||
rkD3DPP.FullScreen_PresentationInterval = D3DPRESENT_INTERVAL_IMMEDIATE;
|
||||
rkD3DPP.PresentationInterval = D3DPRESENT_INTERVAL_IMMEDIATE;
|
||||
|
||||
IDirect3DDevice8& rkD3DDev=*ms_lpd3dDevice;
|
||||
IDirect3DDevice9& rkD3DDev=*ms_lpd3dDevice;
|
||||
HRESULT hr=rkD3DDev.Reset(&rkD3DPP);
|
||||
if (FAILED(hr))
|
||||
return;
|
||||
@@ -99,7 +95,7 @@ void CGraphicDevice::DisableWebBrowserMode()
|
||||
|
||||
rkD3DPP=g_kD3DPP;
|
||||
|
||||
IDirect3DDevice8& rkD3DDev=*ms_lpd3dDevice;
|
||||
IDirect3DDevice9& rkD3DDev=*ms_lpd3dDevice;
|
||||
HRESULT hr=rkD3DDev.Reset(&rkD3DPP);
|
||||
if (FAILED(hr))
|
||||
return;
|
||||
@@ -120,7 +116,7 @@ bool CGraphicDevice::ResizeBackBuffer(UINT uWidth, UINT uHeight)
|
||||
rkD3DPP.BackBufferWidth=uWidth;
|
||||
rkD3DPP.BackBufferHeight=uHeight;
|
||||
|
||||
IDirect3DDevice8& rkD3DDev=*ms_lpd3dDevice;
|
||||
IDirect3DDevice9& rkD3DDev=*ms_lpd3dDevice;
|
||||
|
||||
HRESULT hr=rkD3DDev.Reset(&rkD3DPP);
|
||||
if (FAILED(hr))
|
||||
@@ -135,94 +131,100 @@ bool CGraphicDevice::ResizeBackBuffer(UINT uWidth, UINT uHeight)
|
||||
return true;
|
||||
}
|
||||
|
||||
DWORD CGraphicDevice::CreatePNTStreamVertexShader()
|
||||
LPDIRECT3DVERTEXDECLARATION9 CGraphicDevice::CreatePNTStreamVertexShader()
|
||||
{
|
||||
assert(ms_lpd3dDevice != NULL);
|
||||
|
||||
DWORD declVector[] =
|
||||
{
|
||||
D3DVSD_STREAM(0),
|
||||
D3DVSD_REG(0, D3DVSDT_FLOAT3),
|
||||
D3DVSD_REG(3, D3DVSDT_FLOAT3),
|
||||
D3DVSD_REG(7, D3DVSDT_FLOAT2),
|
||||
D3DVSD_END()
|
||||
|
||||
LPDIRECT3DVERTEXDECLARATION9 dwShader = NULL;
|
||||
|
||||
D3DVERTEXELEMENT9 pShaderDecl[] = {
|
||||
{ 0, 0, D3DDECLTYPE_FLOAT3, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_POSITION, 0 },
|
||||
{ 0, 12, D3DDECLTYPE_FLOAT3, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_NORMAL, 0 },
|
||||
{ 0, 24, D3DDECLTYPE_FLOAT2, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_TEXCOORD, 0 },
|
||||
D3DDECL_END()
|
||||
};
|
||||
|
||||
DWORD ret;
|
||||
|
||||
if (FAILED(ms_lpd3dDevice->CreateVertexShader(&declVector[0], NULL, &ret, 0)))
|
||||
return 0;
|
||||
|
||||
return ret;
|
||||
|
||||
if (ms_lpd3dDevice->CreateVertexDeclaration(pShaderDecl, &dwShader) != D3D_OK)
|
||||
{
|
||||
char szError[1024];
|
||||
sprintf(szError, "Failed to create CreatePNTBTStreamVertexShader");
|
||||
MessageBox(NULL, szError, "Vertex Shader Error", MB_ICONSTOP);
|
||||
}
|
||||
|
||||
return dwShader;
|
||||
}
|
||||
|
||||
DWORD CGraphicDevice::CreatePNT2StreamVertexShader()
|
||||
LPDIRECT3DVERTEXDECLARATION9 CGraphicDevice::CreatePNT2StreamVertexShader()
|
||||
{
|
||||
assert(ms_lpd3dDevice != NULL);
|
||||
|
||||
DWORD declVector[] =
|
||||
{
|
||||
D3DVSD_STREAM(0),
|
||||
D3DVSD_REG(0, D3DVSDT_FLOAT3),
|
||||
D3DVSD_REG(3, D3DVSDT_FLOAT3),
|
||||
D3DVSD_REG(7, D3DVSDT_FLOAT2),
|
||||
D3DVSD_REG(D3DVSDE_TEXCOORD1, D3DVSDT_FLOAT2),
|
||||
// D3DVSD_STREAM(1),
|
||||
D3DVSD_END()
|
||||
LPDIRECT3DVERTEXDECLARATION9 dwShader = NULL;
|
||||
|
||||
D3DVERTEXELEMENT9 pShaderDecl[] = {
|
||||
{ 0, 0, D3DDECLTYPE_FLOAT3, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_POSITION, 0 },
|
||||
{ 0, 12, D3DDECLTYPE_FLOAT3, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_NORMAL, 0 },
|
||||
{ 0, 24, D3DDECLTYPE_FLOAT2, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_TEXCOORD, 0 },
|
||||
{ 0, 32, D3DDECLTYPE_FLOAT2, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_TEXCOORD, 1 },
|
||||
D3DDECL_END()
|
||||
};
|
||||
|
||||
DWORD ret;
|
||||
if (ms_lpd3dDevice->CreateVertexDeclaration(pShaderDecl, &dwShader) != D3D_OK)
|
||||
{
|
||||
char szError[1024];
|
||||
sprintf(szError, "Failed to create CreatePNTBT2StreamVertexShader");
|
||||
MessageBox(NULL, szError, "Vertex Shader Error", MB_ICONSTOP);
|
||||
}
|
||||
|
||||
if (FAILED(ms_lpd3dDevice->CreateVertexShader(&declVector[0], NULL, &ret, 0)))
|
||||
return 0;
|
||||
|
||||
return ret;
|
||||
return dwShader;
|
||||
}
|
||||
|
||||
DWORD CGraphicDevice::CreatePTStreamVertexShader()
|
||||
LPDIRECT3DVERTEXDECLARATION9 CGraphicDevice::CreatePTStreamVertexShader()
|
||||
{
|
||||
assert(ms_lpd3dDevice != NULL);
|
||||
|
||||
DWORD declVector[] =
|
||||
{
|
||||
D3DVSD_STREAM(0),
|
||||
D3DVSD_REG(0, D3DVSDT_FLOAT3),
|
||||
D3DVSD_STREAM(1),
|
||||
D3DVSD_REG(7, D3DVSDT_FLOAT2),
|
||||
D3DVSD_END()
|
||||
LPDIRECT3DVERTEXDECLARATION9 dwShader = NULL;
|
||||
|
||||
D3DVERTEXELEMENT9 pShaderDecl[] = {
|
||||
{ 0, 0, D3DDECLTYPE_FLOAT3, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_POSITION, 0 },
|
||||
{ 1, 0, D3DDECLTYPE_FLOAT2, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_TEXCOORD, 0 },
|
||||
D3DDECL_END()
|
||||
};
|
||||
|
||||
DWORD ret;
|
||||
if (ms_lpd3dDevice->CreateVertexDeclaration(pShaderDecl, &dwShader) != D3D_OK)
|
||||
{
|
||||
char szError[1024];
|
||||
sprintf(szError, "Failed to create CreatePTStreamVertexShader");
|
||||
MessageBox(NULL, szError, "Vertex Shader Error", MB_ICONSTOP);
|
||||
}
|
||||
|
||||
if (FAILED(ms_lpd3dDevice->CreateVertexShader(&declVector[0], NULL, &ret, 0)))
|
||||
return 0;
|
||||
|
||||
return (ret);
|
||||
return dwShader;
|
||||
}
|
||||
|
||||
DWORD CGraphicDevice::CreateDoublePNTStreamVertexShader()
|
||||
LPDIRECT3DVERTEXDECLARATION9 CGraphicDevice::CreateDoublePNTStreamVertexShader()
|
||||
{
|
||||
assert(ms_lpd3dDevice != NULL);
|
||||
|
||||
DWORD declVector[] =
|
||||
{
|
||||
D3DVSD_STREAM(0),
|
||||
D3DVSD_REG(0, D3DVSDT_FLOAT3),
|
||||
D3DVSD_REG(3, D3DVSDT_FLOAT3),
|
||||
D3DVSD_REG(7, D3DVSDT_FLOAT2),
|
||||
D3DVSD_STREAM(1),
|
||||
D3DVSD_REG(D3DVSDE_POSITION2, D3DVSDT_FLOAT3),
|
||||
D3DVSD_REG(D3DVSDE_NORMAL2, D3DVSDT_FLOAT3),
|
||||
D3DVSD_REG(D3DVSDE_TEXCOORD1, D3DVSDT_FLOAT2),
|
||||
D3DVSD_END()
|
||||
LPDIRECT3DVERTEXDECLARATION9 dwShader = NULL;
|
||||
|
||||
D3DVERTEXELEMENT9 pShaderDecl[] = {
|
||||
{ 0, 0, D3DDECLTYPE_FLOAT3, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_POSITION, 0 },
|
||||
{ 0, 12, D3DDECLTYPE_FLOAT3, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_NORMAL, 0 },
|
||||
{ 0, 24, D3DDECLTYPE_FLOAT2, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_TEXCOORD, 0 },
|
||||
|
||||
{ 1, 0, D3DDECLTYPE_FLOAT3, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_POSITION, 1 },
|
||||
{ 1, 12, D3DDECLTYPE_FLOAT3, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_NORMAL, 1 },
|
||||
{ 1, 24, D3DDECLTYPE_FLOAT2, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_TEXCOORD, 1 },
|
||||
D3DDECL_END()
|
||||
};
|
||||
|
||||
DWORD ret;
|
||||
if (ms_lpd3dDevice->CreateVertexDeclaration(pShaderDecl, &dwShader) != D3D_OK)
|
||||
{
|
||||
char szError[1024];
|
||||
sprintf(szError, "Failed to create CreateDoublePNTBTStreamVertexShader");
|
||||
MessageBox(NULL, szError, "Vertex Shader Error", MB_ICONSTOP);
|
||||
}
|
||||
|
||||
if (FAILED(ms_lpd3dDevice->CreateVertexShader(&declVector[0], NULL, &ret, 0)))
|
||||
return 0;
|
||||
|
||||
return ret;
|
||||
return dwShader;
|
||||
}
|
||||
|
||||
CGraphicDevice::EDeviceState CGraphicDevice::GetDeviceState()
|
||||
@@ -256,42 +258,33 @@ bool CGraphicDevice::Reset()
|
||||
return true;
|
||||
}
|
||||
|
||||
static LPDIRECT3DSURFACE8 s_lpStencil;
|
||||
static LPDIRECT3DSURFACE9 s_lpStencil;
|
||||
static DWORD s_MaxTextureWidth, s_MaxTextureHeight;
|
||||
|
||||
BOOL EL3D_ConfirmDevice(D3DCAPS8& rkD3DCaps, UINT uBehavior, D3DFORMAT /*eD3DFmt*/)
|
||||
BOOL EL3D_ConfirmDevice(D3DCAPS9& rkD3DCaps, UINT uBehavior)
|
||||
{
|
||||
// PUREDEVICE는 GetTransform / GetViewport 등이 되지 않는다.
|
||||
if (uBehavior & D3DCREATE_PUREDEVICE)
|
||||
return FALSE;
|
||||
|
||||
if (uBehavior & D3DCREATE_HARDWARE_VERTEXPROCESSING)
|
||||
{
|
||||
// PUREDEVICE´Â GetTransform / GetViewport µîÀÌ µÇÁö ¾Ê´Â´Ù.
|
||||
if (uBehavior & D3DCREATE_PUREDEVICE)
|
||||
return FALSE;
|
||||
|
||||
if (uBehavior & D3DCREATE_HARDWARE_VERTEXPROCESSING)
|
||||
{
|
||||
// DirectionalLight
|
||||
if (!(rkD3DCaps.VertexProcessingCaps & D3DVTXPCAPS_DIRECTIONALLIGHTS))
|
||||
return FALSE;
|
||||
|
||||
|
||||
// PositionalLight
|
||||
if (!(rkD3DCaps.VertexProcessingCaps & D3DVTXPCAPS_POSITIONALLIGHTS))
|
||||
return FALSE;
|
||||
|
||||
// Software T&L Support - ATI NOT SUPPORT CLIP, USE DIRECTX SOFTWARE PROCESSING CLIPPING
|
||||
if (GRAPHICS_CAPS_SOFTWARE_TILING)
|
||||
{
|
||||
if (!(rkD3DCaps.PrimitiveMiscCaps & D3DPMISCCAPS_CLIPTLVERTS))
|
||||
return FALSE;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Shadow/Terrain
|
||||
if (!(rkD3DCaps.VertexProcessingCaps & D3DVTXPCAPS_TEXGEN))
|
||||
return FALSE;
|
||||
}
|
||||
// Shadow/Terrain
|
||||
if (!(rkD3DCaps.VertexProcessingCaps & D3DVTXPCAPS_TEXGEN))
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
s_MaxTextureWidth = rkD3DCaps.MaxTextureWidth;
|
||||
s_MaxTextureHeight = rkD3DCaps.MaxTextureHeight;
|
||||
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@@ -305,46 +298,6 @@ DWORD GetMaxTextureHeight()
|
||||
return s_MaxTextureHeight;
|
||||
}
|
||||
|
||||
bool CGraphicDevice::__IsInDriverBlackList(D3D_CAdapterInfo& rkD3DAdapterInfo)
|
||||
{
|
||||
D3DADAPTER_IDENTIFIER8& rkD3DAdapterIdentifier=rkD3DAdapterInfo.GetIdentifier();
|
||||
|
||||
char szSrcDriver[256];
|
||||
strncpy(szSrcDriver, rkD3DAdapterIdentifier.Driver, sizeof(szSrcDriver)-1);
|
||||
DWORD dwSrcHighVersion=rkD3DAdapterIdentifier.DriverVersion.QuadPart>>32;
|
||||
DWORD dwSrcLowVersion=rkD3DAdapterIdentifier.DriverVersion.QuadPart&0xffffffff;
|
||||
|
||||
bool ret=false;
|
||||
|
||||
FILE* fp=fopen("grpblk.txt", "r");
|
||||
if (fp)
|
||||
{
|
||||
DWORD dwChkHighVersion;
|
||||
DWORD dwChkLowVersion;
|
||||
|
||||
char szChkDriver[256];
|
||||
|
||||
char szLine[256];
|
||||
while (fgets(szLine, sizeof(szLine)-1, fp))
|
||||
{
|
||||
sscanf(szLine, "%s %x %x", szChkDriver, &dwChkHighVersion, &dwChkLowVersion);
|
||||
|
||||
if (strcmp(szSrcDriver, szChkDriver)==0)
|
||||
if (dwSrcHighVersion==dwChkHighVersion)
|
||||
if (dwSrcLowVersion==dwChkLowVersion)
|
||||
{
|
||||
ret=true;
|
||||
break;
|
||||
}
|
||||
|
||||
szLine[0]='\0';
|
||||
}
|
||||
fclose(fp);
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
int CGraphicDevice::Create(HWND hWnd, int iHres, int iVres, bool Windowed, int /*iBit*/, int iReflashRate)
|
||||
{
|
||||
int iRet = CREATE_OK;
|
||||
@@ -356,64 +309,55 @@ int CGraphicDevice::Create(HWND hWnd, int iHres, int iVres, bool Windowed, int /
|
||||
|
||||
ms_hWnd = hWnd;
|
||||
ms_hDC = GetDC(hWnd);
|
||||
ms_lpd3d = Direct3DCreate8(D3D_SDK_VERSION);
|
||||
ms_lpd3d = Direct3DCreate9(D3D_SDK_VERSION);
|
||||
|
||||
if (!ms_lpd3d)
|
||||
return CREATE_NO_DIRECTX;
|
||||
|
||||
if (!ms_kD3DDetector.Build(*ms_lpd3d, EL3D_ConfirmDevice))
|
||||
return CREATE_ENUM;
|
||||
D3DADAPTER_IDENTIFIER9 d3dAdapterId;
|
||||
ms_lpd3d->GetAdapterIdentifier(D3DADAPTER_DEFAULT, 0, &d3dAdapterId);
|
||||
|
||||
if (!ms_kD3DDetector.Find(800, 600, 32, TRUE, &ms_iD3DModeInfo, &ms_iD3DDevInfo, &ms_iD3DAdapterInfo))
|
||||
return CREATE_DETECT;
|
||||
D3DDISPLAYMODE d3dDisplayMode;
|
||||
ms_lpd3d->GetAdapterDisplayMode(D3DADAPTER_DEFAULT, &d3dDisplayMode);
|
||||
|
||||
std::string stDevList;
|
||||
ms_kD3DDetector.GetString(&stDevList);
|
||||
|
||||
//Tracen(stDevList.c_str());
|
||||
//Tracenf("adapter %d, device %d, mode %d", ms_iD3DAdapterInfo, ms_iD3DDevInfo, ms_iD3DModeInfo);
|
||||
|
||||
D3D_CAdapterInfo * pkD3DAdapterInfo = ms_kD3DDetector.GetD3DAdapterInfop(ms_iD3DAdapterInfo);
|
||||
if (!pkD3DAdapterInfo)
|
||||
{
|
||||
Tracenf("adapter %d is EMPTY", ms_iD3DAdapterInfo);
|
||||
return CREATE_DETECT;
|
||||
}
|
||||
|
||||
if (__IsInDriverBlackList(*pkD3DAdapterInfo))
|
||||
{
|
||||
iRet |= CREATE_BAD_DRIVER;
|
||||
__WarningMessage(hWnd, CREATE_BAD_DRIVER);
|
||||
}
|
||||
|
||||
D3D_SModeInfo * pkD3DModeInfo = pkD3DAdapterInfo->GetD3DModeInfop(ms_iD3DDevInfo, ms_iD3DModeInfo);
|
||||
if (!pkD3DModeInfo)
|
||||
{
|
||||
Tracenf("device %d, mode %d is EMPTY", ms_iD3DDevInfo, ms_iD3DModeInfo);
|
||||
return CREATE_DETECT;
|
||||
}
|
||||
|
||||
D3DADAPTER_IDENTIFIER8& rkD3DAdapterId=pkD3DAdapterInfo->GetIdentifier();
|
||||
if (Windowed &&
|
||||
strnicmp(rkD3DAdapterId.Driver, "3dfx", 4)==0 &&
|
||||
22 == pkD3DAdapterInfo->GetDesktopD3DDisplayModer().Format)
|
||||
strnicmp(d3dAdapterId.Driver, "3dfx", 4) == 0 &&
|
||||
D3DFMT_X8R8G8B8 == d3dDisplayMode.Format)
|
||||
{
|
||||
return CREATE_FORMAT;
|
||||
}
|
||||
|
||||
if (pkD3DModeInfo->m_dwD3DBehavior==D3DCREATE_SOFTWARE_VERTEXPROCESSING)
|
||||
{
|
||||
iRet |= CREATE_NO_TNL;
|
||||
D3DCAPS9 d3dCaps;
|
||||
ms_lpd3d->GetDeviceCaps(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, &d3dCaps);
|
||||
|
||||
// DISABLE_NOTIFY_NOT_SUPPORT_TNL_MESSAGE
|
||||
//__WarningMessage(hWnd, CREATE_NO_TNL);
|
||||
// END_OF_DISABLE_NOTIFY_NOT_SUPPORT_TNL_MESSAGE
|
||||
BOOL isFormatConfirmed = FALSE;
|
||||
if (d3dCaps.DevCaps & D3DDEVCAPS_HWTRANSFORMANDLIGHT)
|
||||
{
|
||||
if (d3dCaps.DevCaps & D3DDEVCAPS_PUREDEVICE)
|
||||
{
|
||||
ms_dwD3DBehavior = D3DCREATE_HARDWARE_VERTEXPROCESSING | D3DCREATE_PUREDEVICE;
|
||||
isFormatConfirmed = EL3D_ConfirmDevice(d3dCaps, ms_dwD3DBehavior);
|
||||
}
|
||||
|
||||
if (!isFormatConfirmed)
|
||||
{
|
||||
ms_dwD3DBehavior = D3DCREATE_HARDWARE_VERTEXPROCESSING;
|
||||
isFormatConfirmed = EL3D_ConfirmDevice(d3dCaps, ms_dwD3DBehavior);
|
||||
}
|
||||
|
||||
if (!isFormatConfirmed)
|
||||
{
|
||||
ms_dwD3DBehavior = D3DCREATE_MIXED_VERTEXPROCESSING;
|
||||
isFormatConfirmed = EL3D_ConfirmDevice(d3dCaps, ms_dwD3DBehavior);
|
||||
}
|
||||
}
|
||||
|
||||
std::string stModeInfo;
|
||||
pkD3DModeInfo->GetString(&stModeInfo);
|
||||
|
||||
//Tracen(stModeInfo.c_str());
|
||||
if (!isFormatConfirmed)
|
||||
{
|
||||
ms_dwD3DBehavior = D3DCREATE_SOFTWARE_VERTEXPROCESSING;
|
||||
isFormatConfirmed = EL3D_ConfirmDevice(d3dCaps, ms_dwD3DBehavior);
|
||||
iRet |= CREATE_NO_TNL;
|
||||
}
|
||||
|
||||
int ErrorCorrection = 0;
|
||||
|
||||
@@ -424,54 +368,76 @@ RETRY:
|
||||
ms_d3dPresentParameter.BackBufferWidth = iHres;
|
||||
ms_d3dPresentParameter.BackBufferHeight = iVres;
|
||||
ms_d3dPresentParameter.hDeviceWindow = hWnd;
|
||||
ms_d3dPresentParameter.BackBufferFormat = d3dDisplayMode.Format;
|
||||
ms_d3dPresentParameter.BackBufferCount = m_uBackBufferCount;
|
||||
ms_d3dPresentParameter.SwapEffect = D3DSWAPEFFECT_DISCARD;
|
||||
ms_d3dPresentParameter.MultiSampleType = D3DMULTISAMPLE_NONE;
|
||||
|
||||
if (Windowed)
|
||||
{
|
||||
ms_d3dPresentParameter.BackBufferFormat = pkD3DAdapterInfo->GetDesktopD3DDisplayModer().Format;
|
||||
ms_d3dPresentParameter.PresentationInterval = D3DPRESENT_INTERVAL_DEFAULT;
|
||||
ms_d3dPresentParameter.FullScreen_RefreshRateInHz = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
ms_d3dPresentParameter.BackBufferFormat = pkD3DModeInfo->m_eD3DFmtPixel;
|
||||
ms_d3dPresentParameter.FullScreen_RefreshRateInHz = iReflashRate;
|
||||
ms_d3dPresentParameter.PresentationInterval = D3DPRESENT_INTERVAL_ONE;
|
||||
ms_d3dPresentParameter.FullScreen_RefreshRateInHz = D3DPRESENT_RATE_DEFAULT;
|
||||
}
|
||||
|
||||
ms_d3dPresentParameter.Flags = D3DPRESENTFLAG_LOCKABLE_BACKBUFFER;
|
||||
ms_d3dPresentParameter.EnableAutoDepthStencil = TRUE;
|
||||
ms_d3dPresentParameter.AutoDepthStencilFormat = pkD3DModeInfo->m_eD3DFmtDepthStencil;
|
||||
ms_d3dPresentParameter.AutoDepthStencilFormat = D3DFMT_D24S8;
|
||||
|
||||
ms_dwD3DBehavior = pkD3DModeInfo->m_dwD3DBehavior;
|
||||
|
||||
if (SUCCEEDED(ms_lpd3d->CheckDeviceMultiSampleType(D3DADAPTER_DEFAULT,
|
||||
D3DDEVTYPE_HAL,
|
||||
D3DFMT_A8R8G8B8,
|
||||
TRUE,
|
||||
D3DMULTISAMPLE_2_SAMPLES,
|
||||
&ms_d3dPresentParameter.MultiSampleQuality)))
|
||||
{
|
||||
ms_d3dPresentParameter.MultiSampleType = D3DMULTISAMPLE_2_SAMPLES;
|
||||
ms_d3dPresentParameter.MultiSampleQuality = 0;
|
||||
}
|
||||
|
||||
if (SUCCEEDED(ms_lpd3d->CheckDeviceMultiSampleType(D3DADAPTER_DEFAULT,
|
||||
D3DDEVTYPE_HAL,
|
||||
D3DFMT_A8R8G8B8,
|
||||
TRUE,
|
||||
D3DMULTISAMPLE_4_SAMPLES,
|
||||
&ms_d3dPresentParameter.MultiSampleQuality)))
|
||||
{
|
||||
ms_d3dPresentParameter.MultiSampleType = D3DMULTISAMPLE_4_SAMPLES;
|
||||
ms_d3dPresentParameter.MultiSampleQuality = 0;
|
||||
}
|
||||
|
||||
if (FAILED(ms_hLastResult = ms_lpd3d->CreateDevice(
|
||||
ms_iD3DAdapterInfo,
|
||||
D3DDEVTYPE_HAL,
|
||||
hWnd,
|
||||
// 2004. 1. 9 myevan 버텍스 프로세싱 방식 자동 선택 추가
|
||||
pkD3DModeInfo->m_dwD3DBehavior,
|
||||
&ms_d3dPresentParameter,
|
||||
&ms_lpd3dDevice)))
|
||||
D3DADAPTER_DEFAULT,
|
||||
D3DDEVTYPE_HAL,
|
||||
hWnd,
|
||||
ms_dwD3DBehavior,
|
||||
&ms_d3dPresentParameter,
|
||||
&ms_lpd3dDevice)))
|
||||
{
|
||||
switch (ms_hLastResult)
|
||||
{
|
||||
case D3DERR_INVALIDCALL:
|
||||
Tracen("IDirect3DDevice.CreateDevice - ERROR D3DERR_INVALIDCALL\nThe method call is invalid. For example, a method's parameter may have an invalid value.");
|
||||
break;
|
||||
case D3DERR_NOTAVAILABLE:
|
||||
Tracen("IDirect3DDevice.CreateDevice - ERROR D3DERR_NOTAVAILABLE\nThis device does not support the queried technique. ");
|
||||
break;
|
||||
case D3DERR_OUTOFVIDEOMEMORY:
|
||||
Tracen("IDirect3DDevice.CreateDevice - ERROR D3DERR_OUTOFVIDEOMEMORY\nDirect3D does not have enough display memory to perform the operation");
|
||||
break;
|
||||
default:
|
||||
Tracenf("IDirect3DDevice.CreateDevice - ERROR %d", ms_hLastResult);
|
||||
break;
|
||||
case D3DERR_INVALIDCALL:
|
||||
Tracen("IDirect3DDevice.CreateDevice - ERROR D3DERR_INVALIDCALL\nThe method call is invalid. For example, a method's parameter may have an invalid value.");
|
||||
break;
|
||||
case D3DERR_NOTAVAILABLE:
|
||||
Tracen("IDirect3DDevice.CreateDevice - ERROR D3DERR_NOTAVAILABLE\nThis device does not support the queried technique. ");
|
||||
break;
|
||||
case D3DERR_OUTOFVIDEOMEMORY:
|
||||
Tracen("IDirect3DDevice.CreateDevice - ERROR D3DERR_OUTOFVIDEOMEMORY\nDirect3D does not have enough display memory to perform the operation");
|
||||
break;
|
||||
default:
|
||||
Tracenf("IDirect3DDevice.CreateDevice - ERROR %d", ms_hLastResult);
|
||||
break;
|
||||
}
|
||||
|
||||
if (ErrorCorrection)
|
||||
return CREATE_DEVICE;
|
||||
|
||||
// 2004. 1. 9 myevan 큰의미 없는 코드인듯.. 에러나면 표시하고 종료하자
|
||||
|
||||
// 2004. 1. 9 myevan Å«ÀÇ¹Ì ¾ø´Â ÄÚµåÀεí.. ¿¡·¯³ª¸é Ç¥½ÃÇϰí Á¾·áÇÏÀÚ
|
||||
iReflashRate = 0;
|
||||
++ErrorCorrection;
|
||||
iRet = CREATE_REFRESHRATE;
|
||||
@@ -479,38 +445,38 @@ RETRY:
|
||||
}
|
||||
|
||||
// Check DXT Support Info
|
||||
if(ms_lpd3d->CheckDeviceFormat(
|
||||
ms_iD3DAdapterInfo,
|
||||
D3DDEVTYPE_HAL,
|
||||
ms_d3dPresentParameter.BackBufferFormat,
|
||||
0,
|
||||
D3DRTYPE_TEXTURE,
|
||||
D3DFMT_DXT1) == D3DERR_NOTAVAILABLE)
|
||||
if (ms_lpd3d->CheckDeviceFormat(
|
||||
D3DADAPTER_DEFAULT,
|
||||
D3DDEVTYPE_HAL,
|
||||
ms_d3dPresentParameter.BackBufferFormat,
|
||||
0,
|
||||
D3DRTYPE_TEXTURE,
|
||||
D3DFMT_DXT1) == D3DERR_NOTAVAILABLE)
|
||||
{
|
||||
ms_bSupportDXT = false;
|
||||
}
|
||||
|
||||
if(ms_lpd3d->CheckDeviceFormat(
|
||||
ms_iD3DAdapterInfo,
|
||||
D3DDEVTYPE_HAL,
|
||||
ms_d3dPresentParameter.BackBufferFormat,
|
||||
0,
|
||||
D3DRTYPE_TEXTURE,
|
||||
D3DFMT_DXT3) == D3DERR_NOTAVAILABLE)
|
||||
if (ms_lpd3d->CheckDeviceFormat(
|
||||
D3DADAPTER_DEFAULT,
|
||||
D3DDEVTYPE_HAL,
|
||||
ms_d3dPresentParameter.BackBufferFormat,
|
||||
0,
|
||||
D3DRTYPE_TEXTURE,
|
||||
D3DFMT_DXT3) == D3DERR_NOTAVAILABLE)
|
||||
{
|
||||
ms_bSupportDXT = false;
|
||||
}
|
||||
|
||||
if(ms_lpd3d->CheckDeviceFormat(
|
||||
ms_iD3DAdapterInfo,
|
||||
D3DDEVTYPE_HAL,
|
||||
ms_d3dPresentParameter.BackBufferFormat,
|
||||
0,
|
||||
D3DRTYPE_TEXTURE,
|
||||
D3DFMT_DXT5) == D3DERR_NOTAVAILABLE)
|
||||
if (ms_lpd3d->CheckDeviceFormat(
|
||||
D3DADAPTER_DEFAULT,
|
||||
D3DDEVTYPE_HAL,
|
||||
ms_d3dPresentParameter.BackBufferFormat,
|
||||
0,
|
||||
D3DRTYPE_TEXTURE,
|
||||
D3DFMT_DXT5) == D3DERR_NOTAVAILABLE)
|
||||
{
|
||||
ms_bSupportDXT = false;
|
||||
}
|
||||
}
|
||||
|
||||
if (FAILED((ms_hLastResult = ms_lpd3dDevice->GetDeviceCaps(&ms_d3dCaps))))
|
||||
{
|
||||
@@ -580,15 +546,15 @@ RETRY:
|
||||
else
|
||||
GRAPHICS_CAPS_CAN_NOT_TEXTURE_ADDRESS_BORDER=true;
|
||||
|
||||
//D3DADAPTER_IDENTIFIER8& rkD3DAdapterId=pkD3DAdapterInfo->GetIdentifier();
|
||||
if (strnicmp(rkD3DAdapterId.Driver, "SIS", 3) == 0)
|
||||
//D3DADAPTER_IDENTIFIER9& rkD3DAdapterId=pkD3DAdapterInfo->GetIdentifier();
|
||||
if (strnicmp(d3dAdapterId.Driver, "SIS", 3) == 0)
|
||||
{
|
||||
GRAPHICS_CAPS_CAN_NOT_DRAW_LINE = true;
|
||||
GRAPHICS_CAPS_CAN_NOT_DRAW_SHADOW = true;
|
||||
GRAPHICS_CAPS_HALF_SIZE_IMAGE = true;
|
||||
ms_isLowTextureMemory = true;
|
||||
}
|
||||
else if (strnicmp(rkD3DAdapterId.Driver, "3dfx", 4) == 0)
|
||||
else if (strnicmp(d3dAdapterId.Driver, "3dfx", 4) == 0)
|
||||
{
|
||||
GRAPHICS_CAPS_CAN_NOT_DRAW_SHADOW = true;
|
||||
GRAPHICS_CAPS_HALF_SIZE_IMAGE = true;
|
||||
@@ -626,7 +592,7 @@ bool CGraphicDevice::__CreatePDTVertexBufferList()
|
||||
D3DUSAGE_DYNAMIC|D3DUSAGE_WRITEONLY,
|
||||
D3DFVF_XYZ|D3DFVF_DIFFUSE|D3DFVF_TEX1,
|
||||
D3DPOOL_SYSTEMMEM,
|
||||
&ms_alpd3dPDTVB[i])
|
||||
&ms_alpd3dPDTVB[i], nullptr)
|
||||
))
|
||||
return false;
|
||||
}
|
||||
@@ -659,12 +625,12 @@ bool CGraphicDevice::__CreateDefaultIndexBuffer(UINT eDefIB, UINT uIdxCount, con
|
||||
D3DUSAGE_WRITEONLY,
|
||||
D3DFMT_INDEX16,
|
||||
D3DPOOL_MANAGED,
|
||||
&ms_alpd3dDefIB[eDefIB])
|
||||
&ms_alpd3dDefIB[eDefIB], nullptr)
|
||||
)) return false;
|
||||
|
||||
WORD* dstIndices;
|
||||
if (FAILED(
|
||||
ms_alpd3dDefIB[eDefIB]->Lock(0, 0, (BYTE**)&dstIndices, 0)
|
||||
ms_alpd3dDefIB[eDefIB]->Lock(0, 0, (void**)&dstIndices, 0)
|
||||
)) return false;
|
||||
|
||||
memcpy(dstIndices, c_awIndices, sizeof(WORD)*uIdxCount);
|
||||
@@ -731,20 +697,20 @@ void CGraphicDevice::Destroy()
|
||||
|
||||
if (ms_ptVS)
|
||||
{
|
||||
ms_lpd3dDevice->DeleteVertexShader(ms_ptVS);
|
||||
ms_ptVS = 0;;
|
||||
ms_ptVS->Release();
|
||||
ms_ptVS = nullptr;
|
||||
}
|
||||
|
||||
if (ms_pntVS)
|
||||
{
|
||||
ms_lpd3dDevice->DeleteVertexShader(ms_pntVS);
|
||||
ms_pntVS = 0;
|
||||
ms_pntVS->Release();
|
||||
ms_pntVS = nullptr;
|
||||
}
|
||||
|
||||
if (ms_pnt2VS)
|
||||
{
|
||||
ms_lpd3dDevice->DeleteVertexShader(ms_pnt2VS);
|
||||
ms_pnt2VS = 0;
|
||||
ms_pnt2VS->Release();
|
||||
ms_pnt2VS = nullptr;
|
||||
}
|
||||
|
||||
safe_release(ms_lpSphereMesh);
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
#pragma once
|
||||
|
||||
#include "GrpBase.h"
|
||||
#include "GrpDetector.h"
|
||||
#include "StateManager.h"
|
||||
|
||||
#include <map>
|
||||
|
||||
class CGraphicDevice : public CGraphicBase
|
||||
{
|
||||
public:
|
||||
@@ -50,7 +51,6 @@ public:
|
||||
|
||||
protected:
|
||||
void __Initialize();
|
||||
bool __IsInDriverBlackList(D3D_CAdapterInfo& rkD3DAdapterInfo);
|
||||
void __WarningMessage(HWND hWnd, UINT uiMsg);
|
||||
|
||||
void __InitializeDefaultIndexBufferList();
|
||||
@@ -62,10 +62,10 @@ protected:
|
||||
void __DestroyPDTVertexBufferList();
|
||||
bool __CreatePDTVertexBufferList();
|
||||
|
||||
DWORD CreatePTStreamVertexShader();
|
||||
DWORD CreatePNTStreamVertexShader();
|
||||
DWORD CreatePNT2StreamVertexShader();
|
||||
DWORD CreateDoublePNTStreamVertexShader();
|
||||
LPDIRECT3DVERTEXDECLARATION9 CreatePTStreamVertexShader();
|
||||
LPDIRECT3DVERTEXDECLARATION9 CreatePNTStreamVertexShader();
|
||||
LPDIRECT3DVERTEXDECLARATION9 CreatePNT2StreamVertexShader();
|
||||
LPDIRECT3DVERTEXDECLARATION9 CreateDoublePNTStreamVertexShader();
|
||||
|
||||
protected:
|
||||
DWORD m_uBackBufferCount;
|
||||
|
||||
@@ -123,7 +123,7 @@ void CGraphicExpandedImageInstance::OnRender()
|
||||
|
||||
STATEMANAGER.SetTexture(0, pTexture->GetD3DTexture());
|
||||
STATEMANAGER.SetTexture(1, NULL);
|
||||
STATEMANAGER.SetVertexShader(D3DFVF_XYZ|D3DFVF_DIFFUSE|D3DFVF_TEX1);
|
||||
STATEMANAGER.SetFVF(D3DFVF_XYZ|D3DFVF_DIFFUSE|D3DFVF_TEX1);
|
||||
STATEMANAGER.DrawIndexedPrimitive(D3DPT_TRIANGLELIST, 0, 4, 0, 2);
|
||||
}
|
||||
//STATEMANAGER.DrawIndexedPrimitiveUP(D3DPT_TRIANGLELIST, 0, 4, 2, c_FillRectIndices, D3DFMT_INDEX16, vertices, sizeof(TPDTVertex));
|
||||
|
||||
@@ -90,7 +90,7 @@ void CGraphicImageInstance::OnRender()
|
||||
|
||||
STATEMANAGER.SetTexture(0, pTexture->GetD3DTexture());
|
||||
STATEMANAGER.SetTexture(1, NULL);
|
||||
STATEMANAGER.SetVertexShader(D3DFVF_XYZ|D3DFVF_DIFFUSE|D3DFVF_TEX1);
|
||||
STATEMANAGER.SetFVF(D3DFVF_XYZ|D3DFVF_DIFFUSE|D3DFVF_TEX1);
|
||||
STATEMANAGER.DrawIndexedPrimitive(D3DPT_TRIANGLELIST, 0, 4, 0, 2);
|
||||
}
|
||||
//OLD: STATEMANAGER.DrawIndexedPrimitiveUP(D3DPT_TRIANGLELIST, 0, 4, 2, c_FillRectIndices, D3DFMT_INDEX16, vertices, sizeof(TPDTVertex));
|
||||
|
||||
@@ -45,7 +45,7 @@ bool CGraphicImageTexture::CreateDeviceObjects()
|
||||
if (m_stFileName.empty())
|
||||
{
|
||||
// 폰트 텍스쳐
|
||||
if (FAILED(ms_lpd3dDevice->CreateTexture(m_width, m_height, 1, 0, m_d3dFmt, D3DPOOL_MANAGED, &m_lpd3dTexture)))
|
||||
if (FAILED(ms_lpd3dDevice->CreateTexture(m_width, m_height, 1, 0, m_d3dFmt, D3DPOOL_MANAGED, &m_lpd3dTexture, nullptr)))
|
||||
return false;
|
||||
}
|
||||
else
|
||||
@@ -96,7 +96,7 @@ bool CGraphicImageTexture::CreateDDSTexture(CDXTCImage & image, const BYTE * /*c
|
||||
int mipmapCount = image.m_dwMipMapCount == 0 ? 1 : image.m_dwMipMapCount;
|
||||
|
||||
D3DFORMAT format;
|
||||
LPDIRECT3DTEXTURE8 lpd3dTexture;
|
||||
LPDIRECT3DTEXTURE9 lpd3dTexture;
|
||||
D3DPOOL pool = ms_bSupportDXT ? D3DPOOL_MANAGED : D3DPOOL_SCRATCH;;
|
||||
|
||||
if(image.m_CompFormat == PF_DXT5)
|
||||
@@ -173,13 +173,13 @@ bool CGraphicImageTexture::CreateDDSTexture(CDXTCImage & image, const BYTE * /*c
|
||||
return false;
|
||||
}
|
||||
|
||||
IDirect3DTexture8* pkTexSrc=lpd3dTexture;
|
||||
IDirect3DTexture8* pkTexDst=m_lpd3dTexture;
|
||||
IDirect3DTexture9* pkTexSrc=lpd3dTexture;
|
||||
IDirect3DTexture9* pkTexDst=m_lpd3dTexture;
|
||||
|
||||
for(int i=0; i<mipmapCount; ++i) {
|
||||
|
||||
IDirect3DSurface8* ppsSrc = NULL;
|
||||
IDirect3DSurface8* ppsDst = NULL;
|
||||
IDirect3DSurface9* ppsSrc = NULL;
|
||||
IDirect3DSurface9* ppsDst = NULL;
|
||||
|
||||
if (SUCCEEDED(pkTexSrc->GetSurfaceLevel(i, &ppsSrc)))
|
||||
{
|
||||
@@ -261,8 +261,8 @@ bool CGraphicImageTexture::CreateFromMemoryFile(UINT bufSize, const void * c_pvB
|
||||
if (IsLowTextureMemory())
|
||||
if (uTexBias || format!=imageInfo.Format)
|
||||
{
|
||||
IDirect3DTexture8* pkTexSrc=m_lpd3dTexture;
|
||||
IDirect3DTexture8* pkTexDst;
|
||||
IDirect3DTexture9* pkTexSrc=m_lpd3dTexture;
|
||||
IDirect3DTexture9* pkTexDst;
|
||||
|
||||
|
||||
if (SUCCEEDED(D3DXCreateTexture(
|
||||
@@ -279,8 +279,8 @@ bool CGraphicImageTexture::CreateFromMemoryFile(UINT bufSize, const void * c_pvB
|
||||
|
||||
for(int i=0; i<imageInfo.MipLevels; ++i) {
|
||||
|
||||
IDirect3DSurface8* ppsSrc = NULL;
|
||||
IDirect3DSurface8* ppsDst = NULL;
|
||||
IDirect3DSurface9* ppsSrc = NULL;
|
||||
IDirect3DSurface9* ppsDst = NULL;
|
||||
|
||||
if (SUCCEEDED(pkTexSrc->GetSurfaceLevel(i, &ppsSrc)))
|
||||
{
|
||||
|
||||
@@ -3,24 +3,27 @@
|
||||
#include "GrpIndexBuffer.h"
|
||||
#include "StateManager.h"
|
||||
|
||||
LPDIRECT3DINDEXBUFFER8 CGraphicIndexBuffer::GetD3DIndexBuffer() const
|
||||
LPDIRECT3DINDEXBUFFER9 CGraphicIndexBuffer::GetD3DIndexBuffer() const
|
||||
{
|
||||
assert(m_lpd3dIdxBuf!=NULL);
|
||||
assert(m_lpd3dIdxBuf != NULL);
|
||||
return m_lpd3dIdxBuf;
|
||||
}
|
||||
|
||||
void CGraphicIndexBuffer::SetIndices(int startIndex) const
|
||||
{
|
||||
assert(ms_lpd3dDevice!=NULL);
|
||||
STATEMANAGER.SetIndices(m_lpd3dIdxBuf, startIndex);
|
||||
assert(ms_lpd3dDevice != NULL);
|
||||
STATEMANAGER.SetIndices(m_lpd3dIdxBuf, startIndex);
|
||||
}
|
||||
|
||||
|
||||
bool CGraphicIndexBuffer::Lock(void** pretIndices) const
|
||||
{
|
||||
assert(m_lpd3dIdxBuf!=NULL);
|
||||
assert(m_lpd3dIdxBuf != NULL);
|
||||
|
||||
if (FAILED(m_lpd3dIdxBuf->Lock(0, 0, (BYTE**)pretIndices, 0)))
|
||||
if (!m_lpd3dIdxBuf)
|
||||
return false;
|
||||
|
||||
if (FAILED(m_lpd3dIdxBuf->Lock(0, 0, pretIndices, 0)))
|
||||
return false;
|
||||
|
||||
return true;
|
||||
@@ -28,16 +31,22 @@ bool CGraphicIndexBuffer::Lock(void** pretIndices) const
|
||||
|
||||
void CGraphicIndexBuffer::Unlock() const
|
||||
{
|
||||
assert(m_lpd3dIdxBuf!=NULL);
|
||||
assert(m_lpd3dIdxBuf != NULL);
|
||||
|
||||
if (!m_lpd3dIdxBuf)
|
||||
return;
|
||||
|
||||
m_lpd3dIdxBuf->Unlock();
|
||||
}
|
||||
|
||||
bool CGraphicIndexBuffer::Lock(void** pretIndices)
|
||||
{
|
||||
assert(m_lpd3dIdxBuf!=NULL);
|
||||
assert(m_lpd3dIdxBuf != NULL);
|
||||
|
||||
if (FAILED(m_lpd3dIdxBuf->Lock(0, 0, (BYTE**)pretIndices, 0)))
|
||||
if (!m_lpd3dIdxBuf)
|
||||
return false;
|
||||
|
||||
if (FAILED(m_lpd3dIdxBuf->Lock(0, 0, pretIndices, 0)))
|
||||
return false;
|
||||
|
||||
return true;
|
||||
@@ -45,17 +54,20 @@ bool CGraphicIndexBuffer::Lock(void** pretIndices)
|
||||
|
||||
void CGraphicIndexBuffer::Unlock()
|
||||
{
|
||||
assert(m_lpd3dIdxBuf!=NULL);
|
||||
assert(m_lpd3dIdxBuf != NULL);
|
||||
|
||||
if (!m_lpd3dIdxBuf)
|
||||
return;
|
||||
|
||||
m_lpd3dIdxBuf->Unlock();
|
||||
}
|
||||
|
||||
bool CGraphicIndexBuffer::Copy(int bufSize, const void* srcIndices)
|
||||
{
|
||||
assert(m_lpd3dIdxBuf!=NULL);
|
||||
assert(m_lpd3dIdxBuf != NULL);
|
||||
|
||||
BYTE* dstIndices;
|
||||
if (FAILED(m_lpd3dIdxBuf->Lock(0, 0, &dstIndices, 0)))
|
||||
if (FAILED(m_lpd3dIdxBuf->Lock(0, 0, (void**)&dstIndices, 0)))
|
||||
return false;
|
||||
|
||||
memcpy(dstIndices, srcIndices, bufSize);
|
||||
@@ -73,15 +85,15 @@ bool CGraphicIndexBuffer::Create(int faceCount, TFace* faces)
|
||||
return false;
|
||||
|
||||
WORD* dstIndices;
|
||||
if (FAILED(m_lpd3dIdxBuf->Lock(0, 0, (BYTE**)&dstIndices, 0)))
|
||||
if (FAILED(m_lpd3dIdxBuf->Lock(0, 0, (void**)&dstIndices, 0)))
|
||||
return false;
|
||||
|
||||
for (int i = 0; i<faceCount; ++i, dstIndices+=3)
|
||||
{
|
||||
TFace * curFace=faces+i;
|
||||
dstIndices[0]=curFace->indices[0];
|
||||
dstIndices[1]=curFace->indices[1];
|
||||
dstIndices[2]=curFace->indices[2];
|
||||
for (int i = 0; i < faceCount; ++i, dstIndices += 3)
|
||||
{
|
||||
TFace* curFace = faces + i;
|
||||
dstIndices[0] = curFace->indices[0];
|
||||
dstIndices[1] = curFace->indices[1];
|
||||
dstIndices[2] = curFace->indices[2];
|
||||
}
|
||||
|
||||
m_lpd3dIdxBuf->Unlock();
|
||||
@@ -91,12 +103,13 @@ bool CGraphicIndexBuffer::Create(int faceCount, TFace* faces)
|
||||
bool CGraphicIndexBuffer::CreateDeviceObjects()
|
||||
{
|
||||
if (FAILED(ms_lpd3dDevice->CreateIndexBuffer(
|
||||
m_dwBufferSize,
|
||||
D3DUSAGE_WRITEONLY,
|
||||
m_dwBufferSize,
|
||||
D3DUSAGE_WRITEONLY,
|
||||
m_d3dFmt,
|
||||
D3DPOOL_MANAGED,
|
||||
&m_lpd3dIdxBuf)
|
||||
))
|
||||
D3DPOOL_MANAGED,
|
||||
&m_lpd3dIdxBuf,
|
||||
NULL)
|
||||
))
|
||||
return false;
|
||||
|
||||
return true;
|
||||
@@ -108,9 +121,9 @@ void CGraphicIndexBuffer::DestroyDeviceObjects()
|
||||
}
|
||||
|
||||
bool CGraphicIndexBuffer::Create(int idxCount, D3DFORMAT d3dFmt)
|
||||
{
|
||||
{
|
||||
Destroy();
|
||||
|
||||
|
||||
m_iidxCount = idxCount;
|
||||
m_dwBufferSize = sizeof(WORD) * idxCount;
|
||||
m_d3dFmt = d3dFmt;
|
||||
@@ -125,7 +138,7 @@ void CGraphicIndexBuffer::Destroy()
|
||||
|
||||
void CGraphicIndexBuffer::Initialize()
|
||||
{
|
||||
m_lpd3dIdxBuf=NULL;
|
||||
m_lpd3dIdxBuf = NULL;
|
||||
}
|
||||
|
||||
CGraphicIndexBuffer::CGraphicIndexBuffer()
|
||||
|
||||
@@ -4,37 +4,37 @@
|
||||
|
||||
class CGraphicIndexBuffer : public CGraphicBase
|
||||
{
|
||||
public:
|
||||
CGraphicIndexBuffer();
|
||||
virtual ~CGraphicIndexBuffer();
|
||||
public:
|
||||
CGraphicIndexBuffer();
|
||||
virtual ~CGraphicIndexBuffer();
|
||||
|
||||
void Destroy();
|
||||
bool Create(int idxCount, D3DFORMAT d3dFmt);
|
||||
bool Create(int faceCount, TFace* faces);
|
||||
void Destroy();
|
||||
bool Create(int idxCount, D3DFORMAT d3dFmt);
|
||||
bool Create(int faceCount, TFace* faces);
|
||||
|
||||
bool CreateDeviceObjects();
|
||||
void DestroyDeviceObjects();
|
||||
bool CreateDeviceObjects();
|
||||
void DestroyDeviceObjects();
|
||||
|
||||
bool Copy(int bufSize, const void* srcIndices);
|
||||
bool Copy(int bufSize, const void* srcIndices);
|
||||
|
||||
bool Lock(void** pretIndices) const;
|
||||
void Unlock() const;
|
||||
bool Lock(void** pretIndices) const;
|
||||
void Unlock() const;
|
||||
|
||||
bool Lock(void** pretIndices);
|
||||
void Unlock();
|
||||
bool Lock(void** pretIndices);
|
||||
void Unlock();
|
||||
|
||||
void SetIndices(int startIndex=0) const;
|
||||
void SetIndices(int startIndex = 0) const;
|
||||
|
||||
LPDIRECT3DINDEXBUFFER8 GetD3DIndexBuffer() const;
|
||||
LPDIRECT3DINDEXBUFFER9 GetD3DIndexBuffer() const;
|
||||
|
||||
int GetIndexCount() const {return m_iidxCount;}
|
||||
int GetIndexCount() const { return m_iidxCount; }
|
||||
|
||||
protected:
|
||||
void Initialize();
|
||||
protected:
|
||||
void Initialize();
|
||||
|
||||
protected:
|
||||
LPDIRECT3DINDEXBUFFER8 m_lpd3dIdxBuf;
|
||||
DWORD m_dwBufferSize;
|
||||
D3DFORMAT m_d3dFmt;
|
||||
int m_iidxCount;
|
||||
protected:
|
||||
LPDIRECT3DINDEXBUFFER9 m_lpd3dIdxBuf;
|
||||
DWORD m_dwBufferSize;
|
||||
D3DFORMAT m_d3dFmt;
|
||||
int m_iidxCount;
|
||||
};
|
||||
|
||||
@@ -32,7 +32,7 @@ void CLightManager::Initialize()
|
||||
m_LightPool.FreeAll();
|
||||
}
|
||||
|
||||
void CLightManager::RegisterLight(ELightType /*LightType*/, TLightID * poutLightID, D3DLIGHT8 & LightData)
|
||||
void CLightManager::RegisterLight(ELightType /*LightType*/, TLightID * poutLightID, D3DLIGHT9 & LightData)
|
||||
{
|
||||
CLight * pLight = m_LightPool.Alloc();
|
||||
TLightID ID = NewLightID();
|
||||
@@ -212,7 +212,7 @@ void CLight::SetDeviceLight(BOOL bActive)
|
||||
}
|
||||
}
|
||||
|
||||
void CLight::SetParameter(TLightID id, const D3DLIGHT8 & c_rLight)
|
||||
void CLight::SetParameter(TLightID id, const D3DLIGHT9 & c_rLight)
|
||||
{
|
||||
m_LightID = id;
|
||||
m_d3dLight = c_rLight;
|
||||
|
||||
@@ -39,7 +39,7 @@ class CLight : public CGraphicBase, public CLightBase
|
||||
|
||||
void Update();
|
||||
|
||||
void SetParameter(TLightID id, const D3DLIGHT8 & c_rLight);
|
||||
void SetParameter(TLightID id, const D3DLIGHT9 & c_rLight);
|
||||
|
||||
void SetDistance(float fDistance);
|
||||
float GetDistance() const { return m_fDistance; }
|
||||
@@ -63,7 +63,7 @@ class CLight : public CGraphicBase, public CLightBase
|
||||
private:
|
||||
TLightID m_LightID; // Light ID. equal to D3D light index
|
||||
|
||||
D3DLIGHT8 m_d3dLight;
|
||||
D3DLIGHT9 m_d3dLight;
|
||||
BOOL m_isEdited;
|
||||
float m_fDistance;
|
||||
|
||||
@@ -100,7 +100,7 @@ class CLightManager : public CGraphicBase, public CLightBase, public CSingleton<
|
||||
void RestoreLight();
|
||||
|
||||
/////
|
||||
void RegisterLight(ELightType LightType, TLightID * poutLightID, D3DLIGHT8 & LightData);
|
||||
void RegisterLight(ELightType LightType, TLightID * poutLightID, D3DLIGHT9 & LightData);
|
||||
CLight * GetLight(TLightID LightID);
|
||||
void DeleteLight(TLightID LightID);
|
||||
/////
|
||||
|
||||
@@ -108,7 +108,7 @@ void CGraphicMarkInstance::OnRender()
|
||||
|
||||
STATEMANAGER.SetTexture(0, pTexture->GetD3DTexture());
|
||||
STATEMANAGER.SetTexture(1, NULL);
|
||||
STATEMANAGER.SetVertexShader(D3DFVF_XYZ|D3DFVF_DIFFUSE|D3DFVF_TEX1);
|
||||
STATEMANAGER.SetFVF(D3DFVF_XYZ|D3DFVF_DIFFUSE|D3DFVF_TEX1);
|
||||
STATEMANAGER.DrawIndexedPrimitive(D3DPT_TRIANGLELIST, 0, 4, 0, 2);
|
||||
//OLD: STATEMANAGER.DrawIndexedPrimitiveUP(D3DPT_TRIANGLELIST, 0, 4, 2, c_FillRectIndices, D3DFMT_INDEX16, vertices, sizeof(TPDTVertex));
|
||||
}
|
||||
|
||||
@@ -22,9 +22,8 @@ void CPixelShader::Destroy()
|
||||
{
|
||||
if (m_handle)
|
||||
{
|
||||
if (ms_lpd3dDevice)
|
||||
ms_lpd3dDevice->DeletePixelShader(m_handle);
|
||||
m_handle=0;
|
||||
m_handle->Release();
|
||||
m_handle=nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -36,7 +35,7 @@ bool CPixelShader::CreateFromDiskFile(const char* c_szFileName)
|
||||
LPD3DXBUFFER lpd3dxErrorBuffer;
|
||||
|
||||
if (FAILED(
|
||||
D3DXAssembleShaderFromFile(c_szFileName, 0, NULL, &lpd3dxShaderBuffer, &lpd3dxErrorBuffer)
|
||||
D3DXAssembleShaderFromFile(c_szFileName, 0, NULL, 0, &lpd3dxShaderBuffer, &lpd3dxErrorBuffer)
|
||||
))
|
||||
return false;
|
||||
|
||||
|
||||
@@ -17,5 +17,5 @@ class CPixelShader : public CGraphicBase
|
||||
void Initialize();
|
||||
|
||||
protected:
|
||||
DWORD m_handle;
|
||||
LPDIRECT3DPIXELSHADER9 m_handle;
|
||||
};
|
||||
|
||||
@@ -3,6 +3,8 @@
|
||||
#include "Camera.h"
|
||||
#include "StateManager.h"
|
||||
|
||||
#include <comdef.h>
|
||||
|
||||
DWORD CScreen::ms_diffuseColor = 0xffffffff;
|
||||
DWORD CScreen::ms_clearColor = 0L;
|
||||
DWORD CScreen::ms_clearStencil = 0L;
|
||||
@@ -29,7 +31,7 @@ void CScreen::RenderLine3d(float sx, float sy, float sz, float ex, float ey, flo
|
||||
{
|
||||
STATEMANAGER.SetTexture(0, NULL);
|
||||
STATEMANAGER.SetTexture(1, NULL);
|
||||
STATEMANAGER.SetVertexShader(D3DFVF_XYZ|D3DFVF_DIFFUSE|D3DFVF_TEX1);
|
||||
STATEMANAGER.SetFVF(D3DFVF_XYZ|D3DFVF_DIFFUSE|D3DFVF_TEX1);
|
||||
STATEMANAGER.DrawPrimitive(D3DPT_LINELIST, 0, 1);
|
||||
}
|
||||
}
|
||||
@@ -61,7 +63,7 @@ void CScreen::RenderBox3d(float sx, float sy, float sz, float ex, float ey, floa
|
||||
{
|
||||
STATEMANAGER.SetTexture(0, NULL);
|
||||
STATEMANAGER.SetTexture(1, NULL);
|
||||
STATEMANAGER.SetVertexShader(D3DFVF_XYZ|D3DFVF_DIFFUSE|D3DFVF_TEX1);
|
||||
STATEMANAGER.SetFVF(D3DFVF_XYZ|D3DFVF_DIFFUSE|D3DFVF_TEX1);
|
||||
STATEMANAGER.DrawPrimitive(D3DPT_LINELIST, 0, 4);
|
||||
}
|
||||
}
|
||||
@@ -84,7 +86,7 @@ void CScreen::RenderBar3d(float sx, float sy, float sz, float ex, float ey, floa
|
||||
{
|
||||
STATEMANAGER.SetTexture(0, NULL);
|
||||
STATEMANAGER.SetTexture(1, NULL);
|
||||
STATEMANAGER.SetVertexShader(D3DFVF_XYZ|D3DFVF_DIFFUSE|D3DFVF_TEX1);
|
||||
STATEMANAGER.SetFVF(D3DFVF_XYZ|D3DFVF_DIFFUSE|D3DFVF_TEX1);
|
||||
STATEMANAGER.DrawPrimitive(D3DPT_TRIANGLESTRIP, 0, 2);
|
||||
}
|
||||
}
|
||||
@@ -106,7 +108,7 @@ void CScreen::RenderBar3d(const D3DXVECTOR3 * c_pv3Positions)
|
||||
{
|
||||
STATEMANAGER.SetTexture(0, NULL);
|
||||
STATEMANAGER.SetTexture(1, NULL);
|
||||
STATEMANAGER.SetVertexShader(D3DFVF_XYZ|D3DFVF_DIFFUSE|D3DFVF_TEX1);
|
||||
STATEMANAGER.SetFVF(D3DFVF_XYZ|D3DFVF_DIFFUSE|D3DFVF_TEX1);
|
||||
STATEMANAGER.DrawPrimitive(D3DPT_TRIANGLESTRIP, 0, 2);
|
||||
}
|
||||
}
|
||||
@@ -129,7 +131,7 @@ void CScreen::RenderGradationBar3d(float sx, float sy, float sz, float ex, float
|
||||
{
|
||||
STATEMANAGER.SetTexture(0, NULL);
|
||||
STATEMANAGER.SetTexture(1, NULL);
|
||||
STATEMANAGER.SetVertexShader(D3DFVF_XYZ|D3DFVF_DIFFUSE|D3DFVF_TEX1);
|
||||
STATEMANAGER.SetFVF(D3DFVF_XYZ|D3DFVF_DIFFUSE|D3DFVF_TEX1);
|
||||
STATEMANAGER.DrawPrimitive(D3DPT_TRIANGLESTRIP, 0, 2);
|
||||
}
|
||||
}
|
||||
@@ -153,7 +155,7 @@ void CScreen::RenderLineCube(float sx, float sy, float sz, float ex, float ey, f
|
||||
{
|
||||
STATEMANAGER.SetTexture(0, NULL);
|
||||
STATEMANAGER.SetTexture(1, NULL);
|
||||
STATEMANAGER.SetVertexShader(D3DFVF_XYZ|D3DFVF_DIFFUSE|D3DFVF_TEX1);
|
||||
STATEMANAGER.SetFVF(D3DFVF_XYZ|D3DFVF_DIFFUSE|D3DFVF_TEX1);
|
||||
STATEMANAGER.SetTransform(D3DTS_WORLD, ms_lpd3dMatStack->GetTop());
|
||||
SetDefaultIndexBuffer(DEFAULT_IB_LINE_CUBE);
|
||||
|
||||
@@ -180,7 +182,7 @@ void CScreen::RenderCube(float sx, float sy, float sz, float ex, float ey, float
|
||||
{
|
||||
STATEMANAGER.SetTexture(0, NULL);
|
||||
STATEMANAGER.SetTexture(1, NULL);
|
||||
STATEMANAGER.SetVertexShader(D3DFVF_XYZ|D3DFVF_DIFFUSE|D3DFVF_TEX1);
|
||||
STATEMANAGER.SetFVF(D3DFVF_XYZ|D3DFVF_DIFFUSE|D3DFVF_TEX1);
|
||||
STATEMANAGER.SetTransform(D3DTS_WORLD, ms_lpd3dMatStack->GetTop());
|
||||
|
||||
SetDefaultIndexBuffer(DEFAULT_IB_FILL_CUBE);
|
||||
@@ -220,7 +222,7 @@ void CScreen::RenderCube(float sx, float sy, float sz, float ex, float ey, float
|
||||
{
|
||||
STATEMANAGER.SetTexture(0, NULL);
|
||||
STATEMANAGER.SetTexture(1, NULL);
|
||||
STATEMANAGER.SetVertexShader(D3DFVF_XYZ|D3DFVF_DIFFUSE|D3DFVF_TEX1);
|
||||
STATEMANAGER.SetFVF(D3DFVF_XYZ|D3DFVF_DIFFUSE|D3DFVF_TEX1);
|
||||
STATEMANAGER.SetTransform(D3DTS_WORLD, ms_lpd3dMatStack->GetTop());
|
||||
|
||||
SetDefaultIndexBuffer(DEFAULT_IB_FILL_CUBE);
|
||||
@@ -315,7 +317,7 @@ public:
|
||||
|
||||
CD3DXMeshRenderingOption(D3DFILLMODE d3dFillMode, const D3DXMATRIX & c_rmatWorld)
|
||||
{
|
||||
ms_lpd3dDevice->GetVertexShader(&m_dwVS);
|
||||
ms_lpd3dDevice->GetFVF(&m_dwVS);
|
||||
|
||||
STATEMANAGER.SaveTextureStageState(0, D3DTSS_COLORARG1, D3DTA_TFACTOR);
|
||||
STATEMANAGER.SaveTextureStageState(0, D3DTSS_COLOROP, D3DTOP_SELECTARG1);
|
||||
@@ -329,7 +331,7 @@ public:
|
||||
|
||||
virtual ~CD3DXMeshRenderingOption()
|
||||
{
|
||||
ms_lpd3dDevice->SetVertexShader(m_dwVS);
|
||||
ms_lpd3dDevice->SetFVF(m_dwVS);
|
||||
|
||||
STATEMANAGER.RestoreTransform(D3DTS_WORLD);
|
||||
STATEMANAGER.RestoreTextureStageState(0, D3DTSS_COLORARG1);
|
||||
@@ -356,11 +358,11 @@ void CScreen::RenderD3DXMesh(LPD3DXMESH lpMesh, const D3DXMATRIX * c_pmatWorld,
|
||||
}
|
||||
|
||||
CD3DXMeshRenderingOption SetRenderingOption(d3dFillMode, matWorld);
|
||||
LPDIRECT3DINDEXBUFFER8 lpIndexBuffer;
|
||||
LPDIRECT3DVERTEXBUFFER8 lpVertexBuffer;
|
||||
LPDIRECT3DINDEXBUFFER9 lpIndexBuffer;
|
||||
LPDIRECT3DVERTEXBUFFER9 lpVertexBuffer;
|
||||
lpMesh->GetIndexBuffer(&lpIndexBuffer);
|
||||
lpMesh->GetVertexBuffer(&lpVertexBuffer);
|
||||
STATEMANAGER.SetVertexShader(lpMesh->GetFVF());
|
||||
STATEMANAGER.SetFVF(lpMesh->GetFVF());
|
||||
STATEMANAGER.SetIndices(lpIndexBuffer, 0);
|
||||
STATEMANAGER.SetStreamSource(0, lpVertexBuffer, 24);
|
||||
STATEMANAGER.DrawIndexedPrimitive(D3DPT_TRIANGLELIST, 0, lpMesh->GetNumVertices(), 0, lpMesh->GetNumFaces());
|
||||
@@ -401,7 +403,7 @@ void CScreen::RenderTextureBox(float sx, float sy, float ex, float ey, float z,
|
||||
#ifdef WORLD_EDITOR
|
||||
STATEMANAGER.SetTransform(D3DTS_WORLD, ms_lpd3dMatStack->GetTop());
|
||||
#endif
|
||||
STATEMANAGER.SetVertexShader(D3DFVF_XYZ|D3DFVF_DIFFUSE|D3DFVF_TEX1);
|
||||
STATEMANAGER.SetFVF(D3DFVF_XYZ|D3DFVF_DIFFUSE|D3DFVF_TEX1);
|
||||
|
||||
// 2004.11.18.myevan.DrawIndexPrimitiveUP -> DynamicVertexBuffer
|
||||
SetDefaultIndexBuffer(DEFAULT_IB_FILL_RECT);
|
||||
@@ -432,7 +434,7 @@ void CScreen::RenderBillboard(D3DXVECTOR3 * Position, D3DXCOLOR & Color)
|
||||
vertices[3].diffuse = Color;
|
||||
vertices[3].texCoord = TTextureCoordinate(1, 1);
|
||||
|
||||
STATEMANAGER.SetVertexShader(D3DFVF_XYZ|D3DFVF_DIFFUSE|D3DFVF_TEX1);
|
||||
STATEMANAGER.SetFVF(D3DFVF_XYZ|D3DFVF_DIFFUSE|D3DFVF_TEX1);
|
||||
|
||||
// 2004.11.18.myevan.DrawIndexPrimitiveUP -> DynamicVertexBuffer
|
||||
SetDefaultIndexBuffer(DEFAULT_IB_FILL_RECT);
|
||||
@@ -631,7 +633,7 @@ BOOL CScreen::IsLostDevice()
|
||||
if (!ms_lpd3dDevice)
|
||||
return TRUE;
|
||||
|
||||
IDirect3DDevice8 & rkD3DDev = *ms_lpd3dDevice;
|
||||
IDirect3DDevice9 & rkD3DDev = *ms_lpd3dDevice;
|
||||
HRESULT hrTestCooperativeLevel = rkD3DDev.TestCooperativeLevel();
|
||||
if (FAILED(hrTestCooperativeLevel))
|
||||
return TRUE;
|
||||
@@ -644,11 +646,9 @@ BOOL CScreen::RestoreDevice()
|
||||
if (!ms_lpd3dDevice)
|
||||
return FALSE;
|
||||
|
||||
UINT iD3DAdapterInfo = ms_iD3DAdapterInfo;
|
||||
IDirect3D8 & rkD3D = *ms_lpd3d;
|
||||
IDirect3DDevice8 & rkD3DDev = *ms_lpd3dDevice;
|
||||
D3DPRESENT_PARAMETERS & rkD3DPP = ms_d3dPresentParameter;
|
||||
D3D_CDisplayModeAutoDetector & rkD3DDetector = ms_kD3DDetector;
|
||||
IDirect3D9& rkD3D = *ms_lpd3d;
|
||||
IDirect3DDevice9& rkD3DDev = *ms_lpd3dDevice;
|
||||
D3DPRESENT_PARAMETERS& rkD3DPP = ms_d3dPresentParameter;
|
||||
|
||||
HRESULT hrTestCooperativeLevel = rkD3DDev.TestCooperativeLevel();
|
||||
|
||||
@@ -661,22 +661,19 @@ BOOL CScreen::RestoreDevice()
|
||||
|
||||
if (D3DERR_DEVICENOTRESET == hrTestCooperativeLevel)
|
||||
{
|
||||
D3D_CAdapterInfo* pkD3DAdapterInfo = rkD3DDetector.GetD3DAdapterInfop(ms_iD3DAdapterInfo);
|
||||
|
||||
if (!pkD3DAdapterInfo)
|
||||
return FALSE;
|
||||
|
||||
D3DDISPLAYMODE & rkD3DDMDesktop = pkD3DAdapterInfo->GetDesktopD3DDisplayModer();
|
||||
|
||||
if (FAILED(rkD3D.GetAdapterDisplayMode(iD3DAdapterInfo, &rkD3DDMDesktop)))
|
||||
D3DDISPLAYMODE d3dDisplayMode;
|
||||
if (FAILED(rkD3D.GetAdapterDisplayMode(D3DADAPTER_DEFAULT, &d3dDisplayMode)))
|
||||
return FALSE;
|
||||
|
||||
rkD3DPP.BackBufferFormat = rkD3DDMDesktop.Format;
|
||||
rkD3DPP.BackBufferFormat = d3dDisplayMode.Format;
|
||||
|
||||
HRESULT hrReset = rkD3DDev.Reset(&rkD3DPP);
|
||||
|
||||
if (FAILED(hrReset))
|
||||
{
|
||||
_com_error err(hrReset);
|
||||
LPCTSTR errMsg = err.ErrorMessage();
|
||||
TraceError(errMsg);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
||||
@@ -35,13 +35,13 @@ bool CGraphicShadowTexture::Create(int width, int height)
|
||||
m_width = width;
|
||||
m_height = height;
|
||||
|
||||
if (FAILED(ms_lpd3dDevice->CreateTexture(m_width, m_height, 1, D3DUSAGE_RENDERTARGET, D3DFMT_A8R8G8B8, D3DPOOL_DEFAULT, &m_lpd3dShadowTexture)))
|
||||
if (FAILED(ms_lpd3dDevice->CreateTexture(m_width, m_height, 1, D3DUSAGE_RENDERTARGET, D3DFMT_A8R8G8B8, D3DPOOL_DEFAULT, &m_lpd3dShadowTexture, nullptr)))
|
||||
return false;
|
||||
|
||||
if (FAILED(m_lpd3dShadowTexture->GetSurfaceLevel(0, &m_lpd3dShadowSurface)))
|
||||
return false;
|
||||
|
||||
if (FAILED(ms_lpd3dDevice->CreateDepthStencilSurface(m_width, m_height, D3DFMT_D16, D3DMULTISAMPLE_NONE, &m_lpd3dDepthSurface)))
|
||||
if (FAILED(ms_lpd3dDevice->CreateDepthStencilSurface(m_width, m_height, D3DFMT_D16, D3DMULTISAMPLE_NONE, 0, TRUE, &m_lpd3dDepthSurface, nullptr)))
|
||||
return false;
|
||||
|
||||
return true;
|
||||
@@ -57,7 +57,7 @@ const D3DXMATRIX& CGraphicShadowTexture::GetLightVPMatrixReference() const
|
||||
return m_d3dLightVPMatrix;
|
||||
}
|
||||
|
||||
LPDIRECT3DTEXTURE8 CGraphicShadowTexture::GetD3DTexture() const
|
||||
LPDIRECT3DTEXTURE9 CGraphicShadowTexture::GetD3DTexture() const
|
||||
{
|
||||
return m_lpd3dShadowTexture;
|
||||
}
|
||||
@@ -66,13 +66,14 @@ void CGraphicShadowTexture::Begin()
|
||||
{
|
||||
D3DXMatrixMultiply(&m_d3dLightVPMatrix, &ms_matView, &ms_matProj);
|
||||
|
||||
ms_lpd3dDevice->GetRenderTarget(&m_lpd3dOldBackBufferSurface);
|
||||
ms_lpd3dDevice->GetRenderTarget(0, &m_lpd3dOldBackBufferSurface);
|
||||
ms_lpd3dDevice->GetDepthStencilSurface(&m_lpd3dOldDepthBufferSurface);
|
||||
ms_lpd3dDevice->GetViewport(&m_d3dOldViewport);
|
||||
|
||||
ms_lpd3dDevice->SetRenderTarget(m_lpd3dShadowSurface, m_lpd3dDepthSurface);
|
||||
ms_lpd3dDevice->SetDepthStencilSurface(m_lpd3dDepthSurface);
|
||||
ms_lpd3dDevice->SetRenderTarget(0, m_lpd3dShadowSurface);
|
||||
|
||||
D3DVIEWPORT8 d3dViewport;
|
||||
D3DVIEWPORT9 d3dViewport;
|
||||
d3dViewport.MinZ = 0.0f;
|
||||
d3dViewport.MaxZ = 1.0f;
|
||||
d3dViewport.X = 0;
|
||||
@@ -99,11 +100,11 @@ void CGraphicShadowTexture::Begin()
|
||||
STATEMANAGER.SaveTextureStageState(0, D3DTSS_ALPHAARG2, D3DTA_TEXTURE);
|
||||
STATEMANAGER.SaveTextureStageState(0, D3DTSS_ALPHAOP, D3DTOP_MODULATE);
|
||||
|
||||
STATEMANAGER.SaveTextureStageState(0, D3DTSS_MINFILTER, D3DTEXF_POINT);
|
||||
STATEMANAGER.SaveTextureStageState(0, D3DTSS_MAGFILTER, D3DTEXF_POINT);
|
||||
STATEMANAGER.SaveTextureStageState(0, D3DTSS_MIPFILTER, D3DTEXF_POINT);
|
||||
STATEMANAGER.SaveTextureStageState(0, D3DTSS_ADDRESSU, D3DTADDRESS_CLAMP);
|
||||
STATEMANAGER.SaveTextureStageState(0, D3DTSS_ADDRESSV, D3DTADDRESS_CLAMP);
|
||||
STATEMANAGER.SaveSamplerState(0, D3DSAMP_MINFILTER, D3DTEXF_POINT);
|
||||
STATEMANAGER.SaveSamplerState(0, D3DSAMP_MAGFILTER, D3DTEXF_POINT);
|
||||
STATEMANAGER.SaveSamplerState(0, D3DSAMP_MIPFILTER, D3DTEXF_POINT);
|
||||
STATEMANAGER.SaveSamplerState(0, D3DSAMP_ADDRESSU, D3DTADDRESS_CLAMP);
|
||||
STATEMANAGER.SaveSamplerState(0, D3DSAMP_ADDRESSV, D3DTADDRESS_CLAMP);
|
||||
|
||||
STATEMANAGER.SetTexture(1, NULL);
|
||||
STATEMANAGER.SaveTextureStageState(1, D3DTSS_COLORARG1, D3DTA_CURRENT);
|
||||
@@ -113,11 +114,11 @@ void CGraphicShadowTexture::Begin()
|
||||
STATEMANAGER.SaveTextureStageState(1, D3DTSS_ALPHAARG2, D3DTA_TEXTURE);
|
||||
STATEMANAGER.SaveTextureStageState(1, D3DTSS_ALPHAOP, D3DTOP_SELECTARG1);
|
||||
|
||||
STATEMANAGER.SaveTextureStageState(1, D3DTSS_MINFILTER, D3DTEXF_POINT);
|
||||
STATEMANAGER.SaveTextureStageState(1, D3DTSS_MAGFILTER, D3DTEXF_POINT);
|
||||
STATEMANAGER.SaveTextureStageState(1, D3DTSS_MIPFILTER, D3DTEXF_POINT);
|
||||
STATEMANAGER.SaveTextureStageState(1, D3DTSS_ADDRESSU, D3DTADDRESS_CLAMP);
|
||||
STATEMANAGER.SaveTextureStageState(1, D3DTSS_ADDRESSV, D3DTADDRESS_CLAMP);
|
||||
STATEMANAGER.SaveSamplerState(1, D3DSAMP_MINFILTER, D3DTEXF_POINT);
|
||||
STATEMANAGER.SaveSamplerState(1, D3DSAMP_MAGFILTER, D3DTEXF_POINT);
|
||||
STATEMANAGER.SaveSamplerState(1, D3DSAMP_MIPFILTER, D3DTEXF_POINT);
|
||||
STATEMANAGER.SaveSamplerState(1, D3DSAMP_ADDRESSU, D3DTADDRESS_CLAMP);
|
||||
STATEMANAGER.SaveSamplerState(1, D3DSAMP_ADDRESSV, D3DTADDRESS_CLAMP);
|
||||
}
|
||||
|
||||
void CGraphicShadowTexture::End()
|
||||
@@ -127,7 +128,8 @@ void CGraphicShadowTexture::End()
|
||||
|
||||
ms_lpd3dDevice->EndScene();
|
||||
|
||||
ms_lpd3dDevice->SetRenderTarget(m_lpd3dOldBackBufferSurface, m_lpd3dOldDepthBufferSurface);
|
||||
ms_lpd3dDevice->SetDepthStencilSurface(m_lpd3dOldDepthBufferSurface);
|
||||
ms_lpd3dDevice->SetRenderTarget(0, m_lpd3dOldBackBufferSurface);
|
||||
ms_lpd3dDevice->SetViewport(&m_d3dOldViewport);
|
||||
|
||||
m_lpd3dOldBackBufferSurface->Release();
|
||||
@@ -149,11 +151,11 @@ void CGraphicShadowTexture::End()
|
||||
STATEMANAGER.RestoreTextureStageState(0, D3DTSS_ALPHAARG2);
|
||||
STATEMANAGER.RestoreTextureStageState(0, D3DTSS_ALPHAOP);
|
||||
|
||||
STATEMANAGER.RestoreTextureStageState(0, D3DTSS_MINFILTER);
|
||||
STATEMANAGER.RestoreTextureStageState(0, D3DTSS_MAGFILTER);
|
||||
STATEMANAGER.RestoreTextureStageState(0, D3DTSS_MIPFILTER);
|
||||
STATEMANAGER.RestoreTextureStageState(0, D3DTSS_ADDRESSU);
|
||||
STATEMANAGER.RestoreTextureStageState(0, D3DTSS_ADDRESSV);
|
||||
STATEMANAGER.RestoreSamplerState(0, D3DSAMP_MINFILTER);
|
||||
STATEMANAGER.RestoreSamplerState(0, D3DSAMP_MAGFILTER);
|
||||
STATEMANAGER.RestoreSamplerState(0, D3DSAMP_MIPFILTER);
|
||||
STATEMANAGER.RestoreSamplerState(0, D3DSAMP_ADDRESSU);
|
||||
STATEMANAGER.RestoreSamplerState(0, D3DSAMP_ADDRESSV);
|
||||
|
||||
STATEMANAGER.RestoreTextureStageState(1, D3DTSS_COLORARG1);
|
||||
STATEMANAGER.RestoreTextureStageState(1, D3DTSS_COLORARG2);
|
||||
@@ -162,11 +164,11 @@ void CGraphicShadowTexture::End()
|
||||
STATEMANAGER.RestoreTextureStageState(1, D3DTSS_ALPHAARG2);
|
||||
STATEMANAGER.RestoreTextureStageState(1, D3DTSS_ALPHAOP);
|
||||
|
||||
STATEMANAGER.RestoreTextureStageState(1, D3DTSS_MINFILTER);
|
||||
STATEMANAGER.RestoreTextureStageState(1, D3DTSS_MAGFILTER);
|
||||
STATEMANAGER.RestoreTextureStageState(1, D3DTSS_MIPFILTER);
|
||||
STATEMANAGER.RestoreTextureStageState(1, D3DTSS_ADDRESSU);
|
||||
STATEMANAGER.RestoreTextureStageState(1, D3DTSS_ADDRESSV);
|
||||
STATEMANAGER.RestoreSamplerState(1, D3DSAMP_MINFILTER);
|
||||
STATEMANAGER.RestoreSamplerState(1, D3DSAMP_MAGFILTER);
|
||||
STATEMANAGER.RestoreSamplerState(1, D3DSAMP_MIPFILTER);
|
||||
STATEMANAGER.RestoreSamplerState(1, D3DSAMP_ADDRESSU);
|
||||
STATEMANAGER.RestoreSamplerState(1, D3DSAMP_ADDRESSV);
|
||||
}
|
||||
|
||||
void CGraphicShadowTexture::Initialize()
|
||||
|
||||
@@ -17,19 +17,19 @@ class CGraphicShadowTexture : public CGraphicTexture
|
||||
void Set(int stage = 0) const;
|
||||
|
||||
const D3DXMATRIX& GetLightVPMatrixReference() const;
|
||||
LPDIRECT3DTEXTURE8 GetD3DTexture() const;
|
||||
LPDIRECT3DTEXTURE9 GetD3DTexture() const;
|
||||
|
||||
protected:
|
||||
void Initialize();
|
||||
|
||||
protected:
|
||||
D3DXMATRIX m_d3dLightVPMatrix;
|
||||
D3DVIEWPORT8 m_d3dOldViewport;
|
||||
D3DVIEWPORT9 m_d3dOldViewport;
|
||||
|
||||
LPDIRECT3DTEXTURE8 m_lpd3dShadowTexture;
|
||||
LPDIRECT3DSURFACE8 m_lpd3dShadowSurface;
|
||||
LPDIRECT3DSURFACE8 m_lpd3dDepthSurface;
|
||||
LPDIRECT3DTEXTURE9 m_lpd3dShadowTexture;
|
||||
LPDIRECT3DSURFACE9 m_lpd3dShadowSurface;
|
||||
LPDIRECT3DSURFACE9 m_lpd3dDepthSurface;
|
||||
|
||||
LPDIRECT3DSURFACE8 m_lpd3dOldBackBufferSurface;
|
||||
LPDIRECT3DSURFACE8 m_lpd3dOldDepthBufferSurface;
|
||||
LPDIRECT3DSURFACE9 m_lpd3dOldBackBufferSurface;
|
||||
LPDIRECT3DSURFACE9 m_lpd3dOldDepthBufferSurface;
|
||||
};
|
||||
|
||||
@@ -539,7 +539,7 @@ void CGraphicTextInstance::Render(RECT * pClipRect)
|
||||
STATEMANAGER.SetRenderState(D3DRS_FOGENABLE, FALSE);
|
||||
STATEMANAGER.SetRenderState(D3DRS_LIGHTING, FALSE);
|
||||
|
||||
STATEMANAGER.SetVertexShader(D3DFVF_XYZ|D3DFVF_DIFFUSE|D3DFVF_TEX1);
|
||||
STATEMANAGER.SetFVF(D3DFVF_XYZ|D3DFVF_DIFFUSE|D3DFVF_TEX1);
|
||||
STATEMANAGER.SetTextureStageState(0, D3DTSS_COLORARG1, D3DTA_TEXTURE);
|
||||
STATEMANAGER.SetTextureStageState(0, D3DTSS_COLORARG2, D3DTA_DIFFUSE);
|
||||
STATEMANAGER.SetTextureStageState(0, D3DTSS_COLOROP, D3DTOP_MODULATE);
|
||||
|
||||
@@ -34,7 +34,7 @@ void CGraphicTexture::SetTextureStage(int stage) const
|
||||
STATEMANAGER.SetTexture(stage, m_lpd3dTexture);
|
||||
}
|
||||
|
||||
LPDIRECT3DTEXTURE8 CGraphicTexture::GetD3DTexture() const
|
||||
LPDIRECT3DTEXTURE9 CGraphicTexture::GetD3DTexture() const
|
||||
{
|
||||
return m_lpd3dTexture;
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@ class CGraphicTexture : public CGraphicBase
|
||||
int GetHeight() const;
|
||||
|
||||
void SetTextureStage(int stage) const;
|
||||
LPDIRECT3DTEXTURE8 GetD3DTexture() const;
|
||||
LPDIRECT3DTEXTURE9 GetD3DTexture() const;
|
||||
|
||||
void DestroyDeviceObjects();
|
||||
|
||||
@@ -28,5 +28,5 @@ class CGraphicTexture : public CGraphicBase
|
||||
int m_width;
|
||||
int m_height;
|
||||
|
||||
LPDIRECT3DTEXTURE8 m_lpd3dTexture;
|
||||
LPDIRECT3DTEXTURE9 m_lpd3dTexture;
|
||||
};
|
||||
|
||||
@@ -31,7 +31,7 @@ bool CGraphicVertexBuffer::LockRange(unsigned count, void** pretVertices) const
|
||||
return false;
|
||||
|
||||
DWORD dwLockSize=GetVertexStride() * count;
|
||||
if (FAILED(m_lpd3dVB->Lock(0, dwLockSize, (BYTE **) pretVertices, m_dwLockFlag)))
|
||||
if (FAILED(m_lpd3dVB->Lock(0, dwLockSize, (void **) pretVertices, m_dwLockFlag)))
|
||||
return false;
|
||||
|
||||
return true;
|
||||
@@ -43,7 +43,7 @@ bool CGraphicVertexBuffer::Lock(void ** pretVertices) const
|
||||
return false;
|
||||
|
||||
DWORD dwLockSize=GetVertexStride()*GetVertexCount();
|
||||
if (FAILED(m_lpd3dVB->Lock(0, dwLockSize, (BYTE **) pretVertices, m_dwLockFlag)))
|
||||
if (FAILED(m_lpd3dVB->Lock(0, dwLockSize, (void **) pretVertices, m_dwLockFlag)))
|
||||
return false;
|
||||
|
||||
return true;
|
||||
@@ -72,7 +72,7 @@ bool CGraphicVertexBuffer::LockDynamic(void** pretVertices)
|
||||
if (!m_lpd3dVB)
|
||||
return false;
|
||||
|
||||
if (FAILED(m_lpd3dVB->Lock(0, 0, (BYTE**)pretVertices, 0)))
|
||||
if (FAILED(m_lpd3dVB->Lock(0, 0, (void**)pretVertices, 0)))
|
||||
return false;
|
||||
|
||||
return true;
|
||||
@@ -83,7 +83,7 @@ bool CGraphicVertexBuffer::Lock(void ** pretVertices)
|
||||
if (!m_lpd3dVB)
|
||||
return false;
|
||||
|
||||
if (FAILED(m_lpd3dVB->Lock(0, 0, (BYTE**)pretVertices, m_dwLockFlag)))
|
||||
if (FAILED(m_lpd3dVB->Lock(0, 0, (void**)pretVertices, m_dwLockFlag)))
|
||||
return false;
|
||||
|
||||
return true;
|
||||
@@ -123,7 +123,8 @@ bool CGraphicVertexBuffer::CreateDeviceObjects()
|
||||
m_dwUsage,
|
||||
m_dwFVF,
|
||||
m_d3dPool,
|
||||
&m_lpd3dVB)
|
||||
&m_lpd3dVB,
|
||||
nullptr)
|
||||
))
|
||||
return false;
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@ class CGraphicVertexBuffer : public CGraphicBase
|
||||
int GetVertexStride() const;
|
||||
DWORD GetFlexibleVertexFormat() const;
|
||||
|
||||
inline LPDIRECT3DVERTEXBUFFER8 GetD3DVertexBuffer() const { return m_lpd3dVB; }
|
||||
inline LPDIRECT3DVERTEXBUFFER9 GetD3DVertexBuffer() const { return m_lpd3dVB; }
|
||||
inline DWORD GetBufferSize() const { return m_dwBufferSize; }
|
||||
|
||||
bool IsEmpty() const;
|
||||
@@ -39,7 +39,7 @@ class CGraphicVertexBuffer : public CGraphicBase
|
||||
void Initialize();
|
||||
|
||||
protected:
|
||||
LPDIRECT3DVERTEXBUFFER8 m_lpd3dVB;
|
||||
LPDIRECT3DVERTEXBUFFER9 m_lpd3dVB;
|
||||
|
||||
DWORD m_dwBufferSize;
|
||||
DWORD m_dwFVF;
|
||||
|
||||
@@ -22,10 +22,8 @@ void CVertexShader::Destroy()
|
||||
{
|
||||
if (m_handle)
|
||||
{
|
||||
if (ms_lpd3dDevice)
|
||||
ms_lpd3dDevice->DeleteVertexShader(m_handle);
|
||||
|
||||
m_handle = 0;
|
||||
m_handle->Release();
|
||||
m_handle = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -37,14 +35,11 @@ bool CVertexShader::CreateFromDiskFile(const char* c_szFileName, const DWORD* c_
|
||||
LPD3DXBUFFER lpd3dxErrorBuffer;
|
||||
|
||||
if (FAILED(
|
||||
D3DXAssembleShaderFromFile(c_szFileName, 0, NULL, &lpd3dxShaderBuffer, &lpd3dxErrorBuffer)
|
||||
D3DXAssembleShaderFromFile(c_szFileName, 0, NULL, 0, &lpd3dxShaderBuffer, &lpd3dxErrorBuffer)
|
||||
)) return false;
|
||||
|
||||
CDirect3DXBuffer shaderBuffer(lpd3dxShaderBuffer);
|
||||
CDirect3DXBuffer errorBuffer(lpd3dxErrorBuffer);
|
||||
|
||||
if (FAILED(
|
||||
ms_lpd3dDevice->CreateVertexShader(c_pdwVertexDecl, (DWORD*)shaderBuffer.GetPointer(), &m_handle, 0 )
|
||||
ms_lpd3dDevice->CreateVertexShader((const DWORD*)lpd3dxShaderBuffer->GetBufferPointer(), &m_handle)
|
||||
))
|
||||
return false;
|
||||
|
||||
|
||||
@@ -17,5 +17,5 @@ class CVertexShader : public CGraphicBase
|
||||
void Initialize();
|
||||
|
||||
protected:
|
||||
DWORD m_handle;
|
||||
LPDIRECT3DVERTEXSHADER9 m_handle;
|
||||
};
|
||||
|
||||
@@ -259,7 +259,7 @@ void CLensFlare::DrawBeforeFlare()
|
||||
STATEMANAGER.SetTextureStageState(0, D3DTSS_ALPHAOP, D3DTOP_SELECTARG1);
|
||||
STATEMANAGER.SetTextureStageState(0, D3DTSS_COLORARG1, D3DTA_TEXTURE);
|
||||
|
||||
STATEMANAGER.SetVertexShader(D3DFVF_XYZ|D3DFVF_DIFFUSE|D3DFVF_TEX1);
|
||||
STATEMANAGER.SetFVF(D3DFVF_XYZ|D3DFVF_DIFFUSE|D3DFVF_TEX1);
|
||||
STATEMANAGER.DrawPrimitiveUP(D3DPT_TRIANGLESTRIP, 2, vertices, sizeof(SVertex));
|
||||
|
||||
STATEMANAGER.RestoreRenderState(D3DRS_LIGHTING);
|
||||
@@ -445,7 +445,7 @@ void CLensFlare::AdjustBrightness()
|
||||
void CLensFlare::ReadDepthPixels(float * /*pPixels*/)
|
||||
{
|
||||
/*
|
||||
LPDIRECT3DSURFACE8 lpSurface;
|
||||
LPDIRECT3DSURFACE9 lpSurface;
|
||||
if (FAILED(ms_lpd3dDevice->GetDepthStencilSurface(&lpSurface)))
|
||||
assert(false);
|
||||
|
||||
@@ -540,7 +540,7 @@ void CFlare::Draw(float fBrightScale, int nWidth, int nHeight, int nX, int nY)
|
||||
float fDY = float(nY) - float(nHeight) / 2.0f;
|
||||
|
||||
STATEMANAGER.SetTexture(1, NULL);
|
||||
STATEMANAGER.SetVertexShader(D3DFVF_XYZ|D3DFVF_DIFFUSE|D3DFVF_TEX1);
|
||||
STATEMANAGER.SetFVF(D3DFVF_XYZ|D3DFVF_DIFFUSE|D3DFVF_TEX1);
|
||||
|
||||
STATEMANAGER.SetTextureStageState(0, D3DTSS_COLORARG1, D3DTA_TEXTURE);
|
||||
STATEMANAGER.SetTextureStageState(0, D3DTSS_COLORARG2, D3DTA_DIFFUSE);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#pragma once
|
||||
|
||||
#include <d3dx8.h>
|
||||
#include <d3dx9.h>
|
||||
|
||||
class CRay
|
||||
{
|
||||
|
||||
@@ -820,7 +820,7 @@ void CSkyBox::Render()
|
||||
STATEMANAGER.SetTextureStageState(1, D3DTSS_COLOROP, D3DTOP_DISABLE);
|
||||
STATEMANAGER.SetTextureStageState(1, D3DTSS_ALPHAOP, D3DTOP_DISABLE);
|
||||
|
||||
STATEMANAGER.SetVertexShader(D3DFVF_XYZ|D3DFVF_DIFFUSE|D3DFVF_TEX1);
|
||||
STATEMANAGER.SetFVF(D3DFVF_XYZ|D3DFVF_DIFFUSE|D3DFVF_TEX1);
|
||||
|
||||
STATEMANAGER.SetTransform(D3DTS_WORLD, &m_matWorld);
|
||||
|
||||
@@ -828,8 +828,8 @@ void CSkyBox::Render()
|
||||
if( m_ucRenderMode == CSkyObject::SKY_RENDER_MODE_TEXTURE )
|
||||
{
|
||||
STATEMANAGER.SetTextureStageState(0, D3DTSS_COLOROP, D3DTOP_SELECTARG1);
|
||||
STATEMANAGER.SaveTextureStageState(0, D3DTSS_ADDRESSU, D3DTADDRESS_CLAMP);
|
||||
STATEMANAGER.SaveTextureStageState(0, D3DTSS_ADDRESSV, D3DTADDRESS_CLAMP);
|
||||
STATEMANAGER.SaveSamplerState(0, D3DSAMP_ADDRESSU, D3DTADDRESS_CLAMP);
|
||||
STATEMANAGER.SaveSamplerState(0, D3DSAMP_ADDRESSV, D3DTADDRESS_CLAMP);
|
||||
|
||||
for (unsigned int i = 0; i < 6; ++i)
|
||||
{
|
||||
@@ -844,8 +844,8 @@ void CSkyBox::Render()
|
||||
|
||||
//STATEMANAGER.SetTexture( 0, NULL );
|
||||
|
||||
STATEMANAGER.RestoreTextureStageState(0, D3DTSS_ADDRESSU);
|
||||
STATEMANAGER.RestoreTextureStageState(0, D3DTSS_ADDRESSV);
|
||||
STATEMANAGER.RestoreSamplerState(0, D3DSAMP_ADDRESSU);
|
||||
STATEMANAGER.RestoreSamplerState(0, D3DSAMP_ADDRESSV);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -1,37 +1,34 @@
|
||||
#include "StdAfx.h"
|
||||
#include "StateManager.h"
|
||||
#include "GrpLightManager.h"
|
||||
|
||||
//#define StateManager_Assert(a) if (!(a)) puts("assert"#a)
|
||||
#define StateManager_Assert(a) assert(a)
|
||||
|
||||
struct SLightData
|
||||
{
|
||||
enum
|
||||
{
|
||||
LIGHT_NUM = 8,
|
||||
};
|
||||
D3DLIGHT8 m_akD3DLight[LIGHT_NUM];
|
||||
D3DLIGHT9 m_akD3DLight[8];
|
||||
} m_kLightData;
|
||||
|
||||
|
||||
|
||||
void CStateManager::SetLight(DWORD index, CONST D3DLIGHT8* pLight)
|
||||
void CStateManager::SetLight(DWORD index, CONST D3DLIGHT9* pLight)
|
||||
{
|
||||
assert(index<SLightData::LIGHT_NUM);
|
||||
m_kLightData.m_akD3DLight[index]=*pLight;
|
||||
assert(index < 8);
|
||||
m_kLightData.m_akD3DLight[index] = *pLight;
|
||||
|
||||
m_lpD3DDev->SetLight(index, pLight);
|
||||
}
|
||||
|
||||
void CStateManager::GetLight(DWORD index, D3DLIGHT8* pLight)
|
||||
void CStateManager::GetLight(DWORD index, D3DLIGHT9* pLight)
|
||||
{
|
||||
assert(index<8);
|
||||
*pLight=m_kLightData.m_akD3DLight[index];
|
||||
assert(index < 8);
|
||||
*pLight = m_kLightData.m_akD3DLight[index];
|
||||
}
|
||||
|
||||
bool CStateManager::BeginScene()
|
||||
{
|
||||
m_bScene=true;
|
||||
m_bScene = true;
|
||||
|
||||
D3DXMATRIX m4Proj;
|
||||
D3DXMATRIX m4View;
|
||||
@@ -51,15 +48,24 @@ bool CStateManager::BeginScene()
|
||||
void CStateManager::EndScene()
|
||||
{
|
||||
m_lpD3DDev->EndScene();
|
||||
m_bScene=false;
|
||||
m_bScene = false;
|
||||
}
|
||||
|
||||
CStateManager::CStateManager(LPDIRECT3DDEVICE8 lpDevice) : m_lpD3DDev(NULL)
|
||||
CStateManager::CStateManager(LPDIRECT3DDEVICE9 lpDevice) : m_lpD3DDev(NULL)
|
||||
{
|
||||
m_bScene = false;
|
||||
m_dwBestMinFilter = D3DTEXF_LINEAR;
|
||||
m_dwBestMagFilter = D3DTEXF_LINEAR;
|
||||
m_dwBestMinFilter = D3DTEXF_ANISOTROPIC;
|
||||
m_dwBestMagFilter = D3DTEXF_ANISOTROPIC;
|
||||
|
||||
for (int i = 0; i < STATEMANAGER_MAX_RENDERSTATES; i++)
|
||||
lpDevice->GetRenderState((D3DRENDERSTATETYPE)i, &gs_DefaultRenderStates[i]);
|
||||
|
||||
SetDevice(lpDevice);
|
||||
|
||||
#ifdef _DEBUG
|
||||
m_iDrawCallCount = 0;
|
||||
m_iLastDrawCallCount = 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
CStateManager::~CStateManager()
|
||||
@@ -71,7 +77,7 @@ CStateManager::~CStateManager()
|
||||
}
|
||||
}
|
||||
|
||||
void CStateManager::SetDevice(LPDIRECT3DDEVICE8 lpDevice)
|
||||
void CStateManager::SetDevice(LPDIRECT3DDEVICE9 lpDevice)
|
||||
{
|
||||
StateManager_Assert(lpDevice);
|
||||
lpDevice->AddRef();
|
||||
@@ -84,33 +90,14 @@ void CStateManager::SetDevice(LPDIRECT3DDEVICE8 lpDevice)
|
||||
|
||||
m_lpD3DDev = lpDevice;
|
||||
|
||||
D3DCAPS8 d3dCaps;
|
||||
m_lpD3DDev->GetDeviceCaps(&d3dCaps);
|
||||
|
||||
if (d3dCaps.TextureFilterCaps & D3DPTFILTERCAPS_MAGFANISOTROPIC)
|
||||
m_dwBestMagFilter = D3DTEXF_ANISOTROPIC;
|
||||
else
|
||||
m_dwBestMagFilter = D3DTEXF_LINEAR;
|
||||
|
||||
if (d3dCaps.TextureFilterCaps & D3DPTFILTERCAPS_MINFANISOTROPIC)
|
||||
m_dwBestMinFilter = D3DTEXF_ANISOTROPIC;
|
||||
else
|
||||
m_dwBestMinFilter = D3DTEXF_LINEAR;
|
||||
|
||||
DWORD dwMax = d3dCaps.MaxAnisotropy;
|
||||
dwMax = dwMax < 4 ? dwMax : 4;
|
||||
|
||||
for (int i = 0; i < 8; ++i)
|
||||
m_lpD3DDev->SetTextureStageState(i, D3DTSS_MAXANISOTROPY, dwMax);
|
||||
|
||||
SetDefaultState();
|
||||
}
|
||||
|
||||
void CStateManager::SetBestFiltering(DWORD dwStage)
|
||||
{
|
||||
SetTextureStageState(dwStage, D3DTSS_MINFILTER, m_dwBestMinFilter);
|
||||
SetTextureStageState(dwStage, D3DTSS_MAGFILTER, m_dwBestMagFilter);
|
||||
SetTextureStageState(dwStage, D3DTSS_MIPFILTER, D3DTEXF_LINEAR);
|
||||
SetSamplerState(dwStage, D3DSAMP_MINFILTER, m_dwBestMinFilter);
|
||||
SetSamplerState(dwStage, D3DSAMP_MAGFILTER, m_dwBestMagFilter);
|
||||
SetSamplerState(dwStage, D3DSAMP_MIPFILTER, D3DTEXF_LINEAR);
|
||||
}
|
||||
|
||||
void CStateManager::Restore()
|
||||
@@ -120,15 +107,24 @@ void CStateManager::Restore()
|
||||
m_bForce = true;
|
||||
|
||||
for (i = 0; i < STATEMANAGER_MAX_RENDERSTATES; ++i)
|
||||
{
|
||||
SetRenderState(D3DRENDERSTATETYPE(i), m_CurrentState.m_RenderStates[i]);
|
||||
}
|
||||
|
||||
for (i = 0; i < STATEMANAGER_MAX_STAGES; ++i)
|
||||
{
|
||||
for (j = 0; j < STATEMANAGER_MAX_TEXTURESTATES; ++j)
|
||||
{
|
||||
SetTextureStageState(i, D3DTEXTURESTAGESTATETYPE(j), m_CurrentState.m_TextureStates[i][j]);
|
||||
SetTextureStageState(i, D3DTEXTURESTAGESTATETYPE(j), m_CurrentState.m_SamplerStates[i][j]);
|
||||
}
|
||||
}
|
||||
|
||||
for (i = 0; i < STATEMANAGER_MAX_STAGES; ++i)
|
||||
{
|
||||
SetTexture(i, m_CurrentState.m_Textures[i]);
|
||||
|
||||
}
|
||||
|
||||
m_bForce = false;
|
||||
}
|
||||
|
||||
@@ -141,15 +137,19 @@ void CStateManager::SetDefaultState()
|
||||
m_bScene = false;
|
||||
m_bForce = true;
|
||||
|
||||
D3DXMATRIX Identity;
|
||||
D3DXMatrixIdentity(&Identity);
|
||||
m_CurrentState_Copy = m_CurrentState;
|
||||
m_CopyState_Copy = m_CopyState;
|
||||
m_ChipState_Copy = m_ChipState;
|
||||
|
||||
SetTransform(D3DTS_WORLD, &Identity);
|
||||
SetTransform(D3DTS_VIEW, &Identity);
|
||||
SetTransform(D3DTS_PROJECTION, &Identity);
|
||||
D3DXMATRIX matIdentity;
|
||||
D3DXMatrixIdentity(&matIdentity);
|
||||
|
||||
D3DMATERIAL8 DefaultMat;
|
||||
ZeroMemory(&DefaultMat, sizeof(D3DMATERIAL8));
|
||||
SetTransform(D3DTS_WORLD, &matIdentity);
|
||||
SetTransform(D3DTS_VIEW, &matIdentity);
|
||||
SetTransform(D3DTS_PROJECTION, &matIdentity);
|
||||
|
||||
D3DMATERIAL9 DefaultMat;
|
||||
ZeroMemory(&DefaultMat, sizeof(D3DMATERIAL9));
|
||||
|
||||
DefaultMat.Diffuse.r = 1.0f;
|
||||
DefaultMat.Diffuse.g = 1.0f;
|
||||
@@ -176,25 +176,26 @@ void CStateManager::SetDefaultState()
|
||||
SetRenderState(D3DRS_AMBIENTMATERIALSOURCE, D3DMCS_MATERIAL);
|
||||
SetRenderState(D3DRS_EMISSIVEMATERIALSOURCE, D3DMCS_MATERIAL);
|
||||
|
||||
SetRenderState(D3DRS_LINEPATTERN, 0xFFFFFFFF);
|
||||
SetRenderState(D3DRS_LASTPIXEL, FALSE);
|
||||
//SetRenderState(D3DRS_LINEPATTERN, 0xFFFFFFFF);
|
||||
SetRenderState(D3DRS_LASTPIXEL, TRUE);
|
||||
SetRenderState(D3DRS_ALPHAREF, 1);
|
||||
SetRenderState(D3DRS_ALPHAFUNC, D3DCMP_GREATEREQUAL);
|
||||
SetRenderState(D3DRS_ZVISIBLE, FALSE);
|
||||
//SetRenderState(D3DRS_ZVISIBLE, FALSE);
|
||||
SetRenderState(D3DRS_FOGSTART, 0);
|
||||
SetRenderState(D3DRS_FOGEND, 0);
|
||||
SetRenderState(D3DRS_FOGDENSITY, 0);
|
||||
SetRenderState(D3DRS_EDGEANTIALIAS, FALSE);
|
||||
SetRenderState(D3DRS_ZBIAS, 0);
|
||||
//SetRenderState(D3DRS_EDGEANTIALIAS, TRUE);
|
||||
//SetRenderState(D3DRS_ZBIAS, 0);
|
||||
SetRenderState(D3DRS_STENCILWRITEMASK, 0xFFFFFFFF);
|
||||
SetRenderState(D3DRS_AMBIENT, 0x00000000);
|
||||
SetRenderState(D3DRS_LOCALVIEWER, FALSE);
|
||||
SetRenderState(D3DRS_LOCALVIEWER, TRUE);
|
||||
SetRenderState(D3DRS_NORMALIZENORMALS, FALSE);
|
||||
SetRenderState(D3DRS_VERTEXBLEND, D3DVBF_DISABLE);
|
||||
SetRenderState(D3DRS_CLIPPLANEENABLE, 0);
|
||||
SetRenderState(D3DRS_SOFTWAREVERTEXPROCESSING, FALSE);
|
||||
SetRenderState(D3DRS_MULTISAMPLEANTIALIAS, FALSE);
|
||||
SaveVertexProcessing(FALSE);
|
||||
SetRenderState(D3DRS_MULTISAMPLEANTIALIAS, TRUE);
|
||||
SetRenderState(D3DRS_MULTISAMPLEMASK, 0xFFFFFFFF);
|
||||
SetRenderState(D3DRS_PATCHEDGESTYLE, D3DPATCHEDGE_CONTINUOUS);
|
||||
SetRenderState(D3DRS_INDEXEDVERTEXBLENDENABLE, FALSE);
|
||||
SetRenderState(D3DRS_COLORWRITEENABLE, 0xFFFFFFFF);
|
||||
SetRenderState(D3DRS_FILLMODE, D3DFILL_SOLID);
|
||||
@@ -206,7 +207,7 @@ void CStateManager::SetDefaultState()
|
||||
SetRenderState(D3DRS_DESTBLEND, D3DBLEND_INVSRCALPHA);
|
||||
SetRenderState(D3DRS_FOGENABLE, FALSE);
|
||||
SetRenderState(D3DRS_FOGCOLOR, 0xFF000000);
|
||||
SetRenderState(D3DRS_FOGTABLEMODE, D3DFOG_NONE);
|
||||
SetRenderState(D3DRS_FOGTABLEMODE, D3DFOG_LINEAR);
|
||||
SetRenderState(D3DRS_FOGVERTEXMODE, D3DFOG_LINEAR);
|
||||
SetRenderState(D3DRS_RANGEFOGENABLE, FALSE);
|
||||
SetRenderState(D3DRS_ZENABLE, TRUE);
|
||||
@@ -293,54 +294,54 @@ void CStateManager::SetDefaultState()
|
||||
SetTextureStageState(6, D3DTSS_TEXCOORDINDEX, 6);
|
||||
SetTextureStageState(7, D3DTSS_TEXCOORDINDEX, 7);
|
||||
|
||||
SetTextureStageState(0, D3DTSS_MINFILTER, D3DTEXF_LINEAR);
|
||||
SetTextureStageState(0, D3DTSS_MAGFILTER, D3DTEXF_LINEAR);
|
||||
SetTextureStageState(0, D3DTSS_MIPFILTER, D3DTEXF_LINEAR);
|
||||
SetSamplerState(0, D3DSAMP_MINFILTER, D3DTEXF_LINEAR);
|
||||
SetSamplerState(0, D3DSAMP_MAGFILTER, D3DTEXF_LINEAR);
|
||||
SetSamplerState(0, D3DSAMP_MIPFILTER, D3DTEXF_LINEAR);
|
||||
|
||||
SetTextureStageState(1, D3DTSS_MINFILTER, D3DTEXF_LINEAR);
|
||||
SetTextureStageState(1, D3DTSS_MAGFILTER, D3DTEXF_LINEAR);
|
||||
SetTextureStageState(1, D3DTSS_MIPFILTER, D3DTEXF_LINEAR);
|
||||
SetSamplerState(1, D3DSAMP_MINFILTER, D3DTEXF_LINEAR);
|
||||
SetSamplerState(1, D3DSAMP_MAGFILTER, D3DTEXF_LINEAR);
|
||||
SetSamplerState(1, D3DSAMP_MIPFILTER, D3DTEXF_LINEAR);
|
||||
|
||||
SetTextureStageState(2, D3DTSS_MINFILTER, D3DTEXF_LINEAR);
|
||||
SetTextureStageState(2, D3DTSS_MAGFILTER, D3DTEXF_LINEAR);
|
||||
SetTextureStageState(2, D3DTSS_MIPFILTER, D3DTEXF_LINEAR);
|
||||
SetSamplerState(2, D3DSAMP_MINFILTER, D3DTEXF_LINEAR);
|
||||
SetSamplerState(2, D3DSAMP_MAGFILTER, D3DTEXF_LINEAR);
|
||||
SetSamplerState(2, D3DSAMP_MIPFILTER, D3DTEXF_LINEAR);
|
||||
|
||||
SetTextureStageState(3, D3DTSS_MINFILTER, D3DTEXF_LINEAR);
|
||||
SetTextureStageState(3, D3DTSS_MAGFILTER, D3DTEXF_LINEAR);
|
||||
SetTextureStageState(3, D3DTSS_MIPFILTER, D3DTEXF_LINEAR);
|
||||
SetSamplerState(3, D3DSAMP_MINFILTER, D3DTEXF_LINEAR);
|
||||
SetSamplerState(3, D3DSAMP_MAGFILTER, D3DTEXF_LINEAR);
|
||||
SetSamplerState(3, D3DSAMP_MIPFILTER, D3DTEXF_LINEAR);
|
||||
|
||||
SetTextureStageState(4, D3DTSS_MINFILTER, D3DTEXF_LINEAR);
|
||||
SetTextureStageState(4, D3DTSS_MAGFILTER, D3DTEXF_LINEAR);
|
||||
SetTextureStageState(4, D3DTSS_MIPFILTER, D3DTEXF_LINEAR);
|
||||
SetSamplerState(4, D3DSAMP_MINFILTER, D3DTEXF_LINEAR);
|
||||
SetSamplerState(4, D3DSAMP_MAGFILTER, D3DTEXF_LINEAR);
|
||||
SetSamplerState(4, D3DSAMP_MIPFILTER, D3DTEXF_LINEAR);
|
||||
|
||||
SetTextureStageState(5, D3DTSS_MINFILTER, D3DTEXF_LINEAR);
|
||||
SetTextureStageState(5, D3DTSS_MAGFILTER, D3DTEXF_LINEAR);
|
||||
SetTextureStageState(5, D3DTSS_MIPFILTER, D3DTEXF_LINEAR);
|
||||
SetSamplerState(5, D3DSAMP_MINFILTER, D3DTEXF_LINEAR);
|
||||
SetSamplerState(5, D3DSAMP_MAGFILTER, D3DTEXF_LINEAR);
|
||||
SetSamplerState(5, D3DSAMP_MIPFILTER, D3DTEXF_LINEAR);
|
||||
|
||||
SetTextureStageState(6, D3DTSS_MINFILTER, D3DTEXF_LINEAR);
|
||||
SetTextureStageState(6, D3DTSS_MAGFILTER, D3DTEXF_LINEAR);
|
||||
SetTextureStageState(6, D3DTSS_MIPFILTER, D3DTEXF_LINEAR);
|
||||
SetSamplerState(6, D3DSAMP_MINFILTER, D3DTEXF_LINEAR);
|
||||
SetSamplerState(6, D3DSAMP_MAGFILTER, D3DTEXF_LINEAR);
|
||||
SetSamplerState(6, D3DSAMP_MIPFILTER, D3DTEXF_LINEAR);
|
||||
|
||||
SetTextureStageState(7, D3DTSS_MINFILTER, D3DTEXF_LINEAR);
|
||||
SetTextureStageState(7, D3DTSS_MAGFILTER, D3DTEXF_LINEAR);
|
||||
SetTextureStageState(7, D3DTSS_MIPFILTER, D3DTEXF_LINEAR);
|
||||
SetSamplerState(7, D3DSAMP_MINFILTER, D3DTEXF_LINEAR);
|
||||
SetSamplerState(7, D3DSAMP_MAGFILTER, D3DTEXF_LINEAR);
|
||||
SetSamplerState(7, D3DSAMP_MIPFILTER, D3DTEXF_LINEAR);
|
||||
|
||||
SetTextureStageState(0, D3DTSS_ADDRESSU, D3DTADDRESS_WRAP);
|
||||
SetTextureStageState(0, D3DTSS_ADDRESSV, D3DTADDRESS_WRAP);
|
||||
SetTextureStageState(1, D3DTSS_ADDRESSU, D3DTADDRESS_WRAP);
|
||||
SetTextureStageState(1, D3DTSS_ADDRESSV, D3DTADDRESS_WRAP);
|
||||
SetTextureStageState(2, D3DTSS_ADDRESSU, D3DTADDRESS_WRAP);
|
||||
SetTextureStageState(2, D3DTSS_ADDRESSV, D3DTADDRESS_WRAP);
|
||||
SetTextureStageState(3, D3DTSS_ADDRESSU, D3DTADDRESS_WRAP);
|
||||
SetTextureStageState(3, D3DTSS_ADDRESSV, D3DTADDRESS_WRAP);
|
||||
SetTextureStageState(4, D3DTSS_ADDRESSU, D3DTADDRESS_WRAP);
|
||||
SetTextureStageState(4, D3DTSS_ADDRESSV, D3DTADDRESS_WRAP);
|
||||
SetTextureStageState(5, D3DTSS_ADDRESSU, D3DTADDRESS_WRAP);
|
||||
SetTextureStageState(5, D3DTSS_ADDRESSV, D3DTADDRESS_WRAP);
|
||||
SetTextureStageState(6, D3DTSS_ADDRESSU, D3DTADDRESS_WRAP);
|
||||
SetTextureStageState(6, D3DTSS_ADDRESSV, D3DTADDRESS_WRAP);
|
||||
SetTextureStageState(7, D3DTSS_ADDRESSU, D3DTADDRESS_WRAP);
|
||||
SetTextureStageState(7, D3DTSS_ADDRESSV, D3DTADDRESS_WRAP);
|
||||
SetSamplerState(0, D3DSAMP_ADDRESSU, D3DTADDRESS_WRAP);
|
||||
SetSamplerState(0, D3DSAMP_ADDRESSV, D3DTADDRESS_WRAP);
|
||||
SetSamplerState(1, D3DSAMP_ADDRESSU, D3DTADDRESS_WRAP);
|
||||
SetSamplerState(1, D3DSAMP_ADDRESSV, D3DTADDRESS_WRAP);
|
||||
SetSamplerState(2, D3DSAMP_ADDRESSU, D3DTADDRESS_WRAP);
|
||||
SetSamplerState(2, D3DSAMP_ADDRESSV, D3DTADDRESS_WRAP);
|
||||
SetSamplerState(3, D3DSAMP_ADDRESSU, D3DTADDRESS_WRAP);
|
||||
SetSamplerState(3, D3DSAMP_ADDRESSV, D3DTADDRESS_WRAP);
|
||||
SetSamplerState(4, D3DSAMP_ADDRESSU, D3DTADDRESS_WRAP);
|
||||
SetSamplerState(4, D3DSAMP_ADDRESSV, D3DTADDRESS_WRAP);
|
||||
SetSamplerState(5, D3DSAMP_ADDRESSU, D3DTADDRESS_WRAP);
|
||||
SetSamplerState(5, D3DSAMP_ADDRESSV, D3DTADDRESS_WRAP);
|
||||
SetSamplerState(6, D3DSAMP_ADDRESSU, D3DTADDRESS_WRAP);
|
||||
SetSamplerState(6, D3DSAMP_ADDRESSV, D3DTADDRESS_WRAP);
|
||||
SetSamplerState(7, D3DSAMP_ADDRESSU, D3DTADDRESS_WRAP);
|
||||
SetSamplerState(7, D3DSAMP_ADDRESSV, D3DTADDRESS_WRAP);
|
||||
|
||||
SetTextureStageState(0, D3DTSS_TEXTURETRANSFORMFLAGS, 0);
|
||||
SetTextureStageState(1, D3DTSS_TEXTURETRANSFORMFLAGS, 0);
|
||||
@@ -361,7 +362,7 @@ void CStateManager::SetDefaultState()
|
||||
SetTexture(7, NULL);
|
||||
|
||||
SetPixelShader(0);
|
||||
SetVertexShader(D3DFVF_XYZ);
|
||||
SetFVF(D3DFVF_XYZ);
|
||||
|
||||
D3DXVECTOR4 av4Null[STATEMANAGER_MAX_VCONSTANTS];
|
||||
memset(av4Null, 0, sizeof(av4Null));
|
||||
@@ -373,14 +374,23 @@ void CStateManager::SetDefaultState()
|
||||
#ifdef _DEBUG
|
||||
int i, j;
|
||||
for (i = 0; i < STATEMANAGER_MAX_RENDERSTATES; i++)
|
||||
{
|
||||
m_bRenderStateSavingFlag[i] = FALSE;
|
||||
}
|
||||
|
||||
for (j = 0; j < STATEMANAGER_MAX_TRANSFORMSTATES; j++)
|
||||
{
|
||||
m_bTransformSavingFlag[j] = FALSE;
|
||||
}
|
||||
|
||||
for (j = 0; j < STATEMANAGER_MAX_STAGES; ++j)
|
||||
{
|
||||
for (i = 0; i < STATEMANAGER_MAX_TEXTURESTATES; ++i)
|
||||
{
|
||||
m_bTextureStageStateSavingFlag[j][i] = FALSE;
|
||||
m_bSamplerStateSavingFlag[j][i] = FALSE;
|
||||
}
|
||||
}
|
||||
#endif _DEBUG
|
||||
}
|
||||
|
||||
@@ -390,7 +400,7 @@ void CStateManager::SaveMaterial()
|
||||
m_CopyState.m_D3DMaterial = m_CurrentState.m_D3DMaterial;
|
||||
}
|
||||
|
||||
void CStateManager::SaveMaterial(const D3DMATERIAL8 * pMaterial)
|
||||
void CStateManager::SaveMaterial(const D3DMATERIAL9* pMaterial)
|
||||
{
|
||||
// Check that we have set this up before, if not, the default is this.
|
||||
m_CopyState.m_D3DMaterial = m_CurrentState.m_D3DMaterial;
|
||||
@@ -402,13 +412,13 @@ void CStateManager::RestoreMaterial()
|
||||
SetMaterial(&m_CopyState.m_D3DMaterial);
|
||||
}
|
||||
|
||||
void CStateManager::SetMaterial(const D3DMATERIAL8 * pMaterial)
|
||||
void CStateManager::SetMaterial(const D3DMATERIAL9* pMaterial)
|
||||
{
|
||||
m_lpD3DDev->SetMaterial(pMaterial);
|
||||
m_CurrentState.m_D3DMaterial = *pMaterial;
|
||||
}
|
||||
|
||||
void CStateManager::GetMaterial(D3DMATERIAL8 * pMaterial)
|
||||
void CStateManager::GetMaterial(D3DMATERIAL9* pMaterial)
|
||||
{
|
||||
// Set the renderstate and remember it.
|
||||
*pMaterial = m_CurrentState.m_D3DMaterial;
|
||||
@@ -420,6 +430,27 @@ DWORD CStateManager::GetRenderState(D3DRENDERSTATETYPE Type)
|
||||
return m_CurrentState.m_RenderStates[Type];
|
||||
}
|
||||
|
||||
void CStateManager::StateManager_Capture()
|
||||
{
|
||||
m_CurrentState_Copy = m_CurrentState;
|
||||
m_CopyState_Copy = m_CopyState;
|
||||
m_ChipState_Copy = m_ChipState;
|
||||
m_DirtyStates_Copy = m_DirtyStates;
|
||||
}
|
||||
|
||||
void CStateManager::StateManager_Apply()
|
||||
{
|
||||
m_CurrentState = m_CurrentState_Copy;
|
||||
m_CopyState = m_CopyState_Copy;
|
||||
m_ChipState = m_ChipState_Copy;
|
||||
m_DirtyStates = m_DirtyStates_Copy;
|
||||
}
|
||||
|
||||
LPDIRECT3DDEVICE9 CStateManager::GetDevice()
|
||||
{
|
||||
return m_lpD3DDev;
|
||||
}
|
||||
|
||||
void CStateManager::SaveRenderState(D3DRENDERSTATETYPE Type, DWORD dwValue)
|
||||
{
|
||||
#ifdef _DEBUG
|
||||
@@ -459,13 +490,13 @@ void CStateManager::SetRenderState(D3DRENDERSTATETYPE Type, DWORD Value)
|
||||
m_CurrentState.m_RenderStates[Type] = Value;
|
||||
}
|
||||
|
||||
void CStateManager::GetRenderState(D3DRENDERSTATETYPE Type, DWORD * pdwValue)
|
||||
void CStateManager::GetRenderState(D3DRENDERSTATETYPE Type, DWORD* pdwValue)
|
||||
{
|
||||
*pdwValue = m_CurrentState.m_RenderStates[Type];
|
||||
}
|
||||
|
||||
// Textures
|
||||
void CStateManager::SaveTexture(DWORD dwStage, LPDIRECT3DBASETEXTURE8 pTexture)
|
||||
void CStateManager::SaveTexture(DWORD dwStage, LPDIRECT3DBASETEXTURE9 pTexture)
|
||||
{
|
||||
// Check that we have set this up before, if not, the default is this.
|
||||
m_CopyState.m_Textures[dwStage] = m_CurrentState.m_Textures[dwStage];
|
||||
@@ -477,7 +508,7 @@ void CStateManager::RestoreTexture(DWORD dwStage)
|
||||
SetTexture(dwStage, m_CopyState.m_Textures[dwStage]);
|
||||
}
|
||||
|
||||
void CStateManager::SetTexture(DWORD dwStage, LPDIRECT3DBASETEXTURE8 pTexture)
|
||||
void CStateManager::SetTexture(DWORD dwStage, LPDIRECT3DBASETEXTURE9 pTexture)
|
||||
{
|
||||
if (pTexture == m_CurrentState.m_Textures[dwStage])
|
||||
return;
|
||||
@@ -486,13 +517,13 @@ void CStateManager::SetTexture(DWORD dwStage, LPDIRECT3DBASETEXTURE8 pTexture)
|
||||
m_CurrentState.m_Textures[dwStage] = pTexture;
|
||||
}
|
||||
|
||||
void CStateManager::GetTexture(DWORD dwStage, LPDIRECT3DBASETEXTURE8 * ppTexture)
|
||||
void CStateManager::GetTexture(DWORD dwStage, LPDIRECT3DBASETEXTURE9* ppTexture)
|
||||
{
|
||||
*ppTexture = m_CurrentState.m_Textures[dwStage];
|
||||
}
|
||||
|
||||
// Texture stage states
|
||||
void CStateManager::SaveTextureStageState(DWORD dwStage,D3DTEXTURESTAGESTATETYPE Type, DWORD dwValue)
|
||||
void CStateManager::SaveTextureStageState(DWORD dwStage, D3DTEXTURESTAGESTATETYPE Type, DWORD dwValue)
|
||||
{
|
||||
// Check that we have set this up before, if not, the default is this.
|
||||
#ifdef _DEBUG
|
||||
@@ -529,13 +560,51 @@ void CStateManager::SetTextureStageState(DWORD dwStage, D3DTEXTURESTAGESTATETYPE
|
||||
m_CurrentState.m_TextureStates[dwStage][Type] = dwValue;
|
||||
}
|
||||
|
||||
void CStateManager::GetTextureStageState(DWORD dwStage, D3DTEXTURESTAGESTATETYPE Type, DWORD * pdwValue)
|
||||
void CStateManager::GetTextureStageState(DWORD dwStage, D3DTEXTURESTAGESTATETYPE Type, DWORD* pdwValue)
|
||||
{
|
||||
*pdwValue = m_CurrentState.m_TextureStates[dwStage][Type];
|
||||
}
|
||||
|
||||
// Sampler states
|
||||
void CStateManager::SaveSamplerState(DWORD dwStage, D3DSAMPLERSTATETYPE Type, DWORD dwValue)
|
||||
{
|
||||
#ifdef _DEBUG
|
||||
if (m_bSamplerStateSavingFlag[dwStage][Type])
|
||||
{
|
||||
Tracenf(" CStateManager::SaveTextureStageState - This texture stage state is already saved [%d, %d]\n", dwStage, Type);
|
||||
StateManager_Assert(!" This texture stage state is already saved!");
|
||||
}
|
||||
m_bSamplerStateSavingFlag[dwStage][Type] = TRUE;
|
||||
#endif _DEBUG
|
||||
m_CopyState.m_SamplerStates[dwStage][Type] = m_CurrentState.m_SamplerStates[dwStage][Type];
|
||||
SetSamplerState(dwStage, Type, dwValue);
|
||||
}
|
||||
void CStateManager::RestoreSamplerState(DWORD dwStage, D3DSAMPLERSTATETYPE Type)
|
||||
{
|
||||
#ifdef _DEBUG
|
||||
if (!m_bSamplerStateSavingFlag[dwStage][Type])
|
||||
{
|
||||
Tracenf(" CStateManager::RestoreTextureStageState - This texture stage state was not saved [%d, %d]\n", dwStage, Type);
|
||||
StateManager_Assert(!" This texture stage state was not saved!");
|
||||
}
|
||||
m_bSamplerStateSavingFlag[dwStage][Type] = FALSE;
|
||||
#endif _DEBUG
|
||||
SetSamplerState(dwStage, Type, m_CopyState.m_SamplerStates[dwStage][Type]);
|
||||
}
|
||||
void CStateManager::SetSamplerState(DWORD dwStage, D3DSAMPLERSTATETYPE Type, DWORD dwValue)
|
||||
{
|
||||
if (m_CurrentState.m_SamplerStates[dwStage][Type] == dwValue)
|
||||
return;
|
||||
m_lpD3DDev->SetSamplerState(dwStage, Type, dwValue);
|
||||
m_CurrentState.m_SamplerStates[dwStage][Type] = dwValue;
|
||||
}
|
||||
void CStateManager::GetSamplerState(DWORD dwStage, D3DSAMPLERSTATETYPE Type, DWORD* pdwValue)
|
||||
{
|
||||
*pdwValue = m_CurrentState.m_SamplerStates[dwStage][Type];
|
||||
}
|
||||
|
||||
// Vertex Shader
|
||||
void CStateManager::SaveVertexShader(DWORD dwShader)
|
||||
void CStateManager::SaveVertexShader(LPDIRECT3DVERTEXSHADER9 dwShader)
|
||||
{
|
||||
m_CopyState.m_dwVertexShader = m_CurrentState.m_dwVertexShader;
|
||||
SetVertexShader(dwShader);
|
||||
@@ -546,7 +615,7 @@ void CStateManager::RestoreVertexShader()
|
||||
SetVertexShader(m_CopyState.m_dwVertexShader);
|
||||
}
|
||||
|
||||
void CStateManager::SetVertexShader(DWORD dwShader)
|
||||
void CStateManager::SetVertexShader(LPDIRECT3DVERTEXSHADER9 dwShader)
|
||||
{
|
||||
if (m_CurrentState.m_dwVertexShader == dwShader)
|
||||
return;
|
||||
@@ -555,13 +624,71 @@ void CStateManager::SetVertexShader(DWORD dwShader)
|
||||
m_CurrentState.m_dwVertexShader = dwShader;
|
||||
}
|
||||
|
||||
void CStateManager::GetVertexShader(DWORD * pdwShader)
|
||||
void CStateManager::GetVertexShader(LPDIRECT3DVERTEXSHADER9* pdwShader)
|
||||
{
|
||||
*pdwShader = m_CurrentState.m_dwVertexShader;
|
||||
}
|
||||
|
||||
// Vertex Processing
|
||||
void CStateManager::SaveVertexProcessing(BOOL IsON)
|
||||
{
|
||||
if (m_CurrentState.m_bVertexProcessing = IsON)
|
||||
return;
|
||||
m_CopyState.m_bVertexProcessing = m_CurrentState.m_bVertexProcessing;
|
||||
m_lpD3DDev->SetSoftwareVertexProcessing(IsON);
|
||||
m_CurrentState.m_bVertexProcessing = IsON;
|
||||
}
|
||||
void CStateManager::RestoreVertexProcessing()
|
||||
{
|
||||
if (m_CopyState.m_bVertexProcessing = m_CurrentState.m_bVertexProcessing)
|
||||
return;
|
||||
m_lpD3DDev->SetSoftwareVertexProcessing(m_CopyState.m_bVertexProcessing);
|
||||
}
|
||||
// Vertex Declaration
|
||||
void CStateManager::SaveVertexDeclaration(LPDIRECT3DVERTEXDECLARATION9 dwShader)
|
||||
{
|
||||
m_CopyState.m_dwVertexDeclaration = m_CurrentState.m_dwVertexDeclaration;
|
||||
SetVertexDeclaration(dwShader);
|
||||
}
|
||||
void CStateManager::RestoreVertexDeclaration()
|
||||
{
|
||||
SetVertexDeclaration(m_CopyState.m_dwVertexDeclaration);
|
||||
}
|
||||
void CStateManager::SetVertexDeclaration(LPDIRECT3DVERTEXDECLARATION9 dwShader)
|
||||
{
|
||||
//if (m_CurrentState.m_dwVertexDeclaration == dwShader)
|
||||
// return;
|
||||
m_lpD3DDev->SetVertexDeclaration(dwShader);
|
||||
m_CurrentState.m_dwVertexDeclaration = dwShader;
|
||||
}
|
||||
void CStateManager::GetVertexDeclaration(LPDIRECT3DVERTEXDECLARATION9* pdwShader)
|
||||
{
|
||||
*pdwShader = m_CurrentState.m_dwVertexDeclaration;
|
||||
}
|
||||
// FVF
|
||||
void CStateManager::SaveFVF(DWORD dwShader)
|
||||
{
|
||||
m_CopyState.m_dwFVF = m_CurrentState.m_dwFVF;
|
||||
SetFVF(dwShader);
|
||||
}
|
||||
void CStateManager::RestoreFVF()
|
||||
{
|
||||
SetFVF(m_CopyState.m_dwFVF);
|
||||
}
|
||||
void CStateManager::SetFVF(DWORD dwShader)
|
||||
{
|
||||
//if (m_CurrentState.m_dwFVF == dwShader)
|
||||
// return;
|
||||
m_lpD3DDev->SetFVF(dwShader);
|
||||
m_CurrentState.m_dwFVF = dwShader;
|
||||
}
|
||||
void CStateManager::GetFVF(DWORD* pdwShader)
|
||||
{
|
||||
*pdwShader = m_CurrentState.m_dwFVF;
|
||||
}
|
||||
|
||||
// Pixel Shader
|
||||
void CStateManager::SavePixelShader(DWORD dwShader)
|
||||
void CStateManager::SavePixelShader(LPDIRECT3DPIXELSHADER9 dwShader)
|
||||
{
|
||||
m_CopyState.m_dwPixelShader = m_CurrentState.m_dwPixelShader;
|
||||
SetPixelShader(dwShader);
|
||||
@@ -572,7 +699,7 @@ void CStateManager::RestorePixelShader()
|
||||
SetPixelShader(m_CopyState.m_dwPixelShader);
|
||||
}
|
||||
|
||||
void CStateManager::SetPixelShader(DWORD dwShader)
|
||||
void CStateManager::SetPixelShader(LPDIRECT3DPIXELSHADER9 dwShader)
|
||||
{
|
||||
if (m_CurrentState.m_dwPixelShader == dwShader)
|
||||
return;
|
||||
@@ -581,14 +708,14 @@ void CStateManager::SetPixelShader(DWORD dwShader)
|
||||
m_CurrentState.m_dwPixelShader = dwShader;
|
||||
}
|
||||
|
||||
void CStateManager::GetPixelShader(DWORD * pdwShader)
|
||||
void CStateManager::GetPixelShader(LPDIRECT3DPIXELSHADER9* pdwShader)
|
||||
{
|
||||
*pdwShader = m_CurrentState.m_dwPixelShader;
|
||||
}
|
||||
|
||||
// *** These states are cached, but not protected from multiple sends of the same value.
|
||||
// Transform
|
||||
void CStateManager::SaveTransform(D3DTRANSFORMSTATETYPE Type, const D3DMATRIX* pMatrix)
|
||||
void CStateManager::SaveTransform(D3DTRANSFORMSTATETYPE Type, const D3DXMATRIX* pMatrix)
|
||||
{
|
||||
#ifdef _DEBUG
|
||||
if (m_bTransformSavingFlag[Type])
|
||||
@@ -600,7 +727,7 @@ void CStateManager::SaveTransform(D3DTRANSFORMSTATETYPE Type, const D3DMATRIX* p
|
||||
#endif _DEBUG
|
||||
|
||||
m_CopyState.m_Matrices[Type] = m_CurrentState.m_Matrices[Type];
|
||||
SetTransform(Type, (D3DXMATRIX *)pMatrix);
|
||||
SetTransform(Type, pMatrix);
|
||||
}
|
||||
|
||||
void CStateManager::RestoreTransform(D3DTRANSFORMSTATETYPE Type)
|
||||
@@ -618,7 +745,7 @@ void CStateManager::RestoreTransform(D3DTRANSFORMSTATETYPE Type)
|
||||
}
|
||||
|
||||
// Don't cache-check the transform. To much to do
|
||||
void CStateManager::SetTransform(D3DTRANSFORMSTATETYPE Type, const D3DMATRIX* pMatrix)
|
||||
void CStateManager::SetTransform(D3DTRANSFORMSTATETYPE Type, const D3DXMATRIX* pMatrix)
|
||||
{
|
||||
if (m_bScene)
|
||||
{
|
||||
@@ -626,19 +753,19 @@ void CStateManager::SetTransform(D3DTRANSFORMSTATETYPE Type, const D3DMATRIX* pM
|
||||
}
|
||||
else
|
||||
{
|
||||
assert(D3DTS_VIEW==Type || D3DTS_PROJECTION==Type || D3DTS_WORLD==Type);
|
||||
assert(D3DTS_VIEW == Type || D3DTS_PROJECTION == Type || D3DTS_WORLD == Type);
|
||||
}
|
||||
|
||||
m_CurrentState.m_Matrices[Type] = *pMatrix;
|
||||
}
|
||||
|
||||
void CStateManager::GetTransform(D3DTRANSFORMSTATETYPE Type, D3DMATRIX * pMatrix)
|
||||
void CStateManager::GetTransform(D3DTRANSFORMSTATETYPE Type, D3DXMATRIX* pMatrix)
|
||||
{
|
||||
*pMatrix = m_CurrentState.m_Matrices[Type];
|
||||
}
|
||||
|
||||
// SetVertexShaderConstant
|
||||
void CStateManager::SaveVertexShaderConstant(DWORD dwRegister,CONST void* pConstantData,DWORD dwConstantCount)
|
||||
void CStateManager::SaveVertexShaderConstant(DWORD dwRegister, CONST void* pConstantData, DWORD dwConstantCount)
|
||||
{
|
||||
DWORD i;
|
||||
|
||||
@@ -656,9 +783,9 @@ void CStateManager::RestoreVertexShaderConstant(DWORD dwRegister, DWORD dwConsta
|
||||
SetVertexShaderConstant(dwRegister, &m_CopyState.m_VertexShaderConstants[dwRegister], dwConstantCount);
|
||||
}
|
||||
|
||||
void CStateManager::SetVertexShaderConstant(DWORD dwRegister,CONST void* pConstantData,DWORD dwConstantCount)
|
||||
void CStateManager::SetVertexShaderConstant(DWORD dwRegister, CONST void* pConstantData, DWORD dwConstantCount)
|
||||
{
|
||||
m_lpD3DDev->SetVertexShaderConstant(dwRegister, pConstantData, dwConstantCount);
|
||||
m_lpD3DDev->SetVertexShaderConstantF(dwRegister, (const float*)pConstantData, dwConstantCount);
|
||||
|
||||
// Set the renderstate and remember it.
|
||||
for (DWORD i = 0; i < dwConstantCount; i++)
|
||||
@@ -669,7 +796,7 @@ void CStateManager::SetVertexShaderConstant(DWORD dwRegister,CONST void* pConsta
|
||||
}
|
||||
|
||||
// SetPixelShaderConstant
|
||||
void CStateManager::SavePixelShaderConstant(DWORD dwRegister,CONST void* pConstantData,DWORD dwConstantCount)
|
||||
void CStateManager::SavePixelShaderConstant(DWORD dwRegister, CONST void* pConstantData, DWORD dwConstantCount)
|
||||
{
|
||||
DWORD i;
|
||||
|
||||
@@ -687,9 +814,9 @@ void CStateManager::RestorePixelShaderConstant(DWORD dwRegister, DWORD dwConstan
|
||||
SetPixelShaderConstant(dwRegister, &m_CopyState.m_PixelShaderConstants[dwRegister], dwConstantCount);
|
||||
}
|
||||
|
||||
void CStateManager::SetPixelShaderConstant(DWORD dwRegister,CONST void* pConstantData,DWORD dwConstantCount)
|
||||
void CStateManager::SetPixelShaderConstant(DWORD dwRegister, CONST void* pConstantData, DWORD dwConstantCount)
|
||||
{
|
||||
m_lpD3DDev->SetPixelShaderConstant(dwRegister, pConstantData, dwConstantCount);
|
||||
m_lpD3DDev->SetVertexShaderConstantF(dwRegister, (const float*)pConstantData, dwConstantCount);
|
||||
|
||||
// Set the renderstate and remember it.
|
||||
for (DWORD i = 0; i < dwConstantCount; i++)
|
||||
@@ -699,7 +826,7 @@ void CStateManager::SetPixelShaderConstant(DWORD dwRegister,CONST void* pConstan
|
||||
}
|
||||
}
|
||||
|
||||
void CStateManager::SaveStreamSource(UINT StreamNumber, LPDIRECT3DVERTEXBUFFER8 pStreamData,UINT Stride)
|
||||
void CStateManager::SaveStreamSource(UINT StreamNumber, LPDIRECT3DVERTEXBUFFER9 pStreamData, UINT Stride)
|
||||
{
|
||||
// Check that we have set this up before, if not, the default is this.
|
||||
m_CopyState.m_StreamData[StreamNumber] = m_CurrentState.m_StreamData[StreamNumber];
|
||||
@@ -708,22 +835,22 @@ void CStateManager::SaveStreamSource(UINT StreamNumber, LPDIRECT3DVERTEXBUFFER8
|
||||
|
||||
void CStateManager::RestoreStreamSource(UINT StreamNumber)
|
||||
{
|
||||
SetStreamSource(StreamNumber,
|
||||
m_CopyState.m_StreamData[StreamNumber].m_lpStreamData,
|
||||
m_CopyState.m_StreamData[StreamNumber].m_Stride);
|
||||
SetStreamSource(StreamNumber,
|
||||
m_CopyState.m_StreamData[StreamNumber].m_lpStreamData,
|
||||
m_CopyState.m_StreamData[StreamNumber].m_Stride);
|
||||
}
|
||||
|
||||
void CStateManager::SetStreamSource(UINT StreamNumber, LPDIRECT3DVERTEXBUFFER8 pStreamData, UINT Stride)
|
||||
void CStateManager::SetStreamSource(UINT StreamNumber, LPDIRECT3DVERTEXBUFFER9 pStreamData, UINT Stride)
|
||||
{
|
||||
CStreamData kStreamData(pStreamData, Stride);
|
||||
if (m_CurrentState.m_StreamData[StreamNumber] == kStreamData)
|
||||
return;
|
||||
return;
|
||||
|
||||
m_lpD3DDev->SetStreamSource(StreamNumber, pStreamData, Stride);
|
||||
m_lpD3DDev->SetStreamSource(StreamNumber, pStreamData, 0, Stride);
|
||||
m_CurrentState.m_StreamData[StreamNumber] = kStreamData;
|
||||
}
|
||||
|
||||
void CStateManager::SaveIndices(LPDIRECT3DINDEXBUFFER8 pIndexData, UINT BaseVertexIndex)
|
||||
void CStateManager::SaveIndices(LPDIRECT3DINDEXBUFFER9 pIndexData, UINT BaseVertexIndex)
|
||||
{
|
||||
m_CopyState.m_IndexData = m_CurrentState.m_IndexData;
|
||||
SetIndices(pIndexData, BaseVertexIndex);
|
||||
@@ -734,36 +861,65 @@ void CStateManager::RestoreIndices()
|
||||
SetIndices(m_CopyState.m_IndexData.m_lpIndexData, m_CopyState.m_IndexData.m_BaseVertexIndex);
|
||||
}
|
||||
|
||||
void CStateManager::SetIndices(LPDIRECT3DINDEXBUFFER8 pIndexData, UINT BaseVertexIndex)
|
||||
void CStateManager::SetIndices(LPDIRECT3DINDEXBUFFER9 pIndexData, UINT BaseVertexIndex)
|
||||
{
|
||||
CIndexData kIndexData(pIndexData, BaseVertexIndex);
|
||||
|
||||
if (m_CurrentState.m_IndexData == kIndexData)
|
||||
return;
|
||||
|
||||
m_lpD3DDev->SetIndices(pIndexData, BaseVertexIndex);
|
||||
|
||||
m_lpD3DDev->SetIndices(pIndexData);
|
||||
m_CurrentState.m_IndexData = kIndexData;
|
||||
}
|
||||
|
||||
HRESULT CStateManager::DrawPrimitive(D3DPRIMITIVETYPE PrimitiveType, UINT StartVertex, UINT PrimitiveCount)
|
||||
{
|
||||
#ifdef _DEBUG
|
||||
++m_iDrawCallCount;
|
||||
#endif
|
||||
|
||||
return (m_lpD3DDev->DrawPrimitive(PrimitiveType, StartVertex, PrimitiveCount));
|
||||
}
|
||||
|
||||
HRESULT CStateManager::DrawPrimitiveUP(D3DPRIMITIVETYPE PrimitiveType, UINT PrimitiveCount, const void* pVertexStreamZeroData, UINT VertexStreamZeroStride)
|
||||
{
|
||||
#ifdef _DEBUG
|
||||
++m_iDrawCallCount;
|
||||
#endif
|
||||
|
||||
m_CurrentState.m_StreamData[0] = NULL;
|
||||
return (m_lpD3DDev->DrawPrimitiveUP(PrimitiveType, PrimitiveCount, pVertexStreamZeroData, VertexStreamZeroStride));
|
||||
}
|
||||
|
||||
HRESULT CStateManager::DrawIndexedPrimitive(D3DPRIMITIVETYPE PrimitiveType, UINT minIndex, UINT NumVertices, UINT startIndex, UINT primCount)
|
||||
{
|
||||
return (m_lpD3DDev->DrawIndexedPrimitive(PrimitiveType, minIndex, NumVertices, startIndex, primCount));
|
||||
#ifdef _DEBUG
|
||||
++m_iDrawCallCount;
|
||||
#endif
|
||||
|
||||
return (m_lpD3DDev->DrawIndexedPrimitive(PrimitiveType, minIndex, 0, NumVertices, startIndex, primCount));
|
||||
}
|
||||
|
||||
HRESULT CStateManager::DrawIndexedPrimitiveUP(D3DPRIMITIVETYPE PrimitiveType, UINT MinVertexIndex, UINT NumVertexIndices, UINT PrimitiveCount, CONST void * pIndexData, D3DFORMAT IndexDataFormat, CONST void * pVertexStreamZeroData, UINT VertexStreamZeroStride)
|
||||
HRESULT CStateManager::DrawIndexedPrimitiveUP(D3DPRIMITIVETYPE PrimitiveType, UINT MinVertexIndex, UINT NumVertexIndices, UINT PrimitiveCount, CONST void* pIndexData, D3DFORMAT IndexDataFormat, CONST void* pVertexStreamZeroData, UINT VertexStreamZeroStride)
|
||||
{
|
||||
#ifdef _DEBUG
|
||||
++m_iDrawCallCount;
|
||||
#endif
|
||||
|
||||
m_CurrentState.m_IndexData = NULL;
|
||||
m_CurrentState.m_StreamData[0] = NULL;
|
||||
return (m_lpD3DDev->DrawIndexedPrimitiveUP(PrimitiveType, MinVertexIndex, NumVertexIndices, PrimitiveCount, pIndexData, IndexDataFormat, pVertexStreamZeroData, VertexStreamZeroStride));
|
||||
}
|
||||
|
||||
#ifdef _DEBUG
|
||||
void CStateManager::ResetDrawCallCounter()
|
||||
{
|
||||
m_iLastDrawCallCount = m_iDrawCallCount;
|
||||
m_iDrawCallCount = 0;
|
||||
}
|
||||
|
||||
int CStateManager::GetDrawCallCount() const
|
||||
{
|
||||
return m_iLastDrawCallCount;
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -6,11 +6,11 @@
|
||||
kind. NVIDIA makes no guarantee of its fitness for a particular purpose and is
|
||||
not liable under any circumstances for any damages or loss whatsoever arising
|
||||
from the use or inability to use this file or items derived from it.
|
||||
|
||||
Comments:
|
||||
|
||||
A simple class to manage rendering state. Created as a singleton.
|
||||
Create it as a static global, or with new. It doesn't matter as long as it is created
|
||||
|
||||
Comments:
|
||||
|
||||
A simple class to manage rendering state. Created as a singleton.
|
||||
Create it as a static global, or with new. It doesn't matter as long as it is created
|
||||
before you use the CStateManager::GetSingleton() API to get a reference to it.
|
||||
|
||||
Call it with STATEMANAGER.SetRenderState(...)
|
||||
@@ -22,7 +22,7 @@
|
||||
There are two levels of caching:
|
||||
- All Sets/Saves/Restores are tracked for redundancy. This reduces the size of the batch to
|
||||
be flushed
|
||||
- The flush function is called before rendering, and only copies state that is
|
||||
- The flush function is called before rendering, and only copies state that is
|
||||
different from the current chip state.
|
||||
|
||||
If you get an assert it is probably because an API call failed.
|
||||
@@ -35,14 +35,14 @@
|
||||
The state manager holds a reference to the d3d device.
|
||||
|
||||
- cmaughan@nvidia.com
|
||||
|
||||
|
||||
******************************************************************************/
|
||||
|
||||
#ifndef __CSTATEMANAGER_H
|
||||
#define __CSTATEMANAGER_H
|
||||
|
||||
#include <d3d8.h>
|
||||
#include <d3dx8.h>
|
||||
#include <d3d9.h>
|
||||
#include <d3dx9.h>
|
||||
|
||||
#include <vector>
|
||||
|
||||
@@ -64,38 +64,40 @@ static const DWORD STATEMANAGER_MAX_PCONSTANTS = 8;
|
||||
static const DWORD STATEMANAGER_MAX_TRANSFORMSTATES = 300; // World1 lives way up there...
|
||||
static const DWORD STATEMANAGER_MAX_STREAMS = 16;
|
||||
|
||||
static DWORD gs_DefaultRenderStates[STATEMANAGER_MAX_RENDERSTATES];
|
||||
|
||||
class CStreamData
|
||||
{
|
||||
public:
|
||||
CStreamData(LPDIRECT3DVERTEXBUFFER8 pStreamData = NULL, UINT Stride = 0) : m_lpStreamData(pStreamData), m_Stride(Stride)
|
||||
{
|
||||
}
|
||||
public:
|
||||
CStreamData(LPDIRECT3DVERTEXBUFFER9 pStreamData = NULL, UINT Stride = 0) : m_lpStreamData(pStreamData), m_Stride(Stride)
|
||||
{
|
||||
}
|
||||
|
||||
bool operator == (const CStreamData& rhs) const
|
||||
{
|
||||
return ((m_lpStreamData == rhs.m_lpStreamData) && (m_Stride == rhs.m_Stride));
|
||||
}
|
||||
bool operator == (const CStreamData& rhs) const
|
||||
{
|
||||
return ((m_lpStreamData == rhs.m_lpStreamData) && (m_Stride == rhs.m_Stride));
|
||||
}
|
||||
|
||||
LPDIRECT3DVERTEXBUFFER8 m_lpStreamData;
|
||||
UINT m_Stride;
|
||||
LPDIRECT3DVERTEXBUFFER9 m_lpStreamData;
|
||||
UINT m_Stride;
|
||||
};
|
||||
|
||||
class CIndexData
|
||||
{
|
||||
public:
|
||||
CIndexData(LPDIRECT3DINDEXBUFFER8 pIndexData = NULL, UINT BaseVertexIndex = 0)
|
||||
: m_lpIndexData(pIndexData),
|
||||
public:
|
||||
CIndexData(LPDIRECT3DINDEXBUFFER9 pIndexData = NULL, UINT BaseVertexIndex = 0)
|
||||
: m_lpIndexData(pIndexData),
|
||||
m_BaseVertexIndex(BaseVertexIndex)
|
||||
{
|
||||
}
|
||||
{
|
||||
}
|
||||
|
||||
bool operator == (const CIndexData& rhs) const
|
||||
{
|
||||
return ((m_lpIndexData == rhs.m_lpIndexData) && (m_BaseVertexIndex == rhs.m_BaseVertexIndex));
|
||||
}
|
||||
bool operator == (const CIndexData& rhs) const
|
||||
{
|
||||
return ((m_lpIndexData == rhs.m_lpIndexData) && (m_BaseVertexIndex == rhs.m_BaseVertexIndex));
|
||||
}
|
||||
|
||||
LPDIRECT3DINDEXBUFFER8 m_lpIndexData;
|
||||
UINT m_BaseVertexIndex;
|
||||
LPDIRECT3DINDEXBUFFER9 m_lpIndexData;
|
||||
UINT m_BaseVertexIndex;
|
||||
};
|
||||
|
||||
// State types managed by the class
|
||||
@@ -116,223 +118,271 @@ typedef enum eStateType
|
||||
|
||||
class CStateID
|
||||
{
|
||||
public:
|
||||
CStateID(eStateType Type, DWORD dwValue0 = 0, DWORD dwValue1 = 0)
|
||||
: m_Type(Type),
|
||||
public:
|
||||
CStateID(eStateType Type, DWORD dwValue0 = 0, DWORD dwValue1 = 0)
|
||||
: m_Type(Type),
|
||||
m_dwValue0(dwValue0),
|
||||
m_dwValue1(dwValue1)
|
||||
{
|
||||
}
|
||||
{
|
||||
}
|
||||
|
||||
CStateID(eStateType Type, DWORD dwStage, D3DTEXTURESTAGESTATETYPE StageType)
|
||||
: m_Type(Type),
|
||||
CStateID(eStateType Type, DWORD dwStage, D3DTEXTURESTAGESTATETYPE StageType)
|
||||
: m_Type(Type),
|
||||
m_dwStage(dwStage),
|
||||
m_TextureStageStateType(StageType)
|
||||
{
|
||||
}
|
||||
{
|
||||
}
|
||||
|
||||
CStateID(eStateType Type, D3DRENDERSTATETYPE RenderType)
|
||||
: m_Type(Type),
|
||||
CStateID(eStateType Type, D3DRENDERSTATETYPE RenderType)
|
||||
: m_Type(Type),
|
||||
m_RenderStateType(RenderType)
|
||||
{
|
||||
}
|
||||
{
|
||||
}
|
||||
|
||||
eStateType m_Type;
|
||||
eStateType m_Type;
|
||||
|
||||
union
|
||||
{
|
||||
DWORD m_dwValue0;
|
||||
DWORD m_dwStage;
|
||||
D3DRENDERSTATETYPE m_RenderStateType;
|
||||
D3DTRANSFORMSTATETYPE m_TransformStateType;
|
||||
};
|
||||
union
|
||||
{
|
||||
DWORD m_dwValue0;
|
||||
DWORD m_dwStage;
|
||||
D3DRENDERSTATETYPE m_RenderStateType;
|
||||
D3DTRANSFORMSTATETYPE m_TransformStateType;
|
||||
};
|
||||
|
||||
union
|
||||
{
|
||||
DWORD m_dwValue1;
|
||||
D3DTEXTURESTAGESTATETYPE m_TextureStageStateType;
|
||||
};
|
||||
union
|
||||
{
|
||||
DWORD m_dwValue1;
|
||||
D3DTEXTURESTAGESTATETYPE m_TextureStageStateType;
|
||||
};
|
||||
};
|
||||
|
||||
typedef std::vector<CStateID> TStateID;
|
||||
|
||||
class CStateManagerState
|
||||
{
|
||||
public:
|
||||
CStateManagerState()
|
||||
{
|
||||
}
|
||||
public:
|
||||
CStateManagerState()
|
||||
{
|
||||
}
|
||||
|
||||
void ResetState()
|
||||
{
|
||||
DWORD i, y;
|
||||
void ResetState()
|
||||
{
|
||||
DWORD i, y;
|
||||
|
||||
for (i = 0; i < STATEMANAGER_MAX_RENDERSTATES; i++)
|
||||
m_RenderStates[i] = 0x7FFFFFFF;
|
||||
for (i = 0; i < STATEMANAGER_MAX_RENDERSTATES; i++)
|
||||
m_RenderStates[i] = gs_DefaultRenderStates[i];
|
||||
|
||||
for (i = 0; i < STATEMANAGER_MAX_STAGES; i++)
|
||||
for (y = 0; y < STATEMANAGER_MAX_TEXTURESTATES; y++)
|
||||
m_TextureStates[i][y] = 0x7FFFFFFF;
|
||||
for (i = 0; i < STATEMANAGER_MAX_STAGES; i++)
|
||||
for (y = 0; y < STATEMANAGER_MAX_TEXTURESTATES; y++)
|
||||
m_TextureStates[i][y] = 0x7FFFFFFF;
|
||||
|
||||
for (i = 0; i < STATEMANAGER_MAX_STREAMS; i++)
|
||||
m_StreamData[i] = CStreamData();
|
||||
for (i = 0; i < STATEMANAGER_MAX_STREAMS; i++)
|
||||
m_StreamData[i] = CStreamData();
|
||||
|
||||
m_IndexData = CIndexData();
|
||||
m_IndexData = CIndexData();
|
||||
|
||||
for (i = 0; i < STATEMANAGER_MAX_STAGES; i++)
|
||||
m_Textures[i] = NULL;
|
||||
for (i = 0; i < STATEMANAGER_MAX_STAGES; i++)
|
||||
m_Textures[i] = NULL;
|
||||
|
||||
// Matrices and constants are not cached, just restored. It's silly to check all the
|
||||
// data elements (by which time the driver could have been sent them).
|
||||
for (i = 0; i < STATEMANAGER_MAX_TRANSFORMSTATES; i++)
|
||||
D3DXMatrixIdentity(&m_Matrices[i]);
|
||||
// Matrices and constants are not cached, just restored. It's silly to check all the
|
||||
// data elements (by which time the driver could have been sent them).
|
||||
for (i = 0; i < STATEMANAGER_MAX_TRANSFORMSTATES; i++)
|
||||
D3DXMatrixIdentity(&m_Matrices[i]);
|
||||
|
||||
for (i = 0; i < STATEMANAGER_MAX_VCONSTANTS; i++)
|
||||
m_VertexShaderConstants[i] = D3DXVECTOR4(0.0f, 0.0f, 0.0f, 0.0f);
|
||||
for (i = 0; i < STATEMANAGER_MAX_VCONSTANTS; i++)
|
||||
m_VertexShaderConstants[i] = D3DXVECTOR4(0, 0, 0, 0);
|
||||
|
||||
for (i = 0; i < STATEMANAGER_MAX_PCONSTANTS; i++)
|
||||
m_PixelShaderConstants[i] = D3DXVECTOR4(0.0f, 0.0f, 0.0f, 0.0f);
|
||||
for (i = 0; i < STATEMANAGER_MAX_PCONSTANTS; i++)
|
||||
m_PixelShaderConstants[i] = D3DXVECTOR4(0, 0, 0, 0);
|
||||
|
||||
m_dwPixelShader = 0;
|
||||
m_dwVertexShader = D3DFVF_XYZ;
|
||||
m_dwPixelShader = 0;
|
||||
m_dwVertexShader = 0;
|
||||
m_dwVertexDeclaration = 0;
|
||||
m_dwFVF = D3DFVF_XYZ;
|
||||
m_bVertexProcessing = FALSE;
|
||||
}
|
||||
|
||||
ZeroMemory(&m_Matrices, sizeof(D3DXMATRIX) * STATEMANAGER_MAX_TRANSFORMSTATES);
|
||||
}
|
||||
// Renderstates
|
||||
DWORD m_RenderStates[STATEMANAGER_MAX_RENDERSTATES];
|
||||
|
||||
// Renderstates
|
||||
DWORD m_RenderStates[STATEMANAGER_MAX_RENDERSTATES];
|
||||
// Texture stage states
|
||||
DWORD m_TextureStates[STATEMANAGER_MAX_STAGES][STATEMANAGER_MAX_TEXTURESTATES];
|
||||
DWORD m_SamplerStates[STATEMANAGER_MAX_STAGES][STATEMANAGER_MAX_TEXTURESTATES];
|
||||
|
||||
// Texture stage states
|
||||
DWORD m_TextureStates[STATEMANAGER_MAX_STAGES][STATEMANAGER_MAX_TEXTURESTATES];
|
||||
// Vertex shader constants
|
||||
D3DXVECTOR4 m_VertexShaderConstants[STATEMANAGER_MAX_VCONSTANTS];
|
||||
|
||||
// Vertex shader constants
|
||||
D3DXVECTOR4 m_VertexShaderConstants[STATEMANAGER_MAX_VCONSTANTS];
|
||||
// Pixel shader constants
|
||||
D3DXVECTOR4 m_PixelShaderConstants[STATEMANAGER_MAX_PCONSTANTS];
|
||||
|
||||
// Pixel shader constants
|
||||
D3DXVECTOR4 m_PixelShaderConstants[STATEMANAGER_MAX_PCONSTANTS];
|
||||
// Textures
|
||||
LPDIRECT3DBASETEXTURE9 m_Textures[STATEMANAGER_MAX_STAGES];
|
||||
|
||||
// Textures
|
||||
LPDIRECT3DBASETEXTURE8 m_Textures[STATEMANAGER_MAX_STAGES];
|
||||
// Shaders
|
||||
LPDIRECT3DPIXELSHADER9 m_dwPixelShader;
|
||||
LPDIRECT3DVERTEXSHADER9 m_dwVertexShader;
|
||||
LPDIRECT3DVERTEXDECLARATION9 m_dwVertexDeclaration;
|
||||
DWORD m_dwFVF;
|
||||
|
||||
// Shaders
|
||||
DWORD m_dwPixelShader;
|
||||
DWORD m_dwVertexShader;
|
||||
D3DXMATRIX m_Matrices[STATEMANAGER_MAX_TRANSFORMSTATES];
|
||||
|
||||
D3DXMATRIX m_Matrices[STATEMANAGER_MAX_TRANSFORMSTATES];
|
||||
D3DMATERIAL9 m_D3DMaterial;
|
||||
|
||||
D3DMATERIAL8 m_D3DMaterial;
|
||||
CStreamData m_StreamData[STATEMANAGER_MAX_STREAMS];
|
||||
CIndexData m_IndexData;
|
||||
|
||||
CStreamData m_StreamData[STATEMANAGER_MAX_STREAMS];
|
||||
CIndexData m_IndexData;
|
||||
BOOL m_bVertexProcessing;
|
||||
};
|
||||
|
||||
class CStateManager : public CSingleton<CStateManager>
|
||||
{
|
||||
public:
|
||||
CStateManager(LPDIRECT3DDEVICE8 lpDevice);
|
||||
virtual ~CStateManager();
|
||||
public:
|
||||
CStateManager(LPDIRECT3DDEVICE9 lpDevice);
|
||||
virtual ~CStateManager();
|
||||
|
||||
void SetDefaultState();
|
||||
void Restore();
|
||||
void SetDefaultState();
|
||||
void Restore();
|
||||
|
||||
bool BeginScene();
|
||||
void EndScene();
|
||||
|
||||
// Material
|
||||
void SaveMaterial();
|
||||
void SaveMaterial(const D3DMATERIAL8 * pMaterial);
|
||||
void RestoreMaterial();
|
||||
void SetMaterial(const D3DMATERIAL8 * pMaterial);
|
||||
void GetMaterial(D3DMATERIAL8 * pMaterial);
|
||||
bool BeginScene();
|
||||
void EndScene();
|
||||
|
||||
void SetLight(DWORD index, CONST D3DLIGHT8* pLight);
|
||||
void GetLight(DWORD index, D3DLIGHT8* pLight);
|
||||
// Material
|
||||
void SaveMaterial();
|
||||
void SaveMaterial(const D3DMATERIAL9* pMaterial);
|
||||
void RestoreMaterial();
|
||||
void SetMaterial(const D3DMATERIAL9* pMaterial);
|
||||
void GetMaterial(D3DMATERIAL9* pMaterial);
|
||||
|
||||
// Renderstates
|
||||
void SaveRenderState(D3DRENDERSTATETYPE Type, DWORD dwValue);
|
||||
void RestoreRenderState(D3DRENDERSTATETYPE Type);
|
||||
void SetRenderState(D3DRENDERSTATETYPE Type, DWORD Value);
|
||||
void GetRenderState(D3DRENDERSTATETYPE Type, DWORD * pdwValue);
|
||||
void SetLight(DWORD index, CONST D3DLIGHT9* pLight);
|
||||
void GetLight(DWORD index, D3DLIGHT9* pLight);
|
||||
|
||||
// Textures
|
||||
void SaveTexture(DWORD dwStage, LPDIRECT3DBASETEXTURE8 pTexture);
|
||||
void RestoreTexture(DWORD dwStage);
|
||||
void SetTexture(DWORD dwStage, LPDIRECT3DBASETEXTURE8 pTexture);
|
||||
void GetTexture(DWORD dwStage, LPDIRECT3DBASETEXTURE8 * ppTexture);
|
||||
// Renderstates
|
||||
void SaveRenderState(D3DRENDERSTATETYPE Type, DWORD dwValue);
|
||||
void RestoreRenderState(D3DRENDERSTATETYPE Type);
|
||||
void SetRenderState(D3DRENDERSTATETYPE Type, DWORD Value);
|
||||
void GetRenderState(D3DRENDERSTATETYPE Type, DWORD* pdwValue);
|
||||
|
||||
// Texture stage states
|
||||
void SaveTextureStageState(DWORD dwStage, D3DTEXTURESTAGESTATETYPE Type, DWORD dwValue);
|
||||
void RestoreTextureStageState(DWORD dwStage, D3DTEXTURESTAGESTATETYPE Type);
|
||||
void SetTextureStageState(DWORD dwStage, D3DTEXTURESTAGESTATETYPE Type, DWORD dwValue);
|
||||
void GetTextureStageState(DWORD dwStage, D3DTEXTURESTAGESTATETYPE Type, DWORD * pdwValue);
|
||||
void SetBestFiltering(DWORD dwStage); // if possible set anisotropy filtering, or use trilinear
|
||||
// Textures
|
||||
void SaveTexture(DWORD dwStage, LPDIRECT3DBASETEXTURE9 pTexture);
|
||||
void RestoreTexture(DWORD dwStage);
|
||||
void SetTexture(DWORD dwStage, LPDIRECT3DBASETEXTURE9 pTexture);
|
||||
void GetTexture(DWORD dwStage, LPDIRECT3DBASETEXTURE9* ppTexture);
|
||||
|
||||
// Vertex Shader
|
||||
void SaveVertexShader(DWORD dwShader);
|
||||
void RestoreVertexShader();
|
||||
void SetVertexShader(DWORD dwShader);
|
||||
void GetVertexShader(DWORD * pdwShader);
|
||||
// Texture stage states
|
||||
void SaveTextureStageState(DWORD dwStage, D3DTEXTURESTAGESTATETYPE Type, DWORD dwValue);
|
||||
void RestoreTextureStageState(DWORD dwStage, D3DTEXTURESTAGESTATETYPE Type);
|
||||
void SetTextureStageState(DWORD dwStage, D3DTEXTURESTAGESTATETYPE Type, DWORD dwValue);
|
||||
void GetTextureStageState(DWORD dwStage, D3DTEXTURESTAGESTATETYPE Type, DWORD* pdwValue);
|
||||
void SetBestFiltering(DWORD dwStage); // if possible set anisotropy filtering, or use trilinear
|
||||
|
||||
// Pixel Shader
|
||||
void SavePixelShader(DWORD dwShader);
|
||||
void RestorePixelShader();
|
||||
void SetPixelShader(DWORD dwShader);
|
||||
void GetPixelShader(DWORD * pdwShader);
|
||||
// Sampler states
|
||||
void SaveSamplerState(DWORD dwStage, D3DSAMPLERSTATETYPE Type, DWORD dwValue);
|
||||
void RestoreSamplerState(DWORD dwStage, D3DSAMPLERSTATETYPE Type);
|
||||
void SetSamplerState(DWORD dwStage, D3DSAMPLERSTATETYPE Type, DWORD dwValue);
|
||||
void GetSamplerState(DWORD dwStage, D3DSAMPLERSTATETYPE Type, DWORD* pdwValue);
|
||||
|
||||
// *** These states are cached, but not protected from multiple sends of the same value.
|
||||
// Transform
|
||||
void SaveTransform(D3DTRANSFORMSTATETYPE Transform, const D3DMATRIX* pMatrix);
|
||||
void RestoreTransform(D3DTRANSFORMSTATETYPE Transform);
|
||||
// Vertex Shader
|
||||
void SaveVertexShader(LPDIRECT3DVERTEXSHADER9 dwShader);
|
||||
void RestoreVertexShader();
|
||||
void SetVertexShader(LPDIRECT3DVERTEXSHADER9 dwShader);
|
||||
void GetVertexShader(LPDIRECT3DVERTEXSHADER9* pdwShader);
|
||||
|
||||
// Don't cache-check the transform. To much to do
|
||||
void SetTransform(D3DTRANSFORMSTATETYPE Type, const D3DMATRIX* pMatrix);
|
||||
void GetTransform(D3DTRANSFORMSTATETYPE Type, D3DMATRIX * pMatrix);
|
||||
// Vertex Declaration
|
||||
void SaveVertexDeclaration(LPDIRECT3DVERTEXDECLARATION9 dwShader);
|
||||
void RestoreVertexDeclaration();
|
||||
void SetVertexDeclaration(LPDIRECT3DVERTEXDECLARATION9 dwShader);
|
||||
void GetVertexDeclaration(LPDIRECT3DVERTEXDECLARATION9* pdwShader);
|
||||
|
||||
// SetVertexShaderConstant
|
||||
void SaveVertexShaderConstant(DWORD dwRegister, CONST void* pConstantData, DWORD dwConstantCount);
|
||||
void RestoreVertexShaderConstant(DWORD dwRegister, DWORD dwConstantCount);
|
||||
void SetVertexShaderConstant(DWORD dwRegister, CONST void* pConstantData, DWORD dwConstantCount);
|
||||
// FVF
|
||||
void SaveFVF(DWORD dwShader);
|
||||
void RestoreFVF();
|
||||
void SetFVF(DWORD dwShader);
|
||||
void GetFVF(DWORD* pdwShader);
|
||||
|
||||
// SetPixelShaderConstant
|
||||
void SavePixelShaderConstant(DWORD dwRegister, CONST void* pConstantData, DWORD dwConstantCount);
|
||||
void RestorePixelShaderConstant(DWORD dwRegister, DWORD dwConstantCount);
|
||||
void SetPixelShaderConstant(DWORD dwRegister, CONST void* pConstantData, DWORD dwConstantCount);
|
||||
// Pixel Shader
|
||||
void SavePixelShader(LPDIRECT3DPIXELSHADER9 dwShader);
|
||||
void RestorePixelShader();
|
||||
void SetPixelShader(LPDIRECT3DPIXELSHADER9 dwShader);
|
||||
void GetPixelShader(LPDIRECT3DPIXELSHADER9* pdwShader);
|
||||
|
||||
void SaveStreamSource(UINT StreamNumber, LPDIRECT3DVERTEXBUFFER8 pStreamData, UINT Stride);
|
||||
void RestoreStreamSource(UINT StreamNumber);
|
||||
void SetStreamSource(UINT StreamNumber, LPDIRECT3DVERTEXBUFFER8 pStreamData, UINT Stride);
|
||||
// *** These states are cached, but not protected from multiple sends of the same value.
|
||||
// Transform
|
||||
void SaveTransform(D3DTRANSFORMSTATETYPE Transform, const D3DXMATRIX* pMatrix);
|
||||
void RestoreTransform(D3DTRANSFORMSTATETYPE Transform);
|
||||
|
||||
void SaveIndices(LPDIRECT3DINDEXBUFFER8 pIndexData, UINT BaseVertexIndex);
|
||||
void RestoreIndices();
|
||||
void SetIndices(LPDIRECT3DINDEXBUFFER8 pIndexData,UINT BaseVertexIndex);
|
||||
|
||||
HRESULT DrawPrimitive(D3DPRIMITIVETYPE PrimitiveType, UINT StartVertex, UINT PrimitiveCount);
|
||||
HRESULT DrawPrimitiveUP(D3DPRIMITIVETYPE PrimitiveType, UINT PrimitiveCount, const void* pVertexStreamZeroData, UINT VertexStreamZeroStride);
|
||||
HRESULT DrawIndexedPrimitive(D3DPRIMITIVETYPE PrimitiveType, UINT minIndex, UINT NumVertices, UINT startIndex, UINT primCount);
|
||||
HRESULT DrawIndexedPrimitiveUP(D3DPRIMITIVETYPE PrimitiveType, UINT MinVertexIndex, UINT NumVertexIndices, UINT PrimitiveCount, CONST void * pIndexData, D3DFORMAT IndexDataFormat, CONST void * pVertexStreamZeroData, UINT VertexStreamZeroStride);
|
||||
// VertexProcessing
|
||||
void SaveVertexProcessing(BOOL IsON);
|
||||
void RestoreVertexProcessing();
|
||||
|
||||
// Codes For Debug
|
||||
DWORD GetRenderState(D3DRENDERSTATETYPE Type);
|
||||
// Don't cache-check the transform. To much to do
|
||||
void SetTransform(D3DTRANSFORMSTATETYPE Type, const D3DXMATRIX* pMatrix);
|
||||
void GetTransform(D3DTRANSFORMSTATETYPE Type, D3DXMATRIX* pMatrix);
|
||||
|
||||
private:
|
||||
void SetDevice(LPDIRECT3DDEVICE8 lpDevice);
|
||||
// SetVertexShaderConstant
|
||||
void SaveVertexShaderConstant(DWORD dwRegister, CONST void* pConstantData, DWORD dwConstantCount);
|
||||
void RestoreVertexShaderConstant(DWORD dwRegister, DWORD dwConstantCount);
|
||||
void SetVertexShaderConstant(DWORD dwRegister, CONST void* pConstantData, DWORD dwConstantCount);
|
||||
|
||||
private:
|
||||
CStateManagerState m_ChipState;
|
||||
CStateManagerState m_CurrentState;
|
||||
CStateManagerState m_CopyState;
|
||||
TStateID m_DirtyStates;
|
||||
bool m_bForce;
|
||||
bool m_bScene;
|
||||
DWORD m_dwBestMinFilter;
|
||||
DWORD m_dwBestMagFilter;
|
||||
LPDIRECT3DDEVICE8 m_lpD3DDev;
|
||||
// SetPixelShaderConstant
|
||||
void SavePixelShaderConstant(DWORD dwRegister, CONST void* pConstantData, DWORD dwConstantCount);
|
||||
void RestorePixelShaderConstant(DWORD dwRegister, DWORD dwConstantCount);
|
||||
void SetPixelShaderConstant(DWORD dwRegister, CONST void* pConstantData, DWORD dwConstantCount);
|
||||
|
||||
void SaveStreamSource(UINT StreamNumber, LPDIRECT3DVERTEXBUFFER9 pStreamData, UINT Stride);
|
||||
void RestoreStreamSource(UINT StreamNumber);
|
||||
void SetStreamSource(UINT StreamNumber, LPDIRECT3DVERTEXBUFFER9 pStreamData, UINT Stride);
|
||||
|
||||
void SaveIndices(LPDIRECT3DINDEXBUFFER9 pIndexData, UINT BaseVertexIndex);
|
||||
void RestoreIndices();
|
||||
void SetIndices(LPDIRECT3DINDEXBUFFER9 pIndexData, UINT BaseVertexIndex);
|
||||
|
||||
HRESULT DrawPrimitive(D3DPRIMITIVETYPE PrimitiveType, UINT StartVertex, UINT PrimitiveCount);
|
||||
HRESULT DrawPrimitiveUP(D3DPRIMITIVETYPE PrimitiveType, UINT PrimitiveCount, const void* pVertexStreamZeroData, UINT VertexStreamZeroStride);
|
||||
HRESULT DrawIndexedPrimitive(D3DPRIMITIVETYPE PrimitiveType, UINT minIndex, UINT NumVertices, UINT startIndex, UINT primCount);
|
||||
HRESULT DrawIndexedPrimitiveUP(D3DPRIMITIVETYPE PrimitiveType, UINT MinVertexIndex, UINT NumVertexIndices, UINT PrimitiveCount, CONST void* pIndexData, D3DFORMAT IndexDataFormat, CONST void* pVertexStreamZeroData, UINT VertexStreamZeroStride);
|
||||
|
||||
// Codes For Debug
|
||||
DWORD GetRenderState(D3DRENDERSTATETYPE Type);
|
||||
|
||||
void StateManager_Capture();
|
||||
void StateManager_Apply();
|
||||
|
||||
LPDIRECT3DDEVICE9 GetDevice();
|
||||
|
||||
#ifdef _DEBUG
|
||||
// Saving Flag
|
||||
BOOL m_bRenderStateSavingFlag[STATEMANAGER_MAX_RENDERSTATES];
|
||||
BOOL m_bTextureStageStateSavingFlag[STATEMANAGER_MAX_STAGES][STATEMANAGER_MAX_TEXTURESTATES];
|
||||
BOOL m_bTransformSavingFlag[STATEMANAGER_MAX_TRANSFORMSTATES];
|
||||
void ResetDrawCallCounter();
|
||||
int GetDrawCallCount() const;
|
||||
#endif
|
||||
|
||||
private:
|
||||
void SetDevice(LPDIRECT3DDEVICE9 lpDevice);
|
||||
|
||||
private:
|
||||
CStateManagerState m_ChipState;
|
||||
CStateManagerState m_CurrentState;
|
||||
CStateManagerState m_CopyState;
|
||||
TStateID m_DirtyStates;
|
||||
|
||||
bool m_bForce;
|
||||
bool m_bScene;
|
||||
DWORD m_dwBestMinFilter;
|
||||
DWORD m_dwBestMagFilter;
|
||||
LPDIRECT3DDEVICE9 m_lpD3DDev;
|
||||
|
||||
CStateManagerState m_ChipState_Copy;
|
||||
CStateManagerState m_CurrentState_Copy;
|
||||
CStateManagerState m_CopyState_Copy;
|
||||
TStateID m_DirtyStates_Copy;
|
||||
|
||||
#ifdef _DEBUG
|
||||
// Saving Flag
|
||||
BOOL m_bRenderStateSavingFlag[STATEMANAGER_MAX_RENDERSTATES];
|
||||
BOOL m_bTextureStageStateSavingFlag[STATEMANAGER_MAX_STAGES][STATEMANAGER_MAX_TEXTURESTATES];
|
||||
BOOL m_bSamplerStateSavingFlag[STATEMANAGER_MAX_STAGES][STATEMANAGER_MAX_TEXTURESTATES];
|
||||
BOOL m_bTransformSavingFlag[STATEMANAGER_MAX_TRANSFORMSTATES];
|
||||
|
||||
int m_iDrawCallCount;
|
||||
int m_iLastDrawCallCount;
|
||||
#endif _DEBUG
|
||||
};
|
||||
|
||||
|
||||
@@ -20,8 +20,8 @@
|
||||
#pragma warning(disable:4201 4512 4238 4239)
|
||||
#endif
|
||||
|
||||
#include <d3d8.h>
|
||||
#include <d3dx8.h>
|
||||
#include <d3d9.h>
|
||||
#include <d3dx9.h>
|
||||
|
||||
#define DIRECTINPUT_VERSION 0x0800
|
||||
|
||||
@@ -37,13 +37,9 @@
|
||||
#include <direct.h>
|
||||
#include <malloc.h>
|
||||
|
||||
#pragma comment(lib, "winmm.lib")
|
||||
#pragma comment(lib, "d3d8.lib")
|
||||
#pragma comment(lib, "d3dx8.lib")
|
||||
|
||||
#include "../eterBase/StdAfx.h"
|
||||
#include "../eterBase/Debug.h"
|
||||
#include "../eterLocale/CodePageId.h"
|
||||
#include "EterBase/StdAfx.h"
|
||||
#include "EterBase/Debug.h"
|
||||
#include "EterLocale/CodePageId.h"
|
||||
|
||||
#ifndef VC_EXTRALEAN
|
||||
#include <winsock.h>
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
#include <map>
|
||||
#include <vector>
|
||||
|
||||
#include <d3dx8.h>
|
||||
#include <d3dx9.h>
|
||||
|
||||
template<typename T>
|
||||
class CTransitor
|
||||
|
||||
@@ -9,7 +9,7 @@ void CPythonGraphic::Destroy()
|
||||
{
|
||||
}
|
||||
|
||||
LPDIRECT3D8 CPythonGraphic::GetD3D()
|
||||
LPDIRECT3D9 CPythonGraphic::GetD3D()
|
||||
{
|
||||
return ms_lpd3d;
|
||||
}
|
||||
@@ -25,9 +25,9 @@ void CPythonGraphic::SetInterfaceRenderState()
|
||||
STATEMANAGER.SetTransform(D3DTS_VIEW, &ms_matIdentity);
|
||||
STATEMANAGER.SetTransform(D3DTS_WORLD, &ms_matIdentity);
|
||||
|
||||
STATEMANAGER.SetTextureStageState(0, D3DTSS_MINFILTER, D3DTEXF_NONE);
|
||||
STATEMANAGER.SetTextureStageState(0, D3DTSS_MAGFILTER, D3DTEXF_NONE);
|
||||
STATEMANAGER.SetTextureStageState(0, D3DTSS_MIPFILTER, D3DTEXF_NONE);
|
||||
STATEMANAGER.SetSamplerState(0, D3DSAMP_MINFILTER, D3DTEXF_NONE);
|
||||
STATEMANAGER.SetSamplerState(0, D3DSAMP_MAGFILTER, D3DTEXF_NONE);
|
||||
STATEMANAGER.SetSamplerState(0, D3DSAMP_MIPFILTER, D3DTEXF_NONE);
|
||||
|
||||
STATEMANAGER.SetRenderState(D3DRS_ALPHABLENDENABLE, TRUE);
|
||||
STATEMANAGER.SetRenderState(D3DRS_SRCBLEND, D3DBLEND_SRCALPHA);
|
||||
@@ -41,9 +41,9 @@ void CPythonGraphic::SetInterfaceRenderState()
|
||||
|
||||
void CPythonGraphic::SetGameRenderState()
|
||||
{
|
||||
STATEMANAGER.SetTextureStageState(0, D3DTSS_MINFILTER, D3DTEXF_LINEAR);
|
||||
STATEMANAGER.SetTextureStageState(0, D3DTSS_MAGFILTER, D3DTEXF_LINEAR);
|
||||
STATEMANAGER.SetTextureStageState(0, D3DTSS_MIPFILTER, D3DTEXF_LINEAR);
|
||||
STATEMANAGER.SetSamplerState(0, D3DSAMP_MINFILTER, D3DTEXF_ANISOTROPIC);
|
||||
STATEMANAGER.SetSamplerState(0, D3DSAMP_MAGFILTER, D3DTEXF_ANISOTROPIC);
|
||||
STATEMANAGER.SetSamplerState(0, D3DSAMP_MIPFILTER, D3DTEXF_LINEAR);
|
||||
|
||||
STATEMANAGER.SetRenderState(D3DRS_ALPHABLENDENABLE, FALSE);
|
||||
STATEMANAGER.SetRenderState(D3DRS_LIGHTING, TRUE);
|
||||
@@ -57,13 +57,13 @@ void CPythonGraphic::SetCursorPosition(int x, int y)
|
||||
void CPythonGraphic::SetOmniLight()
|
||||
{
|
||||
// Set up a material
|
||||
D3DMATERIAL8 Material;
|
||||
D3DMATERIAL9 Material;
|
||||
Material.Ambient = D3DXCOLOR(0.3f, 0.3f, 0.3f, 1.0f);
|
||||
Material.Diffuse = D3DXCOLOR(1.0f, 1.0f, 1.0f, 1.0f);
|
||||
Material.Emissive = D3DXCOLOR(0.1f, 0.1f, 0.1f, 1.0f);
|
||||
STATEMANAGER.SetMaterial(&Material);
|
||||
|
||||
D3DLIGHT8 Light;
|
||||
D3DLIGHT9 Light;
|
||||
Light.Type = D3DLIGHT_SPOT;
|
||||
Light.Position = D3DXVECTOR3(50.0f, 150.0f, 350.0f);
|
||||
Light.Direction = D3DXVECTOR3(-0.15f, -0.3f, -0.9f);
|
||||
@@ -98,7 +98,7 @@ void CPythonGraphic::SetViewport(float fx, float fy, float fWidth, float fHeight
|
||||
{
|
||||
ms_lpd3dDevice->GetViewport(&m_backupViewport);
|
||||
|
||||
D3DVIEWPORT8 ViewPort;
|
||||
D3DVIEWPORT9 ViewPort;
|
||||
ViewPort.X = fx;
|
||||
ViewPort.Y = fy;
|
||||
ViewPort.Width = fWidth;
|
||||
@@ -123,7 +123,7 @@ void CPythonGraphic::RestoreViewport()
|
||||
|
||||
void CPythonGraphic::SetGamma(float fGammaFactor)
|
||||
{
|
||||
D3DCAPS8 d3dCaps;
|
||||
D3DCAPS9 d3dCaps;
|
||||
D3DGAMMARAMP NewRamp;
|
||||
int ui, val;
|
||||
|
||||
@@ -151,7 +151,7 @@ void CPythonGraphic::SetGamma(float fGammaFactor)
|
||||
NewRamp.blue[i] = (WORD) (val | (32768 * ui));
|
||||
}
|
||||
|
||||
ms_lpd3dDevice->SetGammaRamp(D3DSGR_NO_CALIBRATION, &NewRamp);
|
||||
ms_lpd3dDevice->SetGammaRamp(0, D3DSGR_NO_CALIBRATION, &NewRamp);
|
||||
}
|
||||
|
||||
void GenScreenShotTag(const char* src, DWORD crc32, char* leaf, size_t leafLen)
|
||||
@@ -172,10 +172,10 @@ bool CPythonGraphic::SaveJPEG(const char * pszFileName, LPBYTE pbyBuffer, UINT u
|
||||
bool CPythonGraphic::SaveScreenShot(const char * c_pszFileName)
|
||||
{
|
||||
HRESULT hr;
|
||||
LPDIRECT3DSURFACE8 lpSurface;
|
||||
LPDIRECT3DSURFACE9 lpSurface;
|
||||
D3DSURFACE_DESC stSurfaceDesc;
|
||||
|
||||
if (FAILED(hr = ms_lpd3dDevice->GetBackBuffer(0, D3DBACKBUFFER_TYPE_MONO, &lpSurface)))
|
||||
if (FAILED(hr = ms_lpd3dDevice->GetBackBuffer(0, 0, D3DBACKBUFFER_TYPE_MONO, &lpSurface)))
|
||||
{
|
||||
TraceError("Failed to get back buffer (0x%08x)", hr);
|
||||
return false;
|
||||
@@ -481,7 +481,7 @@ void CPythonGraphic::RenderAlphaImage(CGraphicImageInstance* pImageInstance, flo
|
||||
vertices[3].diffuse = DiffuseColor2;
|
||||
vertices[3].texCoord = TTextureCoordinate(eu, ev);
|
||||
|
||||
STATEMANAGER.SetVertexShader(ms_pntVS);
|
||||
STATEMANAGER.SetVertexDeclaration(ms_pntVS);
|
||||
// 2004.11.18.myevan.DrawIndexPrimitiveUP -> DynamicVertexBuffer
|
||||
CGraphicBase::SetDefaultIndexBuffer(DEFAULT_IB_FILL_RECT);
|
||||
if (CGraphicBase::SetPDTStream(vertices, 4))
|
||||
@@ -563,7 +563,7 @@ void CPythonGraphic::RenderCoolTimeBox(float fxCenter, float fyCenter, float fRa
|
||||
STATEMANAGER.SaveTextureStageState(0, D3DTSS_ALPHAOP, D3DTOP_SELECTARG1);
|
||||
STATEMANAGER.SetTexture(0, NULL);
|
||||
STATEMANAGER.SetTexture(1, NULL);
|
||||
STATEMANAGER.SetVertexShader(D3DFVF_XYZ|D3DFVF_DIFFUSE|D3DFVF_TEX1);
|
||||
STATEMANAGER.SetFVF(D3DFVF_XYZ|D3DFVF_DIFFUSE|D3DFVF_TEX1);
|
||||
STATEMANAGER.DrawPrimitive(D3DPT_TRIANGLEFAN, 0, iTriCount);
|
||||
STATEMANAGER.RestoreTextureStageState(0, D3DTSS_COLORARG1);
|
||||
STATEMANAGER.RestoreTextureStageState(0, D3DTSS_COLOROP);
|
||||
@@ -613,7 +613,7 @@ CPythonGraphic::CPythonGraphic()
|
||||
m_lightColor = GetColor(1.0f, 1.0f, 1.0f);
|
||||
m_darkColor = GetColor(0.0f, 0.0f, 0.0f);
|
||||
|
||||
memset(&m_backupViewport, 0, sizeof(D3DVIEWPORT8));
|
||||
memset(&m_backupViewport, 0, sizeof(D3DVIEWPORT9));
|
||||
|
||||
m_fOrthoDepth = 1000.0f;
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@ class CPythonGraphic : public CScreen, public CSingleton<CPythonGraphic>
|
||||
void PushState();
|
||||
void PopState();
|
||||
|
||||
LPDIRECT3D8 GetD3D();
|
||||
LPDIRECT3D9 GetD3D();
|
||||
|
||||
float GetOrthoDepth();
|
||||
void SetInterfaceRenderState();
|
||||
@@ -62,7 +62,7 @@ class CPythonGraphic : public CScreen, public CSingleton<CPythonGraphic>
|
||||
|
||||
CCullingManager m_CullingManager;
|
||||
|
||||
D3DVIEWPORT8 m_backupViewport;
|
||||
D3DVIEWPORT9 m_backupViewport;
|
||||
|
||||
float m_fOrthoDepth;
|
||||
};
|
||||
@@ -32,7 +32,7 @@ void CActorInstance::SetMaterialAlpha(DWORD dwAlpha)
|
||||
|
||||
void CActorInstance::OnRender()
|
||||
{
|
||||
D3DMATERIAL8 kMtrl;
|
||||
D3DMATERIAL9 kMtrl;
|
||||
STATEMANAGER.GetMaterial(&kMtrl);
|
||||
|
||||
kMtrl.Diffuse=D3DXCOLOR(m_dwMtrlColor);
|
||||
|
||||
@@ -757,7 +757,7 @@ void CTerrain::RAW_GenerateSplat(bool bBGLoading)
|
||||
}
|
||||
}
|
||||
|
||||
LPDIRECT3DTEXTURE8 CTerrain::AddTexture32(BYTE byImageNum, BYTE * pbyImage, long lTextureWidth, long lTextureHeight)
|
||||
LPDIRECT3DTEXTURE9 CTerrain::AddTexture32(BYTE byImageNum, BYTE * pbyImage, long lTextureWidth, long lTextureHeight)
|
||||
{
|
||||
assert(NULL==m_lpAlphaTexture[byImageNum]);
|
||||
|
||||
@@ -777,13 +777,13 @@ LPDIRECT3DTEXTURE8 CTerrain::AddTexture32(BYTE byImageNum, BYTE * pbyImage, long
|
||||
|
||||
bool bResizedAndSuccess = false;
|
||||
|
||||
IDirect3DTexture8* pkTex=NULL;
|
||||
IDirect3DTexture9* pkTex=NULL;
|
||||
|
||||
UINT uiNewWidth = 256;
|
||||
UINT uiNewHeight = 256;
|
||||
hr = ms_lpd3dDevice->CreateTexture(
|
||||
uiNewWidth, uiNewHeight, 5, 0,
|
||||
format, D3DPOOL_MANAGED, &pkTex);
|
||||
format, D3DPOOL_MANAGED, &pkTex, nullptr);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
TraceError("CTerrain::AddTexture32 - CreateTexture Error");
|
||||
@@ -1153,7 +1153,7 @@ void CTerrain::AllocateMarkedSplats(BYTE * pbyAlphaMap)
|
||||
|
||||
do
|
||||
{
|
||||
hr = ms_lpd3dDevice->CreateTexture(ATTRMAP_XSIZE, ATTRMAP_YSIZE, 1, 0, D3DFMT_A8R8G8B8, D3DPOOL_MANAGED, &m_lpMarkedTexture);
|
||||
hr = ms_lpd3dDevice->CreateTexture(ATTRMAP_XSIZE, ATTRMAP_YSIZE, 1, 0, D3DFMT_A8R8G8B8, D3DPOOL_MANAGED, &m_lpMarkedTexture, nullptr);
|
||||
} while(FAILED(hr));
|
||||
|
||||
D3DLOCKED_RECT d3dlr;
|
||||
|
||||
@@ -78,7 +78,7 @@ class CTerrain : public CTerrainImpl, public CGraphicBase
|
||||
|
||||
// MiniMap
|
||||
void LoadMiniMapTexture(const char * c_pszFileName);
|
||||
inline LPDIRECT3DTEXTURE8 GetMiniMapTexture() { return m_lpMiniMapTexture; }
|
||||
inline LPDIRECT3DTEXTURE9 GetMiniMapTexture() { return m_lpMiniMapTexture; }
|
||||
|
||||
// Marked Area
|
||||
BOOL IsMarked() { return m_bMarked; }
|
||||
@@ -107,7 +107,7 @@ class CTerrain : public CTerrainImpl, public CGraphicBase
|
||||
void RAW_DeallocateSplats(bool bBGLoading = false);
|
||||
virtual void RAW_CountTiles();
|
||||
|
||||
LPDIRECT3DTEXTURE8 AddTexture32(BYTE byImageNum, BYTE * pbyImage, long lTextureWidth, long lTextureHeight);
|
||||
LPDIRECT3DTEXTURE9 AddTexture32(BYTE byImageNum, BYTE * pbyImage, long lTextureWidth, long lTextureHeight);
|
||||
void PutImage32(BYTE * pbySrc, BYTE * pbyDst, long src_pitch, long dst_pitch, long lTextureWidth, long lTextureHeight, bool bResize = false);
|
||||
void PutImage16(BYTE * pbySrc, BYTE * pbyDst, long src_pitch, long dst_pitch, long lTextureWidth, long lTextureHeight, bool bResize = false);
|
||||
|
||||
@@ -126,7 +126,7 @@ class CTerrain : public CTerrainImpl, public CGraphicBase
|
||||
|
||||
//MiniMap
|
||||
CGraphicImageInstance m_MiniMapGraphicImageInstance;
|
||||
LPDIRECT3DTEXTURE8 m_lpMiniMapTexture;
|
||||
LPDIRECT3DTEXTURE9 m_lpMiniMapTexture;
|
||||
|
||||
|
||||
// Owner COutdoorMap poineter
|
||||
@@ -142,7 +142,7 @@ class CTerrain : public CTerrainImpl, public CGraphicBase
|
||||
|
||||
BOOL m_bMarked;
|
||||
TTerrainSplatPatch m_MarkedSplatPatch;
|
||||
LPDIRECT3DTEXTURE8 m_lpMarkedTexture;
|
||||
LPDIRECT3DTEXTURE9 m_lpMarkedTexture;
|
||||
|
||||
public:
|
||||
CTerrainPatch * GetTerrainPatchPtr(BYTE byPatchNumX, BYTE byPatchNumY);
|
||||
|
||||
@@ -14,8 +14,8 @@ class CDungeonModelInstance : public CGrannyModelInstance
|
||||
if (IsEmpty())
|
||||
return;
|
||||
|
||||
STATEMANAGER.SetVertexShader(ms_pnt2VS);
|
||||
LPDIRECT3DVERTEXBUFFER8 lpd3dRigidPNTVtxBuf = m_pModel->GetPNTD3DVertexBuffer();
|
||||
STATEMANAGER.SetVertexDeclaration(ms_pnt2VS);
|
||||
LPDIRECT3DVERTEXBUFFER9 lpd3dRigidPNTVtxBuf = m_pModel->GetPNTD3DVertexBuffer();
|
||||
if (lpd3dRigidPNTVtxBuf)
|
||||
{
|
||||
STATEMANAGER.SetStreamSource(0, lpd3dRigidPNTVtxBuf, sizeof(TPNT2Vertex));
|
||||
@@ -36,8 +36,8 @@ class CDungeonModelInstance : public CGrannyModelInstance
|
||||
STATEMANAGER.SaveRenderState(D3DRS_SRCBLEND, D3DBLEND_ZERO);
|
||||
STATEMANAGER.SaveRenderState(D3DRS_DESTBLEND, D3DBLEND_SRCCOLOR);
|
||||
|
||||
STATEMANAGER.SetVertexShader(ms_pnt2VS);
|
||||
LPDIRECT3DVERTEXBUFFER8 lpd3dRigidPNTVtxBuf = m_pModel->GetPNTD3DVertexBuffer();
|
||||
STATEMANAGER.SetVertexDeclaration(ms_pnt2VS);
|
||||
LPDIRECT3DVERTEXBUFFER9 lpd3dRigidPNTVtxBuf = m_pModel->GetPNTD3DVertexBuffer();
|
||||
if (lpd3dRigidPNTVtxBuf)
|
||||
{
|
||||
STATEMANAGER.SetStreamSource(0, lpd3dRigidPNTVtxBuf, sizeof(TPNT2Vertex));
|
||||
|
||||
@@ -130,7 +130,7 @@ void CFlyTrace::Render()
|
||||
D3DXMatrixIdentity(&matWorld);
|
||||
|
||||
STATEMANAGER.SaveTransform(D3DTS_WORLD, &matWorld);
|
||||
STATEMANAGER.SaveVertexShader(D3DFVF_XYZ | D3DFVF_DIFFUSE | D3DFVF_TEX1);
|
||||
STATEMANAGER.SetFVF(D3DFVF_XYZ | D3DFVF_DIFFUSE | D3DFVF_TEX1);
|
||||
STATEMANAGER.SaveRenderState(D3DRS_CULLMODE, D3DCULL_NONE);
|
||||
|
||||
STATEMANAGER.SaveRenderState(D3DRS_ALPHABLENDENABLE, TRUE);
|
||||
|
||||
@@ -23,7 +23,7 @@ class CFlyTrace : public CScreen
|
||||
typedef std::deque<TTimePosition> TTimePositionDeque;
|
||||
|
||||
//CGraphicImageInstance m_ImageInstance;
|
||||
//LPDIRECT3DTEXTURE8 m_lpTexture;
|
||||
//LPDIRECT3DTEXTURE9 m_lpTexture;
|
||||
|
||||
bool m_bRectShape;
|
||||
DWORD m_dwColor;
|
||||
|
||||
@@ -24,7 +24,7 @@ class CMapBase : public CScreen
|
||||
virtual float GetHeight(float fx, float fy) = 0;
|
||||
virtual void OnBeginEnvironment() = 0; // 렌더링 할 때 불려지며 여기서 Environment에 관련 있는 것들을 셋팅 한다.
|
||||
|
||||
virtual void ApplyLight(DWORD dwVersion, const D3DLIGHT8& c_rkLight) = 0;
|
||||
virtual void ApplyLight(DWORD dwVersion, const D3DLIGHT9& c_rkLight) = 0;
|
||||
|
||||
protected:
|
||||
virtual void OnRender() = 0;
|
||||
|
||||
@@ -254,7 +254,7 @@ void CMapOutdoor::OnBeginEnvironment()
|
||||
mc_pEnvironmentData->GetFogFarDistance()
|
||||
);
|
||||
|
||||
const D3DLIGHT8& c_rkLight = mc_pEnvironmentData->DirLights[ENV_DIRLIGHT_CHARACTER];
|
||||
const D3DLIGHT9& c_rkLight = mc_pEnvironmentData->DirLights[ENV_DIRLIGHT_CHARACTER];
|
||||
rkForest.SetLight(
|
||||
(const float *)&c_rkLight.Direction,
|
||||
(const float *)&c_rkLight.Ambient,
|
||||
@@ -1070,8 +1070,8 @@ void CMapOutdoor::SaveAlphaFogOperation()
|
||||
STATEMANAGER.SetTextureStageState(1, D3DTSS_ALPHAOP, D3DTOP_MODULATE);
|
||||
STATEMANAGER.SetTextureStageState(1, D3DTSS_TEXTURETRANSFORMFLAGS, D3DTTFF_COUNT2);
|
||||
STATEMANAGER.SetTextureStageState(1, D3DTSS_TEXCOORDINDEX, D3DTSS_TCI_CAMERASPACEPOSITION);
|
||||
STATEMANAGER.SetTextureStageState(1, D3DTSS_ADDRESSU, D3DTADDRESS_CLAMP);
|
||||
STATEMANAGER.SetTextureStageState(1, D3DTSS_ADDRESSV, D3DTADDRESS_CLAMP);
|
||||
STATEMANAGER.SetSamplerState(1, D3DSAMP_ADDRESSU, D3DTADDRESS_CLAMP);
|
||||
STATEMANAGER.SetSamplerState(1, D3DSAMP_ADDRESSV, D3DTADDRESS_CLAMP);
|
||||
|
||||
STATEMANAGER.SetTransform(D3DTS_TEXTURE1, &m_matAlphaFogTexture);
|
||||
STATEMANAGER.SaveRenderState(D3DRS_ALPHABLENDENABLE, TRUE);
|
||||
|
||||
@@ -100,7 +100,7 @@ class CMapOutdoor : public CMapBase
|
||||
|
||||
bool LoadSetting(const char * c_szFileName);
|
||||
|
||||
void ApplyLight(DWORD dwVersion, const D3DLIGHT8& c_rkLight);
|
||||
void ApplyLight(DWORD dwVersion, const D3DLIGHT9& c_rkLight);
|
||||
void SetEnvironmentScreenFilter();
|
||||
void SetEnvironmentSkyBox();
|
||||
void SetEnvironmentLensFlare();
|
||||
@@ -431,16 +431,16 @@ class CMapOutdoor : public CMapBase
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// Character Shadow
|
||||
LPDIRECT3DTEXTURE8 m_lpCharacterShadowMapTexture;
|
||||
LPDIRECT3DSURFACE8 m_lpCharacterShadowMapRenderTargetSurface;
|
||||
LPDIRECT3DSURFACE8 m_lpCharacterShadowMapDepthSurface;
|
||||
D3DVIEWPORT8 m_ShadowMapViewport;
|
||||
LPDIRECT3DTEXTURE9 m_lpCharacterShadowMapTexture;
|
||||
LPDIRECT3DSURFACE9 m_lpCharacterShadowMapRenderTargetSurface;
|
||||
LPDIRECT3DSURFACE9 m_lpCharacterShadowMapDepthSurface;
|
||||
D3DVIEWPORT9 m_ShadowMapViewport;
|
||||
WORD m_wShadowMapSize;
|
||||
|
||||
// Backup Device Context
|
||||
LPDIRECT3DSURFACE8 m_lpBackupRenderTargetSurface;
|
||||
LPDIRECT3DSURFACE8 m_lpBackupDepthSurface;
|
||||
D3DVIEWPORT8 m_BackupViewport;
|
||||
LPDIRECT3DSURFACE9 m_lpBackupRenderTargetSurface;
|
||||
LPDIRECT3DSURFACE9 m_lpBackupDepthSurface;
|
||||
D3DVIEWPORT9 m_BackupViewport;
|
||||
|
||||
// Character Shadow
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
@@ -593,8 +593,8 @@ class CMapOutdoor : public CMapBase
|
||||
NONE_VB_NUM = 8,
|
||||
};
|
||||
|
||||
IDirect3DVertexBuffer8* m_pkVBSplat[SPLAT_VB_NUM];
|
||||
IDirect3DVertexBuffer8* m_pkVBNone[NONE_VB_NUM];
|
||||
IDirect3DVertexBuffer9* m_pkVBSplat[SPLAT_VB_NUM];
|
||||
IDirect3DVertexBuffer9* m_pkVBNone[NONE_VB_NUM];
|
||||
DWORD m_dwSplatPos;
|
||||
DWORD m_dwNonePos;
|
||||
DWORD m_dwLightVersion;
|
||||
@@ -604,8 +604,8 @@ class CMapOutdoor : public CMapBase
|
||||
D3DXMATRIX m_m4Proj;
|
||||
D3DXMATRIX m_m4Frustum;
|
||||
D3DXMATRIX m_m4DynamicShadow;
|
||||
D3DLIGHT8 m_kLight;
|
||||
D3DMATERIAL8 m_kMtrl;
|
||||
D3DLIGHT9 m_kLight;
|
||||
D3DMATERIAL9 m_kMtrl;
|
||||
D3DXVECTOR3 m_v3Player;
|
||||
DWORD m_dwFogColor;
|
||||
float m_fScreenHalfWidth;
|
||||
|
||||
@@ -36,7 +36,7 @@ void CMapOutdoor::CreateCharacterShadowTexture()
|
||||
m_ShadowMapViewport.MinZ = 0.0f;
|
||||
m_ShadowMapViewport.MaxZ = 1.0f;
|
||||
|
||||
if (FAILED(ms_lpd3dDevice->CreateTexture(m_wShadowMapSize, m_wShadowMapSize, 1, D3DUSAGE_RENDERTARGET, D3DFMT_R5G6B5, D3DPOOL_DEFAULT, &m_lpCharacterShadowMapTexture)))
|
||||
if (FAILED(ms_lpd3dDevice->CreateTexture(m_wShadowMapSize, m_wShadowMapSize, 1, D3DUSAGE_RENDERTARGET, D3DFMT_R5G6B5, D3DPOOL_DEFAULT, &m_lpCharacterShadowMapTexture, nullptr)))
|
||||
{
|
||||
TraceError("CMapOutdoor Unable to create Character Shadow render target texture\n");
|
||||
return;
|
||||
@@ -48,7 +48,7 @@ void CMapOutdoor::CreateCharacterShadowTexture()
|
||||
return;
|
||||
}
|
||||
|
||||
if (FAILED(ms_lpd3dDevice->CreateDepthStencilSurface(m_wShadowMapSize, m_wShadowMapSize, D3DFMT_D16, D3DMULTISAMPLE_NONE, &m_lpCharacterShadowMapDepthSurface)))
|
||||
if (FAILED(ms_lpd3dDevice->CreateDepthStencilSurface(m_wShadowMapSize, m_wShadowMapSize, D3DFMT_D16, D3DMULTISAMPLE_NONE, 0, TRUE, &m_lpCharacterShadowMapDepthSurface, nullptr)))
|
||||
{
|
||||
TraceError("CMapOutdoor Unable to create Character Shadow depth Surface\n");
|
||||
return;
|
||||
@@ -105,53 +105,26 @@ bool CMapOutdoor::BeginRenderCharacterShadowToTexture()
|
||||
STATEMANAGER.SetTextureStageState(0, D3DTSS_ALPHAOP, D3DTOP_DISABLE);
|
||||
STATEMANAGER.SetTextureStageState(1, D3DTSS_COLOROP, D3DTOP_DISABLE);
|
||||
|
||||
bool bSuccess = true;
|
||||
ms_lpd3dDevice->GetDepthStencilSurface(&m_lpBackupDepthSurface);
|
||||
ms_lpd3dDevice->GetRenderTarget(0, &m_lpBackupRenderTargetSurface);
|
||||
|
||||
// Backup Device Context
|
||||
if (FAILED(ms_lpd3dDevice->GetRenderTarget(&m_lpBackupRenderTargetSurface)))
|
||||
{
|
||||
TraceError("CMapOutdoor::BeginRenderCharacterShadowToTexture : Unable to Save Window Render Target\n");
|
||||
bSuccess = false;
|
||||
}
|
||||
ms_lpd3dDevice->SetRenderTarget(0, m_lpCharacterShadowMapRenderTargetSurface);
|
||||
ms_lpd3dDevice->SetDepthStencilSurface(m_lpCharacterShadowMapDepthSurface);
|
||||
|
||||
if (FAILED(ms_lpd3dDevice->GetDepthStencilSurface(&m_lpBackupDepthSurface)))
|
||||
{
|
||||
TraceError("CMapOutdoor::BeginRenderCharacterShadowToTexture : Unable to Save Window Depth Surface\n");
|
||||
bSuccess = false;
|
||||
}
|
||||
ms_lpd3dDevice->Clear(0, NULL, D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER, 0xFFFFFFFF, 1.0f, 0);
|
||||
|
||||
if (FAILED(ms_lpd3dDevice->SetRenderTarget(m_lpCharacterShadowMapRenderTargetSurface, m_lpCharacterShadowMapDepthSurface)))
|
||||
{
|
||||
TraceError("CMapOutdoor::BeginRenderCharacterShadowToTexture : Unable to Set Shadow Map Render Target\n");
|
||||
bSuccess = false;
|
||||
}
|
||||
ms_lpd3dDevice->GetViewport(&m_BackupViewport);
|
||||
ms_lpd3dDevice->SetViewport(&m_ShadowMapViewport);
|
||||
|
||||
if (FAILED(ms_lpd3dDevice->Clear(0L, NULL, D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER, D3DCOLOR_XRGB(0xFF, 0xFF, 0xFF), 1.0f, 0)))
|
||||
{
|
||||
TraceError("CMapOutdoor::BeginRenderCharacterShadowToTexture : Unable to Clear Render Target");
|
||||
bSuccess = false;
|
||||
}
|
||||
|
||||
if (FAILED(ms_lpd3dDevice->GetViewport(&m_BackupViewport)))
|
||||
{
|
||||
TraceError("CMapOutdoor::BeginRenderCharacterShadowToTexture : Unable to Save Window Viewport\n");
|
||||
bSuccess = false;
|
||||
}
|
||||
|
||||
if (FAILED(ms_lpd3dDevice->SetViewport(&m_ShadowMapViewport)))
|
||||
{
|
||||
TraceError("CMapOutdoor::BeginRenderCharacterShadowToTexture : Unable to Set Shadow Map viewport\n");
|
||||
bSuccess = false;
|
||||
}
|
||||
|
||||
return bSuccess;
|
||||
return true;
|
||||
}
|
||||
|
||||
void CMapOutdoor::EndRenderCharacterShadowToTexture()
|
||||
{
|
||||
ms_lpd3dDevice->SetViewport(&m_BackupViewport);
|
||||
|
||||
ms_lpd3dDevice->SetRenderTarget(m_lpBackupRenderTargetSurface, m_lpBackupDepthSurface);
|
||||
ms_lpd3dDevice->SetDepthStencilSurface(m_lpBackupDepthSurface);
|
||||
ms_lpd3dDevice->SetRenderTarget(0, m_lpBackupRenderTargetSurface);
|
||||
|
||||
SAFE_RELEASE(m_lpBackupRenderTargetSurface);
|
||||
SAFE_RELEASE(m_lpBackupDepthSurface);
|
||||
|
||||
@@ -128,7 +128,7 @@ void CMapOutdoor::__RenderTerrain_AppendPatch(const D3DXVECTOR3& c_rv3Center, fl
|
||||
m_PatchVector.push_back(std::make_pair(fDistance, lPatchNum));
|
||||
}
|
||||
|
||||
void CMapOutdoor::ApplyLight(DWORD dwVersion, const D3DLIGHT8& c_rkLight)
|
||||
void CMapOutdoor::ApplyLight(DWORD dwVersion, const D3DLIGHT9& c_rkLight)
|
||||
{
|
||||
m_kSTPD.m_dwLightVersion=dwVersion;
|
||||
STATEMANAGER.SetLight(0, &c_rkLight);
|
||||
@@ -426,17 +426,17 @@ void CMapOutdoor::RenderArea(bool bRenderAmbience)
|
||||
STATEMANAGER.SetTextureStageState(1, D3DTSS_COLORARG2, D3DTA_CURRENT);
|
||||
STATEMANAGER.SetTextureStageState(1, D3DTSS_COLOROP, D3DTOP_MODULATE);
|
||||
STATEMANAGER.SetTextureStageState(1, D3DTSS_ALPHAOP, D3DTOP_DISABLE);
|
||||
STATEMANAGER.SaveTextureStageState(1, D3DTSS_ADDRESSU, D3DTADDRESS_BORDER);
|
||||
STATEMANAGER.SaveTextureStageState(1, D3DTSS_ADDRESSV, D3DTADDRESS_BORDER);
|
||||
STATEMANAGER.SaveTextureStageState(1, D3DTSS_BORDERCOLOR, 0xFFFFFFFF);
|
||||
STATEMANAGER.SaveSamplerState(1, D3DSAMP_ADDRESSU, D3DTADDRESS_BORDER);
|
||||
STATEMANAGER.SaveSamplerState(1, D3DSAMP_ADDRESSV, D3DTADDRESS_BORDER);
|
||||
STATEMANAGER.SaveSamplerState(1, D3DSAMP_BORDERCOLOR, 0xFFFFFFFF);
|
||||
|
||||
std::for_each(m_ShadowReceiverVector.begin(), m_ShadowReceiverVector.end(), FAreaRenderShadow());
|
||||
|
||||
STATEMANAGER.RestoreTextureStageState(1, D3DTSS_TEXCOORDINDEX);
|
||||
STATEMANAGER.RestoreTextureStageState(1, D3DTSS_TEXTURETRANSFORMFLAGS);
|
||||
STATEMANAGER.RestoreTextureStageState(1, D3DTSS_ADDRESSU);
|
||||
STATEMANAGER.RestoreTextureStageState(1, D3DTSS_ADDRESSV);
|
||||
STATEMANAGER.RestoreTextureStageState(1, D3DTSS_BORDERCOLOR);
|
||||
STATEMANAGER.RestoreSamplerState(1, D3DSAMP_ADDRESSU);
|
||||
STATEMANAGER.RestoreSamplerState(1, D3DSAMP_ADDRESSV);
|
||||
STATEMANAGER.RestoreSamplerState(1, D3DSAMP_BORDERCOLOR);
|
||||
|
||||
STATEMANAGER.RestoreTransform(D3DTS_TEXTURE1);
|
||||
|
||||
@@ -634,8 +634,8 @@ void CMapOutdoor::RenderPCBlocker()
|
||||
STATEMANAGER.SetTextureStageState(1, D3DTSS_COLOROP, D3DTOP_SELECTARG1);
|
||||
STATEMANAGER.SetTextureStageState(1, D3DTSS_ALPHAARG1, D3DTA_TEXTURE);
|
||||
STATEMANAGER.SetTextureStageState(1, D3DTSS_ALPHAOP, D3DTOP_SELECTARG1);
|
||||
STATEMANAGER.SaveTextureStageState(1, D3DTSS_ADDRESSU, D3DTADDRESS_CLAMP);
|
||||
STATEMANAGER.SaveTextureStageState(1, D3DTSS_ADDRESSV, D3DTADDRESS_CLAMP);
|
||||
STATEMANAGER.SaveSamplerState(1, D3DSAMP_ADDRESSU, D3DTADDRESS_CLAMP);
|
||||
STATEMANAGER.SaveSamplerState(1, D3DSAMP_ADDRESSV, D3DTADDRESS_CLAMP);
|
||||
|
||||
STATEMANAGER.SaveTransform(D3DTS_TEXTURE1, &m_matBuildingTransparent);
|
||||
STATEMANAGER.SetTexture(1, m_BuildingTransparentImageInstance.GetTexturePointer()->GetD3DTexture());
|
||||
@@ -651,8 +651,8 @@ void CMapOutdoor::RenderPCBlocker()
|
||||
STATEMANAGER.SetTextureStageState(1, D3DTSS_COLOROP, D3DTOP_DISABLE);
|
||||
STATEMANAGER.SetTextureStageState(1, D3DTSS_ALPHAARG1, D3DTA_TEXTURE);
|
||||
STATEMANAGER.SetTextureStageState(1, D3DTSS_ALPHAOP, D3DTOP_DISABLE);
|
||||
STATEMANAGER.RestoreTextureStageState(1, D3DTSS_ADDRESSU);
|
||||
STATEMANAGER.RestoreTextureStageState(1, D3DTSS_ADDRESSV);
|
||||
STATEMANAGER.RestoreSamplerState(1, D3DSAMP_ADDRESSU);
|
||||
STATEMANAGER.RestoreSamplerState(1, D3DSAMP_ADDRESSV);
|
||||
STATEMANAGER.RestoreRenderState(D3DRS_ALPHABLENDENABLE);
|
||||
}
|
||||
#endif
|
||||
@@ -862,11 +862,11 @@ void CMapOutdoor::RenderMarkedArea()
|
||||
STATEMANAGER.SetTextureStageState(1, D3DTSS_ALPHAOP, D3DTOP_MODULATE);
|
||||
STATEMANAGER.SaveTextureStageState(1, D3DTSS_TEXCOORDINDEX, D3DTSS_TCI_CAMERASPACEPOSITION);
|
||||
STATEMANAGER.SaveTextureStageState(1, D3DTSS_TEXTURETRANSFORMFLAGS, D3DTTFF_COUNT2);
|
||||
STATEMANAGER.SaveTextureStageState(1, D3DTSS_MINFILTER, D3DTEXF_POINT);
|
||||
STATEMANAGER.SaveTextureStageState(1, D3DTSS_MAGFILTER, D3DTEXF_POINT);
|
||||
STATEMANAGER.SaveTextureStageState(1, D3DTSS_MIPFILTER, D3DTEXF_POINT);
|
||||
STATEMANAGER.SaveTextureStageState(1, D3DTSS_ADDRESSU, D3DTADDRESS_CLAMP);
|
||||
STATEMANAGER.SaveTextureStageState(1, D3DTSS_ADDRESSV, D3DTADDRESS_CLAMP);
|
||||
STATEMANAGER.SaveSamplerState(1, D3DSAMP_MINFILTER, D3DTEXF_POINT);
|
||||
STATEMANAGER.SaveSamplerState(1, D3DSAMP_MAGFILTER, D3DTEXF_POINT);
|
||||
STATEMANAGER.SaveSamplerState(1, D3DSAMP_MIPFILTER, D3DTEXF_POINT);
|
||||
STATEMANAGER.SaveSamplerState(1, D3DSAMP_ADDRESSU, D3DTADDRESS_CLAMP);
|
||||
STATEMANAGER.SaveSamplerState(1, D3DSAMP_ADDRESSV, D3DTADDRESS_CLAMP);
|
||||
|
||||
STATEMANAGER.SetTexture(0, m_attrImageInstance.GetTexturePointer()->GetD3DTexture());
|
||||
|
||||
@@ -876,11 +876,11 @@ void CMapOutdoor::RenderMarkedArea()
|
||||
STATEMANAGER.RestoreTextureStageState(0, D3DTSS_TEXTURETRANSFORMFLAGS);
|
||||
STATEMANAGER.RestoreTextureStageState(1, D3DTSS_TEXCOORDINDEX);
|
||||
STATEMANAGER.RestoreTextureStageState(1, D3DTSS_TEXTURETRANSFORMFLAGS);
|
||||
STATEMANAGER.RestoreTextureStageState(1, D3DTSS_MINFILTER);
|
||||
STATEMANAGER.RestoreTextureStageState(1, D3DTSS_MAGFILTER);
|
||||
STATEMANAGER.RestoreTextureStageState(1, D3DTSS_MIPFILTER);
|
||||
STATEMANAGER.RestoreTextureStageState(1, D3DTSS_ADDRESSU);
|
||||
STATEMANAGER.RestoreTextureStageState(1, D3DTSS_ADDRESSV);
|
||||
STATEMANAGER.RestoreSamplerState(1, D3DSAMP_MINFILTER);
|
||||
STATEMANAGER.RestoreSamplerState(1, D3DSAMP_MAGFILTER);
|
||||
STATEMANAGER.RestoreSamplerState(1, D3DSAMP_MIPFILTER);
|
||||
STATEMANAGER.RestoreSamplerState(1, D3DSAMP_ADDRESSU);
|
||||
STATEMANAGER.RestoreSamplerState(1, D3DSAMP_ADDRESSV);
|
||||
|
||||
STATEMANAGER.RestoreTransform(D3DTS_TEXTURE0);
|
||||
STATEMANAGER.RestoreTransform(D3DTS_TEXTURE1);
|
||||
@@ -953,7 +953,7 @@ void CMapOutdoor::DrawPatchAttr(long patchnum)
|
||||
TTerrainSplatPatch & rAttrSplatPatch = pTerrain->GetMarkedSplatPatch();
|
||||
STATEMANAGER.SetTexture(1, rAttrSplatPatch.Splats[0].pd3dTexture);
|
||||
|
||||
STATEMANAGER.SetVertexShader(D3DFVF_XYZ | D3DFVF_NORMAL);
|
||||
STATEMANAGER.SetFVF(D3DFVF_XYZ | D3DFVF_NORMAL);
|
||||
STATEMANAGER.SetStreamSource(0, pTerrainPatchProxy->HardwareTransformPatch_GetVertexBufferPtr()->GetD3DVertexBuffer(), m_iPatchTerrainVertexSize);
|
||||
|
||||
#ifdef WORLD_EDITOR
|
||||
|
||||
@@ -41,15 +41,15 @@ void CMapOutdoor::__RenderTerrain_RenderHardwareTransformPatch()
|
||||
STATEMANAGER.SetTextureStageState(0, D3DTSS_COLOROP, D3DTOP_MODULATE);
|
||||
STATEMANAGER.SetTextureStageState(0, D3DTSS_ALPHAARG1, D3DTA_TEXTURE);
|
||||
STATEMANAGER.SetTextureStageState(0, D3DTSS_ALPHAOP, D3DTOP_SELECTARG1);
|
||||
STATEMANAGER.SetTextureStageState(0, D3DTSS_ADDRESSU, D3DTADDRESS_WRAP);
|
||||
STATEMANAGER.SetTextureStageState(0, D3DTSS_ADDRESSV, D3DTADDRESS_WRAP);
|
||||
STATEMANAGER.SetSamplerState(0, D3DSAMP_ADDRESSU, D3DTADDRESS_WRAP);
|
||||
STATEMANAGER.SetSamplerState(0, D3DSAMP_ADDRESSV, D3DTADDRESS_WRAP);
|
||||
|
||||
STATEMANAGER.SetTextureStageState(1, D3DTSS_COLORARG1, D3DTA_CURRENT);
|
||||
STATEMANAGER.SetTextureStageState(1, D3DTSS_COLOROP, D3DTOP_SELECTARG1);
|
||||
STATEMANAGER.SetTextureStageState(1, D3DTSS_ALPHAARG1, D3DTA_TEXTURE);
|
||||
STATEMANAGER.SetTextureStageState(1, D3DTSS_ALPHAOP, D3DTOP_SELECTARG1);
|
||||
STATEMANAGER.SetTextureStageState(1, D3DTSS_ADDRESSU, D3DTADDRESS_CLAMP);
|
||||
STATEMANAGER.SetTextureStageState(1, D3DTSS_ADDRESSV, D3DTADDRESS_CLAMP);
|
||||
STATEMANAGER.SetSamplerState(1, D3DSAMP_ADDRESSU, D3DTADDRESS_CLAMP);
|
||||
STATEMANAGER.SetSamplerState(1, D3DSAMP_ADDRESSV, D3DTADDRESS_CLAMP);
|
||||
|
||||
#ifdef WORLD_EDITOR
|
||||
if (GetAsyncKeyState(VK_CAPITAL))
|
||||
@@ -88,7 +88,7 @@ void CMapOutdoor::__RenderTerrain_RenderHardwareTransformPatch()
|
||||
// Render State & TextureStageState
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
STATEMANAGER.SetVertexShader(D3DFVF_XYZ | D3DFVF_NORMAL);
|
||||
STATEMANAGER.SetFVF(D3DFVF_XYZ | D3DFVF_NORMAL);
|
||||
|
||||
m_iRenderedSplatNumSqSum = 0;
|
||||
m_iRenderedPatchNum = 0;
|
||||
@@ -624,9 +624,8 @@ void CMapOutdoor::__HardwareTransformPatch_RenderPatchSplat(long patchnum, WORD
|
||||
STATEMANAGER.SetTextureStageState(0, D3DTSS_ALPHAARG1, D3DTA_TEXTURE);
|
||||
STATEMANAGER.SetTextureStageState(0, D3DTSS_ALPHAARG2, D3DTA_CURRENT);
|
||||
STATEMANAGER.SetTextureStageState(0, D3DTSS_ALPHAOP, D3DTOP_DISABLE);
|
||||
STATEMANAGER.SetTextureStageState(0, D3DTSS_ADDRESSU, D3DTADDRESS_CLAMP);
|
||||
STATEMANAGER.SetTextureStageState(0, D3DTSS_ADDRESSV, D3DTADDRESS_CLAMP);
|
||||
|
||||
STATEMANAGER.SetSamplerState(0, D3DSAMP_ADDRESSU, D3DTADDRESS_CLAMP);
|
||||
STATEMANAGER.SetSamplerState(0, D3DSAMP_ADDRESSV, D3DTADDRESS_CLAMP);
|
||||
if (m_bDrawChrShadow)
|
||||
{
|
||||
STATEMANAGER.SetTransform(D3DTS_TEXTURE1, &m_matDynamicShadow);
|
||||
@@ -636,8 +635,8 @@ void CMapOutdoor::__HardwareTransformPatch_RenderPatchSplat(long patchnum, WORD
|
||||
STATEMANAGER.SetTextureStageState(1, D3DTSS_COLORARG2, D3DTA_CURRENT);
|
||||
STATEMANAGER.SetTextureStageState(1, D3DTSS_COLOROP, D3DTOP_MODULATE);
|
||||
STATEMANAGER.SetTextureStageState(1, D3DTSS_ALPHAOP, D3DTOP_DISABLE);
|
||||
STATEMANAGER.SetTextureStageState(1, D3DTSS_ADDRESSU, D3DTADDRESS_CLAMP);
|
||||
STATEMANAGER.SetTextureStageState(1, D3DTSS_ADDRESSV, D3DTADDRESS_CLAMP);
|
||||
STATEMANAGER.SetSamplerState(1, D3DSAMP_ADDRESSU, D3DTADDRESS_CLAMP);
|
||||
STATEMANAGER.SetSamplerState(1, D3DSAMP_ADDRESSV, D3DTADDRESS_CLAMP);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -661,8 +660,8 @@ void CMapOutdoor::__HardwareTransformPatch_RenderPatchSplat(long patchnum, WORD
|
||||
STATEMANAGER.SetTextureStageState(0, D3DTSS_COLOROP, D3DTOP_MODULATE);
|
||||
STATEMANAGER.SetTextureStageState(0, D3DTSS_ALPHAARG1, D3DTA_TEXTURE);
|
||||
STATEMANAGER.SetTextureStageState(0, D3DTSS_ALPHAOP, D3DTOP_SELECTARG1);
|
||||
STATEMANAGER.SetTextureStageState(0, D3DTSS_ADDRESSU, D3DTADDRESS_WRAP);
|
||||
STATEMANAGER.SetTextureStageState(0, D3DTSS_ADDRESSV, D3DTADDRESS_WRAP);
|
||||
STATEMANAGER.SetSamplerState(0, D3DSAMP_ADDRESSU, D3DTADDRESS_WRAP);
|
||||
STATEMANAGER.SetSamplerState(0, D3DSAMP_ADDRESSV, D3DTADDRESS_WRAP);
|
||||
|
||||
|
||||
STATEMANAGER.SetRenderState(D3DRS_SRCBLEND, D3DBLEND_SRCALPHA);
|
||||
|
||||
@@ -43,7 +43,7 @@ void CMapOutdoor::__RenderTerrain_RenderSoftwareTransformPatch()
|
||||
|
||||
SelectIndexBuffer(0, &wPrimitiveCount, &ePrimitiveType);
|
||||
|
||||
STATEMANAGER.SetVertexShader(D3DFVF_XYZRHW|D3DFVF_DIFFUSE|D3DFVF_SPECULAR|D3DFVF_TEX2);
|
||||
STATEMANAGER.SetFVF(D3DFVF_XYZRHW|D3DFVF_DIFFUSE|D3DFVF_SPECULAR|D3DFVF_TEX2);
|
||||
|
||||
std::vector<std::pair<float, long> >::iterator it = m_PatchVector.begin();
|
||||
|
||||
@@ -100,7 +100,7 @@ void CMapOutdoor::__RenderTerrain_RenderSoftwareTransformPatch()
|
||||
STATEMANAGER.SetTextureStageState(1, D3DTSS_COLOROP, D3DTOP_DISABLE);
|
||||
STATEMANAGER.SetTextureStageState(1, D3DTSS_ALPHAOP, D3DTOP_DISABLE);
|
||||
|
||||
STATEMANAGER.SetVertexShader(D3DFVF_XYZRHW);
|
||||
STATEMANAGER.SetFVF(D3DFVF_XYZRHW);
|
||||
|
||||
if (IsFastTNL())
|
||||
{
|
||||
@@ -315,7 +315,7 @@ void CMapOutdoor::__SoftwareTransformPatch_RenderPatchNone(SoftwareTransformPatc
|
||||
}
|
||||
|
||||
|
||||
IDirect3DVertexBuffer8* pkVB=m_kSTPD.m_pkVBNone[m_kSTPD.m_dwNonePos++];
|
||||
IDirect3DVertexBuffer9* pkVB=m_kSTPD.m_pkVBNone[m_kSTPD.m_dwNonePos++];
|
||||
m_kSTPD.m_dwNonePos%=SoftwareTransformPatch_SData::NONE_VB_NUM;
|
||||
if (!pkVB)
|
||||
return;
|
||||
@@ -323,7 +323,7 @@ void CMapOutdoor::__SoftwareTransformPatch_RenderPatchNone(SoftwareTransformPatc
|
||||
DWORD dwVBSize=sizeof(SoftwareTransformPatch_STVertex)*CTerrainPatch::TERRAIN_VERTEX_COUNT;
|
||||
SoftwareTransformPatch_STVertex* akDstVertex;
|
||||
if (FAILED(
|
||||
pkVB->Lock(0, dwVBSize, (BYTE**)&akDstVertex, D3DLOCK_DISCARD)
|
||||
pkVB->Lock(0, dwVBSize, (void**)&akDstVertex, D3DLOCK_DISCARD)
|
||||
)) return;
|
||||
|
||||
memcpy(akDstVertex, akTransVertex, dwVBSize);
|
||||
@@ -345,8 +345,8 @@ void CMapOutdoor::__SoftwareTransformPatch_ApplyStaticShadowRenderState()
|
||||
STATEMANAGER.SetTextureStageState(0, D3DTSS_COLOROP, D3DTOP_MODULATE);
|
||||
STATEMANAGER.SetTextureStageState(0, D3DTSS_ALPHAARG1, D3DTA_TEXTURE);
|
||||
STATEMANAGER.SetTextureStageState(0, D3DTSS_ALPHAOP, D3DTOP_SELECTARG1);
|
||||
STATEMANAGER.SetTextureStageState(0, D3DTSS_ADDRESSU, D3DTADDRESS_CLAMP);
|
||||
STATEMANAGER.SetTextureStageState(0, D3DTSS_ADDRESSV, D3DTADDRESS_CLAMP);
|
||||
STATEMANAGER.SetSamplerState(0, D3DSAMP_ADDRESSU, D3DTADDRESS_CLAMP);
|
||||
STATEMANAGER.SetSamplerState(0, D3DSAMP_ADDRESSV, D3DTADDRESS_CLAMP);
|
||||
|
||||
}
|
||||
|
||||
@@ -359,8 +359,8 @@ void CMapOutdoor::__SoftwareTransformPatch_ApplyDynamicShadowRenderState()
|
||||
STATEMANAGER.SetTextureStageState(1, D3DTSS_ALPHAARG1, D3DTA_CURRENT);
|
||||
STATEMANAGER.SetTextureStageState(1, D3DTSS_ALPHAOP, D3DTOP_SELECTARG1);
|
||||
|
||||
STATEMANAGER.SetTextureStageState(1, D3DTSS_ADDRESSU, D3DTADDRESS_CLAMP);
|
||||
STATEMANAGER.SetTextureStageState(1, D3DTSS_ADDRESSV, D3DTADDRESS_CLAMP);
|
||||
STATEMANAGER.SetSamplerState(1, D3DSAMP_ADDRESSU, D3DTADDRESS_CLAMP);
|
||||
STATEMANAGER.SetSamplerState(1, D3DSAMP_ADDRESSV, D3DTADDRESS_CLAMP);
|
||||
}
|
||||
|
||||
void CMapOutdoor::__SoftwareTransformPatch_ApplyFogShadowRenderState()
|
||||
@@ -377,8 +377,8 @@ void CMapOutdoor::__SoftwareTransformPatch_RestoreStaticShadowRenderState()
|
||||
STATEMANAGER.SetTextureStageState(0, D3DTSS_COLOROP, D3DTOP_SELECTARG1);
|
||||
STATEMANAGER.SetTextureStageState(0, D3DTSS_ALPHAARG1, D3DTA_TEXTURE);
|
||||
STATEMANAGER.SetTextureStageState(0, D3DTSS_ALPHAOP, D3DTOP_SELECTARG1);
|
||||
STATEMANAGER.SetTextureStageState(0, D3DTSS_ADDRESSU, D3DTADDRESS_WRAP);
|
||||
STATEMANAGER.SetTextureStageState(0, D3DTSS_ADDRESSV, D3DTADDRESS_WRAP);
|
||||
STATEMANAGER.SetSamplerState(0, D3DSAMP_ADDRESSU, D3DTADDRESS_WRAP);
|
||||
STATEMANAGER.SetSamplerState(0, D3DSAMP_ADDRESSV, D3DTADDRESS_WRAP);
|
||||
|
||||
STATEMANAGER.SetRenderState(D3DRS_SRCBLEND, D3DBLEND_SRCALPHA);
|
||||
STATEMANAGER.SetRenderState(D3DRS_DESTBLEND, D3DBLEND_INVSRCALPHA);
|
||||
@@ -394,8 +394,8 @@ void CMapOutdoor::__SoftwareTransformPatch_RestoreDynamicShadowRenderState()
|
||||
STATEMANAGER.SetTextureStageState(1, D3DTSS_ALPHAARG1, D3DTA_TEXTURE);
|
||||
STATEMANAGER.SetTextureStageState(1, D3DTSS_ALPHAOP, D3DTOP_SELECTARG1);
|
||||
|
||||
STATEMANAGER.SetTextureStageState(1, D3DTSS_ADDRESSU, D3DTADDRESS_CLAMP);
|
||||
STATEMANAGER.SetTextureStageState(1, D3DTSS_ADDRESSV, D3DTADDRESS_CLAMP);
|
||||
STATEMANAGER.SetSamplerState(1, D3DSAMP_ADDRESSU, D3DTADDRESS_CLAMP);
|
||||
STATEMANAGER.SetSamplerState(1, D3DSAMP_ADDRESSV, D3DTADDRESS_CLAMP);
|
||||
}
|
||||
|
||||
|
||||
@@ -413,89 +413,10 @@ void CMapOutdoor::__SoftwareTransformPatch_RestoreFogShadowRenderState()
|
||||
|
||||
void CMapOutdoor::__SoftwareTransformPatch_ApplyRenderState()
|
||||
{
|
||||
DWORD dwFogColor=0xffffffff;
|
||||
if (mc_pEnvironmentData)
|
||||
dwFogColor=mc_pEnvironmentData->FogColor;
|
||||
|
||||
BOOL isSoftwareVertexClipping=FALSE;
|
||||
if (!IsTLVertexClipping())
|
||||
isSoftwareVertexClipping=TRUE;
|
||||
|
||||
STATEMANAGER.SaveRenderState(D3DRS_SOFTWAREVERTEXPROCESSING, isSoftwareVertexClipping);
|
||||
|
||||
STATEMANAGER.SaveRenderState(D3DRS_ALPHABLENDENABLE, TRUE);
|
||||
STATEMANAGER.SaveRenderState(D3DRS_ALPHATESTENABLE, TRUE);
|
||||
STATEMANAGER.SaveRenderState(D3DRS_ALPHAREF, 0x00000000);
|
||||
STATEMANAGER.SaveRenderState(D3DRS_ALPHAFUNC, D3DCMP_GREATER);
|
||||
|
||||
STATEMANAGER.SaveRenderState(D3DRS_TEXTUREFACTOR, dwFogColor);
|
||||
STATEMANAGER.SetRenderState(D3DRS_LIGHTING, FALSE);
|
||||
STATEMANAGER.SetRenderState(D3DRS_FOGENABLE, FALSE);
|
||||
|
||||
STATEMANAGER.SetTextureStageState(0, D3DTSS_COLORARG1, D3DTA_TEXTURE);
|
||||
STATEMANAGER.SetTextureStageState(0, D3DTSS_COLORARG2, D3DTA_DIFFUSE);
|
||||
STATEMANAGER.SetTextureStageState(0, D3DTSS_COLOROP, D3DTOP_SELECTARG1);
|
||||
STATEMANAGER.SetTextureStageState(0, D3DTSS_ALPHAARG1, D3DTA_TEXTURE);
|
||||
STATEMANAGER.SetTextureStageState(0, D3DTSS_ALPHAOP, D3DTOP_SELECTARG1);
|
||||
STATEMANAGER.SetTextureStageState(0, D3DTSS_ADDRESSU, D3DTADDRESS_WRAP);
|
||||
STATEMANAGER.SetTextureStageState(0, D3DTSS_ADDRESSV, D3DTADDRESS_WRAP);
|
||||
STATEMANAGER.SetBestFiltering(0);
|
||||
|
||||
STATEMANAGER.SetTextureStageState(1, D3DTSS_COLORARG1, D3DTA_CURRENT);
|
||||
STATEMANAGER.SetTextureStageState(1, D3DTSS_COLORARG2, D3DTA_TEXTURE);
|
||||
STATEMANAGER.SetTextureStageState(1, D3DTSS_COLOROP, D3DTOP_SELECTARG1);
|
||||
STATEMANAGER.SetTextureStageState(1, D3DTSS_ALPHAARG1, D3DTA_TEXTURE);
|
||||
STATEMANAGER.SetTextureStageState(1, D3DTSS_ALPHAARG2, D3DTA_CURRENT);
|
||||
STATEMANAGER.SetTextureStageState(1, D3DTSS_ALPHAOP, D3DTOP_SELECTARG1);
|
||||
STATEMANAGER.SetTextureStageState(1, D3DTSS_ADDRESSU, D3DTADDRESS_CLAMP);
|
||||
STATEMANAGER.SetTextureStageState(1, D3DTSS_ADDRESSV, D3DTADDRESS_CLAMP);
|
||||
STATEMANAGER.SetBestFiltering(1);
|
||||
|
||||
CSpeedTreeWrapper::ms_bSelfShadowOn = true;
|
||||
|
||||
// Render State & TextureStageState
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
m_iRenderedSplatNumSqSum = 0;
|
||||
m_iRenderedPatchNum = 0;
|
||||
m_iRenderedSplatNum = 0;
|
||||
m_RenderedTextureNumVector.clear();
|
||||
|
||||
m_matWorldForCommonUse._41 = 0.0f;
|
||||
m_matWorldForCommonUse._42 = 0.0f;
|
||||
STATEMANAGER.SetTransform(D3DTS_WORLD, &m_matWorldForCommonUse);
|
||||
}
|
||||
|
||||
void CMapOutdoor::__SoftwareTransformPatch_RestoreRenderState(DWORD dwFogEnable)
|
||||
{
|
||||
STATEMANAGER.SetRenderState(D3DRS_LIGHTING, TRUE);
|
||||
|
||||
STATEMANAGER.SetTextureStageState(0, D3DTSS_COLORARG1, D3DTA_TEXTURE);
|
||||
STATEMANAGER.SetTextureStageState(0, D3DTSS_COLORARG2, D3DTA_CURRENT);
|
||||
STATEMANAGER.SetTextureStageState(0, D3DTSS_COLOROP, D3DTOP_MODULATE);
|
||||
STATEMANAGER.SetTextureStageState(0, D3DTSS_ALPHAARG1, D3DTA_TEXTURE);
|
||||
STATEMANAGER.SetTextureStageState(0, D3DTSS_ALPHAOP, D3DTOP_SELECTARG1);
|
||||
|
||||
STATEMANAGER.SetTextureStageState(1, D3DTSS_COLORARG1, D3DTA_CURRENT);
|
||||
STATEMANAGER.SetTextureStageState(1, D3DTSS_COLOROP, D3DTOP_SELECTARG1);
|
||||
STATEMANAGER.SetTextureStageState(1, D3DTSS_ALPHAARG1, D3DTA_TEXTURE);
|
||||
STATEMANAGER.SetTextureStageState(1, D3DTSS_ALPHAOP, D3DTOP_SELECTARG1);
|
||||
|
||||
STATEMANAGER.SetRenderState(D3DRS_FOGENABLE, dwFogEnable);
|
||||
|
||||
std::sort(m_RenderedTextureNumVector.begin(),m_RenderedTextureNumVector.end());
|
||||
|
||||
STATEMANAGER.RestoreRenderState(D3DRS_TEXTUREFACTOR);
|
||||
|
||||
STATEMANAGER.RestoreRenderState(D3DRS_ALPHABLENDENABLE);
|
||||
STATEMANAGER.RestoreRenderState(D3DRS_ALPHATESTENABLE);
|
||||
STATEMANAGER.RestoreRenderState(D3DRS_ALPHAREF);
|
||||
STATEMANAGER.RestoreRenderState(D3DRS_ALPHAFUNC);
|
||||
|
||||
STATEMANAGER.RestoreRenderState(D3DRS_SOFTWAREVERTEXPROCESSING);
|
||||
|
||||
// Render State & TextureStageState
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
}
|
||||
|
||||
void CMapOutdoor::__SoftwareTransformPatch_BuildPipeline(SoftwareTransformPatch_SRenderState& rkTPRS)
|
||||
@@ -679,7 +600,7 @@ bool CMapOutdoor::__SoftwareTransformPatch_SetTransform(SoftwareTransformPatch_S
|
||||
|
||||
bool CMapOutdoor::__SoftwareTransformPatch_SetSplatStream(SoftwareTransformPatch_STLVertex* akSrcVertex)
|
||||
{
|
||||
IDirect3DVertexBuffer8* pkVB=m_kSTPD.m_pkVBSplat[m_kSTPD.m_dwSplatPos++];
|
||||
IDirect3DVertexBuffer9* pkVB=m_kSTPD.m_pkVBSplat[m_kSTPD.m_dwSplatPos++];
|
||||
m_kSTPD.m_dwSplatPos%=SoftwareTransformPatch_SData::SPLAT_VB_NUM;
|
||||
if (!pkVB)
|
||||
return false;
|
||||
@@ -687,7 +608,7 @@ bool CMapOutdoor::__SoftwareTransformPatch_SetSplatStream(SoftwareTransformPatch
|
||||
DWORD dwVBSize=sizeof(SoftwareTransformPatch_SSplatVertex)*CTerrainPatch::TERRAIN_VERTEX_COUNT;
|
||||
SoftwareTransformPatch_SSplatVertex* akDstVertex;
|
||||
if (FAILED(
|
||||
pkVB->Lock(0, dwVBSize, (BYTE**)&akDstVertex, 0)//D3DLOCK_DISCARD)
|
||||
pkVB->Lock(0, dwVBSize, (void**)&akDstVertex, 0)//D3DLOCK_DISCARD)
|
||||
)) return false;
|
||||
|
||||
for (UINT uIndex=0; uIndex!=CTerrainPatch::TERRAIN_VERTEX_COUNT; ++uIndex)
|
||||
@@ -701,7 +622,7 @@ bool CMapOutdoor::__SoftwareTransformPatch_SetSplatStream(SoftwareTransformPatch
|
||||
|
||||
bool CMapOutdoor::__SoftwareTransformPatch_SetShadowStream(SoftwareTransformPatch_STLVertex* akSrcVertex)
|
||||
{
|
||||
IDirect3DVertexBuffer8* pkVB=m_kSTPD.m_pkVBSplat[m_kSTPD.m_dwSplatPos++];
|
||||
IDirect3DVertexBuffer9* pkVB=m_kSTPD.m_pkVBSplat[m_kSTPD.m_dwSplatPos++];
|
||||
m_kSTPD.m_dwSplatPos%=SoftwareTransformPatch_SData::SPLAT_VB_NUM;
|
||||
if (!pkVB)
|
||||
return false;
|
||||
@@ -709,7 +630,7 @@ bool CMapOutdoor::__SoftwareTransformPatch_SetShadowStream(SoftwareTransformPatc
|
||||
DWORD dwVBSize=sizeof(SoftwareTransformPatch_SSplatVertex)*CTerrainPatch::TERRAIN_VERTEX_COUNT;
|
||||
SoftwareTransformPatch_SSplatVertex* akDstVertex;
|
||||
if (FAILED(
|
||||
pkVB->Lock(0, dwVBSize, (BYTE**)&akDstVertex, 0)//D3DLOCK_DISCARD)
|
||||
pkVB->Lock(0, dwVBSize, (void**)&akDstVertex, 0)//D3DLOCK_DISCARD)
|
||||
)) return false;
|
||||
|
||||
SoftwareTransformPatch_STLVertex* pkSrcVertex;
|
||||
@@ -727,7 +648,7 @@ bool CMapOutdoor::__SoftwareTransformPatch_SetShadowStream(SoftwareTransformPatc
|
||||
pkVB->Unlock();
|
||||
|
||||
|
||||
ms_lpd3dDevice->SetStreamSource(0, pkVB, sizeof(SoftwareTransformPatch_SSplatVertex));
|
||||
//ms_lpd3dDevice->SetStreamSource(0, pkVB, sizeof(SoftwareTransformPatch_SSplatVertex));
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -759,7 +680,8 @@ bool CMapOutdoor::__SoftwareTransformPatch_Create()
|
||||
D3DUSAGE_DYNAMIC|D3DUSAGE_WRITEONLY,
|
||||
D3DFVF_XYZRHW|D3DFVF_DIFFUSE|D3DFVF_SPECULAR|D3DFVF_TEX2,
|
||||
D3DPOOL_SYSTEMMEM,
|
||||
&m_kSTPD.m_pkVBSplat[uIndex]
|
||||
&m_kSTPD.m_pkVBSplat[uIndex],
|
||||
nullptr
|
||||
)
|
||||
)) return false;
|
||||
}
|
||||
@@ -775,7 +697,8 @@ bool CMapOutdoor::__SoftwareTransformPatch_Create()
|
||||
D3DUSAGE_DYNAMIC|D3DUSAGE_WRITEONLY,
|
||||
D3DFVF_XYZRHW,
|
||||
D3DPOOL_SYSTEMMEM,
|
||||
&m_kSTPD.m_pkVBNone[uIndex]
|
||||
&m_kSTPD.m_pkVBNone[uIndex],
|
||||
nullptr
|
||||
)
|
||||
)) return false;
|
||||
}
|
||||
|
||||
@@ -46,15 +46,16 @@ void CMapOutdoor::RenderWater()
|
||||
D3DXMatrixMultiply(&matTexTransformWater, &m_matViewInverse, &matTexTransformWater);
|
||||
|
||||
STATEMANAGER.SaveTransform(D3DTS_TEXTURE0, &matTexTransformWater);
|
||||
STATEMANAGER.SaveVertexShader(D3DFVF_XYZ|D3DFVF_DIFFUSE);
|
||||
STATEMANAGER.SetFVF(D3DFVF_XYZ|D3DFVF_DIFFUSE);
|
||||
|
||||
STATEMANAGER.SaveTextureStageState(0, D3DTSS_TEXCOORDINDEX, D3DTSS_TCI_CAMERASPACEPOSITION);
|
||||
STATEMANAGER.SaveTextureStageState(0, D3DTSS_TEXTURETRANSFORMFLAGS, D3DTTFF_COUNT2);
|
||||
STATEMANAGER.SaveTextureStageState(0, D3DTSS_MINFILTER, D3DTEXF_LINEAR);
|
||||
STATEMANAGER.SaveTextureStageState(0, D3DTSS_MAGFILTER, D3DTEXF_LINEAR);
|
||||
STATEMANAGER.SaveTextureStageState(0, D3DTSS_MIPFILTER, D3DTEXF_LINEAR);
|
||||
STATEMANAGER.SaveTextureStageState(0, D3DTSS_ADDRESSU, D3DTADDRESS_WRAP);
|
||||
STATEMANAGER.SaveTextureStageState(0, D3DTSS_ADDRESSV, D3DTADDRESS_WRAP);
|
||||
|
||||
STATEMANAGER.SaveSamplerState(0, D3DSAMP_MINFILTER, D3DTEXF_ANISOTROPIC);
|
||||
STATEMANAGER.SaveSamplerState(0, D3DSAMP_MAGFILTER, D3DTEXF_ANISOTROPIC);
|
||||
STATEMANAGER.SaveSamplerState(0, D3DSAMP_MIPFILTER, D3DTEXF_LINEAR);
|
||||
STATEMANAGER.SaveSamplerState(0, D3DSAMP_ADDRESSU, D3DTADDRESS_WRAP);
|
||||
STATEMANAGER.SaveSamplerState(0, D3DSAMP_ADDRESSV, D3DTADDRESS_WRAP);
|
||||
|
||||
STATEMANAGER.SetTextureStageState(0, D3DTSS_COLORARG1, D3DTA_TEXTURE);
|
||||
STATEMANAGER.SetTextureStageState(0, D3DTSS_COLOROP, D3DTOP_SELECTARG1);
|
||||
@@ -123,11 +124,11 @@ void CMapOutdoor::RenderWater()
|
||||
// RenderState
|
||||
STATEMANAGER.RestoreVertexShader();
|
||||
STATEMANAGER.RestoreTransform(D3DTS_TEXTURE0);
|
||||
STATEMANAGER.RestoreTextureStageState(0, D3DTSS_MINFILTER);
|
||||
STATEMANAGER.RestoreTextureStageState(0, D3DTSS_MAGFILTER);
|
||||
STATEMANAGER.RestoreTextureStageState(0, D3DTSS_MIPFILTER);
|
||||
STATEMANAGER.RestoreTextureStageState(0, D3DTSS_ADDRESSU);
|
||||
STATEMANAGER.RestoreTextureStageState(0, D3DTSS_ADDRESSV);
|
||||
STATEMANAGER.RestoreSamplerState(0, D3DSAMP_MINFILTER);
|
||||
STATEMANAGER.RestoreSamplerState(0, D3DSAMP_MAGFILTER);
|
||||
STATEMANAGER.RestoreSamplerState(0, D3DSAMP_MIPFILTER);
|
||||
STATEMANAGER.RestoreSamplerState(0, D3DSAMP_ADDRESSU);
|
||||
STATEMANAGER.RestoreSamplerState(0, D3DSAMP_ADDRESSV);
|
||||
STATEMANAGER.RestoreTextureStageState(0, D3DTSS_TEXCOORDINDEX);
|
||||
STATEMANAGER.RestoreTextureStageState(0, D3DTSS_TEXTURETRANSFORMFLAGS);
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user