Ejemplo n.º 1
0
        private void applyPolygonData()
        {
            if (this.currentPolygonType == PolygonType.None)
            {
                return;
            }

            IShaderData shaderData = null;

            switch (this.currentPolygonType)
            {
            case PolygonType.Sprite:
                shaderData = new SpriteData(this.localTransform, this.textureId, this.color, this.clipArea, this.linearFiltering);
                break;

            case PolygonType.Orbit:
                shaderData = new OrbitData(this.minRadius, this.maxRadius, this.color, this.localTransform, this.sprite);
                break;

            case PolygonType.Sdf:
                shaderData = new SdfData(this.localTransform, this.textureId, this.color, this.clipArea);
                break;

            default:
                throw new NotImplementedException(this.currentPolygonType.ToString());
            }

            this.polygons.Add(new PolygonData(this.z, shaderData, this.vertexData));

            //clean up
            this.vertexData     = new List <float>();
            this.localTransform = Matrix4.Identity;
        }
Ejemplo n.º 2
0
        public void UpdateDrawable(IShaderData shaderUniforms)
        {
            this.ShaderData = shaderUniforms;

            if (this.spawnedDrawable != null)
            {
                this.spawnedDrawable.Update(shaderUniforms);
            }
        }
Ejemplo n.º 3
0
		public void Update(IShaderData shaderUniforms)
		{
			this.objectData = shaderUniforms as SdfData;
		}
Ejemplo n.º 4
0
 public void Update(IShaderData shaderUniforms)
 {
     this.objectData = (SpriteData)shaderUniforms;
     this.updateFilters();
 }
Ejemplo n.º 5
0
 public void Update(IShaderData shaderUniforms)
 {
     this.objectData = (SpriteData)shaderUniforms;
 }
Ejemplo n.º 6
0
 public PolygonData(float z, IShaderData shaderUniforms, IEnumerable <Vector2> vertexData) :
     this(z, shaderUniforms, vertexData.SelectMany(v => new [] { v.X, v.Y }).ToList())
 {
 }
Ejemplo n.º 7
0
 public PolygonData(float z, IShaderData shaderUniforms, ICollection <float> vertexData)
 {
     this.Z          = z;
     this.ShaderData = shaderUniforms;
     this.VertexData = vertexData;
 }