Esempio n. 1
0
 /// <summary>
 /// Creates a new GLObject
 /// </summary>
 /// <param name="Gl">the GL instance</param>
 /// <param name="verts">float[] of vertices</param>
 /// <param name="indices">uint[] of vertices</param>
 /// <param name="vertPath">the path to the vertex shader</param>
 /// <param name="fragPath">the path to the fragment shader</param>
 /// <param name="isDynamic">is the vertices going to change often (WARNING More expensive to draw the object if this is true)</param>
 public GLObject(GL Gl, float[] verts, uint[] indices, string vertPath, string fragPath, bool isDynamic, uint VertexSize)
 {
     this.gl      = Gl;
     this.indices = indices;
     shader       = new Shader(Gl, vertPath, fragPath);
     Ebo          = new EBO(Gl, indices);
     Vbo          = new VBO(Gl, verts, isDynamic ? GLEnum.DynamicDraw : GLEnum.StaticDraw);
     Vao          = new VAO(Gl, Vbo, Ebo);
     Vao.VertexAttributePointer(0, 3, VertexAttribPointerType.Float, VertexSize, 0);
     gl.EnableVertexAttribArray(0);
 }
Esempio n. 2
0
 public VAO(GL gl, VBO vbo, EBO ebo) : base(gl, vbo, ebo)
 {
 }