예제 #1
0
 public ConwayCell(int _i, int _j, ConwayCellGrid _grid) : base(_i, _j, _grid)
 {
     value     = Basics.Utils.RandomInt(0, 4) == 0 ? 1 : 0;
     NextValue = ConwayAlgorithm;
     rectangleBuffer.SetColor(Color4.White);
     rectangleArray = ColoredVertexArray.FromBuffer(rectangleBuffer);
 }
예제 #2
0
        public static void Line(float x1, float y1, float x2, float y2, Color4?_color = null)
        {
            //Create
            var color  = _color ?? Color4.White;
            var buffer = new ColoredVertexBuffer(PrimitiveType.Lines);

            buffer.AddVertex(new ColoredVertex(new Vector3(x1, y1, 0), color));
            buffer.AddVertex(new ColoredVertex(new Vector3(x2, y2, 0), color));
            var array = ColoredVertexArray.FromBuffer(buffer);

            //Use
            array.Render();

            //Destroy
            buffer.Destroy();
            array.Destroy();
        }
예제 #3
0
 public CustomCell(int _i, int _j, CustomCellGrid _grid) : base(_i, _j, _grid)
 {
     value          = (float)Basics.Utils.RandomDouble();
     NextValue      = Algorithm;
     rectangleArray = ColoredVertexArray.FromBuffer(rectangleBuffer);
 }