📄 d3dtypes.h
字号:
/*
* 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, //
#if(DIRECT3D_VERSION >= 0x0700)
#endif /* DIRECT3D_VERSION >= 0x0700 */
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;
#endif /* DIRECT3D_VERSION >= 0x0600 */
/*
* 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)
#if(DIRECT3D_VERSION >= 0x0500)
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
#endif /* DIRECT3D_VERSION >= 0x0500 */
/*
* 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 */
#if(DIRECT3D_VERSION >= 0x0600)
typedef struct _D3DVERTEXBUFFERDESC {
DWORD dwSize;
DWORD dwCaps;
DWORD dwFVF;
DWORD dwNumVertices;
} D3DVERTEXBUFFERDESC, *LPD3DVERTEXBUFFERDESC;
#define D3DVBCAPS_SYSTEMMEMORY 0x00000800l
#define D3DVBCAPS_WRITEONLY 0x00010000l
#define D3DVBCAPS_OPTIMIZED 0x80000000l
#define D3DVBCAPS_DONOTCLIP 0x00000001l
/* Vertex Operations for ProcessVertices */
#define D3DVOP_LIGHT (1 << 10)
#define D3DVOP_TRANSFORM (1 << 0)
#define D3DVOP_CLIP (1 << 2)
#define D3DVOP_EXTENTS (1 << 3)
/* The maximum number of vertices user can pass to any d3d
drawing function or to create vertex buffer with
*/
#define D3DMAXNUMVERTICES ((1<<16) - 1)
/* The maximum number of primitives user can pass to any d3d
drawing function.
*/
#define D3DMAXNUMPRIMITIVES ((1<<16) - 1)
#if(DIRECT3D_VERSION >= 0x0700)
/* Bits for dwFlags in ProcessVertices call */
#define D3DPV_DONOTCOPYDATA (1 << 0)
#endif /* DIRECT3D_VERSION >= 0x0700 */
//-------------------------------------------------------------------
// Flexible vertex format bits
//
#define D3DFVF_RESERVED0 0x001
#define D3DFVF_POSITION_MASK 0x00E
#define D3DFVF_XYZ 0x002
#define D3DFVF_XYZRHW 0x004
#if(DIRECT3D_VERSION >= 0x0700)
#define D3DFVF_XYZB1 0x006
#define D3DFVF_XYZB2 0x008
#define D3DFVF_XYZB3 0x00a
#define D3DFVF_XYZB4 0x00c
#define D3DFVF_XYZB5 0x00e
#endif /* DIRECT3D_VERSION >= 0x0700 */
#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)
#endif /* DIRECT3D_VERSION >= 0x0600 */
#if(DIRECT3D_VERSION >= 0x0700)
// To be used with GetInfo()
#define D3DDEVINFOID_TEXTUREMANAGER 1
#define D3DDEVINFOID_D3DTEXTUREMANAGER 2
#define D3DDEVINFOID_TEXTURING 3
typedef enum _D3DSTATEBLOCKTYPE
{
D3DSBT_ALL = 1, // capture all state
D3DSBT_PIXELSTATE = 2, // capture pixel state
D3DSBT_VERTEXSTATE = 3, // capture vertex state
D3DSBT_FORCE_DWORD = 0xffffffff
} D3DSTATEBLOCKTYPE;
// The D3DVERTEXBLENDFLAGS type is used with D3DRENDERSTATE_VERTEXBLEND state.
//
typedef enum _D3DVERTEXBLENDFLAGS
{
D3DVBLEND_DISABLE = 0, // Disable vertex blending
D3DVBLEND_1WEIGHT = 1, // blend between 2 matrices
D3DVBLEND_2WEIGHTS = 2, // blend between 3 matrices
D3DVBLEND_3WEIGHTS = 3, // blend between 4 matrices
} D3DVERTEXBLENDFLAGS;
typedef enum _D3DTEXTURETRANSFORMFLAGS {
D3DTTFF_DISABLE = 0, // texture coordinates are passed directly
D3DTTFF_COUNT1 = 1, // rasterizer should expect 1-D texture coords
D
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -