]> git.tdb.fi Git - libs/gl.git/blobdiff - source/vertexbuffer.cpp
Generalize VertexBuffer into Buffer with support for other types as well
[libs/gl.git] / source / vertexbuffer.cpp
diff --git a/source/vertexbuffer.cpp b/source/vertexbuffer.cpp
deleted file mode 100644 (file)
index 395334b..0000000
+++ /dev/null
@@ -1,52 +0,0 @@
-/* $Id$
-
-This file is part of libmspgl
-Copyright © 2007  Mikko Rasa, Mikkosoft Productions
-Distributed under the LGPL
-*/
-
-#include "arb_vertex_buffer_object.h"
-#include "extension.h"
-#include "vertexbuffer.h"
-
-namespace Msp {
-namespace GL {
-
-VertexBuffer::VertexBuffer()
-{
-       static RequireExtension _ext("GL_ARB_vertex_buffer_object");
-
-       glGenBuffersARB(1, &id);
-}
-
-void VertexBuffer::bind() const
-{
-       glBindBufferARB(GL_ARRAY_BUFFER, id);
-       bound=this;
-}
-
-void VertexBuffer::data(sizei size, void *d)
-{
-       if(bound!=this) bind();
-
-       glBufferDataARB(GL_ARRAY_BUFFER, size, d, GL_STATIC_DRAW);
-}
-
-VertexBuffer::~VertexBuffer()
-{
-       glDeleteBuffersARB(1, &id);
-}
-
-void VertexBuffer::unbind()
-{
-       if(bound)
-       {
-               glBindBufferARB(GL_ARRAY_BUFFER, 0);
-               bound=0;
-       }
-}
-
-const VertexBuffer *VertexBuffer::bound=0;
-
-} // namespace GL
-} // namespace Msp