Пример #1
0
        public void Start()
        {
            _vertexBufferObject =
                new BufferObject <float>(_vertices, BufferTarget.ArrayBuffer, BufferUsageHint.DynamicDraw);
            _elementBufferObject =
                new BufferObject <uint>(GenerateIndices(), BufferTarget.ElementArrayBuffer,
                                        BufferUsageHint.StaticDraw);
            _vertexArrayobject =
                new VertexArrayObject <float, uint>(_vertexBufferObject, _elementBufferObject);

            _vertexArrayobject.VertexAttributePointer(0, PositionSize, VertexAttribPointerType.Float, VertexSize,
                                                      PositionOffset);
            _vertexArrayobject.VertexAttributePointer(1, ColorSize, VertexAttribPointerType.Float, VertexSize,
                                                      ColorOffset);
            _vertexArrayobject.VertexAttributePointer(2, TextureCoordinatesSize, VertexAttribPointerType.Float,
                                                      VertexSize,
                                                      TextureCoordinatesOffset);
            _vertexArrayobject.VertexAttributePointer(3, TextureIdSize, VertexAttribPointerType.Float, VertexSize,
                                                      TextureIdOffset);
        }
Пример #2
0
 public bool Equals(BufferObject <TDataType> other)
 {
     return((other != null) && Handle.Equals(other.Handle));
 }