public void AddNullIndexBuffer()
        {
            IVertexArray vertexArray = new OpenGLVertexArray();

            Assert.Throws <ArgumentNullException>(() =>
                                                  vertexArray.Add((IIndexBuffer)null));
        }
        public void AddVertexBufferWithNullLayout()
        {
            IVertexArray  vertexArray  = new OpenGLVertexArray();
            IVertexBuffer vertexBuffer = new OpenGLVertexBuffer(new float[0]);

            Assert.Throws <ArgumentNullException>(() =>
                                                  vertexArray.Add(vertexBuffer));
        }
        public void AddIndexBuffer()
        {
            IVertexArray vertexArray = new OpenGLVertexArray();
            IIndexBuffer indexBuffer = new OpenGLIndexBuffer(new int[0]);

            vertexArray.Add(indexBuffer);

            Assert.NotNull(vertexArray.IndexBuffer);
        }
        public void AddVertexBuffer(int count)
        {
            IVertexArray vertexArray = new OpenGLVertexArray();

            for (int i = 0; i < count; i++)
            {
                IVertexBuffer vertexBuffer = new OpenGLVertexBuffer(new float[] { 0, 0 })
                {
                    Layout = new OpenGLBufferLayout(
                        new BufferElement(ShaderDataType.Float2, "TestsBuffer")
                        )
                };
                vertexArray.Add(vertexBuffer);
            }

            Assert.NotNull(vertexArray.VertexBuffers);
            Assert.Equal(count, vertexArray.VertexBuffers.Count());
        }
 public void ConvertShaderDataTypeToOpenGL(ShaderDataType type, VertexAttribType openGlType)
 {
     Assert.Equal(openGlType,
                  OpenGLVertexArray.ToOpenGLDataType(type));
 }