📄 d3dtypes.h
字号:
typedef enum _D3DFOGMODE {
D3DFOG_NONE = 0,
D3DFOG_EXP = 1,
D3DFOG_EXP2 = 2,
D3DFOG_LINEAR = 3
} D3DFOGMODE;
/*
* Amount to add to a state to generate the override for that state.
*/
#define D3DSTATE_OVERRIDE_BIAS 256
/*
* A state which sets the override flag for the specified state type.
*/
#define D3DSTATE_OVERRIDE(type) ((DWORD) (type) + D3DSTATE_OVERRIDE_BIAS)
typedef enum _D3DTRANSFORMSTATETYPE {
D3DTRANSFORMSTATE_WORLD = 1,
D3DTRANSFORMSTATE_VIEW = 2,
D3DTRANSFORMSTATE_PROJECTION = 3,
} D3DTRANSFORMSTATETYPE;
typedef enum _D3DLIGHTSTATETYPE {
D3DLIGHTSTATE_MATERIAL = 1,
D3DLIGHTSTATE_AMBIENT = 2,
D3DLIGHTSTATE_COLORMODEL = 3,
D3DLIGHTSTATE_FOGMODE = 4,
D3DLIGHTSTATE_FOGSTART = 5,
D3DLIGHTSTATE_FOGEND = 6,
D3DLIGHTSTATE_FOGDENSITY = 7,
} D3DLIGHTSTATETYPE;
typedef enum _D3DRENDERSTATETYPE {
D3DRENDERSTATE_TEXTUREHANDLE = 1, /* Texture handle */
D3DRENDERSTATE_ANTIALIAS = 2, /* Antialiasing prim edges */
D3DRENDERSTATE_TEXTUREADDRESS = 3, /* D3DTEXTUREADDRESS */
D3DRENDERSTATE_TEXTUREPERSPECTIVE = 4, /* TRUE for perspective correction */
D3DRENDERSTATE_WRAPU = 5, /* TRUE for wrapping in u */
D3DRENDERSTATE_WRAPV = 6, /* TRUE for wrapping in v */
D3DRENDERSTATE_ZENABLE = 7, /* TRUE to enable z test */
D3DRENDERSTATE_FILLMODE = 8, /* D3DFILL_MODE */
D3DRENDERSTATE_SHADEMODE = 9, /* D3DSHADEMODE */
D3DRENDERSTATE_LINEPATTERN = 10, /* D3DLINEPATTERN */
D3DRENDERSTATE_MONOENABLE = 11, /* TRUE to enable mono rasterization */
D3DRENDERSTATE_ROP2 = 12, /* ROP2 */
D3DRENDERSTATE_PLANEMASK = 13, /* DWORD physical plane mask */
D3DRENDERSTATE_ZWRITEENABLE = 14, /* TRUE to enable z writes */
D3DRENDERSTATE_ALPHATESTENABLE = 15, /* TRUE to enable alpha tests */
D3DRENDERSTATE_LASTPIXEL = 16, /* TRUE for last-pixel on lines */
D3DRENDERSTATE_TEXTUREMAG = 17, /* D3DTEXTUREFILTER */
D3DRENDERSTATE_TEXTUREMIN = 18, /* D3DTEXTUREFILTER */
D3DRENDERSTATE_SRCBLEND = 19, /* D3DBLEND */
D3DRENDERSTATE_DESTBLEND = 20, /* D3DBLEND */
D3DRENDERSTATE_TEXTUREMAPBLEND = 21, /* D3DTEXTUREBLEND */
D3DRENDERSTATE_CULLMODE = 22, /* D3DCULL */
D3DRENDERSTATE_ZFUNC = 23, /* D3DCMPFUNC */
D3DRENDERSTATE_ALPHAREF = 24, /* D3DFIXED */
D3DRENDERSTATE_ALPHAFUNC = 25, /* D3DCMPFUNC */
D3DRENDERSTATE_DITHERENABLE = 26, /* TRUE to enable dithering */
D3DRENDERSTATE_BLENDENABLE = 27, /* TRUE to enable alpha blending */
D3DRENDERSTATE_FOGENABLE = 28, /* TRUE to enable fog */
D3DRENDERSTATE_SPECULARENABLE = 29, /* TRUE to enable specular */
D3DRENDERSTATE_ZVISIBLE = 30, /* TRUE to enable z checking */
D3DRENDERSTATE_SUBPIXEL = 31, /* TRUE to enable subpixel correction */
D3DRENDERSTATE_SUBPIXELX = 32, /* TRUE to enable correction in X only */
D3DRENDERSTATE_STIPPLEDALPHA = 33, /* TRUE to enable stippled alpha */
D3DRENDERSTATE_FOGCOLOR = 34, /* D3DCOLOR */
D3DRENDERSTATE_FOGTABLEMODE = 35, /* D3DFOGMODE */
D3DRENDERSTATE_FOGTABLESTART = 36, /* Fog table start */
D3DRENDERSTATE_FOGTABLEEND = 37, /* Fog table end */
D3DRENDERSTATE_FOGTABLEDENSITY = 38, /* Fog table density */
D3DRENDERSTATE_STIPPLEENABLE = 39, /* TRUE to enable stippling */
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,
} D3DRENDERSTATETYPE;
#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
/*
* 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 strip structure.
* The instruction count - 1 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)
/*
* 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 defined(__cplusplus)
};
#endif
#pragma pack()
#endif /* _D3DTYPES_H_ */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -