📄 d3dtypes.h
字号:
/*
* Options for direct transform calls
*/
#define D3DTRANSFORM_CLIPPED 0x00000001l
#define D3DTRANSFORM_UNCLIPPED 0x00000002l
typedef struct _D3DTRANSFORMDATA {
DWORD dwSize;
LPVOID lpIn; /* Input vertices */
DWORD dwInSize; /* Stride of input vertices */
LPVOID lpOut; /* Output vertices */
DWORD dwOutSize; /* Stride of output vertices */
LPD3DHVERTEX lpHOut; /* Output homogeneous vertices */
DWORD dwClip; /* Clipping hint */
DWORD dwClipIntersection;
DWORD dwClipUnion; /* Union of all clip flags */
D3DRECT drExtent; /* Extent of transformed vertices */
} D3DTRANSFORMDATA, *LPD3DTRANSFORMDATA;
/*
* Structure defining position and direction properties for lighting.
*/
typedef struct _D3DLIGHTINGELEMENT {
D3DVECTOR dvPosition; /* Lightable point in model space */
D3DVECTOR dvNormal; /* Normalised unit vector */
} D3DLIGHTINGELEMENT, *LPD3DLIGHTINGELEMENT;
/*
* Structure defining material properties for lighting.
*/
typedef struct _D3DMATERIAL {
DWORD dwSize;
union {
D3DCOLORVALUE diffuse; /* Diffuse color RGBA */
D3DCOLORVALUE dcvDiffuse;
};
union {
D3DCOLORVALUE ambient; /* Ambient color RGB */
D3DCOLORVALUE dcvAmbient;
};
union {
D3DCOLORVALUE specular; /* Specular 'shininess' */
D3DCOLORVALUE dcvSpecular;
};
union {
D3DCOLORVALUE emissive; /* Emissive color RGB */
D3DCOLORVALUE dcvEmissive;
};
union {
D3DVALUE power; /* Sharpness if specular highlight */
D3DVALUE dvPower;
};
D3DTEXTUREHANDLE hTexture; /* Handle to texture map */
DWORD dwRampSize;
} D3DMATERIAL, *LPD3DMATERIAL;
#if(DIRECT3D_VERSION >= 0x0700)
typedef struct _D3DMATERIAL7 {
union {
D3DCOLORVALUE diffuse; /* Diffuse color RGBA */
D3DCOLORVALUE dcvDiffuse;
};
union {
D3DCOLORVALUE ambient; /* Ambient color RGB */
D3DCOLORVALUE dcvAmbient;
};
union {
D3DCOLORVALUE specular; /* Specular 'shininess' */
D3DCOLORVALUE dcvSpecular;
};
union {
D3DCOLORVALUE emissive; /* Emissive color RGB */
D3DCOLORVALUE dcvEmissive;
};
union {
D3DVALUE power; /* Sharpness if specular highlight */
D3DVALUE dvPower;
};
} D3DMATERIAL7, *LPD3DMATERIAL7;
#endif /* DIRECT3D_VERSION >= 0x0700 */
#if(DIRECT3D_VERSION < 0x0800)
typedef enum _D3DLIGHTTYPE {
D3DLIGHT_POINT = 1,
D3DLIGHT_SPOT = 2,
D3DLIGHT_DIRECTIONAL = 3,
// Note: The following light type (D3DLIGHT_PARALLELPOINT)
// is no longer supported from D3D for DX7 onwards.
D3DLIGHT_PARALLELPOINT = 4,
#if(DIRECT3D_VERSION < 0x0500) // For backward compatible headers
D3DLIGHT_GLSPOT = 5,
#endif
D3DLIGHT_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */
} D3DLIGHTTYPE;
#else
typedef enum _D3DLIGHTTYPE D3DLIGHTTYPE;
#define D3DLIGHT_PARALLELPOINT (D3DLIGHTTYPE)4
#define D3DLIGHT_GLSPOT (D3DLIGHTTYPE)5
#endif //(DIRECT3D_VERSION < 0x0800)
/*
* Structure defining a light source and its properties.
*/
typedef struct _D3DLIGHT {
DWORD dwSize;
D3DLIGHTTYPE dltType; /* Type of light source */
D3DCOLORVALUE dcvColor; /* Color of light */
D3DVECTOR dvPosition; /* Position in world space */
D3DVECTOR dvDirection; /* Direction in world space */
D3DVALUE dvRange; /* Cutoff range */
D3DVALUE dvFalloff; /* Falloff */
D3DVALUE dvAttenuation0; /* Constant attenuation */
D3DVALUE dvAttenuation1; /* Linear attenuation */
D3DVALUE dvAttenuation2; /* Quadratic attenuation */
D3DVALUE dvTheta; /* Inner angle of spotlight cone */
D3DVALUE dvPhi; /* Outer angle of spotlight cone */
} D3DLIGHT, *LPD3DLIGHT;
#if(DIRECT3D_VERSION >= 0x0700)
typedef struct _D3DLIGHT7 {
D3DLIGHTTYPE dltType; /* Type of light source */
D3DCOLORVALUE dcvDiffuse; /* Diffuse color of light */
D3DCOLORVALUE dcvSpecular; /* Specular color of light */
D3DCOLORVALUE dcvAmbient; /* Ambient color of light */
D3DVECTOR dvPosition; /* Position in world space */
D3DVECTOR dvDirection; /* Direction in world space */
D3DVALUE dvRange; /* Cutoff range */
D3DVALUE dvFalloff; /* Falloff */
D3DVALUE dvAttenuation0; /* Constant attenuation */
D3DVALUE dvAttenuation1; /* Linear attenuation */
D3DVALUE dvAttenuation2; /* Quadratic attenuation */
D3DVALUE dvTheta; /* Inner angle of spotlight cone */
D3DVALUE dvPhi; /* Outer angle of spotlight cone */
} D3DLIGHT7, *LPD3DLIGHT7;
#endif /* DIRECT3D_VERSION >= 0x0700 */
#if(DIRECT3D_VERSION >= 0x0500)
/*
* Structure defining a light source and its properties.
*/
/* flags bits */
#define D3DLIGHT_ACTIVE 0x00000001
#define D3DLIGHT_NO_SPECULAR 0x00000002
#define D3DLIGHT_ALL (D3DLIGHT_ACTIVE | D3DLIGHT_NO_SPECULAR)
/* maximum valid light range */
#define D3DLIGHT_RANGE_MAX ((float)sqrt(FLT_MAX))
typedef struct _D3DLIGHT2 {
DWORD dwSize;
D3DLIGHTTYPE dltType; /* Type of light source */
D3DCOLORVALUE dcvColor; /* Color of light */
D3DVECTOR dvPosition; /* Position in world space */
D3DVECTOR dvDirection; /* Direction in world space */
D3DVALUE dvRange; /* Cutoff range */
D3DVALUE dvFalloff; /* Falloff */
D3DVALUE dvAttenuation0; /* Constant attenuation */
D3DVALUE dvAttenuation1; /* Linear attenuation */
D3DVALUE dvAttenuation2; /* Quadratic attenuation */
D3DVALUE dvTheta; /* Inner angle of spotlight cone */
D3DVALUE dvPhi; /* Outer angle of spotlight cone */
DWORD dwFlags;
} D3DLIGHT2, *LPD3DLIGHT2;
#endif /* DIRECT3D_VERSION >= 0x0500 */
typedef struct _D3DLIGHTDATA {
DWORD dwSize;
LPD3DLIGHTINGELEMENT lpIn; /* Input positions and normals */
DWORD dwInSize; /* Stride of input elements */
LPD3DTLVERTEX lpOut; /* Output colors */
DWORD dwOutSize; /* Stride of output colors */
} D3DLIGHTDATA, *LPD3DLIGHTDATA;
#if(DIRECT3D_VERSION >= 0x0500)
/*
* Before DX5, these values were in an enum called
* D3DCOLORMODEL. This was not correct, since they are
* bit flags. A driver can surface either or both flags
* in the dcmColorModel member of D3DDEVICEDESC.
*/
#define D3DCOLOR_MONO 1
#define D3DCOLOR_RGB 2
typedef DWORD D3DCOLORMODEL;
#endif /* DIRECT3D_VERSION >= 0x0500 */
/*
* Options for clearing
*/
#define D3DCLEAR_TARGET 0x00000001l /* Clear target surface */
#define D3DCLEAR_ZBUFFER 0x00000002l /* Clear target z buffer */
#if(DIRECT3D_VERSION >= 0x0600)
#define D3DCLEAR_STENCIL 0x00000004l /* Clear stencil planes */
#endif /* DIRECT3D_VERSION >= 0x0600 */
/*
* Execute buffers are allocated via Direct3D. These buffers may then
* be filled by the application with instructions to execute along with
* vertex data.
*/
/*
* Supported op codes for execute instructions.
*/
typedef enum _D3DOPCODE {
D3DOP_POINT = 1,
D3DOP_LINE = 2,
D3DOP_TRIANGLE = 3,
D3DOP_MATRIXLOAD = 4,
D3DOP_MATRIXMULTIPLY = 5,
D3DOP_STATETRANSFORM = 6,
D3DOP_STATELIGHT = 7,
D3DOP_STATERENDER = 8,
D3DOP_PROCESSVERTICES = 9,
D3DOP_TEXTURELOAD = 10,
D3DOP_EXIT = 11,
D3DOP_BRANCHFORWARD = 12,
D3DOP_SPAN = 13,
D3DOP_SETSTATUS = 14,
#if(DIRECT3D_VERSION >= 0x0500)
D3DOP_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */
#endif /* DIRECT3D_VERSION >= 0x0500 */
} D3DOPCODE;
typedef struct _D3DINSTRUCTION {
BYTE bOpcode; /* Instruction opcode */
BYTE bSize; /* Size of each instruction data unit */
WORD wCount; /* Count of instruction data units to follow */
} D3DINSTRUCTION, *LPD3DINSTRUCTION;
/*
* Structure for texture loads
*/
typedef struct _D3DTEXTURELOAD {
D3DTEXTUREHANDLE hDestTexture;
D3DTEXTUREHANDLE hSrcTexture;
} D3DTEXTURELOAD, *LPD3DTEXTURELOAD;
/*
* Structure for picking
*/
typedef struct _D3DPICKRECORD {
BYTE bOpcode;
BYTE bPad;
DWORD dwOffset;
D3DVALUE dvZ;
} D3DPICKRECORD, *LPD3DPICKRECORD;
/*
* The following defines the rendering states which can be set in the
* execute buffer.
*/
#if(DIRECT3D_VERSION < 0x0800)
typedef enum _D3DSHADEMODE {
D3DSHADE_FLAT = 1,
D3DSHADE_GOURAUD = 2,
D3DSHADE_PHONG = 3,
#if(DIRECT3D_VERSION >= 0x0500)
D3DSHADE_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */
#endif /* DIRECT3D_VERSION >= 0x0500 */
} D3DSHADEMODE;
typedef enum _D3DFILLMODE {
D3DFILL_POINT = 1,
D3DFILL_WIREFRAME = 2,
D3DFILL_SOLID = 3,
#if(DIRECT3D_VERSION >= 0x0500)
D3DFILL_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */
#endif /* DIRECT3D_VERSION >= 0x0500 */
} D3DFILLMODE;
typedef struct _D3DLINEPATTERN {
WORD wRepeatFactor;
WORD wLinePattern;
} D3DLINEPATTERN;
#endif //(DIRECT3D_VERSION < 0x0800)
typedef enum _D3DTEXTUREFILTER {
D3DFILTER_NEAREST = 1,
D3DFILTER_LINEAR = 2,
D3DFILTER_MIPNEAREST = 3,
D3DFILTER_MIPLINEAR = 4,
D3DFILTER_LINEARMIPNEAREST = 5,
D3DFILTER_LINEARMIPLINEAR = 6,
#if(DIRECT3D_VERSION >= 0x0500)
D3DFILTER_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */
#endif /* DIRECT3D_VERSION >= 0x0500 */
} D3DTEXTUREFILTER;
#if(DIRECT3D_VERSION < 0x0800)
typedef enum _D3DBLEND {
D3DBLEND_ZERO = 1,
D3DBLEND_ONE = 2,
D3DBLEND_SRCCOLOR = 3,
D3DBLEND_INVSRCCOLOR = 4,
D3DBLEND_SRCALPHA = 5,
D3DBLEND_INVSRCALPHA = 6,
D3DBLEND_DESTALPHA = 7,
D3DBLEND_INVDESTALPHA = 8,
D3DBLEND_DESTCOLOR = 9,
D3DBLEND_INVDESTCOLOR = 10,
D3DBLEND_SRCALPHASAT = 11,
D3DBLEND_BOTHSRCALPHA = 12,
D3DBLEND_BOTHINVSRCALPHA = 13,
#if(DIRECT3D_VERSION >= 0x0500)
D3DBLEND_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */
#endif /* DIRECT3D_VERSION >= 0x0500 */
} D3DBLEND;
#endif //(DIRECT3D_VERSION < 0x0800)
typedef enum _D3DTEXTUREBLEND {
D3DTBLEND_DECAL = 1,
D3DTBLEND_MODULATE = 2,
D3DTBLEND_DECALALPHA = 3,
D3DTBLEND_MODULATEALPHA = 4,
D3DTBLEND_DECALMASK = 5,
D3DTBLEND_MODULATEMASK = 6,
D3DTBLEND_COPY = 7,
#if(DIRECT3D_VERSION >= 0x0500)
D3DTBLEND_ADD = 8,
D3DTBLEND_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */
#endif /* DIRECT3D_VERSION >= 0x0500 */
} D3DTEXTUREBLEND;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -