示例#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);
        }
示例#2
0
        public void Render()
        {
            if (_needUpdate)
            {
                const int size  = sizeof(float) * 2;
                var       coord = _uvCoords[_index];
                _vertexArrayHandle.VertexSubData(_offsets.ButtonLeft, size, new[] { coord.Min.X, coord.Min.Y })
                .VertexSubData(_offsets.ButtonRight, size, new[] { coord.Max.X, coord.Min.Y })
                .VertexSubData(_offsets.TopLeft, size, new[] { coord.Min.X, coord.Max.Y })
                .VertexSubData(_offsets.TopRight, size, new[] { coord.Max.X, coord.Max.Y });
                _needUpdate = false;
            }

            _vertexArrayHandle.Render();
        }