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);
 }
Example #2
0
 public VertexesDrawable(int mode, Vector2D[] vertexes)
 {
     if (vertexes == null)
     {
         throw new ArgumentNullException("vertexes");
     }
     this.vertexes = new ARBArrayBuffer <Vector2D>(vertexes, Vector2D.Size);
     this.mode     = mode;
 }
Example #3
0
 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;
 }
 public BumpmapSpriteDrawable(
     Surface surface,
     Surface bumpmap,
     Vector2D[] vertexes, Vector2D[] coordinates,
     bool flip, bool xInverted, bool yInverted,
     Light light)
 {
     this.light     = light;
     this.size      = Math.Max(surface.Width, surface.Height);
     this.xInverted = xInverted;
     if (flip)
     {
         this.yInverted = !yInverted;
     }
     else
     {
         this.yInverted = yInverted;
     }
     this.vertexes    = new ARBArrayBuffer <Vector2D>(vertexes, Vector2D.Size);
     this.coordinates = new ARBArrayBuffer <Vector2D>(coordinates, Vector2D.Size);
     this.bumpmap     = new Texture2D(bumpmap, flip, new TextureOptions());
     this.sprite      = new Texture2D(surface, flip, new TextureOptions());
 }