Page tree
Skip to end of metadata
Go to start of metadata

IMaterialManager interface provide access to the material manager implemented in 3DEngine. More...

#include <IMaterial.h>

Public Types

enum  ELoadingFlags { ELoadingFlagsPreviewMode = BIT(0) }
 Loading flags.

Public Member Functions

virtual void GetMemoryUsage (ICrySizer *pSizer) const =0
virtual IMaterialCreateMaterial (const char *sMtlName, int nMtlFlags=0)=0
virtual void RenameMaterial (IMaterial *pMtl, const char *sNewName)=0
virtual IMaterialFindMaterial (const char *sMtlName) const =0
 Finds named material.
virtual IMaterialLoadMaterial (const char *sMtlName, bool bMakeIfNotFound=true, bool bNonremovable=false, unsigned long nLoadingFlags=0)=0
virtual IMaterialLoadMaterialFromXml (const char *sMtlName, XmlNodeRef mtlNode)=0
 Loads material from xml.
virtual IMaterialCloneMaterial (IMaterial *pMtl, int nSubMtl=-1)=0
virtual void CopyMaterial (IMaterial *pMtlSrc, IMaterial *pMtlDest, EMaterialCopyFlags flags)=0
 Copy single material.
virtual IMaterialCloneMultiMaterial (IMaterial *pMtl, const char *sSubMtlName=0)=0
virtual void SetListener (IMaterialManagerListener *pListener)=0
virtual IMaterialGetDefaultMaterial ()=0
 Retrieve a default engine material.
virtual IMaterialGetDefaultTerrainLayerMaterial ()=0
 Retrieve a default engine material for terrain layer.
virtual IMaterialGetDefaultLayersMaterial ()=0
 Retrieve a default engine material with material layers presets.
virtual IMaterialGetDefaultHelperMaterial ()=0
 Retrieve a default engine material for drawing helpers.
virtual ISurfaceTypeGetSurfaceTypeByName (const char *sSurfaceTypeName, const char *sWhy=NULL)=0
 Retrieve surface type by name.
virtual int GetSurfaceTypeIdByName (const char *sSurfaceTypeName, const char *sWhy=NULL)=0
virtual ISurfaceTypeGetSurfaceType (int nSurfaceTypeId, const char *sWhy=NULL)=0
 Retrieve surface type by unique surface type id.
virtual ISurfaceTypeManager * GetSurfaceTypeManager ()=0
 Retrieve interface to surface type manager.
virtual IMaterialLoadCGFMaterial (const char *szMaterialName, const char *szCgfFilename, unsigned long nLoadingFlags=0)=0
virtual void GetLoadedMaterials (IMaterial **pData, uint32 &nObjCount) const =0
 For statistics - call once to get the count (pData==0), again to get the data(pData!=0).
virtual void SetAltMaterialSuffix (const char *pSuffix)=0
virtual void RefreshMaterialRuntime ()=0
 Updates material data in the renderer.

Detailed Description

IMaterialManager interface provide access to the material manager implemented in 3DEngine.

Member Function Documentation

◆ CloneMaterial()

virtual IMaterial* IMaterialManager::CloneMaterial ( IMaterial pMtl,
int  nSubMtl = -1 
pure virtual

Clone single material or multi sub material.

nSubMtlWhen negative all sub materials of MultiSubMtl are cloned, if positive only specified slot is cloned.

◆ CloneMultiMaterial()

virtual IMaterial* IMaterialManager::CloneMultiMaterial ( IMaterial pMtl,
const char *  sSubMtlName = 0 
pure virtual

Clone MultiSubMtl material.

sSubMtlNameName of the sub-material to clone, if NULL all submaterial are cloned.

◆ CreateMaterial()

virtual IMaterial* IMaterialManager::CreateMaterial ( const char *  sMtlName,
int  nMtlFlags = 0 
pure virtual

Creates a new material object and register it with the material manager

Newly created object derived from IMaterial.

◆ LoadCGFMaterial()

virtual IMaterial* IMaterialManager::LoadCGFMaterial ( const char *  szMaterialName,
const char *  szCgfFilename,
unsigned long  nLoadingFlags = 0 
pure virtual

Get IMaterial pointer for a material referenced by a .cgf file.

nLoadingFlagsZero, or a bitwise combination of the enum items from ELoadingFlags.

◆ LoadMaterial()

virtual IMaterial* IMaterialManager::LoadMaterial ( const char *  sMtlName,
bool  bMakeIfNotFound = true,
bool  bNonremovable = false,
unsigned long  nLoadingFlags = 0 
pure virtual

Loads material.

nLoadingFlagsZero or a bitwise combination of the values defined in ELoadingFlags.

◆ RenameMaterial()

virtual void IMaterialManager::RenameMaterial ( IMaterial pMtl,
const char *  sNewName 
pure virtual

Rename a material object.

Do not use IMaterial::SetName directly.
pMtlPointer to a material object.
sNewNameNew name to assign to the material.

◆ SetAltMaterialSuffix()

virtual void IMaterialManager::SetAltMaterialSuffix ( const char *  pSuffix)
pure virtual

Sets a suffix that will be appended onto every requested material to try and find an alternative version.

pSuffixSet this to null to stop returning alternates.

◆ SetListener()

virtual void IMaterialManager::SetListener ( IMaterialManagerListener *  pListener)
pure virtual

Associate a special listener callback with material manager inside 3DEngine. This listener callback is used primerly by the editor.

  • No labels