#include "VertexArray.hpp"
#include "VertexBuffer.hpp"

namespace mce::gfx{
	VertexArray::VertexArray() : 
		vertexSizeInMem(sizeof(Vertex)) {
	
	}

    void VertexArray::setVertexLayout(const bgfx::VertexLayout& layout, size_t vertexSizeInMem) {
		VertexArray::vLayout = layout;
		VertexArray::vertexSizeInMem = vertexSizeInMem;
	}
   
    size_t VertexArray::getVertexCount() const {
		return VertexArray::vertices.size();
	}

	Vertex& VertexArray::operator[](size_t index) {
		return VertexArray::vertices[index];
	}
	
	const Vertex& VertexArray::operator[](size_t index) const {
		return VertexArray::vertices[index];
	}

	void VertexArray::resize(size_t count) {
		VertexArray::vertices.resize(count);
	}

	void VertexArray::append(const Vertex& vertex) {
		this->vertices.push_back(vertex);
	}


}
