📄 d3dtypes.h
字号:
D3DTSS_MAXANISOTROPY = 21, /* DWORD maximum anisotropy */
D3DTSS_BUMPENVLSCALE = 22, /* D3DVALUE scale for bump map luminance */
D3DTSS_BUMPENVLOFFSET = 23, /* D3DVALUE offset for bump map luminance */
D3DTSS_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */
} D3DTEXTURESTAGESTATETYPE;
/*
* 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
#define D3DTA_COMPLEMENT 0x00000010 // take 1.0 - x
#define D3DTA_ALPHAREPLICATE 0x00000020 // replicate alpha to color components
/*
* IDirect3DTexture2 State Filter Types
*/
typedef enum _D3DTEXTUREMAGFILTER
{
D3DTFG_POINT = 1, // nearest
D3DTFG_LINEAR = 2, // linear interpolation
D3DTFG_FLATCUBIC = 3, // cubic
D3DTFG_GAUSSIANCUBIC = 4, // different cubic kernel
D3DTFG_ANISOTROPIC = 5, //
D3DTFG_FORCE_DWORD = 0x7fffffff, // force 32-bit size enum
} D3DTEXTUREMAGFILTER;
typedef enum _D3DTEXTUREMINFILTER
{
D3DTFN_POINT = 1, // nearest
D3DTFN_LINEAR = 2, // linear interpolation
D3DTFN_ANISOTROPIC = 3, //
D3DTFN_FORCE_DWORD = 0x7fffffff, // force 32-bit size enum
} D3DTEXTUREMINFILTER;
typedef enum _D3DTEXTUREMIPFILTER
{
D3DTFP_NONE = 1, // mipmapping disabled (use MAG filter)
D3DTFP_POINT = 2, // nearest
D3DTFP_LINEAR = 3, // linear interpolation
D3DTFP_FORCE_DWORD = 0x7fffffff, // force 32-bit size enum
} D3DTEXTUREMIPFILTER;
/*
* Triangle flags
*/
/*
* Tri strip and fan flags.
* START loads all three vertices
* EVEN and ODD load just v3 with even or odd culling
* START_FLAT contains a count from 0 to 29 that allows the
* whole strip or fan to be culled in one hit.
* e.g. for a quad len = 1
*/
#define D3DTRIFLAG_START 0x00000000L
#define D3DTRIFLAG_STARTFLAT(len) (len) /* 0 < len < 30 */
#define D3DTRIFLAG_ODD 0x0000001eL
#define D3DTRIFLAG_EVEN 0x0000001fL
/*
* Triangle edge flags
* enable edges for wireframe or antialiasing
*/
#define D3DTRIFLAG_EDGEENABLE1 0x00000100L /* v0-v1 edge */
#define D3DTRIFLAG_EDGEENABLE2 0x00000200L /* v1-v2 edge */
#define D3DTRIFLAG_EDGEENABLE3 0x00000400L /* v2-v0 edge */
#define D3DTRIFLAG_EDGEENABLETRIANGLE \
(D3DTRIFLAG_EDGEENABLE1 | D3DTRIFLAG_EDGEENABLE2 | D3DTRIFLAG_EDGEENABLE3)
/*
* Primitive structures and related defines. Vertex offsets are to types
* D3DVERTEX, D3DLVERTEX, or D3DTLVERTEX.
*/
/*
* Triangle list primitive structure
*/
typedef struct _D3DTRIANGLE {
union {
WORD v1; /* Vertex indices */
WORD wV1;
};
union {
WORD v2;
WORD wV2;
};
union {
WORD v3;
WORD wV3;
};
WORD wFlags; /* Edge (and other) flags */
} D3DTRIANGLE, *LPD3DTRIANGLE;
/*
* Line list structure.
* The instruction count defines the number of line segments.
*/
typedef struct _D3DLINE {
union {
WORD v1; /* Vertex indices */
WORD wV1;
};
union {
WORD v2;
WORD wV2;
};
} D3DLINE, *LPD3DLINE;
/*
* Span structure
* Spans join a list of points with the same y value.
* If the y value changes, a new span is started.
*/
typedef struct _D3DSPAN {
WORD wCount; /* Number of spans */
WORD wFirst; /* Index to first vertex */
} D3DSPAN, *LPD3DSPAN;
/*
* Point structure
*/
typedef struct _D3DPOINT {
WORD wCount; /* number of points */
WORD wFirst; /* index to first vertex */
} D3DPOINT, *LPD3DPOINT;
/*
* Forward branch structure.
* Mask is logically anded with the driver status mask
* if the result equals 'value', the branch is taken.
*/
typedef struct _D3DBRANCH {
DWORD dwMask; /* Bitmask against D3D status */
DWORD dwValue;
BOOL bNegate; /* TRUE to negate comparison */
DWORD dwOffset; /* How far to branch forward (0 for exit)*/
} D3DBRANCH, *LPD3DBRANCH;
/*
* Status used for set status instruction.
* The D3D status is initialised on device creation
* and is modified by all execute calls.
*/
typedef struct _D3DSTATUS {
DWORD dwFlags; /* Do we set extents or status */
DWORD dwStatus; /* D3D status */
D3DRECT drExtent;
} D3DSTATUS, *LPD3DSTATUS;
#define D3DSETSTATUS_STATUS 0x00000001L
#define D3DSETSTATUS_EXTENTS 0x00000002L
#define D3DSETSTATUS_ALL (D3DSETSTATUS_STATUS | D3DSETSTATUS_EXTENTS)
typedef struct _D3DCLIPSTATUS {
DWORD dwFlags; /* Do we set 2d extents, 3D extents or status */
DWORD dwStatus; /* Clip status */
float minx, maxx; /* X extents */
float miny, maxy; /* Y extents */
float minz, maxz; /* Z extents */
} D3DCLIPSTATUS, *LPD3DCLIPSTATUS;
#define D3DCLIPSTATUS_STATUS 0x00000001L
#define D3DCLIPSTATUS_EXTENTS2 0x00000002L
#define D3DCLIPSTATUS_EXTENTS3 0x00000004L
/*
* Statistics structure
*/
typedef struct _D3DSTATS {
DWORD dwSize;
DWORD dwTrianglesDrawn;
DWORD dwLinesDrawn;
DWORD dwPointsDrawn;
DWORD dwSpansDrawn;
DWORD dwVerticesProcessed;
} D3DSTATS, *LPD3DSTATS;
/*
* Execute options.
* When calling using D3DEXECUTE_UNCLIPPED all the primitives
* inside the buffer must be contained within the viewport.
*/
#define D3DEXECUTE_CLIPPED 0x00000001l
#define D3DEXECUTE_UNCLIPPED 0x00000002l
typedef struct _D3DEXECUTEDATA {
DWORD dwSize;
DWORD dwVertexOffset;
DWORD dwVertexCount;
DWORD dwInstructionOffset;
DWORD dwInstructionLength;
DWORD dwHVertexOffset;
D3DSTATUS dsStatus; /* Status after execute */
} D3DEXECUTEDATA, *LPD3DEXECUTEDATA;
/*
* Palette flags.
* This are or'ed with the peFlags in the PALETTEENTRYs passed to DirectDraw.
*/
#define D3DPAL_FREE 0x00 /* Renderer may use this entry freely */
#define D3DPAL_READONLY 0x40 /* Renderer may not set this entry */
#define D3DPAL_RESERVED 0x80 /* Renderer may not use this entry */
typedef struct _D3DVERTEXBUFFERDESC {
DWORD dwSize;
DWORD dwCaps;
DWORD dwFVF;
DWORD dwNumVertices;
} D3DVERTEXBUFFERDESC, *LPD3DVERTEXBUFFERDESC;
/* These correspond to DDSCAPS_* flags */
#define D3DVBCAPS_SYSTEMMEMORY 0x00000800l
#define D3DVBCAPS_WRITEONLY 0x00010000l
#define D3DVBCAPS_OPTIMIZED 0x80000000l
/* Vertex Operations for ProcessVertices */
#define D3DVOP_LIGHT (1 << 10)
#define D3DVOP_TRANSFORM (1 << 0)
#define D3DVOP_CLIP (1 << 2)
#define D3DVOP_EXTENTS (1 << 3)
//-------------------------------------------------------------------
// Flexible vertex format bits
//
#define D3DFVF_RESERVED0 0x001
#define D3DFVF_POSITION_MASK 0x00E
#define D3DFVF_XYZ 0x002
#define D3DFVF_XYZRHW 0x004
#define D3DFVF_NORMAL 0x010
#define D3DFVF_RESERVED1 0x020
#define D3DFVF_DIFFUSE 0x040
#define D3DFVF_SPECULAR 0x080
#define D3DFVF_TEXCOUNT_MASK 0xf00
#define D3DFVF_TEXCOUNT_SHIFT 8
#define D3DFVF_TEX0 0x000
#define D3DFVF_TEX1 0x100
#define D3DFVF_TEX2 0x200
#define D3DFVF_TEX3 0x300
#define D3DFVF_TEX4 0x400
#define D3DFVF_TEX5 0x500
#define D3DFVF_TEX6 0x600
#define D3DFVF_TEX7 0x700
#define D3DFVF_TEX8 0x800
#define D3DFVF_RESERVED2 0xf000 // 4 reserved bits
#define D3DFVF_VERTEX ( D3DFVF_XYZ | D3DFVF_NORMAL | D3DFVF_TEX1 )
#define D3DFVF_LVERTEX ( D3DFVF_XYZ | D3DFVF_RESERVED1 | D3DFVF_DIFFUSE | \
D3DFVF_SPECULAR | D3DFVF_TEX1 )
#define D3DFVF_TLVERTEX ( D3DFVF_XYZRHW | D3DFVF_DIFFUSE | D3DFVF_SPECULAR | \
D3DFVF_TEX1 )
typedef struct _D3DDP_PTRSTRIDE
{
LPVOID lpvData;
DWORD dwStride;
} D3DDP_PTRSTRIDE;
#define D3DDP_MAXTEXCOORD 8
typedef struct _D3DDRAWPRIMITIVESTRIDEDDATA
{
D3DDP_PTRSTRIDE position;
D3DDP_PTRSTRIDE normal;
D3DDP_PTRSTRIDE diffuse;
D3DDP_PTRSTRIDE specular;
D3DDP_PTRSTRIDE textureCoords[D3DDP_MAXTEXCOORD];
} D3DDRAWPRIMITIVESTRIDEDDATA, *LPD3DDRAWPRIMITIVESTRIDEDDATA;
//---------------------------------------------------------------------
// ComputeSphereVisibility return values
//
#define D3DVIS_INSIDE_FRUSTUM 0
#define D3DVIS_INTERSECT_FRUSTUM 1
#define D3DVIS_OUTSIDE_FRUSTUM 2
#define D3DVIS_INSIDE_LEFT 0
#define D3DVIS_INTERSECT_LEFT (1 << 2)
#define D3DVIS_OUTSIDE_LEFT (2 << 2)
#define D3DVIS_INSIDE_RIGHT 0
#define D3DVIS_INTERSECT_RIGHT (1 << 4)
#define D3DVIS_OUTSIDE_RIGHT (2 << 4)
#define D3DVIS_INSIDE_TOP 0
#define D3DVIS_INTERSECT_TOP (1 << 6)
#define D3DVIS_OUTSIDE_TOP (2 << 6)
#define D3DVIS_INSIDE_BOTTOM 0
#define D3DVIS_INTERSECT_BOTTOM (1 << 8)
#define D3DVIS_OUTSIDE_BOTTOM (2 << 8)
#define D3DVIS_INSIDE_NEAR 0
#define D3DVIS_INTERSECT_NEAR (1 << 10)
#define D3DVIS_OUTSIDE_NEAR (2 << 10)
#define D3DVIS_INSIDE_FAR 0
#define D3DVIS_INTERSECT_FAR (1 << 12)
#define D3DVIS_OUTSIDE_FAR (2 << 12)
#define D3DVIS_MASK_FRUSTUM (3 << 0)
#define D3DVIS_MASK_LEFT (3 << 2)
#define D3DVIS_MASK_RIGHT (3 << 4)
#define D3DVIS_MASK_TOP (3 << 6)
#define D3DVIS_MASK_BOTTOM (3 << 8)
#define D3DVIS_MASK_NEAR (3 << 10)
#define D3DVIS_MASK_FAR (3 << 12)
#pragma pack()
#endif /* _D3DTYPES_H_ */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -