Exemplo n.º 1
0
        public void Render()
        {
            var matrix = _viewMatrix.GetMatrix();

            matrix.Column3 = Vector4.UnitW;
            _shader.Use();
            _shader.View       = matrix;
            _shader.Projection = _projectionMatrix.GetMatrix();
            _vertexArray.Bind();
            _vertexArray.Render(PrimitiveType.Lines);
        }
Exemplo n.º 2
0
 /// <summary>
 /// 创建元素堆
 /// </summary>
 /// <param name="vertexArray">顶点堆</param>
 /// <param name="elements">元素堆</param>
 public ElementArray(IVertexArrayHandle vertexArray, IEnumerable <uint> elements)
 {
     _elements          = elements.ToArray();
     _count             = _elements.Length;
     _vertexArrayHandle = vertexArray;
     _vertexArrayHandle.Bind();
     _elementBufferObject = GL.GenBuffer();
     GL.BindBuffer(BufferTarget.ElementArrayBuffer, _elementBufferObject);
     GL.BufferData(BufferTarget.ElementArrayBuffer, _elements.Length * sizeof(uint), _elements,
                   BufferUsageHint.StaticDraw);
     //_logger.Info($"Create an element array:{_elementBufferObject}");
 }
Exemplo n.º 3
0
 public void Bind()
 {
     _texture.Bind();
     _vertexArrayHandle.Bind();
 }