/// <summary> /// Adds the line. /// </summary> /// <param name="points">The points.</param> /// <param name="argb">ARGB.</param> public void AddLine(float[] points, float width, int argb) { // a float is 4 bytes, therefore we multiply the number if // vertices with 4. ByteBuffer vbb = ByteBuffer.AllocateDirect(points.Length * 4); vbb.Order(ByteOrder.NativeOrder()); FloatBuffer vertexBuffer = vbb.AsFloatBuffer(); vertexBuffer.Put(points); vertexBuffer.Position(0); LineProcessed line = new LineProcessed() { Vertices = vertexBuffer, Color = argb, Width = width, Count = points.Length / 3 }; _lines.Add(line); }
/// <summary> /// Adds the line. /// </summary> /// <param name="points">The points.</param> /// <param name="argb">ARGB.</param> public void AddLine(float[] points, float width, int argb) { lock (_triangles) { // a float is 4 bytes, therefore we multiply the number if // vertices with 4. ByteBuffer vbb = ByteBuffer.AllocateDirect(points.Length * 4); vbb.Order(ByteOrder.NativeOrder()); FloatBuffer vertexBuffer = vbb.AsFloatBuffer(); vertexBuffer.Put(points); vertexBuffer.Position(0); LineProcessed line = new LineProcessed() { Vertices = vertexBuffer, Color = argb, Width = width, Count = points.Length / 3 }; _lines.Add(line); } }