RwSetPolygonTextureModes(RwPolygon3d *polygon, RwTextureModes modes);
Description
Sets the texture modes of a polygons material. Texture modes permit fine grain control over the rendering of textures.
Arguments
polygon Pointer to the polygon.
modes A bitfield representing a texture mode (or "bitwise or" of modes).
Return Value
The argument polygon if successful, and NULL otherwise.
Comments
The texture modes are:
rwLIT The texture will be lit according to the current light sampling type of the material (rwFACET or rwVERTEX).
rwFORESHORTEN The texture will be foreshortened in a perspectively correct manner.
rwFILTER A filter will be applied to the texture to reduce the effect of pixelation due to aliasing.
For further information see the Texture Modes section in Chapter 2: Data Types.
Unlike RwAddTextureModeToPolygon(), which simply adds one or more texture modes to a polygons materials set of modes, RwSetPolygonTextureModes() replaces a polygons materials entire set of modes with those specified.
RenderWare optimizes memory usage by sharing materials across multiple polygons. Setting a polygon material property with this function will cause the polygon to have its own copy of the material, not shared by any other polygons. Unless this is the desired effect, it is more memory efficient to use the corresponding material function RwSetMaterialTextureModes() to change the underlying polygon material. This change will then be propagated to all polygons which use the material. The following line of code demonstrates how this is achieved:
RwSetMaterialTextureModes(RwGetPolygonMaterial(polygon),
modes);
See Also