1234567891011121314151617181920212223242526272829303132 |
- using System;
- using System.Collections.Generic;
- using System.Drawing;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using OpenTK.Graphics.OpenGL;
- using bbiwarg.DataSource;
- using MathNet.Numerics.LinearAlgebra.Single;
- namespace bbiwarg.Graphics.GraphicElements2D
- {
- class Point2D : IGraphicElement2D
- {
- private Vector position;
- private Color color;
- public Point2D(Vector position, Color color)
- {
- this.position = position;
- this.color = color;
- }
- public void draw(short[] textureData, int width)
- {
- int index = (3 * ((int)position.y() * width + (int)position.x()));
- textureData[index + 0] = (short) ((Int16.MaxValue / byte.MaxValue) * color.R);
- textureData[index + 1] = (short) ((Int16.MaxValue / byte.MaxValue) * color.G);
- textureData[index + 2] = (short) ((Int16.MaxValue / byte.MaxValue) * color.B);
- }
- }
- }
|