Example #1
0
 public SpriteDrawable(Surface surface, Vector2D[] vertexes, Vector2D[] coordinates, bool flip, TextureOptions options)
 {
     this.vertexes    = new ARBArrayBuffer <Vector2D>(vertexes, Vector2D.Size);
     this.coordinates = new ARBArrayBuffer <Vector2D>(coordinates, Vector2D.Size);
     this.texture     = new Texture2D(surface, flip, options);
     this.color       = new ScalarColor4(1, 1, 1, 1);
 }
 public Colored4VertexesDrawable(int mode,Vector2D[] vertexes, ScalarColor4[] colors)
 {
     if (vertexes == null) { throw new ArgumentNullException("vertexes"); }
     if (colors == null) { throw new ArgumentNullException("colors"); }
     if (colors.Length != vertexes.Length) { throw new ArgumentException("TODO length !="); }
     this.vertexes = new ARBArrayBuffer<Vector2D>(vertexes, Vector2D.Size);
     this.colors = new ARBArrayBuffer<ScalarColor4>(colors, ScalarColor4.Size);
     this.mode = mode;
 }
Example #3
0
 public static ScalarColor4[] CreateColor4Array(ScalarColor4 first, ScalarColor4 rest, int count)
 {
     ScalarColor4[] result = new ScalarColor4[count];
     result[0] = first;
     for (int index = 1; index < count; ++index)
     {
         result[index] = rest;
     }
     return result;
 }
Example #4
0
 public static ScalarColor4[] CreateColor4Array(ScalarColor4 first, ScalarColor4 rest, int count)
 {
     ScalarColor4[] result = new ScalarColor4[count];
     result[0] = first;
     for (int index = 1; index < count; ++index)
     {
         result[index] = rest;
     }
     return(result);
 }
Example #5
0
 public static PolygonShape CreatePolygon(Vector2D[] vertexes, Scalar gridSpacing, ScalarColor4[] colors)
 {
     PolygonShape shape = new PolygonShape(vertexes, gridSpacing);
     shape.Tag = DrawableFactory.CreatePolygon(vertexes, colors);
     return shape;
 }
Example #6
0
 public static IShape CreateMultiPolygon(Vector2D[][] polygons, Scalar gridSpacing, ScalarColor4[][] colors)
 {
     if (polygons.Length == 1)
     {
         return CreatePolygon(polygons[0], gridSpacing, colors[0]);
     }
     else
     {
         MultiPolygonShape shape = new MultiPolygonShape(polygons, gridSpacing);
         shape.Tag = DrawableFactory.CreateMultiPolygon(polygons, colors);
         return shape;
     }
 }
Example #7
0
 public static CircleShape CreateCircle(Scalar radius, int vertexCount, ScalarColor4[] colors)
 {
     CircleShape shape = new CircleShape(radius, vertexCount);
     shape.Tag = DrawableFactory.CreatePolygon(shape.Vertexes, colors);
     return shape;
 }
 public SpriteDrawable(Surface surface, Vector2D[] vertexes, Vector2D[] coordinates, bool flip, TextureOptions options)
 {
     this.vertexes = new ARBArrayBuffer<Vector2D>(vertexes, Vector2D.Size);
     this.coordinates = new ARBArrayBuffer<Vector2D>(coordinates, Vector2D.Size);
     this.texture = new Texture2D(surface, flip, options);
     this.color = new ScalarColor4(1, 1, 1, 1);
 }
 public static Colored4MultiVertexesDrawable CreateMultiPolygon(Vector2D[][] polygons, ScalarColor4[][] colors)
 {
     return new Colored4MultiVertexesDrawable(Gl.GL_POLYGON, polygons, colors);
 }
 public static Colored4VertexesDrawable CreatePolygon(Vector2D[] vertexes, ScalarColor4[] colors)
 {
     return new Colored4VertexesDrawable(Gl.GL_POLYGON, vertexes, colors);
 }