Пример #1
0
 public void Draw(PrimitiveType mode, IElementArray elements)
 {
     using (elements.Bind())
     {
         _gl.DrawElements(mode, (int)elements.Elements, (uint)elements.Type, IntPtr.Zero);
     }
 }
Пример #2
0
 private Terrain(IOpenGL33 gl, IVertexArray vertexArray, IVertexBuffer vertexBuffer, IElementArray elementBuffer, TerrainShader shader)
 {
     _gl = gl;
     _vertexArray = vertexArray;
     _vertexBuffer = vertexBuffer;
     _elementBuffer = elementBuffer;
     _shader = shader;
     Model = Matrix4f.Identity;
     View = Matrix4f.Identity;
     Projection = Matrix4f.Identity;
     Diffuse = new Vector4f(Color.DodgerBlue.R / 255f, Color.DodgerBlue.G / 255f, Color.DodgerBlue.B / 255f, 1f);
 }