Add API to delete shader materials

This commit is contained in:
sfan5
2024-02-20 21:27:15 +01:00
parent e60921f0cb
commit c83f28431b
4 changed files with 47 additions and 3 deletions

View File

@ -5,6 +5,8 @@
#ifndef __E_MATERIAL_TYPES_H_INCLUDED__
#define __E_MATERIAL_TYPES_H_INCLUDED__
#include "irrTypes.h"
namespace irr
{
namespace video
@ -67,6 +69,9 @@ namespace video
0
};
constexpr u32 numBuiltInMaterials =
sizeof(sBuiltInMaterialTypeNames) / sizeof(char*) - 1;
} // end namespace video
} // end namespace irr

View File

@ -356,6 +356,15 @@ public:
scene::EPT_TRIANGLES, scene::EPT_TRIANGLE_STRIP, 0,
callback, baseMaterial, userData);
}
//! Delete a shader material and associated data.
/**
After you have deleted a material it is invalid to still use and doing
so might result in a crash. The ID may be reused in the future when new
materials are added.
\param material Number of the material type. Must not be a built-in
material. */
virtual void deleteShaderMaterial(s32 material) = 0;
};