public Mesh(Shader shader = null, int numberOfAxis = 2)
{
this.customBuffers = new Dictionary <int, VertexAttrib>();
this.numberOfAxis = numberOfAxis;
// use VAO if possible
this.vertexArrayId = Graphics.NewArray();
if (this.vertexArrayId > -1)
{
this.Bind();
}
// vertex
this.vBufferId = Graphics.NewBuffer();
Graphics.MapBufferToArray(this.vBufferId, 0, numberOfAxis);
// uv
this.uvBufferId = Graphics.NewBuffer();
Graphics.MapBufferToArray(this.uvBufferId, 1, 2);
// vc
this.vcBufferId = Graphics.NewBuffer();
Graphics.MapBufferToArray(this.vcBufferId, 2, 4);
if (shader == null)
{
shader = simpleShader;
shader.SetUniform("tex", 0);
}
this.shader = shader;
this.noMatrix = false;
this.hasVertexColors = true;
this.requireUseTexture = true;
}