typedef struct _D3DPrimCaps {
DWORD dwSize;
DWORD dwMiscCaps;
DWORD dwRasterCaps;
DWORD dwZCmpCaps;
DWORD dwSrcBlendCaps;
DWORD dwDestBlendCaps;
DWORD dwAlphaCmpCaps;
DWORD dwShadeCaps;
DWORD dwTextureCaps;
DWORD dwTextureFilterCaps;
DWORD dwTextureBlendCaps;
DWORD dwTextureAddressCaps;
DWORD dwStippleWidth;
DWORD dwStippleHeight;
} D3DPRIMCAPS, *LPD3DPRIMCAPS;
Defines the capabilities for each primitive type. This structure is used when creating a device and when querying the capabilities of a device. This structure defines several members in the D3DDEVICEDESC structure.
Size, in bytes, of this structure.
General capabilities for this primitive. This member can be one or more of the following:
The device conforms to the OpenGL standard.
The driver supports counterclockwise culling through the D3DRENDERSTATE_CULLMODE state. (This applies only to triangle primitives.) This corresponds to the D3DCULL_CCW member of the D3DCULL enumerated type.
The driver supports clockwise triangle culling through the D3DRENDERSTATE_CULLMODE state. (This applies only to triangle primitives.) This corresponds to the D3DCULL_CW member of the D3DCULL enumerated type.
The driver does not perform triangle culling. This corresponds to the D3DCULL_NONE member of the D3DCULL enumerated type.
The driver can handle values other than 1 in the wRepeatFactor member of the D3DLINEPATTERN structure. (This applies only to line-drawing primitives.)
The device can perform a bitmask of color planes.
The device can enable and disable modification of the z-buffer on pixel operations.
Information on raster-drawing capabilities. This member can be one or more of the following:
The device can dither to improve color resolution.
The device calculates the fog value by referring to a lookup table containing fog values that are indexed to the depth of a given pixel.
The device calculates the fog value during the lighting operation, places the value into the alpha component of the D3DCOLOR value given for the specular member of the D3DTLVERTEX structure, and interpolates the fog value during rasterization.
The driver can perform patterned drawing (lines or fills with D3DRENDERSTATE_LINEPATTERN or one of the D3DRENDERSTATE_STIPPLEPATTERN render states) for the primitive being queried.
The device can support raster operations other than R2_COPYPEN.
The device can stipple polygons to simulate translucency.
The device performs subpixel placement of z, color, and texture data, rather than working with the nearest integer pixel coordinate. This helps avoid bleed-through due to z imprecision, and jitter of color and texture values for pixels. Note that there is no corresponding state that can be enabled and disabled; the device either performs subpixel placement or it does not, and this bit is present only so that the Direct3D client will be better able to determine what the rendering quality will be.
The device is subpixel accurate along the x-axis only and is clamped to an integer y-axis scanline. For information about subpixel accuracy, see D3DPRASTERCAPS_SUBPIXEL.
The device can support XOR operations. If this flag is not set but D3DPRIM_RASTER_ROP2 is set, then XOR operations must still be supported.
The device can perform z-test operations. This effectively renders a primitive and indicates whether any z pixels would have been rendered.
Z-buffer comparison functions that the driver can perform. This member can be one or more of the following:
Always pass the z test.
Pass the z test if the new z equals the current z.
Pass the z test if the new z is greater than the current z.
Pass the z test if the new z is greater than or equal to the current z.
Pass the z test if the new z is less than the current z.
Pass the z test if the new z is less than or equal to the current z.
Always fail the z test.
Pass the z test if the new z does not equal the current z.
Source blending capabilities. This member can be one or more of the following. (The RGBA values of the source and destination are indicated with the subscripts s and d.)
Source blend factor is (1-As, 1-As, 1-As, 1-As) and destination blend factor is (As, As, As, As); the destination blend selection is overridden.
Source blend factor is (As, As, As, As) and destination blend factor is (1-As, 1-As, 1-As, 1-As); the destination blend selection is overridden.
Blend factor is (Ad, Ad, Ad, Ad).
Blend factor is (Rd, Gd, Bd, Ad).
Blend factor is (1-Ad, 1-Ad, 1-Ad, 1-Ad).
Blend factor is (1-Rd, 1-Gd, 1-Bd, 1-Ad).
Blend factor is (1-As, 1-As, 1-As, 1-As).
Blend factor is (1-Rd, 1-Gd, 1-Bd, 1-Ad).
Blend factor is (1, 1, 1, 1).
Blend factor is (As, As, As, As).
Blend factor is (f, f, f, 1); f = min(As, 1-Ad).
Blend factor is (Rs, Gs, Bs, As).
Blend factor is (0, 0, 0, 0).
Destination blending capabilities. This member can be the same capabilities that are defined for the dwSrcBlendCaps member.
Alpha-test comparison functions that the driver can perform. This member can be the same capabilities that are defined for the dwZCmpCaps member.
Shading operations that the device can perform. It is assumed, in general, that if a device supports a given command (such as D3DOP_TRIANGLE) at all, it supports the D3DSHADE_FLAT mode (as specified in the D3DSHADEMODE enumerated type). This flag specifies whether the driver can also support Gouraud and Phong shading and whether alpha color components are supported for each of the three color-generation modes. When alpha components are not supported in a given mode, the alpha value of colors generated in that mode is implicitly 255. This is the maximum possible alpha (that is, the alpha component is at full intensity).
The color, specular highlights, fog, and alpha interpolants of a triangle each have capability flags that an application can use to find out how they are implemented by the device driver. These are modified by the shade mode, color model, and by whether the alpha component of a color is blended or stippled. For more information, see Polygons.
This member can be one or more of the following:
D3DPSHADECAPS_ALPHAFLATSTIPPLED
Device can support an alpha component for flat blended and stippled transparency, respectively (the D3DSHADE_FLAT state for the D3DSHADEMODE enumerated type). In these modes, the alpha color component for a primitive is provided as part of the color for the first vertex of the primitive.
D3DPSHADECAPS_ALPHAGOURAUDBLEND
D3DPSHADECAPS_ALPHAGOURAUDSTIPPLED
Device can support an alpha component for Gouraud blended and stippled transparency, respectively (the D3DSHADE_GOURAUD state for the D3DSHADEMODE enumerated type). In these modes, the alpha color component for a primitive is provided at vertices and interpolated across a face along with the other color components.
D3DPSHADECAPS_ALPHAPHONGSTIPPLED
Device can support an alpha component for Phong blended and stippled transparency, respectively (the D3DSHADE_PHONG state for the D3DSHADEMODE enumerated type). In these modes, vertex parameters are reevaluated on a per-pixel basis, applying lighting effects for the red, green, and blue color components. Phong shading is not currently supported.
Device can support colored flat shading in the D3DCOLOR_MONO and D3DCOLOR_RGB color models, respectively. In these modes, the color component for a primitive is provided as part of the color for the first vertex of the primitive. In monochromatic lighting modes, only the blue component of the color is interpolated; in RGB lighting modes, of course, the red, green, and blue components are interpolated.
D3DPSHADECAPS_COLORGOURAUDMONO
Device can support colored Gouraud shading in the D3DCOLOR_MONO and D3DCOLOR_RGB color models, respectively. In these modes, the color component for a primitive is provided at vertices and interpolated across a face along with the other color components. In monochromatic lighting modes, only the blue component of the color is interpolated; in RGB lighting modes, of course, the red, green, and blue components are interpolated.
Device can support colored Phong shading in the D3DCOLOR_MONO and D3DCOLOR_RGB color models, respectively. In these modes, vertex parameters are reevaluated on a per-pixel basis. Lighting effects are applied for the red, green, and blue color components in RGB mode, and for the blue component only for monochromatic mode. Phong shading is not currently supported.
Device can support fog in the flat, Gouraud, and Phong shading models, respectively. Phong shading is not currently supported.
D3DPSHADECAPS_SPECULARFLATMONO
Device can support specular highlights in flat shading in the D3DCOLOR_MONO and D3DCOLOR_RGB color models, respectively.
D3DPSHADECAPS_SPECULARGOURAUDMONO
D3DPSHADECAPS_SPECULARGOURAUDRGB
Device can support specular highlights in Gouraud shading in the D3DCOLOR_MONO and D3DCOLOR_RGB color models, respectively.
D3DPSHADECAPS_SPECULARPHONGMONO
D3DPSHADECAPS_SPECULARPHONGRGB
Device can support specular highlights in Phong shading in the D3DCOLOR_MONO and D3DCOLOR_RGB color models, respectively. Phong shading is not currently supported.
Miscellaneous texture-mapping capabilities. This member can be one or more of the following:
Supports RGBA textures in the D3DTEX_DECAL and D3DTEX_MODULATE texture filtering modes. If this capability is not set, then only RGB textures are supported in those modes. Regardless of the setting of this flag, alpha must always be supported in D3DTEX_DECAL_MASK, D3DTEX_DECAL_ALPHA, and D3DTEX_MODULATE_ALPHA filtering modes whenever those filtering modes are available.
Supports texture mapping along borders.
Perspective correction is supported.
All non-mipmapped textures must have widths and heights specified as powers of two if this flag is set. (Note that all mipmapped textures must always have dimensions that are powers of two.)
All textures must be square.
Texture transparency is supported. (Only those texels that are not the current transparent color are drawn.)
Texture-mapping capabilities. This member can be one or more of the following:
A weighted average of a 2-by-2 area of texels surrounding the desired pixel is used. This applies to both zooming in and zooming out. If either zooming in or zooming out is supported, then both must be supported.
D3DPTFILTERCAPS_LINEARMIPLINEAR
Similar to D3DPRIM_TEX_MIP_LINEAR, but interpolates between the two nearest mipmaps.
D3DPTFILTERCAPS_LINEARMIPNEAREST
Similar to D3DPRIM_TEX_MIP_NEAREST, but interpolates between the two nearest mipmaps.
Similar to D3DPRIM_TEX_LINEAR, but uses the appropriate mipmap for texel selection.
Similar to D3DPRIM_TEX_NEAREST, but uses the appropriate mipmap for texel selection.
The texel with coordinates nearest to the desired pixel value is used. This applies to both zooming in and zooming out. If either zooming in or zooming out is supported, then both must be supported.
Texture-blending capabilities. See the D3DTEXTUREBLEND enumerated type for discussions of the various texture-blending modes. This member can be one or more of the following:
Copy mode texture-blending (D3DTBLEND_COPY from the D3DTEXTUREBLEND enumerated type) is supported.
Decal texture-blending mode (D3DTBLEND_DECAL from the D3DTEXTUREBLEND enumerated type) is supported.
Decal-alpha texture-blending mode (D3DTBLEND_DECALALPHA from the D3DTEXTUREBLEND enumerated type) is supported.
Decal-mask texture-blending mode (D3DTBLEND_DECALMASK from the D3DTEXTUREBLEND enumerated type) is supported.
Modulate texture-blending mode (D3DTBLEND_MODULATE from the D3DTEXTUREBLEND enumerated type) is supported.
Modulate-alpha texture-blending mode (D3DTBLEND_MODULATEALPHA from the D3DTEXTUREBLEND enumerated type) is supported.
Modulate-mask texture-blending mode (D3DTBLEND_MODULATEMASK from the D3DTEXTUREBLEND enumerated type) is supported.
Texture-addressing capabilities. This member can be one or more of the following:
Device can clamp textures to addresses.
Device can mirror textures to addresses.
Device can wrap textures to addresses.
dwStippleWidth and dwStippleHeight
Maximum width and height of the supported stipple (up to 32-by-32).