iMaterial Struct Reference (Crystal Space 2.0 Public API Reference)

| ## Public API Reference

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

- Class List
- Class Index
- Class Hierarchy
- Class Members

Public Member Functions
iMaterial Struct Reference
3D

This class represents a material as seen from the engine view. More...

`#include <ivideo/material.h>`

Inheritance diagram for iMaterial:

List of all members.

## Public Member Functions
virtual iShader * | GetFirstShader (const csStringID *types, size_t numTypes)=0
| Get shader for the first type from types that as a shader attached.
virtual iShader * | GetShader (csStringID type)=0
| Get shader associated with a shader type.
virtual const csHash< csRef < iShader >, csStringID > & | GetShaders () const =0
| Get all Shaders.
virtual iTextureHandle * | GetTexture ()=0
| Get the base ("tex diffuse") texture from the material.
virtual iTextureHandle * | GetTexture (CS::ShaderVarStringID name)=0
| Get a texture from the material.
virtual void | SetShader (csStringID type, iShader *shader)=0
| Associate a shader with a shader type.

## Detailed Description

This class represents a material as seen from the engine view.

Because it is also a shader variable context it can be used directly for rendering.

Main creators of instances implementing this interface:

- iEngine::CreateBaseMaterial()

Main ways to get pointers to this interface:

- iMaterialWrapper::GetMaterial()

Main users of this interface:

- 3D renderer implementations (iGraphics3D).

Definition at line 55 of file material.h.

## Member Function Documentation

virtual iShader* iMaterial::GetFirstShader | ( | const csStringID * | types,
|  | size_t | numTypes
| ) |  | `[pure virtual]`

Get shader for the first type from types that as a shader attached.

virtual iShader* iMaterial::GetShader | ( | csStringID | type | ) | `[pure virtual]`

Get shader associated with a shader type.

virtual const csHash<csRef<iShader>, csStringID>& iMaterial::GetShaders | ( |  | ) | const`[pure virtual]`

Get all Shaders.

virtual iTextureHandle* iMaterial::GetTexture | ( |  | ) | `[pure virtual]`

Get the base ("tex diffuse") texture from the material.

Remarks:
  A material can have an arbitrary number of textures attached, however not necessarily a diffuse texture. What texture is used to what effect depends on the actual shader(s) used at runtime.

virtual iTextureHandle* iMaterial::GetTexture | ( | CS::ShaderVarStringID | name | ) | `[pure virtual]`

Get a texture from the material.

Remarks:
  A material can have an arbitrary number of textures attached. What texture is used to what effect depends on the actual shader(s) used at runtime.

virtual void iMaterial::SetShader | ( | csStringID | type,
|  | iShader * | shader
| ) |  | `[pure virtual]`

Associate a shader with a shader type.

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

- ivideo/material.h