MCPcopy Create free account
hub / github.com/axmolengine/axmol / createWithFilename

Method createWithFilename

core/renderer/Material.cpp:71–87  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

69static bool isValidUniform(const char* name);
70
71Material* Material::createWithFilename(std::string_view filepath)
72{
73 AXLOGD("Loading material: {}", filepath);
74 auto validfilename = FileUtils::getInstance()->fullPathForFilename(filepath);
75 if (!validfilename.empty())
76 {
77 auto mat = new Material();
78 if (mat->initWithFile(validfilename))
79 {
80 mat->autorelease();
81 return mat;
82 }
83 delete mat;
84 }
85
86 return nullptr;
87}
88
89Material* Material::createWithProperties(Properties* materialProperties)
90{

Callers

nothing calls this directly

Calls 5

getInstanceFunction · 0.85
fullPathForFilenameMethod · 0.80
autoreleaseMethod · 0.80
emptyMethod · 0.45
initWithFileMethod · 0.45

Tested by

no test coverage detected