示例#1
0
        /// <summary>
        /// 在使用<see cref="VertexArrayObject"/>后,此方法只会执行一次。
        /// </summary>
        /// <param name="e"></param>
        /// <param name="shaderProgram"></param>
        public override void Render(RenderEventArgs e, Shaders.ShaderProgram shaderProgram)
        {
            uint location = shaderProgram.GetAttributeLocation(this.VarNameInVertexShader);

            GL.BindBuffer(BufferTarget.ArrayBuffer, this.BufferID);
            GL.VertexAttribPointer(location, this.DataSize, this.DataType, false, 0, IntPtr.Zero);
            GL.EnableVertexAttribArray(location);
        }