i need some help when it comes to hashmaps and the russimp library https://crates.io/crates/russimp
i have gone ahead with using learnopengl.com's model loading tutorial, properly rewriting most of the code to at least mimic the behaviour.
but i am having trouble at one specific line https://learnopengl.com/code_viewer_gh.php?code=includes/learnopengl/model.h
vector<Texture> loadMaterialTextures(aiMaterial *mat, aiTextureType type, string typeName)
{
vector<Texture> textures;
for(unsigned int i = 0; i < mat->GetTextureCount(type); i++)
{...}
...}
the russimp library doesn't implement many of the QOL functions in Assimp, which is fine and until now hasn't caused issues, but i am having issues with aiMaterial::GetTextureCount()
in russimp when i look at russimp::material::Material (aiMaterial)
pub struct Material {
pub properties: Vec<MaterialProperty>,
pub textures: HashMap<TextureType, Rc<RefCell<Texture>>>,
}
TextureType is an Enum
i am not experienced with Rc at all, but i was told hashmaps can have only one value per key.
looking at assimp c++ docs: https://assimp.sourceforge.net/lib_html/structai_material.html#ad619f2bc4400c19caede1ef68b483ff4
it returns an unsigned int
my question is, how should i go about rewriting the c++ code? am i missing something?