X-Git-Url: http://git.tdb.fi/?p=libs%2Fgl.git;a=blobdiff_plain;f=source%2Fvertexarray.h;h=6e54f681717f4269fb135f66bd18420b5d87943e;hp=8e72d9554c7e39078b2ddebed2e94d5f8434fd59;hb=HEAD;hpb=16f6f15328b3a6eec87b1b5e5822368966d44a38 diff --git a/source/vertexarray.h b/source/vertexarray.h deleted file mode 100644 index 8e72d955..00000000 --- a/source/vertexarray.h +++ /dev/null @@ -1,68 +0,0 @@ -/* $Id$ - -This file is part of libmspgl -Copyright © 2007 Mikko Rasa, Mikkosoft Productions -Distributed under the LGPL -*/ - -#ifndef MSP_GL_VERTEXARRAY_H_ -#define MSP_GL_VERTEXARRAY_H_ - -#include -#include -#include -#include "primitivetype.h" -#include "types.h" -#include "vertexarraybuilder.h" -#include "vertexformat.h" - -namespace Msp { -namespace GL { - -class VertexBuffer; - -class VertexArray -{ -public: - class Loader: public DataFile::Loader, public VertexArrayBuilder - { - public: - Loader(VertexArray &); - }; - -private: - VertexFormat format; - std::vector data; - uint stride; - VertexBuffer *vbuf; - bool own_vbuf; - - VertexArray(const VertexArray &); - VertexArray &operator=(const VertexArray &); -public: - VertexArray(VertexFormat); - ~VertexArray(); - - VertexFormat get_format() const { return format; } - const std::vector &get_data() const { return data; } - void use_vertex_buffer(); - void use_vertex_buffer(VertexBuffer *); - void reserve(unsigned); - unsigned size() const { return data.size()/stride; } - void clear(); - void reset(VertexFormat); - void apply() const; - void update_data(); - float *append(); - float *operator[](unsigned i) { return &data[0]+i*stride; } - const float *operator[](unsigned i) const { return &data[0]+i*stride; } -private: - void set_array(unsigned, unsigned, unsigned) const; - - static unsigned enabled_arrays; -}; - -} // namespace GL -} // namespace Msp - -#endif