public VertexBufferObjectWithVAO(bool isStatic, int numVerticies, VertexAttributes attributes) { this.isStatic = isStatic; this.attributes = attributes; this.vertices = new float[numVerticies]; bufferHandle = GL.GenBuffer(); usage = isStatic ? BufferUsageHint.StaticDraw : BufferUsageHint.DynamicDraw; createVAO(); }
public VertexAttribute getVertexAttribute(int usage) { VertexAttributes attributes = vertices.getAttributes(); int len = attributes.size(); for (int i = 0; i < len; i++) { if (attributes[i].usage == usage) { return(attributes[i]); } } return(null); }
public Mesh(bool isStatic, int maxVertices, int maxIndices, VertexAttributes attributes) { vertices = new VertexBufferObjectWithVAO(isStatic, maxVertices, attributes); indices = new IndexBufferObject(isStatic, maxIndices); isVertexArray = false; }
public Mesh(VertexDataType type, bool isStatic, int maxVertices, int maxIndices, VertexAttributes attributes) { // todo: handle other type vertices = new VertexBufferObjectWithVAO(isStatic, maxVertices, attributes); indices = new IndexBufferObject(isStatic, maxIndices); isVertexArray = false; }