Exemple #1
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="bufferName"></param>
 /// <param name="varNameInShader"></param>
 /// <returns></returns>
 public VertexBuffer GetVertexAttributeBuffer(string bufferName, string varNameInShader)
 {
     if (bufferName == strPosition)
     {
         if (this.positionBuffer == null)
         {
             var array = new vec3[positions.Length];
             for (int i = 0; i < positions.Length; i++)
             {
                 array[i] = positions[i] / 2 * this.lengths;
             }
             VertexBuffer buffer = array.GenVertexBuffer(VBOConfig.Vec3, varNameInShader, BufferUsage.StaticDraw);
             this.positionBuffer = buffer;
         }
         return(this.positionBuffer);
     }
     else
     {
         throw new ArgumentException();
     }
 }