Bindings - other languages => DotNet => Topic started by: kubawich on July 29, 2016, 12:26:33 pm
Title: How can i get access to vertex in VertexArray?
Post by: kubawich on July 29, 2016, 12:26:33 pm
Hi, i'm learning SFML.net and i've created vertex array with public static VertexArray arr = new VertexArray(PrimitiveType.Lines, 2); And when i try to get access to arr[0].position 4example i get error 'Cannot modify return value, because it's not variable' So how can i get access to any vertex in this array? In normal vertex class it works properly.
Title: Re: How can i get access to vertex in VertexArray?
Post by: Laurent on July 29, 2016, 12:55:05 pm
Vertex is a structure, so it is always passed by copy. I'm not an expert but think you have to do this:
Vertex v = arr[0]; v.position= ...; arr[0]= v;
Title: Re: How can i get access to vertex in VertexArray?
Post by: kubawich on July 29, 2016, 01:04:23 pm
Thanks Laurent, it works... and creates big amounts of additional code :'( Btw. is there binding of sfml 2.3 for .net?
Title: Re: How can i get access to vertex in VertexArray?
Post by: Laurent on July 29, 2016, 01:18:58 pm
Quote
and creates big amounts of additional code
Yes, there are many things that I don't like in SFML.Net, but there's no way to do them differently with C#.