Inheritance: IShaderResource
コード例 #1
0
ファイル: Shader.cs プロジェクト: damian-666/ReignSDK
        public override IShaderResource Resource(string name)
        {
            // Try to find existing resource
            foreach (var resource in resources)
            {
                if (resource.Name == name)
                {
                    return(resource);
                }
            }

            // Otherwise add a resource instance
            int vertexIndex = vertex.Resource(name);
            int pixelIndex  = pixel.Resource(name);

            if (pixelIndex == -1 && pixelIndex == -1)
            {
                Debug.ThrowError("Shader", string.Format("Shader resource '{0}' does not exist.", name));
            }

            var newResource = new ShaderResource(name, video.com, vertex.com, pixel.com, vertexIndex, pixelIndex);

            resources.Add(newResource);
            return(newResource);
        }
コード例 #2
0
ファイル: Shader.cs プロジェクト: reignstudios/ReignSDK
		public override IShaderResource Resource(string name)
		{
			// Try to find existing resource
			foreach (var resource in resources)
			{
				if (resource.Name == name) return resource;
			}

			// Otherwise add a resource instance
			int vertexIndex = vertex.Resource(name);
			int pixelIndex = pixel.Resource(name);

			if (pixelIndex == -1 && pixelIndex == -1)
			{
				Debug.ThrowError("Shader", string.Format("Shader resource '{0}' does not exist.", name));
			}

			var newResource = new ShaderResource(name, video.com, vertex.com, pixel.com, vertexIndex, pixelIndex);
			resources.Add(newResource);
			return newResource;
		}