RenderWare V2.1

Previous Page Index Next Page

RwPolygon3d *

RwSetPolygonTexture(RwPolygon3d *polygon, RwTexture *texture);

Description

Sets the texture of the polygon’s 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 polygon’s material’s 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 it’s 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

RwCreateTexture()

RwFindNamedTexture()

RwGetNamedTexture()

RwGetPolygonTexture()

RwReadNamedTexture()

RwReadTexture()

RwSetMaterialTexture()

RwSetSurfaceTexture()