📄 d3dtypes.h
字号:
D3DRENDERSTATE_ALPHATESTENABLE = 15, /* TRUE to enable alpha tests */
D3DRENDERSTATE_LASTPIXEL = 16, /* TRUE for last-pixel on lines */
D3DRENDERSTATE_SRCBLEND = 19, /* D3DBLEND */
D3DRENDERSTATE_DESTBLEND = 20, /* D3DBLEND */
D3DRENDERSTATE_CULLMODE = 22, /* D3DCULL */
D3DRENDERSTATE_ZFUNC = 23, /* D3DCMPFUNC */
D3DRENDERSTATE_ALPHAREF = 24, /* D3DFIXED */
D3DRENDERSTATE_ALPHAFUNC = 25, /* D3DCMPFUNC */
D3DRENDERSTATE_DITHERENABLE = 26, /* TRUE to enable dithering */
#if(DIRECT3D_VERSION >= 0x0500)
D3DRENDERSTATE_ALPHABLENDENABLE = 27, /* TRUE to enable alpha blending */
#endif /* DIRECT3D_VERSION >= 0x0500 */
D3DRENDERSTATE_FOGENABLE = 28, /* TRUE to enable fog blending */
D3DRENDERSTATE_SPECULARENABLE = 29, /* TRUE to enable specular */
D3DRENDERSTATE_ZVISIBLE = 30, /* TRUE to enable z checking */
D3DRENDERSTATE_STIPPLEDALPHA = 33, /* TRUE to enable stippled alpha (RGB device only) */
D3DRENDERSTATE_FOGCOLOR = 34, /* D3DCOLOR */
D3DRENDERSTATE_FOGTABLEMODE = 35, /* D3DFOGMODE */
#if(DIRECT3D_VERSION >= 0x0700)
D3DRENDERSTATE_FOGSTART = 36, /* Fog start (for both vertex and pixel fog) */
D3DRENDERSTATE_FOGEND = 37, /* Fog end */
D3DRENDERSTATE_FOGDENSITY = 38, /* Fog density */
#endif /* DIRECT3D_VERSION >= 0x0700 */
#if(DIRECT3D_VERSION >= 0x0500)
D3DRENDERSTATE_EDGEANTIALIAS = 40, /* TRUE to enable edge antialiasing */
D3DRENDERSTATE_COLORKEYENABLE = 41, /* TRUE to enable source colorkeyed textures */
D3DRENDERSTATE_ZBIAS = 47, /* LONG Z bias */
D3DRENDERSTATE_RANGEFOGENABLE = 48, /* Enables range-based fog */
#endif /* DIRECT3D_VERSION >= 0x0500 */
#if(DIRECT3D_VERSION >= 0x0600)
D3DRENDERSTATE_STENCILENABLE = 52, /* BOOL enable/disable stenciling */
D3DRENDERSTATE_STENCILFAIL = 53, /* D3DSTENCILOP to do if stencil test fails */
D3DRENDERSTATE_STENCILZFAIL = 54, /* D3DSTENCILOP to do if stencil test passes and Z test fails */
D3DRENDERSTATE_STENCILPASS = 55, /* D3DSTENCILOP to do if both stencil and Z tests pass */
D3DRENDERSTATE_STENCILFUNC = 56, /* D3DCMPFUNC fn. Stencil Test passes if ((ref & mask) stencilfn (stencil & mask)) is true */
D3DRENDERSTATE_STENCILREF = 57, /* Reference value used in stencil test */
D3DRENDERSTATE_STENCILMASK = 58, /* Mask value used in stencil test */
D3DRENDERSTATE_STENCILWRITEMASK = 59, /* Write mask applied to values written to stencil buffer */
D3DRENDERSTATE_TEXTUREFACTOR = 60, /* D3DCOLOR used for multi-texture blend */
#endif /* DIRECT3D_VERSION >= 0x0600 */
#if(DIRECT3D_VERSION >= 0x0600)
/*
* 128 values [128, 255] are reserved for texture coordinate wrap flags.
* These are constructed with the D3DWRAP_U and D3DWRAP_V macros. Using
* a flags word preserves forward compatibility with texture coordinates
* that are >2D.
*/
D3DRENDERSTATE_WRAP0 = 128, /* wrap for 1st texture coord. set */
D3DRENDERSTATE_WRAP1 = 129, /* wrap for 2nd texture coord. set */
D3DRENDERSTATE_WRAP2 = 130, /* wrap for 3rd texture coord. set */
D3DRENDERSTATE_WRAP3 = 131, /* wrap for 4th texture coord. set */
D3DRENDERSTATE_WRAP4 = 132, /* wrap for 5th texture coord. set */
D3DRENDERSTATE_WRAP5 = 133, /* wrap for 6th texture coord. set */
D3DRENDERSTATE_WRAP6 = 134, /* wrap for 7th texture coord. set */
D3DRENDERSTATE_WRAP7 = 135, /* wrap for 8th texture coord. set */
#endif /* DIRECT3D_VERSION >= 0x0600 */
#if(DIRECT3D_VERSION >= 0x0700)
D3DRENDERSTATE_CLIPPING = 136,
D3DRENDERSTATE_LIGHTING = 137,
D3DRENDERSTATE_EXTENTS = 138,
D3DRENDERSTATE_AMBIENT = 139,
D3DRENDERSTATE_FOGVERTEXMODE = 140,
D3DRENDERSTATE_COLORVERTEX = 141,
D3DRENDERSTATE_LOCALVIEWER = 142,
D3DRENDERSTATE_NORMALIZENORMALS = 143,
D3DRENDERSTATE_COLORKEYBLENDENABLE = 144,
D3DRENDERSTATE_DIFFUSEMATERIALSOURCE = 145,
D3DRENDERSTATE_SPECULARMATERIALSOURCE = 146,
D3DRENDERSTATE_AMBIENTMATERIALSOURCE = 147,
D3DRENDERSTATE_EMISSIVEMATERIALSOURCE = 148,
D3DRENDERSTATE_VERTEXBLEND = 151,
D3DRENDERSTATE_CLIPPLANEENABLE = 152,
#endif /* DIRECT3D_VERSION >= 0x0700 */
//
// retired renderstates - not supported for DX7 interfaces
//
D3DRENDERSTATE_TEXTUREHANDLE = 1, /* Texture handle for legacy interfaces (Texture,Texture2) */
D3DRENDERSTATE_TEXTUREADDRESS = 3, /* D3DTEXTUREADDRESS */
D3DRENDERSTATE_WRAPU = 5, /* TRUE for wrapping in u */
D3DRENDERSTATE_WRAPV = 6, /* TRUE for wrapping in v */
D3DRENDERSTATE_MONOENABLE = 11, /* TRUE to enable mono rasterization */
D3DRENDERSTATE_ROP2 = 12, /* ROP2 */
D3DRENDERSTATE_PLANEMASK = 13, /* DWORD physical plane mask */
D3DRENDERSTATE_TEXTUREMAG = 17, /* D3DTEXTUREFILTER */
D3DRENDERSTATE_TEXTUREMIN = 18, /* D3DTEXTUREFILTER */
D3DRENDERSTATE_TEXTUREMAPBLEND = 21, /* D3DTEXTUREBLEND */
D3DRENDERSTATE_SUBPIXEL = 31, /* TRUE to enable subpixel correction */
D3DRENDERSTATE_SUBPIXELX = 32, /* TRUE to enable correction in X only */
D3DRENDERSTATE_STIPPLEENABLE = 39, /* TRUE to enable stippling */
#if(DIRECT3D_VERSION >= 0x0500)
D3DRENDERSTATE_BORDERCOLOR = 43, /* Border color for texturing w/border */
D3DRENDERSTATE_TEXTUREADDRESSU = 44, /* Texture addressing mode for U coordinate */
D3DRENDERSTATE_TEXTUREADDRESSV = 45, /* Texture addressing mode for V coordinate */
D3DRENDERSTATE_MIPMAPLODBIAS = 46, /* D3DVALUE Mipmap LOD bias */
D3DRENDERSTATE_ANISOTROPY = 49, /* Max. anisotropy. 1 = no anisotropy */
#endif /* DIRECT3D_VERSION >= 0x0500 */
D3DRENDERSTATE_FLUSHBATCH = 50, /* Explicit flush for DP batching (DX5 Only) */
#if(DIRECT3D_VERSION >= 0x0600)
D3DRENDERSTATE_TRANSLUCENTSORTINDEPENDENT=51, /* BOOL enable sort-independent transparency */
#endif /* DIRECT3D_VERSION >= 0x0600 */
D3DRENDERSTATE_STIPPLEPATTERN00 = 64, /* Stipple pattern 01... */
D3DRENDERSTATE_STIPPLEPATTERN01 = 65,
D3DRENDERSTATE_STIPPLEPATTERN02 = 66,
D3DRENDERSTATE_STIPPLEPATTERN03 = 67,
D3DRENDERSTATE_STIPPLEPATTERN04 = 68,
D3DRENDERSTATE_STIPPLEPATTERN05 = 69,
D3DRENDERSTATE_STIPPLEPATTERN06 = 70,
D3DRENDERSTATE_STIPPLEPATTERN07 = 71,
D3DRENDERSTATE_STIPPLEPATTERN08 = 72,
D3DRENDERSTATE_STIPPLEPATTERN09 = 73,
D3DRENDERSTATE_STIPPLEPATTERN10 = 74,
D3DRENDERSTATE_STIPPLEPATTERN11 = 75,
D3DRENDERSTATE_STIPPLEPATTERN12 = 76,
D3DRENDERSTATE_STIPPLEPATTERN13 = 77,
D3DRENDERSTATE_STIPPLEPATTERN14 = 78,
D3DRENDERSTATE_STIPPLEPATTERN15 = 79,
D3DRENDERSTATE_STIPPLEPATTERN16 = 80,
D3DRENDERSTATE_STIPPLEPATTERN17 = 81,
D3DRENDERSTATE_STIPPLEPATTERN18 = 82,
D3DRENDERSTATE_STIPPLEPATTERN19 = 83,
D3DRENDERSTATE_STIPPLEPATTERN20 = 84,
D3DRENDERSTATE_STIPPLEPATTERN21 = 85,
D3DRENDERSTATE_STIPPLEPATTERN22 = 86,
D3DRENDERSTATE_STIPPLEPATTERN23 = 87,
D3DRENDERSTATE_STIPPLEPATTERN24 = 88,
D3DRENDERSTATE_STIPPLEPATTERN25 = 89,
D3DRENDERSTATE_STIPPLEPATTERN26 = 90,
D3DRENDERSTATE_STIPPLEPATTERN27 = 91,
D3DRENDERSTATE_STIPPLEPATTERN28 = 92,
D3DRENDERSTATE_STIPPLEPATTERN29 = 93,
D3DRENDERSTATE_STIPPLEPATTERN30 = 94,
D3DRENDERSTATE_STIPPLEPATTERN31 = 95,
//
// retired renderstate names - the values are still used under new naming conventions
//
D3DRENDERSTATE_FOGTABLESTART = 36, /* Fog table start */
D3DRENDERSTATE_FOGTABLEEND = 37, /* Fog table end */
D3DRENDERSTATE_FOGTABLEDENSITY = 38, /* Fog table density */
#if(DIRECT3D_VERSION >= 0x0500)
D3DRENDERSTATE_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */
#endif /* DIRECT3D_VERSION >= 0x0500 */
} D3DRENDERSTATETYPE;
// Values for material source
typedef enum _D3DMATERIALCOLORSOURCE
{
D3DMCS_MATERIAL = 0, // Color from material is used
D3DMCS_COLOR1 = 1, // Diffuse vertex color is used
D3DMCS_COLOR2 = 2, // Specular vertex color is used
D3DMCS_FORCE_DWORD = 0x7fffffff, // force 32-bit size enum
} D3DMATERIALCOLORSOURCE;
#if(DIRECT3D_VERSION >= 0x0500)
// For back-compatibility with legacy compilations
#define D3DRENDERSTATE_BLENDENABLE D3DRENDERSTATE_ALPHABLENDENABLE
#endif /* DIRECT3D_VERSION >= 0x0500 */
#if(DIRECT3D_VERSION >= 0x0600)
// Bias to apply to the texture coordinate set to apply a wrap to.
#define D3DRENDERSTATE_WRAPBIAS 128UL
/* Flags to construct the WRAP render states */
#define D3DWRAP_U 0x00000001L
#define D3DWRAP_V 0x00000002L
#endif /* DIRECT3D_VERSION >= 0x0600 */
#if(DIRECT3D_VERSION >= 0x0700)
/* Flags to construct the WRAP render states for 1D thru 4D texture coordinates */
#define D3DWRAPCOORD_0 0x00000001L // same as D3DWRAP_U
#define D3DWRAPCOORD_1 0x00000002L // same as D3DWRAP_V
#define D3DWRAPCOORD_2 0x00000004L
#define D3DWRAPCOORD_3 0x00000008L
#endif /* DIRECT3D_VERSION >= 0x0700 */
#define D3DRENDERSTATE_STIPPLEPATTERN(y) (D3DRENDERSTATE_STIPPLEPATTERN00 + (y))
typedef struct _D3DSTATE {
union {
D3DTRANSFORMSTATETYPE dtstTransformStateType;
D3DLIGHTSTATETYPE dlstLightStateType;
D3DRENDERSTATETYPE drstRenderStateType;
};
union {
DWORD dwArg[1];
D3DVALUE dvArg[1];
};
} D3DSTATE, *LPD3DSTATE;
/*
* Operation used to load matrices
* hDstMat = hSrcMat
*/
typedef struct _D3DMATRIXLOAD {
D3DMATRIXHANDLE hDestMatrix; /* Destination matrix */
D3DMATRIXHANDLE hSrcMatrix; /* Source matrix */
} D3DMATRIXLOAD, *LPD3DMATRIXLOAD;
/*
* Operation used to multiply matrices
* hDstMat = hSrcMat1 * hSrcMat2
*/
typedef struct _D3DMATRIXMULTIPLY {
D3DMATRIXHANDLE hDestMatrix; /* Destination matrix */
D3DMATRIXHANDLE hSrcMatrix1; /* First source matrix */
D3DMATRIXHANDLE hSrcMatrix2; /* Second source matrix */
} D3DMATRIXMULTIPLY, *LPD3DMATRIXMULTIPLY;
/*
* Operation used to transform and light vertices.
*/
typedef struct _D3DPROCESSVERTICES {
DWORD dwFlags; /* Do we transform or light or just copy? */
WORD wStart; /* Index to first vertex in source */
WORD wDest; /* Index to first vertex in local buffer */
DWORD dwCount; /* Number of vertices to be processed */
DWORD dwReserved; /* Must be zero */
} D3DPROCESSVERTICES, *LPD3DPROCESSVERTICES;
#define D3DPROCESSVERTICES_TRANSFORMLIGHT 0x00000000L
#define D3DPROCESSVERTICES_TRANSFORM 0x00000001L
#define D3DPROCESSVERTICES_COPY 0x00000002L
#define D3DPROCESSVERTICES_OPMASK 0x00000007L
#define D3DPROCESSVERTICES_UPDATEEXTENTS 0x00000008L
#define D3DPROCESSVERTICES_NOCOLOR 0x00000010L
#if(DIRECT3D_VERSION >= 0x0600)
/*
* State enumerants for per-stage texture processing.
*/
typedef enum _D3DTEXTURESTAGESTATETYPE
{
D3DTSS_COLOROP = 1, /* D3DTEXTUREOP - per-stage blending controls for color channels */
D3DTSS_COLORARG1 = 2, /* D3DTA_* (texture arg) */
D3DTSS_COLORARG2 = 3, /* D3DTA_* (texture arg) */
D3DTSS_ALPHAOP = 4, /* D3DTEXTUREOP - per-stage blending controls for alpha channel */
D3DTSS_ALPHAARG1 = 5, /* D3DTA_* (texture arg) */
D3DTSS_ALPHAARG2 = 6, /* D3DTA_* (texture arg) */
D3DTSS_BUMPENVMAT00 = 7, /* D3DVALUE (bump mapping matrix) */
D3DTSS_BUMPENVMAT01 = 8, /* D3DVALUE (bump mapping matrix) */
D3DTSS_BUMPENVMAT10 = 9, /* D3DVALUE (bump mapping matrix) */
D3DTSS_BUMPENVMAT11 = 10, /* D3DVALUE (bump mapping matrix) */
D3DTSS_TEXCOORDINDEX = 11, /* identifies which set of texture coordinates index this texture */
D3DTSS_ADDRESS = 12, /* D3DTEXTUREADDRESS for both coordinates */
D3DTSS_ADDRESSU = 13, /* D3DTEXTUREADDRESS for U coordinate */
D3DTSS_ADDRESSV = 14, /* D3DTEXTUREADDRESS for V coordinate */
D3DTSS_BORDERCOLOR = 15, /* D3DCOLOR */
D3DTSS_MAGFILTER = 16, /* D3DTEXTUREMAGFILTER filter to use for magnification */
D3DTSS_MINFILTER = 17, /* D3DTEXTUREMINFILTER filter to use for minification */
D3DTSS_MIPFILTER = 18, /* D3DTEXTUREMIPFILTER filter to use between mipmaps during minification */
D3DTSS_MIPMAPLODBIAS = 19, /* D3DVALUE Mipmap LOD bias */
D3DTSS_MAXMIPLEVEL = 20, /* DWORD 0..(n-1) LOD index of largest map to use (0 == largest) */
D3DTSS_MAXANISOTROPY = 21, /* DWORD maximum anisotropy */
D3DTSS_BUMPENVLSCALE = 22, /* D3DVALUE scale for bump map luminance */
D3DTSS_BUMPENVLOFFSET = 23, /* D3DVALUE offset for bump map luminance */
#if(DIRECT3D_VERSION >= 0x0700)
D3DTSS_TEXTURETRANSFORMFLAGS = 24, /* D3DTEXTURETRANSFORMFLAGS controls texture transform */
#endif /* DIRECT3D_VERSION >= 0x0700 */
D3DTSS_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */
} D3DTEXTURESTAGESTATETYPE;
#if(DIRECT3D_VERSION >= 0x0700)
// Values, used with D3DTSS_TEXCOORDINDEX, to specify that the vertex data(position
// and normal in the camera space) should be taken as texture coordinates
// Low 16 bits are used to specify texture coordinate index, to take the WRAP mode from
//
#define D3DTSS_TCI_PASSTHRU 0x00000000
#define D3DTSS_TCI_CAMERASPACENORMAL 0x00010000
#define D3DTSS_TCI_CAMERASPACEPOSITION 0x00020000
#define D3DTSS_TCI_CAMERASPACEREFLECTIONVECTOR 0x00030000
#endif /* DIRECT3D_VERSION >= 0x0700 */
/*
* Enumerations for COLOROP and ALPHAOP texture blending operations set in
* texture processing stage controls in D3DRENDERSTATE.
*/
typedef enum _D3DTEXTUREOP
{
// Control
D3DTOP_DISABLE = 1, // disables stage
D3DTOP_SELECTARG1 = 2, // the default
D3DTOP_SELECTARG2 = 3,
// Modulate
D3DTOP_MODULATE = 4, // multiply args together
D3DTOP_MODULATE2X = 5, // multiply and 1 bit
D3DTOP_MODULATE4X = 6, // multiply and 2 bits
// Add
D3DTOP_ADD = 7, // add arguments together
D3DTOP_ADDSIGNED = 8, // add with -0.5 bias
D3DTOP_ADDSIGNED2X = 9, // as above but left 1 bit
D3DTOP_SUBTRACT = 10, // Arg1 - Arg2, with no saturation
D3DTOP_ADDSMOOTH = 11, // add 2 args, subtract product
// Arg1 + Arg2 - Arg1*Arg2
// = Arg1 + (1-Arg1)*Arg2
// Linear alpha blend: Arg1*(Alpha) + Arg2*(1-Alpha)
D3DTOP_BLENDDIFFUSEALPHA = 12, // iterated alpha
D3DTOP_BLENDTEXTUREALPHA = 13, // texture alpha
D3DTOP_BLENDFACTORALPHA = 14, // alpha from D3DRENDERSTATE_TEXTUREFACTOR
// Linear alpha blend with pre-multiplied arg1 input: Arg1 + Arg2*(1-Alpha)
D3DTOP_BLENDTEXTUREALPHAPM = 15, // texture alpha
D3DTOP_BLENDCURRENTALPHA = 16, // by alpha of current color
// Specular mapping
D3DTOP_PREMODULATE = 17, // modulate with next texture before use
D3DTOP_MODULATEALPHA_ADDCOLOR = 18, // Arg1.RGB + Arg1.A*Arg2.RGB
// COLOROP only
D3DTOP_MODULATECOLOR_ADDALPHA = 19, // Arg1.RGB*Arg2.RGB + Arg1.A
// COLOROP only
D3DTOP_MODULATEINVALPHA_ADDCOLOR = 20, // (1-Arg1.A)*Arg2.RGB + Arg1.RGB
// COLOROP only
D3DTOP_MODULATEINVCOLOR_ADDALPHA = 21, // (1-Arg1.RGB)*Arg2.RGB + Arg1.A
// COLOROP only
// Bump mapping
D3DTOP_BUMPENVMAP = 22, // per pixel env map perturbation
D3DTOP_BUMPENVMAPLUMINANCE = 23, // with luminance channel
// This can do either diffuse or specular bump mapping with correct input.
// Performs the function (Arg1.R*Arg2.R + Arg1.G*Arg2.G + Arg1.B*Arg2.B)
// where each component has been scaled and offset to make it signed.
// The result is replicated into all four (including alpha) channels.
// This is a valid COLOROP only.
D3DTOP_DOTPRODUCT3 = 24,
D3DTOP_FORCE_DWORD = 0x7fffffff,
} D3DTEXTUREOP;
/*
* Values for COLORARG1,2 and ALPHAARG1,2 texture blending operations
* set in texture processing stage controls in D3DRENDERSTATE.
*/
#define D3DTA_SELECTMASK 0x0000000f // mask for arg selector
#define D3DTA_DIFFUSE 0x00000000 // select diffuse color
#define D3DTA_CURRENT 0x00000001 // select result of previous stage
#define D3DTA_TEXTURE 0x00000002 // select texture color
#define D3DTA_TFACTOR 0x00000003 // select RENDERSTATE_TEXTUREFACTOR
#if(DIRECT3D_VERSION >= 0x0700)
#define D3DTA_SPECULAR 0x00000004 // select specular color
#endif /* DIRECT3D_VERSION >= 0x0700 */
#define D3DTA_COMPLEMENT 0x00000010 // take 1.0 - x
#define D3DTA_ALPHAREPLICATE 0x00000020 // replicate alpha to color components
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -