The D3DPRIMCAPS structure 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.
typedef struct _D3DPrimCaps {
DWORD dwSize; // size of structure
DWORD dwMiscCaps; // miscellaneous caps
DWORD dwRasterCaps; // raster caps
DWORD dwZCmpCaps; // z-comparison caps
DWORD dwSrcBlendCaps; // source blending caps
DWORD dwDestBlendCaps; // destination blending caps
DWORD dwAlphaCmpCaps; // alpha-test comparison caps
DWORD dwShadeCaps; // shading caps
DWORD dwTextureCaps; // texture caps
DWORD dwTextureFilterCaps; // texture filtering caps
DWORD dwTextureBlendCaps; // texture blending caps
DWORD dwTextureAddressCaps; // texture addressing caps
DWORD dwStippleWidth; // stipple width
DWORD dwStippleHeight; // stipple height
} D3DPRIMCAPS, *LPD3DPRIMCAPS;
D3DPMISCCAPS_CONFORMANT | |
The device conforms to the OpenGL standard. | |
D3DPMISCCAPS_CULLCCW | |
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. | |
D3DPMISCCAPS_CULLCW | |
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. | |
D3DPMISCCAPS_CULLNONE | |
The driver does not perform triangle culling. This corresponds to the D3DCULL_NONE member of the D3DCULL enumerated type. | |
D3DPMISCCAPS_LINEPATTERNREP | |
The driver can handle values other than 1 in the wRepeatFactor member of the D3DLINEPATTERN structure. (This applies only to line-drawing primitives.) | |
D3DPMISCCAPS_MASKPLANES | |
The device can perform a bitmask of color planes. | |
D3DPMISCCAPS_MASKZ | |
The device can enable and disable modification of the z-buffer on pixel operations. |
D3DPRASTERCAPS_ANISOTROPY | |
The device supports anisotropic filtering. For more information, see D3DRENDERSTATE_ANISOTROPY in the D3DRENDERSTATETYPE structure. This flag was introduced in DirectX 5. |
|
D3DPRASTERCAPS_ANTIALIASEDGES | |
The device can antialias lines forming the convex outline of objects. For more information, see D3DRENDERSTATE_EDGEANTIALIAS in the D3DRENDERSTATETYPE structure. This flag was introduced in DirectX 5. |
|
D3DPRASTERCAPS_ANTIALIASSORTDEPENDENT | |
The device supports antialiasing that is dependent on the sort order of the polygons (back-to-front or front-to-back). The application must draw polygons in the right order for antialiasing to occur. For more information, see the D3DANTIALIASMODE enumerated type. This flag was introduced in DirectX 5. |
|
D3DPRASTERCAPS_ANTIALIASSORTINDEPENDENT | |
The device supports antialiasing that is not dependent on the sort order of the polygons. For more information, see the D3DANTIALIASMODE enumerated type. This flag was introduced in DirectX 5. |
|
D3DPRASTERCAPS_DITHER | |
The device can dither to improve color resolution. | |
D3DPRASTERCAPS_FOGRANGE | |
The device supports range-based fog. In range-based fog, the distance of an object from the viewer is used to compute fog effects, not the depth of the object (that is, the z-coordinate) in the scene. For more information, see D3DRENDERSTATE_RANGEFOGENABLE. This flag was introduced in DirectX 5. |
|
D3DPRASTERCAPS_FOGTABLE | |
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. | |
D3DPRASTERCAPS_FOGVERTEX | |
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. | |
D3DPRASTERCAPS_MIPMAPLODBIAS | |
The device supports level-of-detail (LOD) bias adjustments. These bias adjustments enable an application to make a mipmap appear crisper or less sharp than it normally would. For more information about LOD bias in mipmaps, see D3DRENDERSTATE_MIPMAPLODBIAS. This flag was introduced in DirectX 5. |
|
D3DPRASTERCAPS_PAT | |
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. | |
D3DPRASTERCAPS_ROP2 | |
The device can support raster operations other than R2_COPYPEN. | |
D3DPRASTERCAPS_STIPPLE | |
The device can stipple polygons to simulate translucency. | |
D3DPRASTERCAPS_SUBPIXEL | |
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. | |
D3DPRASTERCAPS_SUBPIXELX | |
The device is subpixel accurate along the x-axis only and is clamped to an integer y-axis scan line. For information about subpixel accuracy, see D3DPRASTERCAPS_SUBPIXEL. | |
D3DPRASTERCAPS_XOR | |
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. | |
D3DPRASTERCAPS_ZBIAS | |
The device supports z-bias values. These are integer values assigned to polygons that allow physically coplanar polygons to appear separate. For more information, see D3DRENDERSTATE_ZBIAS in the D3DRENDERSTATETYPE structure. This flag was introduced in DirectX 5. |
|
D3DPRASTERCAPS_ZBUFFERLESSHSR | |
The device can perform hidden-surface removal without requiring the application to sort polygons, and without requiring the allocation of a z-buffer. This leaves more video memory for textures. The method used to perform hidden-surface removal is hardware-dependent and is transparent to the application. Z-bufferless HSR is performed if no z-buffer surface is attached to the rendering-target surface and the z-buffer comparison test is enabled (that is, when the state value associated with the D3DRENDERSTATE_ZENABLE enumeration constant is set to TRUE). This flag was introduced in DirectX 5. |
|
D3DPRASTERCAPS_ZTEST | |
The device can perform z-test operations. This effectively renders a primitive and indicates whether any z pixels would have been rendered. |
D3DPBLENDCAPS_BOTHINVSRCALPHA | |
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. | |
D3DPBLENDCAPS_BOTHSRCALPHA | |
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. | |
D3DPBLENDCAPS_DESTALPHA | |
Blend factor is (Ad, Ad, Ad, Ad). | |
D3DPBLENDCAPS_DESTCOLOR | |
Blend factor is (Rd, Gd, Bd, Ad). | |
D3DPBLENDCAPS_INVDESTALPHA | |
Blend factor is (1-Ad, 1-Ad, 1-Ad, 1-Ad). | |
D3DPBLENDCAPS_INVDESTCOLOR | |
Blend factor is (1-Rd, 1-Gd, 1-Bd, 1-Ad). | |
D3DPBLENDCAPS_INVSRCALPHA | |
Blend factor is (1-As, 1-As, 1-As, 1-As). | |
D3DPBLENDCAPS_INVSRCCOLOR | |
Blend factor is (1-Rd, 1-Gd, 1-Bd, 1-Ad). | |
D3DPBLENDCAPS_ONE | |
Blend factor is (1, 1, 1, 1). | |
D3DPBLENDCAPS_SRCALPHA | |
Blend factor is (As, As, As, As). | |
D3DPBLENDCAPS_SRCALPHASAT | |
Blend factor is (f, f, f, 1); f = min(As, 1-Ad). | |
D3DPBLENDCAPS_SRCCOLOR | |
Blend factor is (Rs, Gs, Bs, As). | |
D3DPBLENDCAPS_ZERO | |
Blend factor is (0, 0, 0, 0). |
With the monochromatic shade modes, the blue channel of the specular component is interpreted as a white intensity. (This is controlled by the D3DRENDERSTATE_MONOENABLE render state.)
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_ALPHAFLATBLEND | |
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_ALPHAPHONGBLEND | |
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. | |
D3DPSHADECAPS_COLORFLATMONO | |
D3DPSHADECAPS_COLORFLATRGB | |
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 | |
D3DPSHADECAPS_COLORGOURAUDRGB | |
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. | |
D3DPSHADECAPS_COLORPHONGMONO | |
D3DPSHADECAPS_COLORPHONGRGB | |
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. | |
D3DPSHADECAPS_FOGFLAT | |
D3DPSHADECAPS_FOGGOURAUD | |
D3DPSHADECAPS_FOGPHONG | |
Device can support fog in the flat, Gouraud, and Phong shading models, respectively. Phong shading is not currently supported. | |
D3DPSHADECAPS_SPECULARFLATMONO | |
D3DPSHADECAPS_SPECULARFLATRGB | |
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. |
D3DPTEXTURECAPS_ALPHA | |
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. | |
D3DPTEXTURECAPS_BORDER | |
Supports texture mapping along borders. | |
D3DPTEXTURECAPS_PERSPECTIVE | |
Perspective correction is supported. | |
D3DPTEXTURECAPS_POW2 | |
All nonmipmapped 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.) | |
D3DPTEXTURECAPS_SQUAREONLY | |
All textures must be square. | |
D3DPTEXTURECAPS_TRANSPARENCY | |
Texture transparency is supported. (Only those texels that are not the current transparent color are drawn.) |
D3DPTFILTERCAPS_LINEAR | |
A weighted average of a 2×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 D3DPTFILTERCAPS_MIPLINEAR, but interpolates between the two nearest mipmaps. | |
D3DPTFILTERCAPS_LINEARMIPNEAREST | |
The mipmap chosen is the mipmap whose texels most closely match the size of the pixel to be textured. The D3DFILTER_LINEAR method is then used with the texture. | |
D3DPTFILTERCAPS_MIPLINEAR | |
Two mipmaps are chosen whose texels most closely match the size of the pixel to be textured. The D3DFILTER_NEAREST method is then used with each texture to produce two values which are then weighted to produce a final texel value. | |
D3DPTFILTERCAPS_MIPNEAREST | |
Similar to D3DPTFILTERCAPS_NEAREST, but uses the appropriate mipmap for texel selection. | |
D3DPTFILTERCAPS_NEAREST | |
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. |
D3DPTBLENDCAPS_ADD | |
Supports the additive texture-blending mode, in which the Gouraud interpolants are added to the texture lookup with saturation semantics. This capability corresponds to the D3DTBLEND_ADD member of the D3DTEXTUREBLEND enumerated type. This flag was introduced in DirectX 5. |
|
D3DPTBLENDCAPS_COPY | |
Copy mode texture-blending (D3DTBLEND_COPY from the D3DTEXTUREBLEND enumerated type) is supported. | |
D3DPTBLENDCAPS_DECAL | |
Decal texture-blending mode (D3DTBLEND_DECAL from the D3DTEXTUREBLEND enumerated type) is supported. | |
D3DPTBLENDCAPS_DECALALPHA | |
Decal-alpha texture-blending mode (D3DTBLEND_DECALALPHA from the D3DTEXTUREBLEND enumerated type) is supported. | |
D3DPTBLENDCAPS_DECALMASK | |
Decal-mask texture-blending mode (D3DTBLEND_DECALMASK from the D3DTEXTUREBLEND enumerated type) is supported. | |
D3DPTBLENDCAPS_MODULATE | |
Modulate texture-blending mode (D3DTBLEND_MODULATE from the D3DTEXTUREBLEND enumerated type) is supported. | |
D3DPTBLENDCAPS_MODULATEALPHA | |
Modulate-alpha texture-blending mode (D3DTBLEND_MODULATEALPHA from the D3DTEXTUREBLEND enumerated type) is supported. | |
D3DPTBLENDCAPS_MODULATEMASK | |
Modulate-mask texture-blending mode (D3DTBLEND_MODULATEMASK from the D3DTEXTUREBLEND enumerated type) is supported. |
D3DPTADDRESSCAPS_BORDER | |
Device supports setting coordinates outside the range [0.0, 1.0] to the border color, as specified by the D3DRENDERSTATE_BORDERCOLOR render state. This ability corresponds to the D3DTADDRESS_BORDER texture-addressing mode. This flag was introduced in DirectX 5. |
|
D3DPTADDRESSCAPS_CLAMP | |
Device can clamp textures to addresses. | |
D3DPTADDRESSCAPS_INDEPENDENTUV | |
Device can separate the texture-addressing modes of the U and V coordinates of the texture. This ability corresponds to the D3DRENDERSTATE_TEXTUREADDRESSU and D3DRENDERSTATE_TEXTUREADDRESSV render-state values. This flag was introduced in DirectX 5. |
|
D3DPTADDRESSCAPS_MIRROR | |
Device can mirror textures to addresses. | |
D3DPTADDRESSCAPS_WRAP | |
Device can wrap textures to addresses. |
Windows NT: Use version 4.0 or later.
Windows: Use Windows 95 or later. Available as a redistributable for Windows 95.
Windows CE: Unsupported.
Header: Declared in d3dcaps.h.