1
DotNet / Feasibility of providing unsafe field-set methods, e.g. for Vertex in VertexArr?
« on: October 09, 2018, 12:36:29 pm »
To not necro-bump this previous topic, I've created a new topic.
I've bumped into the same issue: needing to recreate a Vertex, and set an index of VertexArray to the new instance.
Would it be feasible to provide methods such as SetPosition(sf::Vector2f position, uint index), SetColor(sf::Color color, uint index), etc, within VertexArray, which would set relevant fields in an unsafe context?
I can imagine this is not the only array-type within SFML.NET which suffers from this problem.
Unfortunately I only have access to a C# environment at work, otherwise I'd spend time trying to get the source to work and profile it, so I have only theoretical comment: it would probably be better performance; it would definitely mean more maintenance; it would most likely be found through Intellisense and used above recreation.
I've bumped into the same issue: needing to recreate a Vertex, and set an index of VertexArray to the new instance.
Would it be feasible to provide methods such as SetPosition(sf::Vector2f position, uint index), SetColor(sf::Color color, uint index), etc, within VertexArray, which would set relevant fields in an unsafe context?
I can imagine this is not the only array-type within SFML.NET which suffers from this problem.
Unfortunately I only have access to a C# environment at work, otherwise I'd spend time trying to get the source to work and profile it, so I have only theoretical comment: it would probably be better performance; it would definitely mean more maintenance; it would most likely be found through Intellisense and used above recreation.