I’m trying to apply a texture to the material of a Model but I could not figure out how to do it:
so I made a direct translation of the c code taken from examples:
(original from “Raylib (shaders) example – postprocessing shader” line 77)
model.materials(0).maps(MAP_DIFFUSE).texture = texture;
(my c# translation)
m_LP_SpookyTree = LP_SpookyTree.GetModel; m_LP_SpookyTree.materials(0).maps(MaterialMapType.MAP_ALBEDO).texture = Raylib.LoadTexture("Ressource/Textures/PlaceHolders/mossy_rock_diff_1k.png");
According to the cs file on the repo, the “materials” definition is an Int pointer.
The problem comes from the Intptr, how could I get the material array from it?
thanks for your time.
PS: I’ve created an issue on Raylib.cs GitHub repo so if I get an answer on one before the other, I’ll update accordingly
I’ve tried to change every IntPtr to the object it should actually point to regarding the comments in the source file, compile the lib, and imported it. unfortunately, it broke. so I don’t think it’s possible.