aboutsummaryrefslogtreecommitdiff
path: root/include/mglpp/graphics/VertexBuffer.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'include/mglpp/graphics/VertexBuffer.hpp')
-rw-r--r--include/mglpp/graphics/VertexBuffer.hpp31
1 files changed, 7 insertions, 24 deletions
diff --git a/include/mglpp/graphics/VertexBuffer.hpp b/include/mglpp/graphics/VertexBuffer.hpp
index ca3defd..03d8763 100644
--- a/include/mglpp/graphics/VertexBuffer.hpp
+++ b/include/mglpp/graphics/VertexBuffer.hpp
@@ -1,43 +1,26 @@
#ifndef MGLPP_VERTEX_BUFFER_HPP
#define MGLPP_VERTEX_BUFFER_HPP
+#include "PrimitiveType.hpp"
#include "Drawable.hpp"
-#include "Color.hpp"
-#include "../system/vec.hpp"
extern "C" {
#include <mgl/graphics/vertex_buffer.h>
}
namespace mgl {
- struct Vertex {
- vec2f position;
- Color color;
- vec2f texcoords;
- };
-
class Texture;
+ class Vertex;
+
class VertexBuffer : public Drawable {
public:
- enum PrimitiveType {
- Points,
- Lines,
- LineStrip,
- Triangles,
- TriangleStrip,
- TriangleFan,
- Quads,
- QuadStrip,
- Polygon
- };
-
enum Usage {
Stream,
Dynamic,
Static
};
- VertexBuffer(PrimitiveType primitive_type, Usage usage);
+ VertexBuffer();
~VertexBuffer();
void set_position(vec2f position) override;
@@ -47,14 +30,14 @@ namespace mgl {
void set_texture(Texture *texture);
const Texture* get_texture() const;
- bool update(const Vertex *vertices, size_t vertex_count);
+ size_t size() const;
+
+ bool update(const Vertex *vertices, size_t vertex_count, PrimitiveType primitive_type, Usage usage);
protected:
void draw(Window &window) override;
private:
mgl_vertex_buffer vertex_buffer;
Texture *texture;
- PrimitiveType primitive_type;
- Usage usage;
};
}