RwSetPolygonTexture(RwPolygon3d *polygon, RwTexture *texture);
Description
Sets the texture of the polygons material.
Arguments
polygon Pointer to the polygon.
texture Pointer to the texture.
Return Value
The argument polygon if successful, and NULL otherwise.
Comments
NULL may be passed as the second argument to remove the polygons materials texture.
Comments
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 RwSetMaterialTexture() 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:
RwSetMaterialTexture(RwGetPolygonMaterial(polygon),
texture);
See Also