-
Notifications
You must be signed in to change notification settings - Fork 87
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
VertexArray indexer doesnt returns a reference #195
Comments
I'm gonna assume the docs are wrong on this detail as they look copied from the C++ documentation where this indexer does return a reference. I'd also imagine the VertexArray class was originally written before return-by-reference for value types was introduced into C#. |
Yep. My sugestion is to maintain indexer as it is, because ref can't work with this operator and create a public ref Vertex GetVertex(int index) {
...
} This will boost the vertex painting performance a lot. |
In this case, I don't believe the Regarding your suggestion, I'd ask @DemoXinMC for input. |
Yes, I'm refer to the vertex copy time. It seems an implementation that can be tested easily. |
I discover this using the same code in c#, pascal and rust. Pascal and Rust bindings already read a reference from vertex array. Only c# doesn't. Pascal and Rust are able to update a 1 Mi vertex in this way(pascal = 24fps, rust=42fps c#=16fps). C# got stucked to update a vertex array of this size. If you need I have the three languages implementations for the same algorithms. |
Since we're doing pInvoke calls, we can't really provide a reference. Anyone willing to update the documentation? |
* Addresses requests in SFML#194 and SFML#195 * Updated all [Obsolete] attributes to be less repetitive * Added a large number of quick reference links to existing summaries * Corrected various typos and unparsable markup(\a and \p) * Added additional formatting to numerous summaries, resulting in more readable tooltips * Added a suggestion to use TimeSpan over SFML's Time while working within a managed environment
* Addresses requests in SFML#194 and SFML#195 * Updated all [Obsolete] attributes to be less repetitive * Added a large number of quick reference links to existing summaries * Corrected various typos and unparsable markup(\a and \p) * Added additional formatting to numerous summaries, resulting in more readable tooltips * Added a suggestion to use TimeSpan over SFML's Time while working within a managed environment * Added a warning to `VertexBuffer.NativeHandle`'s getter informing the end-user that most people shouldn't need that property and to be cautious
* Addresses requests in SFML#194 and SFML#195 * Updated all [Obsolete] attributes to be less repetitive * Added a large number of quick reference links to existing summaries * Corrected various typos and unparsable markup(\a and \p) * Added additional formatting to numerous summaries, resulting in more readable tooltips * Added a suggestion to use TimeSpan over SFML's Time while working within a managed environment
* Addresses requests in #194 and #195 * Updated all [Obsolete] attributes to be less repetitive * Added a large number of quick reference links to existing summaries * Corrected various typos and unparsable markup(\a and \p) * Added additional formatting to numerous summaries, resulting in more readable tooltips * Added a suggestion to use TimeSpan over SFML's Time while working within a managed environment
This indexer in VertexArray does'nt returns a reference to a vertex. Docs are wrong, or the indexer is wrong. A deepy copy leads to poor performance in painting.
This code will not work because v is a Vertex copy.
The text was updated successfully, but these errors were encountered: