CreateProgram() public static method

Creates a shader program object by a single shader.
public static CreateProgram ( this shaderCode ) : ShaderProgram
shaderCode this
return ShaderProgram
Example #1
0
        /// <summary>
        ///
        /// </summary>
        /// <returns></returns>
        public ShaderProgram GetProgram()
        {
            if (this.program == null)
            {
                this.program = ShaderCodesHelper.CreateProgram(shaderCodes);
            }

            return(this.program);
        }
Example #2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="indexBuffer"></param>
        /// <param name="vertexBuffers"></param>
        /// <returns></returns>
        public VertexArrayObject GetVertexArrayObject(IndexBuffer indexBuffer, VertexBuffer[] vertexBuffers)
        {
            if (this.vertexArrayObject == null)
            {
                if (this.program == null)
                {
                    this.program = ShaderCodesHelper.CreateProgram(shaderCodes);
                }
                this.vertexArrayObject = new VertexArrayObject(indexBuffer, vertexBuffers);
                this.vertexArrayObject.Initialize(this.program);
            }

            return(this.vertexArrayObject);
        }