Crystal Space: iMaterialWrapper Struct Reference (Crystal Space Public API Reference)

| ## Public API Reference

- Main Page
- Modules
- Namespaces
- Classes
- Files
- Related Pages

- Alphabetical List
- Class List
- Class Hierarchy
- Class Members

# iMaterialWrapper Struct Reference
[Textures & Materials]

A material wrapper is an engine-level object that wraps around an actual material (iMaterial). More...

`#include <iengine/material.h>`

Inheritance diagram for iMaterialWrapper:

[legend]
List of all members.

## Public Member Functions
virtual iMaterial * | GetMaterial ()=0
| Get the original material.
virtual bool | IsVisitRequired () const =0
| Return true if it is needed to call Visit().
virtual iObject * | QueryObject ()=0
| Get the iObject for this material.
virtual void | SetMaterial (iMaterial *material)=0
| Change the base material.
virtual void | Visit ()=0
| Visit this material.

## Detailed Description

A material wrapper is an engine-level object that wraps around an actual material (iMaterial).

Every material in the engine is represented by a material wrapper, which keeps the pointer to the material and its name, and possibly the base material object.

Main creators of instances implementing this interface:

- iEngine::CreateMaterial()
- iMaterialList::NewMaterial()

Main ways to get pointers to this interface:

- iEngine::FindMaterial()
- iMaterialList::Get()
- iMaterialList::FindByName()
- iLoaderContext::FindMaterial()
- iLoaderContext::FindNamedMaterial()
- iMeshObject::GetMaterialWrapper()
- Various state interfaces for mesh objects.

Main users of this interface:

- iEngine
- Mesh objects

Definition at line 61 of file material.h.

## Member Function Documentation

virtual iMaterial* iMaterialWrapper::GetMaterial | ( |  | ) | `[pure virtual]`

Get the original material.

virtual bool iMaterialWrapper::IsVisitRequired | ( |  | ) | const`[pure virtual]`

Return true if it is needed to call Visit().

virtual iObject* iMaterialWrapper::QueryObject | ( |  | ) | `[pure virtual]`

Get the iObject for this material.

virtual void iMaterialWrapper::SetMaterial | ( | iMaterial * | material | ) | `[pure virtual]`

Change the base material.

Note: The changes will not be visible until you re-register the material.

virtual void iMaterialWrapper::Visit | ( |  | ) | `[pure virtual]`

Visit this material.

This should be called by the engine right before using the material. It will call Visit() on all textures that are used.

The documentation for this struct was generated from the following file:

- iengine/material.h