Open turric4n opened 6 years ago
Hi! Structures are lightweight value types, in most cases they just hold a single integer inside the binding. Classes have the overhead of full memory management, garbage collection ,etc. Being just containers for the underlying memory handlers of the library, I choose structs. I have to check your observation, of course there may be a mistake, thanks for pointing it!
Hi Marc, Thanks for your response.
Hi Marc,
I'm reviewing the code and all entities are defined using struct instead classes, there is a specific reason to do this?
Also, I found this library binding :
[DllImport("Tilengine")] private static extern IntPtr TLN_CreateTilemap(int rows, int cols, Tile[] tiles, uint bgcolor, Tileset tileset);
You pass Tileset structure reference directly instead handle pointer. I'm not sure if this is ok, because I didn't test it. Can you confirm?
Thanks